Control the Temperature: Selective Sampling for Diverse and High-Quality LLM Outputs
Diversity is an essential metric for evaluating the creativity of outputs generated by language models. Temperature-based sampling is a common strategy to increase diversity. However, for tasks that require high precision, e.g., mathematical reasoning, uncontrolled high temperature sampling, e.g., min-$p$ or top-$p$, degrades reasoning quality. We demonstrate that the loss of accuracy is caused by sampling incorrect continuations in sensitive decoding positions. To address this, in this paper, we propose \textbf{selective sampling}, a method that dynamically switches between greedy and high-temperature sampling based on a sampling risk metric. This risk metric estimates the likelihood of output errors when applying high-temperature sampling on the current token position. To predict sampling risk, we train a lightweight classifier on a small subset of verifiable problems. The trained classifier can be integrated with the base language model with minimal latency overhead. Experiments on mathematical reasoning tasks demonstrate that selective sampling enhances the quality-diversity trade-off, even in high-temperature settings.
Code (0)
등록된 구현이 없습니다.
Tasks
Mathematical ReasoningSimilar Papers 제목 키워드 기반
STATe-of-Thoughts: Structured Action Templates for Tree-of-Thoughts
Inference-Time-Compute (ITC) methods like Best-of-N and Tree-of-Thoughts are meant to produce output candidates that are both high-quality and diverse, but their use of high-temperature sampling often fails to achieve me…
Text GenerationGenerating Diverse Hypotheses for Inductive Reasoning
Inductive reasoning - the process of inferring general rules from a small number of observations - is a fundamental aspect of human intelligence. Recent works suggest that large language models (LLMs) can engage in induc…
DiversityBatch Model Predictive Control for Selective Laser Melting
Selective laser melting is a promising additive manufacturing technology enabling the fabrication of highly customizable products. A major challenge in selective laser melting is ensuring the quality of produced parts, w…
Model Predictive ControlUnify and Triumph: Polyglot, Diverse, and Self-Consistent Generation of Unit Tests with LLMs
Large language model (LLM)-based test generation has gained attention in software engineering, yet most studies evaluate LLMs' ability to generate unit tests in a single attempt for a given language, missing the opportun…
DiversityLarge Language ModelOverall - TestSensitivity Analysis of the Laser Power Control System to Measurement Noise in SLS 3D Printers
Uniform temperature distribution in Selective Laser Sintering (SLS) is essential for producing durable 3D prints. Achieving uniformity requires a laser power control system that minimises deviation of the printing temper…
Sensitivity