Forcing Diffuse Distributions out of Language Models

Yiming Zhang, Avi Schwarzschild, Nicholas Carlini, Zico Kolter, Daphne Ippolito · DOI

Introduction

Modern Large Language Models (LLMs) are often criticized for their lack of diversity in generation, particularly when tasked with producing "random" or "uniform" outputs. While humans can generally conceptualize a uniform choice, instruction-tuned LLMs frequently exhibit extreme bias toward specific tokens. For instance, Llama-2-13B-chat has been observed to select the number "5" over 60% of the time when asked for a random integer between 1 and 10. This "low-entropy" behavior significantly limits the utility of LLMs for synthetic dataset generation, where diversity is paramount.

The Distribution Matching Framework

To address this distributional collapse, we introduce a fine-tuning method called Distribution Matching. Unlike standard next-token prediction, which optimizes for a single ground-truth answer, our approach minimizes the cross-entropy loss between the model's output distribution and a target uniform distribution. Mathematically, this is equivalent to minimizing the Kullback-Leibler (KL) divergence between the model and an ideal diffuse distribution.

To maintain computational efficiency and preserve the model's underlying knowledge, we utilize Low-Rank Adaptation (LoRA), tuning less than 0.1% of the total parameters. A key hypothesis of this work is that "randomness" is a transferable meta-skill. We employ a leave-one-out experimental setup, training the model on a subset of tasks (e.g., picking random fruits or dates) and evaluating its performance on unseen categories (e.g., random occupations).

Empirical Results

The impact of distribution matching is most visible when comparing the empirical probabilities of baseline models versus their tuned counterparts. Baseline models for Gemma, Llama-2, and Mistral exhibit highly "pointy" distributions, fixating on specific names like "Anya" or "Aurora" and specific numbers like "5". After fine-tuning, these distributions become significantly more diffuse, approaching the target uniform distribution.

Comparison of empirical probability distributions for Baby Names and Random Number Generation (RNG) across baseline and tuned models.

Key Findings:

  • Enhanced Coverage: In baby name generation, the tuned Llama-2 model produced four times more unique names than the baseline. In RNG tasks, tuned models achieved full coverage of the 1-10 range, whereas baselines often missed certain numbers entirely.
  • Zero-Shot Generalization: Models tuned on simple categories successfully generalized their diffuse behavior to entirely new domains, such as complex occupations, without specific training. This suggests the model learns the meta-instruction of being diverse.
  • Preservation of Utility: Critically, this increase in diversity does not come at the cost of general intelligence. Evaluation on the MT-Bench benchmark showed that fine-tuned models maintained nearly identical performance in reasoning, coding, and writing tasks. The "brain" of the model remains intact; only the output filter is widened.

Conclusion

LLMs are naturally prone to repetitive, high-confidence outputs due to the nature of instruction tuning. By explicitly optimizing for diffuse distributions through KL-divergence minimization, we can force models to produce more diverse and representative outputs. This method proves that randomness is a learnable and transferable skill, enabling the creation of higher-quality synthetic datasets without sacrificing the core capabilities of the underlying model.

Summary updated

BibTeX
@inproceedings{zhang2024forcing,
  author = {Yiming Zhang and Avi Schwarzschild and Nicholas Carlini and Zico Kolter and Daphne Ippolito},
  title = {{Forcing Diffuse Distributions out of Language Models}},
  booktitle = {COLM},
  year = {2024},
  url = {https://openreview.net/forum?id=9JY1QLVFPZ},
}
Figure