TL;DR
Researchers have introduced HALO, a highly efficient distillation pipeline that converts standard Transformers into hybrid RNN-Attention models using less than 0.01% of the original pre-training data. By combining this with HypeNet—a novel architecture featuring a "best of both worlds" position encoding scheme—they achieved state-of-the-art long-context performance and up to a 3x speedup in inference without the prohibitive cost of training from scratch.
What Problem Does This Paper Address?
Standard Transformer models are the backbone of modern AI, but they have a "long-context tax." Because their self-attention mechanism has quadratic complexity ($O(n^2)$), doubling the input length quadruples the computational cost and memory usage.
Recurrent Neural Networks (RNNs) and State Space Models (SSMs) offer a linear-time ($O(n)$) alternative, but they often struggle with "recall-intensive" tasks—essentially, they have a hard time remembering specific details from a massive sea of information. Hybrid architectures, which interleave a few attention layers with many RNN layers, offer a promising middle ground.
However, two major hurdles remain:
- Training Cost: Training these hybrids from scratch requires trillions of tokens and massive compute.
- The Distillation Gap: Existing methods to "distill" (convert) a pre-trained Transformer into a hybrid model often require tens of billions of tokens and result in models that fail miserably when the context gets long.
Methods
The authors propose a two-part solution: a distillation pipeline (HALO) and a specific architecture (HypeNet).
1. HALO (Hybrid Attention via Layer Optimization)
HALO is a four-stage distillation pipeline designed for data efficiency:
- Weight Transfer: It initializes RNN layers using the pre-trained weights of the Transformer’s attention layers.
- Hidden State Alignment: It trains RNN layers individually to mimic the output of the original attention layers using Mean Squared Error (MSE).
- Smart Layer Selection: Not all layers are equal. HALO uses a new metric to decide which layers must remain as softmax attention to preserve "recall" and which can be safely converted to RNNs to save speed.
- Knowledge Distillation & Finetuning: The whole model is refined using KL-divergence against the teacher model, followed by a short burst of long-context finetuning.
2. HypeNet & HyPE
The architectural "secret sauce" is HyPE (Hybrid Position Encoding).
- The Logic: RNNs have a naturally limited "receptive field." The authors found that adding complex position info (like RoPE) to attention layers actually hurts long-context generalization.
- The Fix: HypeNet applies RoPE (Rotary Positional Embeddings) to the RNN layers (providing rich local structure) but uses NoPE (No Position Encoding) for the attention layers. This allows the attention layers to generalize to any length, while a position-dependent scaling factor prevents the model's focus from "blurring" at extreme lengths.
Datasets
- Training: The models were distilled using FineWeb-edu, a high-quality subset of web data.
- Evaluation:
- Common-sense Reasoning (CSR): Benchmarks like HellaSwag, ARC, and MMLU.
- Long Context: The NIAH (Needle-in-a-Haystack) test and the RULER benchmark were used to see if the model could find specific facts buried in up to 1M tokens of text.
Key Insights and Ideas
- Data Efficiency is King: HALO requires only 2.3B tokens. For context, the original Qwen3 models it was tested on were trained on trillions. This makes hybrid conversion accessible to academic teams, not just tech giants.
- The 25% Rule: The authors found that keeping roughly 25% of the layers as full attention is the "sweet spot" for maintaining Transformer-level reasoning while gaining RNN-level speed.
- Position Encoding Paradox: In a hybrid system, the RNN layers handle the "near-field" (local context), while attention handles the "far-field" (long-distance dependencies). By removing position encodings from attention, the model doesn't get "confused" by token indices it never saw during training, allowing it to work on much longer sequences than it was trained on.
Key Results
The researchers applied HALO to the Qwen3 series (1.7B to 8B parameters) with impressive results:
- Performance: HypeNet achieved performance comparable to the original Transformers on standard benchmarks but significantly outperformed prior distillation methods (like Jet-Nemotron) on long-context recall.
- Speed: At a 512K context length, HypeNet showed a 3.0x decoding speedup and a 3.4x prefilling speedup compared to the base Transformer.
- Memory: HypeNet is significantly more memory-efficient. While the base Qwen3-1.7B model crashed (OOM) at 1M tokens, HypeNet continued to function.
Limitations and Future Work
- Instruction Following: The distillation process used "pre-training style" data. The authors note that the specific instruction-following and alignment behaviors of the original model might be slightly diminished and require further recovery.
- Architecture Specificity: HALO is currently optimized for Transformer-to-Hybrid conversion. Its effectiveness on other non-Transformer architectures remains an open question.
- Future Directions: The authors suggest exploring how to more efficiently recover the "chat" capabilities of base models after the hybrid conversion.
Summary updated