TL;DR
Large language models (LLMs) trained with reinforcement learning often become too focused, producing high-quality but repetitive outputs. This paper introduces DQO (Diversity Quality Optimization), a novel training method that uses Determinantal Point Processes (DPPs) to simultaneously optimize LLMs for both response quality and semantic diversity. DQO effectively encourages LLMs to generate a wider range of meaningful and distinct responses without sacrificing performance.
What Problem Does This Paper Address?
Post-training LLMs with reinforcement learning (RL), particularly methods like RLHF (Reinforcement Learning from Human Feedback), has significantly improved their ability to follow instructions and generate high-quality outputs. However, a common side effect is a drastic reduction in output diversity. LLMs tend to converge on a narrow set of "canonical" responses, which can be problematic for several reasons: it limits personalization and exploration of alternative solutions, hinders robustness to distribution shifts, and can even weaken the training process itself by reducing exploration. Existing methods to combat this often rely on inference-time tricks (like temperature scaling) or focus on superficial, token-level differences, failing to capture true semantic diversity. This paper aims to address this by developing a principled training-time method to jointly optimize for both quality and semantic diversity.
Methods
The core of this paper is the DQO (Diversity Quality Optimization) algorithm, which leverages Determinantal Point Processes (DPPs). Here's how it works:
- Response Sampling and Embedding: For a given prompt, the LLM generates a group of k responses. These responses are then mapped into a high-dimensional semantic space using a pre-trained encoder.
- Diversity Measurement with DPPs: The diversity of this group of responses is quantified using the determinant of a kernel-based similarity matrix. This determinant, representing the volume spanned by the response embeddings, serves as a measure of semantic diversity. A larger determinant indicates more distinct and less redundant responses.
- Joint Optimization Objective: DQO modifies the standard RL objective by incorporating a diversity term derived from the DPP determinant. This new objective,
JDiv(πθ), balances the reward for response quality with the diversity score. The hyperparameterαcontrols this trade-off. - Algorithmic Stability: To address numerical instability issues arising from the determinant calculation (especially when it's close to zero), the authors propose adding an identity matrix to the kernel matrix (
det(L + Ik)). This acts as a regularization, bounding the diversity term and stabilizing training. They also introduce a leave-one-out (LOO) estimator for the gradient to reduce variance.
DQO is designed to be flexible and can be applied on top of existing RL algorithms like PPO and GRPO.
Datasets
The paper evaluates DQO on several standard NLP datasets:
- GSM8K: A dataset of grade-school math problems, used for reasoning tasks.
- CNN-dailymail: A dataset for summarization.
- Dolly: An instruction-following dataset.
- CommonGen: A dataset for story generation.
The authors do not introduce new benchmarks but rather apply their method to existing ones to demonstrate its effectiveness across diverse tasks.
Key Insights and Ideas
- Semantic Diversity is Key: The paper argues that true diversity lies in semantic differences, not just superficial token-level variations. Their DPP-based approach directly targets this by operating in the embedding space.
- DPPs as a Natural Fit for Diversity: The determinant of a kernel matrix naturally captures the concept of "volume" spanned by vectors, making it an intuitive and theoretically grounded measure of group diversity that penalizes redundancy and linear dependence.
- Avoiding Degenerate Solutions: Unlike pairwise distance metrics that can be fooled by clusters of similar responses, the determinant-based metric is more robust and encourages responses that truly span the semantic space.
- Quality-Diversity Trade-off is Manageable: DQO provides a principled way to balance quality and diversity, controlled by a hyperparameter
α. Experiments show that this balance can be achieved without significant performance degradation. - D-Optimal Design Analogy: The method draws a compelling analogy to D-optimal experimental design, where selecting informative points is crucial. DQO similarly selects responses that are "informative" in terms of both quality and semantic distinctiveness.
Key Results
- Improved Diversity: DQO consistently outperforms baseline methods (PPO, GRPO) and other quality-diversity algorithms (GRPO-likelihood, GRPO-entropy) across multiple diversity metrics (distinct-n, self-BLEU, self-ROUGE, LLM-as-a-judge) on various tasks. For instance, on the Dolly task, DQO achieved a distinct-1 score of 0.28 compared to PPO's 0.24.
- Maintained Quality: Crucially, DQO does not sacrifice response quality. The
pass@1metric (representing the quality of the top response) remains comparable to or better than baselines, whilepass@n(for n>1) often improves, indicating that DQO generates high-quality and diverse responses. - Robustness: The method shows robust performance across different tasks and settings, with hyperparameters
αandknot requiring extremely sensitive tuning. - Qualitative Improvements: Human evaluations (using GPT-40-mini as a judge) confirm that DQO generates responses with greater variety in structure, phrasing, and semantic content compared to baselines. For example, on GSM8K, DQO received a diversity score of 0.5/1 compared to GRPO's 0.2/1.
Limitations and Future Work
- Reward Hacking with Outcome Rewards: The paper notes that when using outcome-based rewards (common in reasoning tasks), the model can "hack" the reward by providing a correct answer first and then generating diverse but irrelevant content. This is less of an issue with reward models.
- Dependence on Embedding Quality: DQO's performance is tied to the quality of the semantic embeddings used. The authors suggest that more principled and adaptive methods for measuring diversity could further improve performance.
- Future Directions: The authors suggest exploring more adaptive diversity measures and addressing the reward hacking issue in outcome-based reward scenarios. They also highlight the potential for DQO to be extended to other domains beyond language generation.
Summary updated