Exploring and Controlling Diversity in LLM -Agent Conversation (2025)

Abstract: Controlling diversity in LLM-agent simulations is essential for balancing stability in structured tasks with variability in open-ended interactions. However, we observe that dialogue diversity tends to degrade over long-term simulations. To explore the role of prompt design in this phenomenon, we modularized the utterance generation prompt and found that reducing contextual information leads to more diverse outputs. Based on this insight, we propose Adaptive Prompt Pruning (APP), a novel method that allows users to control diversity via a single parameter, λ. APP dynamically prunes prompt segments based on attention scores and is compatible with existing diversity control methods. We demonstrate that APP effectively modulates diversity through extensive experiments and propose a method to balance the control trade-offs. Our analysis reveals that all prompt components impose constraints on diversity, with the Memory being the most influential. Additionally, high-attention contents consistently suppress output diversity.

## introduction llm-agent simulation @xcite can be used across various domains, such as social sciences @xcite and game development @xcite , where agents interact dynamically to model real-world scenarios. by controlling the diversity of dialogues between llm agents, we can ensure the interactions align with the intended objectives of the simulation. for instance, in social science research, managing dialogue diversity helps explore how individuals or groups might react, providing insights into human behavior and social dynamics. in game development, a more consistent, static conversation may be preferred for advancing the main storyline, while more varied and creative dialogues can enhance immersion and offer players a unique, personalized experience. meanwhile, as shown in figure 1 : diversity control in llm-agent conversations. by increasing λ, more components are removed from the prompt, selected by their attention scores, thereby enhancing the diversity of the dialogue content. fig. 2 , we observe a significant decline in dialogue diversity over time, emphasizing the importance of controlling and enhancing diversity in prolonging multi-agent simulation. in this work, we define diversity as the range of variations generated under identical initial conditions, with a specific focus on llm-agent conversations. the prompt for this task typically comprises several key components: an environment description, agent's profile and memory, dialogue history, and the current dialogue. although most previous works integrate these components into the prompt, it is unclear how these components affect diversity. does reducing the provided information lead to generalized and less diverse responses, or does it encourage more open and varied outputs? although previous studies have explored the influence of communication structures, the impact of communication content on interaction quality remains underexplored @xcite . traditional diversity control methods, such as temperature @xcite or top-p sampling @xcite , primarily regulate word distribution during decoding but fail to account for subtle shifts in the input prompt over time. moreover, these methods can prioritize rare word selection and lead to incoherent output rather than sustaining meaningful diversity. on the other hand, prompting each llm agent to directly generate diverse outputs through sequential generation @xcite can be challenging, as it may be harder to follow instructions, and the outcomes often lack contextual coherence. to address this gap, we propose adaptive prompt pruning (app), a removal-based approach for controlling diversity by dynamically adjusting the prompt content via a single parameter, λ. we organized the prompt into blocks, each containing one or more items. leveraging attention weights from raw output utterances, app selectively removes items from the modularized prompt. a higher λ corresponds to more aggressive pruning and, consequently, a greater potential for diversity. we investigate various design choices for the pruning selection, and comprehensively analyze the relation between prompt content and output diversity. using data from @xcite and @xcite , we demonstrate that app effectively modulates the degree of diversity by pruning influential prompt components. our findings reveal that all prompt components constrain diversity to some extent, with the memory block having the most significant impact. in addition, app is compatible with established diversity control techniques. while increasing diversity through prompt pruning can result in inconsistencies with omitted information, we mitigate this issue by introducing a correction step post-dialogue generation. experimental results show that this approach balances the trade-off between enhancing diversity and preserving information consistency. beyond pruning, we investigate the role of prompt structure, including the order and length of components, in influencing diversity. our results indicate that component order significantly affects diversity. moreover, we analyze the role of pre-existing knowledge within llms and its interaction with diversity by replacing agents' names with well-known or rare ones. in summary, this paper tackles three fundamental questions related to diversity in multi-agent simulation: (1) how can diversity be effectively controlled in multi-agent communication? (2) how does prompt content influence the level of conversational diversity? (3) what trade-offs arise in diversity control, and how can they be mitigated? by addressing these questions, we aim to lay the groundwork for understanding and engineering diversity in llm-based multi-agent systems. ## adaptive prompt pruning while longer prompts can provide more contextual cues (weston and sukhbaatar, 2023) and enrich outputs, they may also constrain generation by impos-ing stronger priors, leading to more deterministic outputs. to investigate this trade-off, we conducted a preliminary ablation study by selectively pruning different blocks from the prompt during utterance generation. the resulting changes in diversity are summarized in motivated by these findings, we aim to develop a more fine-grained method to control diversity via a single parameter. specifically, we propose using attention scores to guide the removal of overemphasized prompt segments. this approach adjusts contextual influence without modifying the attention mechanism itself, thus preserving the model's general capabilities. moreover, it operates independently of specific prompt structures, enhancing its flexibility and applicability. further analysis of content removal is provided in appendix d. ## balancing diversity trade-off using unit removal is an effective method to control and enhance dialogue diversity. however, the generated responses may conflict with the pruned information. to address this issue, we introduce an additional step for revision to rectify potential discrepancies in the generated utterances. ## comparing diversity approaches we compared app with two common methods for controlling generation diversity: (1) tuning decoding parameters and (2) sequential generation, with results summarized in decoding parameter tuning (e.g., increasing temperature t or top-p) is a widely adopted strategy to boost diversity by encouraging lowprobability token selection. however, sequential generation produces multiple responses in parallel, conditioning each on the preceding ones to promote topical variation. we imple-mented this by appending "please output ten candidates" to the prompt and selecting one at random. this method largely improves diversity, aligning with findings by @xcite . however, it often led to shorter, less coherent outputs, and can hinder desired output formatting. in addition to diversity evaluation, we also measured fluency, coherence, and the overall dialogue quality by gpt-4 on a 5-point likert scale, following @xcite . results demonstrate that our adaptive pruning maintains perfect output fluency and even yields higher coherence and overall scores compared to the baseline. in summary, app (1) enables direct control of diversity via context pruning, ideal for heterogeneous agent simulation; (2) outperforms decoding-based methods and complements sequential generation without harming coherence; and (3) can be combined with other strategies for further gains. ## other factors affecting diversity beyond using unit removal to control and enhance diversity, we also explored factors influencing diversity in the original prompt, specifically block order, name frequency, and block length. the results are shown in block order critically affects diversity the reasoning abilities of llms are influenced by premise order @xcite and critical information placement @xcite . this experiment examined whether input order also impacts dialogue diversity. we rearranged blocks in the prompt (denoted by the sequence of their initials) and observed that sequence substantially influences diversity. for instance, reversing bpmec to cempb drastically reduced quality and diversity, with dist-3 dropping from 0.535 to 0.191. under cempb, the generated dialogue started to repetitively cycle through the same round foot_1 , leading to a significant degradation in dist-n. notably, the amplified context differences caused by such repetition also reduced sim scores, an embedding-based measure. a key negative pattern was placing c first and b last. comparing bmepc and bmecp (with dist-3 scores of 0.514 and 0.413, respectively) revealed that placing p before c mitigates significant drops in diversity. this pattern aligns with chronological order, highlighting the importance of block order in ensuring greater initial diversity. a frequent name can enhance diversity as parametric knowledge is amplified we used name replacement to analyze the agent's reliance on parametric and in-context knowledge in dialogue generation and its impact on diversity. inspired by the input sensitivity hypothesis in @xcite , which links input frequency to task performance, we replaced agent names with two sets of fictional characters: "harry potter with severus snape (hpss)" and "tifa lockhart with cloud strife (tlcs)." names are distinctive nouns that can strongly invoke learned knowledge, making them useful for this analysis. according to the c4 dataset @xcite , a common llm pretraining corpus, "harry potter" appears 762,023 times, whereas "tifa lockhart" appears only 432 times. this disparity suggests differing learned strengths, potentially affecting the model's use of parametric knowledge. results show that replacing names alone did not improve diversity (hpss to full). however, when prompts were further pruned (rmbmp), name replacement significantly boosted diversity, as shown by dist-n (hpss+rmbmp to rmbmp). comparing name combinations (hpss+rmbmp to tlcs+rmbmp) revealed that high-frequency names had a stronger effect. this suggests that pruning strengthens parametric knowledge, enabling outputs to integrate both parametric and incontext information, enhancing diversity. notably, this manifests larges on additional vocabulary 4 in dialogue, increasing distinct n-grams with minimal impact on embeddings. overall, the experiment highlights how llm agents utilize both knowledge sources, shedding light on their interplay and impact on diversity. ## related work diversity in natural language generation has long been a critical research challenge. techniques such as temperature scaling @xcite or nucleus sampling @xcite have been explored to generate varied responses while maintaining coherence. stasaski et al. (2020) progressively collects more diverse training data based on a diversity metric. to reduce the cost of enhancing diversity, lee et al. (2022) further improves upon nucleus sampling, achieving better trade-offs between generation diversity and factuality. similarly, chung et al. (2023) increases text generation diversity while maintaining data accuracy through human interventions. balancing diversity and relevance in multi-turn dialogues remains non-trivial. studies such as li et al. (2016) have investigated diversity-promoting objectives like maximum mutual information (mmi) to address response repetition in dialogue systems. zhou et al. ( 2023 ) generated a large number of utterance candidates and selected the best one using nli entailment scores to achieve the generation of diverse and coherent dialogues. however, controlling diversity in multi-agent conversations is still underdeveloped. @xcite applied dynamic similarity threshold to remove repetitive utterances. our work bridges the gap of diversity control while maintaining consistency. ## conclusion we presented adaptive prompt pruning (app), a simple yet effective method for controlling diversity in llm-agent simulations. by leveraging attention scores to identify and prune overemphasized prompt segments, app enables fine-grained diversity control via a single parameter and complements existing decoding-based techniques. our analysis reveals that prompt components, especially high-attention segments, significantly constrain generation. app offers a flexible framework for balancing consistency and creativity in multiagent settings, paving the way for more robust and controllable simulations.