On the Effect of Sampling Diversity in Scaling LLM Inference

Tianchun Wang, Zichuan Liu, Yuanzhou Chen, Jonathan Light, Weiyang Liu, Haifeng Chen, Xiang Zhang, Wei Cheng · Submission to ICLR 2026 · Rejected

TL;DR

Repeatedly sampling from an LLM with an identical prompt often leaves the model trapped in a narrow, suboptimal cluster of solutions. This paper provides a theoretical and empirical framework showing that introducing prompt-level diversity accelerates Best-of-$N$ test-time scaling and lowers asymptotic error rates, provided perturbations balance diversity with task fidelity. Crucially, the authors prove and demonstrate that this diversity benefit vanishes under majority-voting aggregation.

What Problem Does This Paper Address?

Test-time compute scaling (such as Best-of-$N$ sampling) aims to boost LLM accuracy by generating multiple candidate solutions and choosing the best one. However, modern LLMs—heavily aligned via instruction-tuning and distillation—tend to collapse into a single mode when queried repeatedly with the exact same prompt.

While practitioners intuitively introduce prompt variations to break out of these local clusters, the field lacks a principled understanding of:

  1. Why and when sampling diversity mathematically improves scaling.
  2. The trade-offs between prompt variation and prompt degradation.
  3. How verification strategies (e.g., outcome verifiers vs. majority voting) interact with response diversity.

Methods

The authors analyze inference attempts configured by a hybrid mode $\zeta = (\eta, \xi)$, where $\eta$ represents base decoding randomness (temperature, seed) and $\xi$ represents an auxiliary diversity source (prompt perturbation).

  • Theoretical Framework & Diversity-Fidelity Principle: The authors prove that auxiliary diversity accelerates the error-reduction rate in Best-of-$N$ by a factor $C_N = \Omega(\hat{\mu}_1^2 N / (1+\epsilon))$, where $\hat{\mu}_1$ is the dispersion of failure log-probabilities across prompts and $\epsilon$ measures fidelity loss on single-attempt quality. Peak scaling occurs in a "sweet spot": perturbations must be varied enough to induce diverse reasoning paths (high $\hat{\mu}_1$) without straying so far that they degrade model accuracy (low $\epsilon$).
  • Task-Level Perturbations: Independent of the specific question, drawing from predefined candidate pools:
  • Role Injection: Personas such as "optimizer," "craftsman," or "visionary."
  • Strategic Instruction Injection: Guiding principles like "functional programming," "modular design," or "test-driven development."
  • Query-Level Perturbations: Conditioned directly on the problem instance:
  • Random Idea Injection (RandIdeaInj): A thinker model proposes high-level solution concepts that are injected into the prompt.
  • Random Query Rephraser (RandQReph): Paraphrasing the question directly or through back-translation.
  • Thinker Variants: Implemented as Single (policy model generates ideas), Dual (a separate external model generates ideas), or Diverse (a multi-model pool).

Datasets

The authors evaluated their methods across six public benchmarks spanning multiple domains (no new benchmarks were introduced):

  • Reasoning: MMLU-Pro (sampled 200 questions).
  • Mathematics: GSM-Hard (sampled 100 problems) and MATH (sampled 100 problems).
  • Code Generation: HumanEval (164 problems), MBPP (399 problems), and APPS (sampled 200 competition problems).

Key Insights and Ideas

  • The Relevance "Rise-and-Fall" Pattern: Plotting semantic similarity against pass rate reveals an inverted U-shape. Completely off-topic perturbations (e.g., injecting baking tips into math queries) ruin baseline fidelity ($\epsilon$), while near-verbatim paraphrases fail to introduce meaningful dispersion ($\hat{\mu}_1 \approx 0$). High-level conceptual hints produce the optimal trade-off.
  • Why Diversity Breaks Majority Voting: In Best-of-$N$ search with a verifier, an instance is solved if $p(y^*) > 0$ (at least one candidate is correct). Diversity expands the search space to find that single hit. In majority voting, however, success requires the correct answer to be the global mode ($p(y^*) = \max_y p(y)$). Expanding diversity disperses probability mass across many unique answers, often shrinking the correct answer's margin and hurting performance.
  • Thinker Strength and Cardinality: Stronger thinker models (e.g., DeepSeek-V3 vs. GPT-3.5) and higher numbers of unique perturbations (cardinality) consistently lift the test-time scaling curve.
  • Model Size Sensitivity: Smaller policy models (e.g., Qwen-2.5-7B) experience substantially higher relative boosts from prompt diversification than frontier-scale models (72B), where base exploration is already broader.

Key Results

  • Task-Level Perturbations: On GPT-4o-mini, Strategic Instruction injection delivered relative gains over standard direct sampling of +6.7% EM@100 on MMLU-Pro, +9.6% EM@100 on MATH, and +9.5% Pass@100 on MBPP.
  • Query-Level Perturbations: On HumanEval, MMLU-Pro, and MATH, the Diverse variant of RandIdeaInj produced relative gains of up to 10.8% EM@100 in reasoning, 8.2% EM@100 in math, and 4.7% Pass@100 in code generation.
  • Compatibility: Diversified sampling compounded gains across temperatures ($0.0$ to $1.4$), added up to +7.4% Pass@100 on top of Chain-of-Thought (CoT) prompting on APPS (Claude-3.5-Sonnet), and remained effective when using an LLM-as-a-judge verifier.

Limitations and Future Work

  • Verifier Dependency: Diversified sampling relies heavily on having a reliable verifier or outcome reward model (ORM); it is demonstrably unsuitable for consensus-based majority voting.
  • Inference Overhead: Query-level idea generation introduces additional LLM calls and token overhead, though batching multiple ideas per query significantly amortizes this cost.
  • Diminishing Returns on Strong Models: The marginal benefit of prompt diversification shrinks as the policy model size increases.
  • Future Work: The authors suggest developing automated selection of optimal perturbation styles and exploring how prompt-level diversity interacts with process reward models (PRMs) and tree-search decoders (MCTS).

Summary updated

BibTeX
@misc{wang2025effect,
  author = {Tianchun Wang and Zichuan Liu and Yuanzhou Chen and Jonathan Light and Weiyang Liu and Haifeng Chen and Xiang Zhang and Wei Cheng},
  title = {{On the Effect of Sampling Diversity in Scaling LLM Inference}},
  year = {2025},
  eprint = {2502.11027},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2502.11027},
}
Figure