Overfill: Two-Stage Models for Efficient Language Model Decoding

Woojeong Kim, Junxiong Wang, Jing Nathan Yan, Mohamed S. Abdelfattah, Alexander M Rush

TL;DR

This paper introduces OverFill, a novel two-stage decoding strategy for Large Language Models (LLMs) that decouples the compute-bound prefill stage from the memory-bound decode stage. By using a full-capacity model for prefill and a smaller, pruned model for decoding, OverFill significantly reduces inference latency and memory footprint without sacrificing accuracy, offering a compelling trade-off for efficient LLM deployment.

What Problem Does This Paper Address?

Deploying large language models (LLMs) is hampered by high inference costs, particularly for long sequences. LLM inference is typically divided into two stages: "prefill," where the input prompt is processed in parallel (compute-bound), and "decode," where tokens are generated sequentially (memory-bound). The decode stage is often the bottleneck due to the need to repeatedly load massive model parameters, especially the feed-forward network (FFN) layers, into memory. Existing methods often treat these stages uniformly or employ complex techniques to disaggregate them, leading to only marginal improvements or requiring intricate frameworks. This paper addresses the challenge of efficiently decoupling these stages to achieve a better balance between accuracy and inference speed.

Methods

The core innovation of OverFill is its two-stage approach:

  • Prefill Stage: The full, original LLM (denoted as $\Theta$) is used to process the input prompt. This stage is compute-bound, and leveraging the full model here allows for efficient parallel processing of the input and building a rich Key-Value (KV) cache.
  • Decode Stage: A significantly smaller, pruned version of the LLM (denoted as $\Theta' \subset \Theta$) is used for sequential token generation. This stage is memory-bound, and by using a pruned model, the memory footprint and latency associated with loading parameters are drastically reduced.

The authors employ a specific form of width pruning (channel pruning) to create the smaller decoder. This method is chosen because it avoids changing the KV cache dimension, ensuring compatibility between the prefill and decode stages. The pruning process involves measuring channel importance and retaining the top-performing channels. Importantly, OverFill is end-to-end trainable, with only the pruned decoder being updated during training, while the full prefill model remains frozen. This approach simplifies training and allows the pruned decoder to be seamlessly integrated into existing models.

Datasets

The paper uses the following datasets:

  • Training:
    • Infinity-Instruct (7M instances)
    • OpenHermes-2.5 (1M instances)
  • Evaluation:
    • GSM8K (math reasoning)
    • ARC-Challenge (science reasoning)
    • MMLU (broad knowledge)
    • MATH (math reasoning)
    • WMT16-DE-EN (machine translation)
    • IFEval (instruction following)
    • NQ (question answering)
    • MMLU-Redux (general knowledge reasoning)
    • CRUXEval (code reasoning, understanding, and execution)

The paper also mentions using a "small calibration set" for determining pruning ratios and a "sampled validation set" for accuracy by generation length analysis.

Key Insights and Ideas

  • Decoupling is Key: The distinct computational profiles of prefill (compute-bound) and decode (memory-bound) are fundamental. Treating them uniformly is suboptimal.
  • Prefill Power: Leveraging a larger model for the compute-bound prefill stage can significantly improve the quality of the KV cache, which benefits the subsequent decoding.
  • Pruning for Efficiency: A smaller, pruned model for the memory-bound decode stage is highly effective at reducing latency and memory usage.
  • Width Pruning Compatibility: Width pruning is crucial because it preserves the KV cache dimension, making it easy to switch between the full and pruned models.
  • Pareto Optimality: OverFill achieves a strong balance between accuracy and latency, outperforming other methods on a latency-accuracy tradeoff plot.
  • Long Generation Benefits: While the gap narrows for extremely long generations, OverFill's advantage persists, making it highly effective for many practical use cases.

Key Results

  • Accuracy Gains:
    • A 3B-to-1B OverFill configuration outperforms 1B pruned models by 83.2% on average.
  • An 8B-to-3B configuration improves over 3B pruned models by 79.2% on average.
  • OverFill matches or outperforms similarly sized models trained from scratch, using significantly less training data.
  • In the 1B scale, OverFill outperforms standalone pruned models and finetuned 1B-Base models across most tasks.
  • In the 3B scale, OverFill with an 8B prefill and 3B decode outperforms pruned models and 3B-Base models on most tasks.
  • Efficiency:
    • OverFill introduces minimal latency overhead compared to standalone pruned models, especially for longer generations.
  • At the 1B scale, OverFill-1B and Pruned-1B are faster than the full 3B model.
  • In realistic serving scenarios with multiple concurrent requests (batch size 256), OverFill achieves a throughput of 7,913 tokens/s, compared to 2,871 tokens/s for standard speculative decoding.
  • Pruning Ratio Impact: OverFill consistently maintains higher accuracy than a pruned model with the same decoder configuration, even at higher pruning ratios (e.g., 0.7 for ARC Challenge).

Limitations and Future Work

  • Limitations:
    • For extremely long generations, the gap between OverFill and the pruned model narrows as decoding becomes more dependent on the smaller decoder.
  • The paper notes that pruned architectures require extensive adaptation to recover accuracy, and standalone pruned models may underperform finetuned counterparts.
  • Future Work:
    • Explore periodically refreshing the prefill to maintain benefits uniformly throughout longer sequences.
  • Investigate pruning attention heads to further optimize KV cache size and decoding efficiency.
  • Scale the approach with larger training data to extend benefits to even more memory-constrained models.
  • Consider other pruning methodologies beyond width pruning.
  • Explore combining OverFill with quantization for further optimization.

Summary updated

BibTeX
@inproceedings{kim2025overfill,
  author = {Woojeong Kim and Junxiong Wang and Jing Nathan Yan and Mohamed S. Abdelfattah and Alexander M Rush},
  title = {{Overfill: Two-Stage Models for Efficient Language Model Decoding}},
  booktitle = {COLM},
  year = {2025},
  url = {https://openreview.net/forum?id=e112iu5ssg},
}
Figure