Abstract
One of the most striking findings in modern research on large language models (LLMs) is that scaling up compute during training leads to better results. However, less attention has been given to the benefits of scaling compute during inference. This survey focuses on these inference-time approaches. We explore three areas under a unified mathematical formalism: token-level generation algorithms, meta-generation algorithms, and efficient generation. Token-level generation algorithms, often called decoding algorithms, operate by sampling a single token at a time or constructing a token-level search space and then selecting an output. These methods typically assume access to a language model's logits, next-token distributions, or probability scores. Meta-generation algorithms work on partial or full sequences, incorporating domain knowledge, enabling backtracking, and integrating external information. Efficient generation methods aim to reduce token costs and improve the speed of generation. Our survey unifies perspectives from three research communities: traditional natural language processing, modern LLMs, and machine learning systems.
Introduction
The "Scaling Laws" for Large Language Models (LLMs) have historically focused on training: more data and more GPUs lead to better models. However, once a model is trained, it is often treated as a static "black box." This paper addresses a major gap: the lack of a unified framework for inference-time algorithms. Currently, research is fragmented across three communities: NLP researchers focusing on decoding, reasoning researchers focusing on "scaffolding" (like Chain-of-Thought), and systems engineers focusing on efficiency. By unifying these perspectives, we explore how trading extra inference compute—generating more samples, searching, or refining—can lead to significantly higher output quality without retraining the model.
A Unified Framework for Inference
The paper introduces a unified mathematical formalism that treats every inference method as a generator. These generators are categorized into three distinct levels of abstraction, ranging from individual tokens to complex programmatic structures.
1. Token-Level Generation
Token-level generation, or "decoding," is the most fundamental layer. These algorithms typically assume access to the model's logits or next-token probability distributions.
- MAP Decoding: Finding the most likely sequence via greedy or beam search.
- Sampling: Techniques like Nucleus (Top-p), Top-k, or Temperature scaling to introduce variety.
- Constrained Decoding: Using parsers to force the model to output valid formats, such as JSON or specific programming languages.
2. Meta-Generation Algorithms
Meta-generation represents a "programmatic" layer where the LLM serves as a component in a larger script. This allows for more complex reasoning patterns:
- Chained & Parallel: Sequential steps like Chain-of-Thought or generating multiple versions (Best-of-N) and using voting (Self-Consistency).
- Search: Using algorithms like Monte Carlo Tree Search (MCTS) or Tree-of-Thought to explore multiple reasoning paths and backtrack when necessary.
- Refinement: Iterative loops where a model critiques and fixes its own work, which is most effective when paired with extrinsic feedback (e.g., compiler errors).
3. Efficient Generation
Systems-level optimizations aim to make these complex inference patterns viable in production. Key techniques include Speculative Decoding, where a smaller model drafts text for a larger model to verify, and KV Cache sharing, which reuses computations across multiple parallel samples to reduce latency.
Key Insights and Scaling Laws
Just as training compute scales performance, inference compute does too. For many tasks, a smaller model using a sophisticated search algorithm can outperform a massive model using simple greedy decoding.
One critical insight is the "Inadequacy of the Mode": the most likely sequence according to a model (the mode) is often repetitive or empty, necessitating sampling to find "typical" human-like text. Furthermore, the paper distinguishes between extrinsic and intrinsic refinement. LLMs are generally poor at self-correction in a vacuum; refinement works best when there is an external source of truth, like a calculator or code execution environment.
Results and Benchmarks
The survey synthesizes results across several key benchmarks to demonstrate the power of inference scaling:
- MATH / MATH500: Performance scales predictably with the number of samples ($N$). Using Weighted Majority Voting with a reward model consistently beats simple majority voting as $N$ increases.
- HumanEval / MBPP: Code generation benchmarks show massive gains when models are allowed to iterate based on unit-test feedback.
- Throughput: Techniques like PagedAttention and Speculative Decoding provide 2x-4x speedups, enabling the complex meta-generation programs described above to run efficiently.
Conclusion and Future Work
We are moving from an era of "prompting" to an era of "programming," where meta-generation treats the LLM as a noisy reasoning engine within a deterministic control flow. Future challenges include overcoming the "self-correction wall" where models struggle to identify their own logical fallacies, and developing "compilers" for meta-generation programs that can automatically optimize token flow and cache reuse. Ultimately, the goal is to find the compute-optimal balance between model size and inference-time search.
Summary updated