Manuscript Offprint
arXiv:2610.22999Controlling the Diversity-Quality Trade-Off of LLMs by Merging Models Before and After Alignment
Abstract
Alignment is known to change the output characteristics of large language models (LLMs). Base models tend to generate more diverse outputs, whereas aligned models tend to produce higher-quality outputs. The appropriate balance between the two depends on the task. Existing methods either require costly fine-tuning or, like temperature sampling, mainly improve lexical diversity rather than semantic diversity. We introduce a depth-aware FrankenMerging approach for controlling the diversity–quality trade-off between an aligned model and its base model without additional training. This approach combines the lower layers of an aligned model with the higher layers of its base model based on the hypothesis that lexical diversity is more closely associated with lower layers and semantic diversity with higher layers. Experiments showed that varying the number of layers taken from each model adjusts both diversity and quality. In most cases, the merged models exhibited higher semantic diversity than the aligned model, and at some split positions, they showed higher lexical diversity than both original models. They also demonstrated a better diversity–quality trade-off than temperature sampling in most settings. A supporting ablation, in which we reversed the merging order, yielded results largely consistent with the hypothesis.
1 Introduction
Large language models (LLMs) are used in a wide range of text generation tasks. LLMs are divided into two types: base models that have undergone only pretraining, and aligned models that have been fine-tuned to conform to human preferences. These two types of models have different output characteristics: base models tend to generate more diverse outputs, whereas aligned models tend to produce outputs of higher quality (Kirk et al., 2024; Shypula et al., 2025). The relative importance of these two characteristics depends on the task and the purpose of use. For example, while output quality is primarily emphasized in summarization, output diversity is essential in story generation. Xu et al. (2025) demonstrate that LLMs tend to generate only plots with similar developments in story generation. Therefore, it is necessary to balance the diversity and quality of LLM outputs according to the task.
Existing methods for enhancing output diversity have two limitations. First, some methods (Wang et al., 2025; Lanchantin et al., 2025; Chung et al., 2025) fine-tune LLMs to improve diversity, but these have high computational costs as they require additional training. Second, there are methods that do not require training, such as temperature sampling (Ackley et al., 1985), but these primarily enhance lexical diversity, which is surface-level variation in vocabulary, and contribute little to semantic diversity, which is variation in content (Tevet and Berant, 2021; Guo et al., 2025).
To address these limitations, this study aims to control the diversity–quality trade-off between an aligned model and its base model without additional training. We evaluate diversity in terms of both lexical diversity and semantic diversity. To this end, we introduce a depth-aware FrankenMerging approach. FrankenMerging (Goddard et al., 2024) is a model merging methodology that constructs new models by combining partial layers from multiple input models. Our approach selects the source model of each layer according to its depth and combines the lower layers of an aligned model with the higher layers of its base model.
In this paper, lower layers refer to the layers closer to the input, while higher layers refer to the layers closer to the output.
This approach is motivated by existing findings that the roles of LLM layers differ with their depth (Liu et al., 2024). On the basis of these findings, we hypothesize that lexical diversity is more closely associated with lower layers, whereas semantic diversity is more closely associated with higher layers. Under this hypothesis, it is expected that by utilizing the higher layers extracted from the base model, its semantic diversity can be brought into the merged model, and that the balance between diversity and quality can be adjusted by varying the split position.
To evaluate our approach, we conducted experiments across four tasks: translation, summarization, story generation, and dialogue generation. In these experiments, we evaluated the output diversity and quality of the merged models for different numbers of layers taken from each model. Furthermore, we compared the diversity–quality trade-off of our approach with that of temperature sampling. Additionally, as a supporting ablation for the hypothesis underlying our approach, we also assessed how reversing the model merging order affects output diversity.
The contributions of this study are as follows:
• We introduce a depth-aware FrankenMerging approach for controlling the diversity–quality trade-off between an aligned LLM and its base model and experimentally demonstrate that varying the number of layers taken from each model adjusts both diversity and quality, and that the approach provides a better diversity–quality trade-off than temperature sampling in most settings.
• We empirically investigate how layer depth relates to lexical and semantic diversity. Our results, together with those of a supporting ablation in which we reverse the merging order, are largely consistent with the hypothesis above.
2.1 Diversity in Natural Language Generation
Some studies evaluate linguistic diversity in natural language generation. Tevet and Berant (2021) reviewed existing diversity assessment metrics and classified them as follows: n-gram-based metrics like Distinct-n (Li et al., 2016) are primarily used for evaluating lexical diversity, while embedding-based metrics such as the distance between sentence embeddings computed by SentenceBERT (Reimers and Gurevych, 2019) are better suited for assessing semantic diversity. Zhang et al. (2021) identified the trade-off between diversity and quality in natural language generation. They demonstrated that texts generated with high likelihood do not necessarily correspond to high-quality outputs according to human evaluation.
Several studies investigate methods for evaluating linguistic diversity in text generated by LLMs. Guo et al. (2025) developed a framework for assessing the linguistic diversity of LLM outputs across lexical, syntactic, and semantic dimensions. They measured diversity across outputs for different inputs and reported that instruction-tuned models show higher lexical diversity but lower semantic diversity than their base models. Kirk et al. (2024) examined how fine-tuning and alignment affect the generalization performance and output diversity of LLMs. They found that alignment improves generalization but yields lower output diversity than supervised fine-tuning, and that this reduction is smaller for diversity across inputs than for diversity among outputs for a single input. Shypula et al. (2025) also showed that preference-tuned models produce outputs with lower lexical and semantic diversity for the same input than supervised fine-tuned or base models. These findings suggest that the effect of alignment on output diversity depends on the aspect of diversity and on the evaluation protocol. Nevertheless, the reduction in some aspects of diversity can pose challenges for tasks requiring diverse outputs, such as story generation and dialogue generation. In this study, we aim to control the diversity–quality trade-off between an aligned LLM and its base model.
2.2 Improving Output Diversity in LLMs
Improving output diversity is important across various tasks such as story generation (Xu et al., 2025), data augmentation (Guo et al., 2024), and dialogue generation (Stasaski and Hearst, 2022). For example, in data augmentation, low-diversity LLM outputs may lead to reduced generalization performance because the augmented data do not sufficiently reflect the diversity of the original dataset.
Research aimed at enhancing the diversity of LLM outputs primarily employs two approaches. The first approach develops decoding algorithms, which determine the next token on the basis of the given probability distribution. The most representa-tive method is temperature sampling (Ackley et al., 1985), which flattens the token probability distribution to increase lexical diversity. Other techniques include top-k sampling (Fan et al., 2018), locally typical sampling (Meister et al., 2023), and minp sampling (Minh et al., 2025). These sampling methods, however, have been shown to primarily improve word-level diversity and to be ineffective for producing semantically diverse outputs (Tevet and Berant, 2021; Guo et al., 2025).
The second approach involves improving diversity through fine-tuning of LLMs. For example, Wang et al. (2025) proposed a method that enhances output diversity by incorporating diverse paraphrased examples into the dataset used for direct preference optimization (DPO) (Rafailov et al., 2023). Lanchantin et al. (2025) presented a method that constructs a preference dataset, wherein high-diversity outputs are incentivized with positive feedback, while low-diversity outputs are penalized during DPO training. Chung et al. (2025) further proposed a modified DPO variant that weights the loss by the cosine distance between the model's responses and reference answers. Nevertheless, all these approaches involve modifying LLM fine-tuning methods, which results in high computational costs. To address this issue, this study introduces an approach that controls the diversity-quality trade-off between an aligned model and its base model through model merging, which requires no additional training.
2.3 Model Merging
Model merging is a methodology that integrates parameters from multiple pre-trained models into a single model with the aim of achieving higher performance (Goddard et al., 2024). One significant merit of model merging is the ability to construct high-performance models without requiring computationally intensive processes like fine-tuning.
Various model merging methods have been proposed. Model soups (Wortsman et al., 2022) averages parameters of models trained with different hyperparameters and achieves higher performance than any individual base model. Git Re-Basin (Ainsworth et al., 2023) extends this to models with different initializations by solving a neuron matching problem. Evolutionary model merging (Akiba et al., 2025) uses evolutionary computation to optimize which layers to merge and in what order. Goddard et al. (2024) proposed Franken-Merging via the MergeKit framework, which con-

Figure 1: Overview of our approach: We sequentially combine layers from the 1st to the i-th layer of an aligned model A with layers from the -th to the L-th layer of its base model B, then output the resulting model as a new one.
structures new models by selectively combining layers from multiple source models without modifying their parameters.
Nevertheless, these studies have focused only on improving the performance of merged models. No previous work has addressed model merging methods specifically aimed at enhancing output diversity. Furthermore, although some of these methods select or combine layers, they do so to improve task performance and do not consider how layers at different depths relate to output diversity. In this study, we introduce a depth-aware FrankenMerging approach that takes into account how layers at different depths relate to output diversity.
3 Approach
This study introduces a depth-aware FrankenMerging approach that merges models before and after alignment into a new model. The approach selects the source model of each layer according to its depth. By combining these models, we aim to control the balance between the diversity of the base model and the quality of the aligned model.
The procedure of our approach is as follows. First, we employ two inputs: model A, which has been fine-tuned with alignment, and base model B, which is the model before fine-tuning with alignment. Since both A and B share the same architecture with the same number of layers, we let L denote this number and specify a hyperparameter . We then sequentially combine the layers from the first to the i-th layer of the aligned model A with the layers from the -th to the L-th layer of the base model B, and output the resulting model as the new one. The overview of our approach is shown in Figure 1.
Our approach draws inspiration from studies on how the functions of LLM layers vary with depth. For example, Liu et al. (2024) showed that the lower layers of LLaMA 2 encode lexical semantics, whereas the higher layers are responsible for next-token prediction. This depth dependence leads us to hypothesize that lexical diversity in LLM outputs is more closely associated with lower layers, whereas semantic diversity is more closely associated with higher layers. Under this hypothesis, it is expected that by utilizing the higher layers extracted from the base model, its semantic diversity can be brought into the merged model. In addition, varying the split position is expected to adjust the balance between diversity and quality.
4 Experiments
4.1 Diversity in Generated Text
4.1.1 Setup
In this experiment, we evaluated how the output diversity of the merged models changes with the hyperparameter i relative to that of the original models.
Preliminary This experiment evaluates per-input diversity: the diversity among M outputs generated for a single input x, as opposed to across-input diversity (one output per input across different inputs). We focus on per-input diversity because it is more directly relevant to downstream tasks such as data augmentation and story generation.
Evaluation metric We measured lexical diversity with Self-BLEU (Zhu et al., 2018) and semantic diversity with the cosine distance between sentence embeddings (Reimers and Gurevych, 2019). Self-BLEU evaluates each output with BLEU (Papineni et al., 2002) against the other outputs for the same input and averages the scores, so lower values indicate higher lexical diversity. Let BLEU(y; R) denote the BLEU score of text y against a set of reference texts R. In this experiment, we defined a metric as one minus Self-BLEU so that higher values indicate higher lexical diversity. Equation 1 gives this definition.
The cosine distance between sentence embeddings is used to measure the semantic diversity of text. Let denote the sentence embedding of text . Appendix A specifies the embedding model. We defined a semantic diversity metric as in Equation 2.
In this experiment, we set . That is, for each input , we obtained 10 outputs and calculated and over these outputs.
Task This experiment addressed four tasks: translation, summarization, story generation, and dialogue generation. For translation, we used the English–Japanese data of the WMT24++ (Deutsch et al., 2025) dataset in the Japanese-to-English direction: the Japanese texts served as inputs, and the original English texts served as references. For summarization, we employed the XL-Sum (Hasan et al., 2021) dataset, where the task involves generating summaries from input articles. For story generation, we utilized the WritingPrompts (Fan et al., 2018) dataset, where the task involves generating a story from a writing prompt. For dialogue generation, we utilized the DailyDialog (Li et al., 2017) dataset, where the task involves completing the subsequent utterances of a partial dialogue. For each task, we used 500 randomly selected instruction examples x and evaluated each model by the average and scores across all inputs.
Model We employed two models: LLaMA 2 (Touvron et al., 2023) and Qwen 2.5 (Qwen et al., 2024). For both models, we used versions with approximately 7B parameters: one that underwent only pretraining and another that was aligned (Appendix A.1). The value of L was 32 for LLaMA 2 and 28 for Qwen 2.5.
Hyperparameter As a default hyperparameter, we set the temperature parameter to 1.0. Furthermore, our approach has a hyperparameter i, and we conducted experiments across all values . Appendix A provides further details of the experimental settings, such as the prompts and the generation parameters.
4.1.2 Result and Discussion
For each task, we plotted the two diversity metrics and for the base model, the aligned
Base model ▲ Aligned model ▲ Merged model

Translation (Qwen 2.5)
Summarization (Qwen 2.5)
Story (Qwen 2.5)
Dialogue (Qwen 2.5)
Figure 2: Lexical and semantic diversity of the base models (blue squares), the aligned models (red diamonds), and the merged models (purple circles) for LLaMA 2 (top row) and Qwen 2.5 (bottom row). The circles are connected in the order of i, and the labels indicate some values of i. The x-axis and y-axis denote and , respectively. Each point is the average over the 500 inputs, and the error bars indicate 95% confidence intervals obtained by 10,000 bootstrap resamples of the inputs.
model, and the merged models for each value of the hyperparameter i. The results are shown in Figure 2.
As i increased, the semantic diversity of the merged models generally moved from that of the base model toward that of the aligned model. This behavior is consistent with the layer composition of our approach, in which layers 1 through i are taken from the aligned model and layers through L from the base model. Smaller values of i therefore correspond to a greater contribution from the base model, and larger values to a greater contribution from the aligned model, which accounts for the observed shift in semantic diversity. In Qwen 2.5 story generation, however, the semantic diversity exceeded that of the base model at intermediate values of i.
The merged models also exhibited higher lexical diversity than both original models for some values of i in many tasks. The number of such values ranged from 2 in LLaMA 2 dialogue generation to 25 in LLaMA 2 story generation, and these values were mainly small to intermediate ones. Furthermore, the merged models exhibited higher semantic diversity than the aligned model for almost all values of i.
4.2 Quality of Generated Text
4.2.1 Setup
We evaluated how the output quality of the merged models changes with the hyperparameter i relative to that of the original models. We evaluated quality together with diversity because higher semantic diversity is not always desirable. In translation and summarization, for example, outputs should remain faithful to the source text. For this reason, we regard our approach as a means of controlling the trade-off between diversity and quality rather than maximizing diversity.
We focused on translation and summarization tasks, for which reference-based metrics are commonly used to measure output quality. Although the datasets for story generation and dialogue generation also contain reference texts, these tasks allow many appropriate outputs for a single input, so similarity to a single reference does not necessarily indicate high quality. We used the same datasets, number of inputs (500), models, and hyperparameters as in Section 4.1. For evaluation metrics, we used COMET (Rei et al., 2020) for translation and BERTScore (Zhang et al., 2020) for summarization. We averaged quality scores over 10 outputs per input and across all inputs.
4.2.2 Result and Discussion
For each task, we plotted quality evaluation metrics for the base model, the aligned model, and the merged models for each value of the hyperparameter i. The results are shown in Figure 3.
The output quality of the merged models changed with i differently in the two model families. In LLaMA 2, the quality of the merged models
Base model …… Aligned model …… Merged model

Translation (Qwen 2.5)
Summarization (Qwen 2.5)
Figure 3: Output quality of the base models (blue dashed lines), the aligned models (red dotted lines), and the merged models (purple circles) for LLaMA 2 (top) and Qwen 2.5 (bottom). The x-axis denotes i, and the y-axis denotes COMET for translation (left) and BERTScore for summarization (right). Each point is the average over the 500 inputs, and the error bars and shaded bands indicate 95% confidence intervals obtained by 10,000 bootstrap resamples of the inputs.
generally increased with i and approached that of the aligned model at large values of i. For Qwen 2.5, the aligned model performed worse than the base model in both tasks. This is likely because all models received plain-text prompts in the input format of base models, without chat templates (Appendix A.4). Even so, the merged models showed higher quality than the aligned model for all values of i. These results indicate that the hyperparameter i adjusts the output quality of the merged models.
4.3 Comparison with Existing Method
4.3.1 Setup
We compared the diversity–quality trade-off of our approach with that of temperature sampling. We computed diversity and quality using the same tasks (translation, summarization), datasets, number of inputs (500), models, and hyperparameters as in Sections 4.1 and 4.2. We varied the temperature for temperature sampling and hyperparameter i for our approach, then plotted the trade-offs.
We quantified each trade-off with the Hypervolume (Zitzler and Thiele, 1998). The Hypervolume of a set of points is the area of the region that is dominated by at least one of the points and that dominates a reference point. A larger Hypervolume indicates a better set of trade-offs. For the merged models, the set consists of the points for all values of i. For temperature sampling, it consists of the points for all temperatures. We set the reference point to the component-wise minimum of the points of the base model and the aligned model at a temperature of 1.0. We estimated 95% confidence intervals of the differences in Hypervolume with a paired bootstrap over the 500 inputs (10,000 resamples) and recomputed the reference point in each resample. We tested the differences with two-sided bootstrap tests with Holm's correction for multiple comparisons.
4.3.2 Result and Discussion
Figure 4 shows the trade-offs between diversity and quality metrics for the base model and the aligned model with temperature sampling, as well as for the merged models for each value of the hyperparameter i. Table 1 lists the Hypervolume of each method.
For both LLaMA 2 and Qwen 2.5, raising the temperature generally increased diversity on both tasks, whereas quality remained relatively stable up to a temperature of 1.0 and decreased sharply above it. This is consistent with the findings of Zhang et al. (2021) that temperature sampling enhances diversity at the cost of quality.
The Hypervolume of the merged models was larger than that of temperature sampling in most settings. With lexical diversity, the Hypervolume of the merged models was significantly larger than those of temperature sampling with both the base model and the aligned model for both model families and both tasks. With semantic diversity, the same held for LLaMA 2. For Qwen 2.5, the merged models significantly exceeded temperature sampling with the aligned model and were comparable to that with the base model. In addition, in the plane of and quality, 30 or 31 of the 31 merged models for LLaMA 2 and 21 or 26 of the 27 merged models for Qwen 2.5 were not dominated by any point of temperature sampling. In other words, no temperature yielded both diversity and quality at least as high as those of these merged models. These results suggest that our approach can provide a better diversity–quality trade-off than temperature sampling, particularly in terms of lexical diversity. We also observed that adjusting the hyperparameter i enabled flexible control over the balance between the two.
Base model
Aligned model
Merged model

Figure 4: Trade-off between diversity (horizontal) and quality (vertical) for temperature sampling with the base models (blue squares) and the aligned models (red diamonds) and for the merged models (purple circles) for LLaMA 2 (top row) and Qwen 2.5 (bottom row). From left to right, the panels in each row show translation and summarization with and translation and summarization with . The labels indicate some temperatures and values of . Each point is the average over the 500 inputs, and the error bars indicate confidence intervals obtained by 10,000 bootstrap resamples of the inputs.
| Model | Task | Merged | Base | Aligned | Merged – Base | Merged – Aligned |
|---|---|---|---|---|---|---|
| Lexical diversity | ||||||
| LLaMA 2 | Translation | 43.80 | 11.89 | 15.98 | +31.91 [+29.80, +34.02]* | +27.82 [+26.16, +29.46]* |
| LLaMA 2 | Summarization | 25.99 | 2.16 | 9.64 | +23.83 [+23.18, +24.47]* | +16.35 [+15.89, +16.83]* |
| Qwen 2.5 | Translation | 5.03 | 0.00 | 0.00 | +5.03 [+4.41, +5.71]* | +5.03 [+4.52, +5.71]* |
| Qwen 2.5 | Summarization | 1.27 | 0.00 | 0.00 | +1.27 [+1.19, +1.37]* | +1.27 [+1.19, +1.37]* |
| Semantic diversity | ||||||
| LLaMA 2 | Translation | 17.61 | 7.12 | 7.71 | +10.50 [+9.53, +11.46]* | +9.91 [+9.04, +10.76]* |
| LLaMA 2 | Summarization | 10.34 | 2.83 | 3.34 | +7.51 [+7.15, +7.84]* | +7.01 [+6.63, +7.39]* |
| Qwen 2.5 | Translation | 11.53 | 11.99 | 0.00 | -0.45 [-0.88, +0.21] | +11.53 [+10.89, +12.42]* |
| Qwen 2.5 | Summarization | 0.85 | 0.82 | 0.00 | +0.03 [-0.00, +0.08] | +0.85 [+0.79, +0.92]* |
Table 1: Hypervolume ( ) of the diversity–quality points of the merged models (all values of i) and of temperature sampling with the base and aligned models (all temperatures). The last two columns show the differences with 95% confidence intervals obtained by a paired bootstrap over the 500 inputs (10,000 resamples). An asterisk (*) indicates p < 0.05 after Holm's correction.
4.4 Ablation Study
4.4.1 Setup
To examine the hypothesis that lexical diversity is more closely associated with lower layers and semantic diversity with higher layers, we conducted a supporting ablation. We evaluated how output diversity changes when the merging order is reversed in our approach. Specifically, we combined layers 1 to i from the base model with layers to L from the aligned model. We used the same metrics, models, tasks, and hyperparameters as in Section 4.1.
4.4.2 Result and Discussion
For each task, we plotted the two diversity metrics and for four model configurations: the base model, the aligned model, the models merged by our approach, and the swapped models. In the swapped models, the order of the base model and the aligned model in our approach is reversed. For the last two configurations, we plotted the results for each value of the hyperparameter . The results are shown in Figure 5.
For both LLaMA 2 and Qwen 2.5, as i increased, the semantic diversity of the swapped models approached that of the base model. As in Section 4.1, this suggests that the more layers a model inherits from a given source, the more strongly it is
Base model ▲ Aligned model ▲ Merged model ▲ Inverse model

Figure 5: Diversity of the base models (blue squares), the aligned models (red diamonds), the merged models of our approach (purple circles), and the swapped models (orange triangles, labeled “Inverse model” in the legend) for LLaMA 2 (top row) and Qwen 2.5 (bottom row). The points of each merging order are connected in the order of i, and the labels indicate some values of i. The x-axis and y-axis denote and , respectively. Each point is the average over the 500 inputs, and the error bars indicate 95% confidence intervals obtained by 10,000 bootstrap resamples of the inputs.
influenced by that source.
The swapped models showed lower lexical diversity than the merged models of our approach at most values of i. To compare the two merging orders at the same value of i, we computed the difference in between them and its 95% confidence interval with a paired bootstrap over the 500 inputs (10,000 resamples). We adjusted the intervals for the multiple comparisons over the values of i and the metrics and regarded the of our approach as significantly higher when the interval was above zero. The of our approach was significantly higher than that of the swapped models for 27 to 30 of the 31 values of i in LLaMA 2, for 22 to 26 of the 27 values in Qwen 2.5 summarization, story generation, and dialogue generation, and for 9 of the 27 values in Qwen 2.5 translation. Moreover, for some values of i, the lexical diversity of the swapped models fell below even that of the aligned model in all settings. This suggests that the higher lexical diversity of our approach may be related to its use of the lower layers of the aligned model. On the other hand, the semantic diversity of the swapped models remained at or below that of the base model for almost all values of i. This suggests that the higher semantic diversity of our approach may be related to its use of the higher layers of the base model. Overall, these results are largely consistent with the hypothesis that lexical diversity is more closely associated with lower layers and semantic diversity with higher layers, and may reflect a depth-dependent effect on output diversity.
5 Conclusion
In this study, we introduce a depth-aware Franken-Merging approach that combines the lower layers of an aligned LLM with the higher layers of its base model to control the diversity–quality trade-off between the two models. Experiments on four tasks showed that the number of layers taken from each model allows us to select an operating point on this trade-off according to the requirements of each task. The merged models also showed a better diversity–quality trade-off than temperature sampling in most settings, particularly in terms of lexical diversity. Furthermore, the results of the supporting ablation in which we reversed the merging order were largely consistent with the hypothesis that lexical diversity is more closely associated with lower layers and semantic diversity with higher layers, which may reflect a depth-dependent effect on output diversity.
Limitations
Our experiments focus on two model families with approximately 7B parameters, LLaMA 2 and Qwen 2.5, which were aligned with different procedures. Extending the experiments to other model families and scales may provide further insights. In addition, since the trade-off range between quality and diversity that our approach can control is limited to that of the base model and the aligned model, the quality and diversity of the merged model depend on those of these two models. This limitation is expected to be resolved as the performance of base models improves.
Our analysis of layer depth compares the two merging orders. Finer-grained analyses, for example the replacement of a fixed number of layers at different depths, would provide further insight into the roles of individual layers.
The appropriate value of i depends on the task and the purpose of use. For practical applications such as data augmentation, we suggest adjusting i automatically, for example with validation data of the target task. Evaluating such adjustment in real applications is future work.
Our approach modifies the model rather than the decoding procedure, so it can be combined with sampling-based methods and diversity-oriented fine-tuning. Such combinations are expected to further improve output diversity.
Ethical Considerations
We used the models and datasets in accordance with their licenses and terms of use. LLaMA 2 is released under the Llama 2 Community License, and Qwen 2.5 and Qwen3-Embedding are released under the Apache License 2.0. Of the datasets, WMT24++ is released under the Apache License 2.0, XL-Sum and DailyDialog under CC BY-NC-SA 4.0, and the version of WritingPrompts that we used under the MIT License. We used all of them only for research purposes, which is consistent with these licenses.
The merged models may not fully retain the safety behavior that the aligned models acquired through alignment. This is because our approach takes the higher layers of a merged model from its base model. Before using merged models in applications, practitioners should evaluate their safety in addition to their diversity and quality.
WritingPrompts consists of prompts and stories posted on Reddit and may contain offensive content. We used these data only as inputs for generation and did not release the generated outputs.
References
David H. Ackley, Geoffrey E. Hinton, and Terrence J. Sejnowski. 1985. A Learning Algorithm for Boltzmann Machines. Cognitive Science, 9(1):147–169.
Samuel Ainsworth, Jonathan Hayase, and Siddhartha Srinivasa. 2023. Git Re-Basin: Merging Models Modulo Permutation Symmetries. In The Eleventh International Conference on Learning Representations.
Takuya Akiba, Makoto Shing, Yujin Tang, Qi Sun, and David Ha. 2025. Evolutionary Optimization of Model Merging Recipes. Nature Machine Intelligence, 7(2):195–204.
John Joon Young Chung, Vishakh Padmakumar, Melissa Roemmele, Yuqian Sun, and Max Kreminski. 2025. Modifying Large Language Model Post-Training for Diverse Creative Writing. In Second Conference on Language Modeling.
Daniel Deutsch, Eleftheria Briakou, Isaac Rayburn Caswell, Mara Finkelstein, Rebecca Galor, Juraj Juraska, Geza Kovacs, Alison Lui, Ricardo Rei, Jason Riesa, Shruti Rijhwani, Parker Riley, Elizabeth Salesky, Firas Trabelsi, Stephanie Winkler, Biao Zhang, and Markus Freitag. 2025. WMT24++: Expanding the Language Coverage of WMT24 to 55 Languages & Dialects. In Findings of the Association for Computational Linguistics: ACL 2025, pages 12257–12284, Vienna, Austria. Association for Computational Linguistics.
Angela Fan, Mike Lewis, and Yann Dauphin. 2018. Hierarchical Neural Story Generation. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 889–898, Melbourne, Australia. Association for Computational Linguistics.
Charles Goddard, Shamane Siriwardhana, Malikeh Ehghaghi, Luke Meyers, Vladimir Karpukhin, Brian Benedict, Mark McQuade, and Jacob Solawetz. 2024. Arcee's MergeKit: A Toolkit for Merging Large Language Models. In Proceedings of the 2024 Conference on Empirical Methods in Natural Language Processing: Industry Track, pages 477–485, Miami, Florida, US. Association for Computational Linguistics.
Yanzhu Guo, Guokan Shang, and Chloé Clavel. 2025. Benchmarking Linguistic Diversity of Large Language Models. Transactions of the Association for Computational Linguistics, 13:1507–1526.
Yanzhu Guo, Guokan Shang, Michalis Vazirgiannis, and Chloé Clavel. 2024. The Curious Decline of Linguistic Diversity: Training Language Models on Synthetic Text. In Findings of the Association for Computational Linguistics: NAACL 2024, pages 3589–3604, Mexico City, Mexico. Association for Computational Linguistics.
Tahmid Hasan, Abhik Bhattacharjee, Md. Saiful Islam, Kazi Mubasshir, Yuan-Fang Li, Yong-Bin Kang, M. Sohel Rahman, and Rifat Shahriyar. 2021. XL-Sum: Large-Scale Multilingual Abstractive Summarization for 44 Languages. In Findings of the Association for Computational Linguistics: ACL-IJCNLP 2021, pages 4693–4703, Online. Association for Computational Linguistics.
Robert Kirk, Ishita Mediratta, Christoforos Nalmpantis, Jelena Luketina, Eric Hambro, Edward Grefenstette, and Roberta Raileanu. 2024. Understanding the Effects of RLHF on LLM Generalisation and Diversity. In The Twelfth International Conference on Learning Representations.
Woosuk Kwon, Zhuohan Li, Siyuan Zhuang, Ying Sheng, Lianmin Zheng, Cody Hao Yu, Joseph E. Gonzalez, Hao Zhang, and Ion Stoica. 2023. Efficient Memory Management for Large Language Model Serving with PagedAttention. In Proceedings of the 29th Symposium on Operating Systems Principles, pages 611–626. Association for Computing Machinery.
Jack Lanchantin, Angelica Chen, Shehzaad Dhuliawala, Ping Yu, Jason Weston, Sainbayar Sukhbaatar, and Ilia Kulikov. 2025. Diverse Preference Optimization. arXiv:2501.18101v4 [cs.CL].
Jiwei Li, Michel Galley, Chris Brockett, Jianfeng Gao, and Bill Dolan. 2016. A Diversity-Promoting Objective Function for Neural Conversation Models. In Proceedings of the 2016 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 110–119, San Diego, California. Association for Computational Linguistics.
Yanran Li, Hui Su, Xiaoyu Shen, Wenjie Li, Ziqiang Cao, and Shuzi Niu. 2017. DailyDialog: A Manually Labelled Multi-Turn Dialogue Dataset. In Proceedings of the Eighth International Joint Conference on Natural Language Processing (Volume 1: Long Papers), pages 986–995, Taipei, Taiwan. Asian Federation of Natural Language Processing.
Yinhan Liu, Myle Ott, Naman Goyal, Jingfei Du, Mandar Joshi, Danqi Chen, Omer Levy, Mike Lewis, Luke Zettlemoyer, and Veselin Stoyanov. 2019. RoBERTa: A Robustly Optimized BERT Pretraining Approach. arXiv:1907.11692v1 [cs.CL].
Zhu Liu, Cunliang Kong, Ying Liu, and Maosong Sun. 2024. Fantastic Semantics and Where to Find Them: Investigating Which Layers of Generative LLMs Reflect Lexical Semantics. In Findings of the Association for Computational Linguistics: ACL 2024, pages 14551–14558, Bangkok, Thailand. Association for Computational Linguistics.
Clara Meister, Tiago Pimentel, Gian Wiher, and Ryan Cotterell. 2023. Locally Typical Sampling. Transactions of the Association for Computational Linguistics, 11:102–121.
Nguyen Nhat Minh, Andrew Baker, Clement Neo, Allen G. Roush, Andreas Kirsch, and Ravid Shwartz-Ziv. 2025. Turning Up the Heat: Min-p Sampling for Creative and Coherent LLM Outputs. In The Thirteenth International Conference on Learning Representations.
Kishore Papineni, Salim Roukos, Todd Ward, and Wei-Jing Zhu. 2002. Bleu: A Method for Automatic Evaluation of Machine Translation. In Proceedings of the 40th Annual Meeting of the Association for Computational Linguistics, pages 311–318, Philadelphia, Pennsylvania, USA. Association for Computational Linguistics.
Qwen, An Yang, Baosong Yang, Beichen Zhang, Binyuan Hui, Bo Zheng, Bowen Yu, Chengyuan Li, Dayiheng Liu, Fei Huang, Haoran Wei, Huan Lin, Jian Yang, Jianhong Tu, Jianwei Zhang, Jianxin Yang, Jiaxi Yang, Jingren Zhou, Junyang Lin, and 24 others. 2024. Qwen2.5 Technical Report. arXiv:2412.15115v2 [cs.CL].
Rafael Rafailov, Archit Sharma, Eric Mitchell, Christopher D. Manning, Stefano Ermon, and Chelsea Finn. 2023. Direct Preference Optimization: Your Language Model Is Secretly a Reward Model. Advances in Neural Information Processing Systems, 36:53728–53741.
Ricardo Rei, José G. C. de Souza, Duarte Alves, Chrysoula Zerva, Ana C Farinha, Taisiya Glushkova, Alon Lavie, Luisa Coheur, and André F. T. Martins. 2022. COMET-22: Unbabel-IST 2022 Submission for the Metrics Shared Task. In Proceedings of the Seventh Conference on Machine Translation (WMT), pages 578–585, Abu Dhabi, United Arab Emirates (Hybrid). Association for Computational Linguistics.
Ricardo Rei, Craig Stewart, Ana C Farinha, and Alon Lavie. 2020. COMET: A Neural Framework for MT Evaluation. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 2685–2702, Online. Association for Computational Linguistics.
Nils Reimers and Iryna Gurevych. 2019. Sentence-BERT: Sentence Embeddings Using Siamese BERT-Networks. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pages 3982–3992, Hong Kong, China. Association for Computational Linguistics.
Alexander Shypula, Shuo Li, Botong Zhang, Vishakh Padmakumar, Kayo Yin, and Osbert Bastani. 2025. Evaluating the Diversity and Quality of LLM Generated Content. In Second Conference on Language Modeling.
Katherine Stasaski and Marti Hearst. 2022. Semantic Diversity in Dialogue with Natural Language Inference. In Proceedings of the 2022 Conference of the
North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 85–98, Seattle, United States. Association for Computational Linguistics.
Guy Tevet and Jonathan Berant. 2021. Evaluating the Evaluation of Diversity in Natural Language Generation. In Proceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics: Main Volume, pages 326–346, Online. Association for Computational Linguistics.
Hugo Touvron, Louis Martin, Kevin Stone, Peter Albert, Amjad Almahairi, Yasmine Babaei, Nikolay Bashlykov, Soumya Batra, Prajjwal Bhargava, Shruti Bhosale, Dan Bikel, Lukas Blecher, Cristian Canton Ferrer, Moya Chen, Guillem Cucurull, David Esibo, Jude Fernandes, Jeremy Fu, Wenyin Fu, and 49 others. 2023. Llama 2: Open Foundation and Fine-Tuned Chat Models. arXiv:2307.09288v2 [cs.CL].
Zaitian Wang, Jinghan Zhang, Xinhao Zhang, Kunpeng Liu, Pengfei Wang, and Yuanchun Zhou. 2025. Diversity-Oriented Data Augmentation with Large Language Models. In Proceedings of the 63rd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 22265–22283, Vienna, Austria. Association for Computational Linguistics.
Mitchell Wortsman, Gabriel Ilharco, Samir Ya Gadre, Rebecca Roelofs, Raphael Gontijo-Lopes, Ari S. Morcos, Hongseok Namkoong, Ali Farhadi, Yair Carmon, Simon Kornblith, and Ludwig Schmidt. 2022. Model Soups: Averaging Weights of Multiple Fine-Tuned Models Improves Accuracy without Increasing Inference Time. In Proceedings of the 39th International Conference on Machine Learning, pages 23965–23998. PMLR.
Weijia Xu, Nebojsa Jojic, Sudha Rao, Chris Brockett, and Bill Dolan. 2025. Echoes in AI: Quantifying Lack of Plot Diversity in LLM Outputs. Proceedings of the National Academy of Sciences, 122(35):e2504966122.
Hugh Zhang, Daniel Duckworth, Daphne Ippolito, and Arvind Neelakantan. 2021. Trading Off Diversity and Quality in Natural Language Generation. In Proceedings of the Workshop on Human Evaluation of NLP Systems (HumEval), pages 25–33, Online. Association for Computational Linguistics.
Tianyi Zhang, Varsha Kishore, Felix Wu, Kilian Q. Weinberger, and Yoav Artzi. 2020. BERTScore: Evaluating Text Generation with BERT. In International Conference on Learning Representations.
Yanzhao Zhang, Mingxin Li, Dingkun Long, Xin Zhang, Huan Lin, Baosong Yang, Pengjun Xie, An Yang, Dayiheng Liu, Junyang Lin, Fei Huang, and Jingren Zhou. 2025. Qwen3 Embedding: Advancing Text Embedding and Reranking Through Foundation Models. arXiv:2506.05176v3 [cs.CL].
Yaoming Zhu, Sidi Lu, Lei Zheng, Jiaxian Guo, Weinan Zhang, Jun Wang, and Yong Yu. 2018. Texygen: A Benchmarking Platform for Text Generation Models. In The 41st International ACM SIGIR Conference on Research & Development in Information Retrieval, pages 1097–1100.
Eckart Zitzler and Lothar Thiele. 1998. Multiobjective Optimization Using Evolutionary Algorithms: A Comparative Case Study. In Parallel Problem Solving from Nature — PPSN V, pages 292–301. Springer.
A Experimental Settings
This appendix provides the settings that Section 4 does not describe.
A.1 Models
We obtained all models from the Hugging Face Hub. For LLaMA 2, we used https://huggingface.co/meta-llama/Llama-2-7b-hf as the base model and https://huggingface.co/meta-llama/Llama-2-7b-chat-hf as the aligned model. For Qwen 2.5, we used https://huggingface.co/Qwen/Qwen2.5-7B as the base model and https://huggingface.co/Qwen/Qwen2.5-7B-Instruct as the aligned model.
A.2 Merging
We merged the models with the passthrough method of MergeKit (Goddard et al., 2024), which applies no weight averaging, rescaling, or additional training. Figure 6 shows the configuration. MergeKit takes the input embeddings from the model of the first slice and takes the final normalization layer and the language modeling head from the model of the second slice. The merged models keep the data types of the original weights, which are float16 for LLaMA 2 and bfloat16 for Qwen 2.5. Their model configurations follow those of the base models, except for the maximum context length and the EOS tokens in Table 3. All conditions use the tokenizer of the base model, which has the same vocabulary as that of the aligned model.
A.3 Data
We used the following datasets on the Hugging Face Hub: the en-ja_JP subset of google/wmt24pp (train split, its only split), the English subset of csebuetnlp/xlsum (test split), euclaise/writingprompts (test split), and roskoN/dailydialog (test split). We used the texts without preprocessing, except for the following. For summarization, we kept only the articles merge_method: passthrough base_model: <base model> slices:
- sources:
- model: <aligned model> layer_range: [0, i]
- sources:
- model: <base model> layer_range: [i, L]
Figure 6: MergeKit configuration of our approach for a split position i. The swapped models exchange the models of the two slices.
with at most 1,024 tokens under the tokenizer of the base model. The selected articles can therefore differ between LLaMA 2 and Qwen 2.5. For story generation, the input is the writing prompt of each example without its leading category tag, such as “[ WP ]”. For dialogue generation, we prefixed the utterances alternately with “A: ” and “B: ”, joined them with line breaks, and removed the text of the last utterance, so the input ends with the label of the last speaker. After this processing, we shuffled each split with the shuffle function of Hugging Face Datasets with a seed of 0 and used the first 500 examples.
A.4 Prompts
All conditions received the plain-text prompts in Table 2. We did not apply chat templates, even to the aligned models. The tokenizers add their default special tokens to the prompts, such as the BOS token for LLaMA 2.
A.5 Generation
We used vLLM (Kwon et al., 2023) for generation with the settings in Table 3. We generated the M outputs for each input in a single request and used the generated texts without post-processing. At a temperature of 0.0, we generated one output by greedy decoding and replicated it M times.
A.6 Evaluation
For Self-BLEU, we computed BLEU with n-grams up to n = 4, the mteval-v13a tokenizer, no smoothing, and the shortest reference length for the brevity penalty, as in the default setting of Hugging Face Evaluate. For the embedding in Equation 2, we used Qwen/Qwen3-Embedding-0.6B (Zhang et al., 2025) with Sentence-Transformers (Reimers and Gurevych, 2019) and no instruction prompt. For COMET, we used Unbabel/wmt22-comet-da (Rei et al., 2022) with the Japanese input as the source. For BERTScore, we used the F1 score with roberta-large (Liu et al., 2019) (layer 17), which is the default model for English, without IDF weighting or baseline rescaling.
A.7 Software and Hardware
Table 4 lists the versions of the software. Each run used a single NVIDIA RTX A6000 GPU with 48 GB of memory.
| Task | Prompt template |
|---|---|
| Translation | Translate the following text into English: {input}Translation: |
| Summarization | Summarize the following text: {input}Summary: |
| Story generation | Write a story based on the following writing prompt: {input}Story: |
| Dialogue generation | Continue the following dialogue: {input} |
Table 2: Prompt templates. {input} is replaced with the input text, and the line breaks are kept as shown.
| Setting | Value |
|---|---|
| Library | vLLM 0.28.0 |
| Top-p | 1.0 |
| Top-k | Not applied |
| Min-p | 0.0 |
| Repetition penalty | 1.0 |
| Presence penalty | 0.0 |
| Frequency penalty | 0.0 |
| Maximum new tokens | 1,024 (story generation)512 (other tasks) |
| Minimum new tokens | Not applied |
| Stopping criterion | EOS token or maximum new tokens |
| EOS token IDs | 2 (LLaMA 2); 151643 and 151645 (Qwen 2.5) |
| Maximum context length | 4,096 (LLaMA 2); 32,768 (Qwen 2.5) |
| Random seed | 0 |
Table 3: Generation settings. The EOS token IDs are the union of those of the base model and the aligned model, and the maximum context length is the smaller of their values.
| Software | Version |
|---|---|
| Python | 3.12 |
| PyTorch | 2.13.0 (CUDA 13.0) |
| Transformers | 5.16.1 (generation); 4.57.6 (merging and evaluation) |
| Tokenizers | 0.23.1 |
| Datasets | 5.0.1 |
| vLLM | 0.28.0 |
| MergeKit | 0.1.4 |
| Sentence-Transformers | 5.7.0 |
| COMET | 2.2.7 (unbabel-comet) |
| BERTScore | 0.3.13 (bert-score) |
| Hugging Face Evaluate | 0.4.6 |
Table 4: Software versions.