SimpleStrat: Diversifying Language Model Generation with Stratification

Justin Wong, Yury Orlovskiy, Alexander Shypula, Michael Luo, Sanjit A. Seshia, Joseph E. Gonzalez

Generating diverse responses from large language models (LLMs) is crucial for applications like adversarial testing, search, and synthetic data generation. However, when asked an underspecified question with many valid answers—such as "Name a U.S. state"—LLMs rarely sample uniformly. Instead, they suffer from "mode collapse," exhibiting a massive bias toward a few common answers.

Standard low-temperature sampling suffers from mode collapse, heavily over-indexing on common answers like California.

The standard fix for this bias is temperature scaling, which increases the randomness of the output. Unfortunately, this approach has significant flaws. It merely flattens the distribution without fixing the underlying bias, often surfacing incorrect or nonsensical answers before finding rare valid ones. Furthermore, high temperatures degrade generation quality, which is problematic for sensitive tasks like code generation or multi-step reasoning.

The SimpleStrat Methodology

To combat these challenges, researchers introduce SimpleStrat, a training-free alternative that uses the language model itself to partition the solution space into strata. The core insight is that while an LLM might struggle to sample uniformly from a set, it possesses the "meta-knowledge" to accurately describe the set's boundaries.

SimpleStrat shifts the burden of diversity from stochastic decoding to the prompting process via a three-stage workflow:

  1. Auto-Stratification: The LLM is prompted to identify "dimensions of diversity" that divide the solution space. For the U.S. state example, it might suggest geographic divisions like "East vs. West of the Mississippi River."
  2. Heuristic Estimation: The model estimates the proportion of valid solutions in each resulting stratum, creating a joint probability distribution over the strata.
  3. Probabilistic Prompting: A specific stratum is randomly sampled based on those estimated weights. The original user prompt is then augmented with a constraint from that stratum (e.g., "Name a U.S. state... that is East of the Mississippi").
SimpleStrat partitions the solution space using geographic strata, ensuring a balanced and diverse spread of generated responses.

This approach is orthogonal to temperature scaling; practitioners can use SimpleStrat with greedy decoding ($T=0$) to obtain high-quality, diverse results, or combine it with higher temperatures for even broader variety.

Evaluation and Key Findings

To measure resampling diversity, the authors introduced CoverageQA, a dataset of 155 underspecified questions with multiple equally plausible answers (e.g., "Name a periodic table element"). They also evaluated open-ended creative diversity using the WritingPrompts dataset, measuring the semantic distance between generated plot outlines.

The results demonstrate significant improvements over standard sampling methods:

  • Massive Recall Gains: On GPT-4o, SimpleStrat achieved up to 4X better recall, successfully finding far more unique valid answers.
  • Distributional Alignment: When applied to Llama 3 models, SimpleStrat reduced the KL Divergence from a uniform distribution by an average of 0.36, meaning the responses were much closer to a true, balanced distribution.
  • Diversity for "Free": SimpleStrat at $T=0$ (greedy decoding) achieved the same level of diversity as standard sampling at $T=1$, but without the spelling, formatting, and logical errors that typically plague high-temperature outputs.

Limitations and Future Work

While highly effective, SimpleStrat's success depends on the underlying model's ability to identify meaningful strata. If a model has deep-seated internal biases, it might suggest skewed strata or incorrect heuristic estimates. Additionally, the multi-step process requires several LLM calls for the stratification and estimation phases, adding latency. Future work may explore applying this stratification technique to complex, multi-step reasoning chains where maintaining diversity remains a major challenge.

Summary updated

BibTeX
@inproceedings{wong2025simplestrat,
  author = {Justin Wong and Yury Orlovskiy and Alexander Shypula and Michael Luo and Sanjit A. Seshia and Joseph E. Gonzalez},
  title = {{SimpleStrat: Diversifying Language Model Generation with Stratification}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=X5B2yTT97A},
}
Figure