TL;DR
Memory-Infused Depth Up-Scaling (MIDUS) replaces the heavy, duplicated feed-forward networks (FFNs) typically used in Depth Up-Scaling with lightweight, head-conditioned memory layers. By combining head-wise product-key retrieval with implicit value expansion, MIDUS drastically slashes trainable parameters and GPU memory usage while outperforming traditional up-scaling baselines across general and mathematical benchmarks.
What Problem Does This Paper Address?
To increase the capacity of large language models (LLMs) without training them from scratch, researchers often use Depth Up-Scaling (DUS). This technique duplicates existing Transformer blocks and inserts them back into the model, followed by continual pre-training (CPT).
However, standard DUS duplicates entire blocks, including the parameter-heavy Feed-Forward Network (FFN) layers. This drastically increases compute and memory costs. Furthermore, traditional DUS applies these block-level dense updates uniformly, ignoring the fact that different attention heads specialize in distinct tasks (e.g., tracking syntax vs. long-range dependencies). The authors address this inefficiency by asking: Can we add depth more efficiently by tailoring the added capacity to individual attention heads using sparse memory instead of dense FFNs?
Methods
The authors introduce MIDUS, which replaces the FFN branches of inserted blocks with a novel Head-wise Memory Layer (HML).
The architecture operates via two main components:
- Multi-head Product-Key Memory (PKM): Instead of sharing a single query space, HML takes the pre-output-projection from each attention head and routes it to a distinct, head-specific product-key space. This allows head-aligned sparse retrieval without the massive computational overhead of standard linear memory.
- Head-wise Implicit Value Expansion (HIVE): To prevent different heads from retrieving from the exact same output value space, HIVE introduces a shared latent value bank. It then applies compact, head-specific projections ($W_h$) to realize distinct values for each head. This keeps parameter storage tractable while allowing head-level specialization.
To ensure training stability, the memory value bank is initialized to zero, meaning the inserted block acts as a simple identity mapping at the start of training, perfectly preserving the base model's original behavior.
Datasets
The models were trained and evaluated using several prominent datasets:
- Continual Pre-training (CPT): A 1.5B-token subset of FineWeb-Edu (for general language and reasoning) and a 1.1B-token subset of MathPile (for math-domain adaptation).
- Supervised Fine-Tuning (SFT): Alpaca-GPT4 (52k examples) and Databricks-Dolly-15k (15k examples) to evaluate instruction-following capabilities.
- Downstream Evaluation: Standard benchmarks including ARC-Easy, LogiQA, Winogrande, CSQA, BoolQ, PIQA, MMLU, GSM8K, MATH, TriviaQA, NQ-Open, RACE, and LongBench.
Key Insights and Ideas
- FFNs as Implicit Memories: The paper builds on the philosophy that FFNs inherently act as key-value memories. Replacing them with explicit, sparse key-value memory layers is a natural architectural evolution for scaling.
- The Irreducible Error Gap: The authors provide a structural analysis proving that under a fixed-retrieval setup, forcing all attention heads to use a single shared realized value bank introduces an irreducible error gap if the heads require different corrections. HIVE's head-specific projections mathematically bypass this limitation.
- Concentrated Head Importance: Gradient-based head-importance analysis revealed that MIDUS-HML leads to a more concentrated, uneven head-importance profile compared to the base model. This confirms that the model successfully allocates capacity in a head-conditioned manner rather than applying a uniform, dense expansion.
Key Results
MIDUS-HML was evaluated against state-of-the-art DUS methods (like Llama Pro, LESA, and OpT-DeUS) using Llama-3.2-1B and Llama-3.1-8B backbones.
- Parameter and Memory Efficiency: For the Llama-3.1-8B model, MIDUS-HML required only 0.42B trainable parameters compared to 3.49B for standard DUS baselines. It reduced peak training GPU memory from ~60 GB down to 34.8 GB.
- Performance Gains: Despite using a fraction of the parameters, MIDUS-HML achieved the lowest perplexity on WikiText and the highest average zero-shot accuracy across general knowledge and math benchmarks (e.g., scoring 39.40% average accuracy on MathPile vs. OpT-DeUS's 38.96%).
- Inference Speed: Thanks to a "Fused Cartesian Top-k" strategy and head-wise value caching during inference, MIDUS-HML achieved faster prefill times than standard DUS across all prompt lengths, particularly excelling at long contexts.
Limitations and Future Work
- Scope of Evaluation: The method was primarily validated on the Llama architecture family (1B and 8B sizes). Testing on other model families and scaling up to much larger models (e.g., 70B+) remains future work.
- Point Estimates: Due to the high computational cost of repeated continual pre-training runs, the main results are reported as single-run point estimates rather than averages with error bars.
- Theoretical Assumptions: The structural proof justifying HIVE assumes a fixed-retrieval regime, which simplifies the dynamic nature of routing during actual model training.
Summary updated