TL;DR
Ask a modern, instruction-tuned LLM to name a chemical element, and it will likely say "Carbon" almost every single time. Researchers found that you can cure this repetitive streak—known as mode collapse—without retraining the model or slowing down inference. By simply swapping a specific middle chunk of the model's layers back to their original, pre-trained weights, you get a "Frankenstein" model that keeps its polished instruction-following manners while recovering its raw, creative imagination.
What Problem Does This Paper Address?
Raw, pre-trained LLMs are chaotic fountains of knowledge: wildly diverse, yet terrible at following directions. To make them useful assistants, we apply post-training (like instruction tuning and RLHF). Unfortunately, post-training is a double-edged sword. In teaching the model to be helpful, it squashes probability mass onto a tiny handful of "safe" responses—a phenomenon called mode collapse.
This is frustrating when you actually want variety—like brainstorming stories, answering open-ended questions, or exploring different paths to solve a math problem. Existing fixes have annoying catch-22s: tweaking decoding settings (like cranking up temperature) can't resurrect behaviors that post-training completely suppressed; clever prompting bloats token counts and inference costs; and retraining from scratch is prohibitively expensive. The authors ask: can we recover lost diversity for free, directly in weight space?
Methods
Drawing on prior evidence that different transformer layers handle different jobs, the authors hypothesize that diversity loss isn't spread evenly across the network. Their novel solution is Selective Layer Restoration (SLR): take a post-trained LLM and overwrite a contiguous block of layers $[i, j]$ with the weights from its original pre-trained checkpoint. Because the architecture doesn't change, inference cost is identical.
To figure out which layers to swap without running expensive evaluations on thousands of stories, the authors invent a clever, lightweight proxy task called Constrained Random Character (CRC). They simply ask the model to generate a single random digit or letter within a strict range (e.g., [0, 5]).
- Quality is the probability mass assigned to valid tokens.
- Diversity is the entropy (evenness) of the probabilities across those valid tokens.
Because CRC only looks at the very first generated token's probabilities, sweeping every possible contiguous block of layers takes just 3 to 20 minutes on a single A100 GPU. SLR picks the block that maximizes diversity while keeping quality within 95% of the best candidate.
Datasets
Because SLR is training-free, datasets are used strictly for interval selection and evaluation:
- Constrained Random Character (CRC) [Newly Introduced]: 40 synthetic prompts (20 digit ranges, 20 letter ranges) with unambiguous, single-token valid sets, enabling instant distribution-level evaluation without sampling.
- Creative Writing: 300 prompts across poem, story, and joke generation (from Zhang et al., 2024).
- Open-Ended QA: An adapted CoverageQA benchmark (40 questions with multiple valid factual answers, like "Name a US national park").
- Math Reasoning: Model-specific 100-question "hard" subsets of GSM8K (filtering for problems the post-trained model fails under greedy decoding).
- Behavioral Benchmarks: IFEval (strict formatting compliance) and safety/refusal evaluations.
Key Insights and Ideas
- Post-training isn't Pareto-optimal for diversity: On the CRC landscape, standard post-trained models sit off the optimal frontier—meaning there is massive headroom to boost variety before output validity noticeably degrades.
- Surgical swapping beats global blending: Averaging all weights between pre-trained and post-trained models (model soups) muddies the waters, yielding weaker diversity gains and worse quality drops than cleanly restoring a middle-to-late block of layers (e.g., layers 12–17 in Llama-3.1-8B).
- Tiny proxies predict complex behaviors: How a model distributes probabilities when picking a random number from 0 to 5 strongly correlates with how well it brainstorms national parks (Spearman rank correlation $\rho = 0.936$ for diversity on Qwen), because both tap into the same depth-dependent entropy shifts inside the network.
- It stacks with inference tricks: SLR operates on weights, so it compounds nicely with higher-temperature sampling and multi-answer prompting (Verbalized Sampling).
Key Results
Evaluated across Llama-3.1-8B, Qwen-2.5-7B, and Gemma-2-9B:
- Creative Writing: SLR boosts embedding-based output diversity by 41.5% on average across poems, stories, and jokes, with a statistically insignificant 2.1% dip in LLM-judged quality.
- Open-Ended QA: Answer entropy jumps by 112.7% and unique valid answer coverage leaps by 169.5%, while factual precision drops by just 1.8%. Where post-trained Llama endlessly repeats "Yellowstone," SLR surfaces Acadia, Yosemite, and Everglades.
- Reasoning: On hard GSM8K problems, SLR beats baselines across all sampling budgets ($k \in \{1 \dots 64\}$), proving that diverse exploration directly translates to more solved math problems.
Limitations and Future Work
- Checkpoint dependency: SLR requires access to both the base pre-trained and final post-trained weights.
- Alignment side effects: Swapping in raw pre-trained layers partially undoes behavioral guardrails. Strict formatting accuracy on IFEval drops by 12.5 to 20.1 percentage points, and safety refusal rates shift unpredictably (sometimes complying with unsafe prompts or over-refusing safe ones).
- Coarse granularity: The method only tests contiguous whole-layer blocks on English benchmarks. Preliminary ablations show MLP modules drive most of the gains; future work could surgically restore individual attention heads, non-contiguous layers, or bake sequence-level safety constraints into the proxy search.
Summary updated