Introduction
When generating multiple responses from Large Language Models (LLMs) for complex reasoning tasks, standard practice involves parallel (ancestral) sampling. This method runs the model $n$ times independently with different random seeds. However, because each run is isolated, models often fall into high-probability traps, producing redundant and repetitive outputs. This redundancy limits the exploration of different reasoning paths and wastes computational resources.
This paper investigates whether simple prompting strategies can encourage LLMs to generate more diverse sets of solutions without the need for complex, search-based decoding algorithms.
Sampling Strategies
The researchers compared three primary strategies for generating multiple candidates:
- Parallel Sampling (Baseline): Independent generation of $n$ responses.
- Enumeration Sampling: Prompting the model to provide multiple distinct solutions in a single forward pass (e.g., "Provide three different solutions...").
- Iterative Sampling: A sequential approach where the model generates one solution, then is re-prompted with that solution in its context to generate a different one.
Measuring Diversity: Words vs. Logic
To evaluate these strategies, the study utilized the GSM8K benchmark of grade-school math word problems. Success was measured using two distinct diversity metrics:
- Lexical Diversity: Based on unique n-grams, measuring how much the wording varies between solutions.
- Computational Flow Diversity: A novel metric that uses an auxiliary LLM to extract raw mathematical steps (e.g.,
240 / 0.4 = 600). This determines if the model is finding truly different logical paths or merely paraphrasing the same steps.
Key Results
The evaluation across the Qwen3 model family (4B to 14B parameters) revealed that LLMs are remarkably "diversity-aware." When models can see their previous outputs in the context window—as in the Enumeration and Iterative strategies—they naturally shift their probability distributions to explore new reasoning paths.
As shown in the data, non-independent strategies significantly outperformed the parallel baseline in diversity metrics. For the Qwen3-4B model, lexical diversity rose from 42.8 in parallel sampling to 68.1 in enumeration. Crucially, this increase in diversity did not come at the expense of accuracy; "Mean Quality" remained stable across all methods, typically hovering around 90% for larger models.
Conclusion and Trade-offs
While all three methods have merits, they offer different efficiency trade-offs:
- Parallel sampling is ideal for high-throughput, multi-GPU environments.
- Enumeration is the most efficient for single-GPU setups, as it reuses the KV cache within a single call.
- Iterative sampling provides the highest degree of control but is the most computationally expensive due to multiple sequential calls.
Ultimately, this research demonstrates that redundancy in LLM outputs is not an inherent limitation of the models themselves, but rather a byproduct of independent sampling. By simply changing the prompt to include previous context, we can unlock a model's ability to explore a much wider range of logical solutions.
Summary updated