[Paper Review] Let's Sample Step by Step: Adaptive-Consistency for Efficient Reasoning and Coding with LLMs
This paper proposes \ours, a model-agnostic, cost-efficient sampling technique for large language models (LLMs) that dynamically adjusts the number of reasoning and code generation samples using a lightweight stopping criterion based on Dirichlet distribution-based confidence in the majority output. It reduces sampling budget by up to 7.9× with less than 0.1% accuracy drop across 17 datasets and three LLMs, outperforming fixed-budget Self-Consistency in efficiency and accuracy trade-offs.
A popular approach for improving the correctness of output from large language models (LLMs) is Self-Consistency - poll the LLM multiple times and output the most frequent solution. Existing Self-Consistency techniques always generate a constant number of samples per question, where a better approach will be to non-uniformly distribute the available budget based on the amount of agreement in the samples generated so far. In response, we introduce Adaptive-Consistency, a cost-efficient, model-agnostic technique that dynamically adjusts the number of samples per question using a lightweight stopping criterion. Our experiments over 17 reasoning and code generation datasets and three LLMs demonstrate that Adaptive-Consistency reduces sample budget by up to 7.9 times with an average accuracy drop of less than 0.1%. Our code and data are available at https://www.sample-step-by-step.info
Motivation & Objective
- To address the high computational cost of fixed-budget Self-Consistency in LLM reasoning and code generation.
- To develop a model-agnostic, inference-time technique that reduces sampling cost without requiring retraining.
- To dynamically adjust the number of samples per input based on confidence in the emerging majority answer.
- To maintain or improve accuracy while significantly reducing the number of required LLM generations.
- To provide a practical, off-the-shelf solution for efficient and reliable LLM inference across diverse tasks.
Proposed method
- The method uses a lightweight stopping criterion that evaluates confidence in the majority output using a Dirichlet distribution over observed answer frequencies.
- It models the probability that the current majority answer remains dominant under future sampling, based on current counts.
- The stopping condition is triggered when the probability that the top answer remains the majority exceeds a confidence threshold, computed via numerical integration of the Dirichlet posterior.
- For computational efficiency, a beta distribution approximation is used by focusing on the top two answer counts, simplifying the high-dimensional integral.
- The algorithm iteratively samples answers, updates counts, and checks the stopping condition after each sample, halting early if confidence is sufficiently high.
- The approach is model-agnostic and requires no fine-tuning, making it applicable to any pre-trained LLM.

Experimental results
Research questions
- RQ1Can a dynamic sampling strategy reduce inference cost in LLM reasoning and code generation without sacrificing accuracy?
- RQ2How does confidence in the majority answer evolve during sampling, and can it be quantified to guide early stopping?
- RQ3What is the optimal trade-off between sampling cost and accuracy in Self-Consistency-style methods?
- RQ4How does the proposed method compare to fixed-budget Self-Consistency across diverse reasoning and code generation tasks?
- RQ5Can a lightweight, model-agnostic stopping criterion achieve significant cost reduction while maintaining high reliability?
Key findings
- On code-davinci-002, \ours reduces the average sample budget by 3.4× with no drop in accuracy compared to Self-Consistency.
- On Vicuna-13B, \ours requires 1.9× fewer samples with less than 0.1% accuracy drop.
- On GPT-3.5-turbo, \ours reduces sampling by 4.4× with less than 0.2% accuracy drop.
- Across all 17 datasets and three models, \ours achieves an average sample budget reduction of 3.3× with less than 0.1% average accuracy drop.
- For a fixed sampling cost, \ours consistently achieves higher accuracy than Self-Consistency, with gains up to 5 percentage points in some tasks.
- The method demonstrates robustness across diverse tasks, including math, commonsense, symbolic reasoning, and code generation.

Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.