TL;DR
The paper introduces HALO (Hybrid Attention via Layer Optimization), an ultra-data-efficient distillation pipeline that converts pre-trained Transformers into hybrid Attention-RNN models using fewer than 3 billion tokens. Paired with a novel position encoding scheme called HyPE, the resulting HypeNet architecture delivers up to a 3.4× speedup and massive memory savings while maintaining excellent performance on extremely long contexts.
What Problem Does This Paper Address?
Standard Transformer-based language models rely on softmax attention, which suffers from quadratic computational and memory complexity ($O(T^2)$) relative to the context length ($T$). This makes processing long documents or extended conversations prohibitively expensive.
To solve this, researchers have turned to hybrid architectures that interleave standard attention layers with linear-complexity Recurrent Neural Networks (RNNs) or State Space Models (SSMs). However, training these hybrid models from scratch requires trillions of tokens, putting them out of reach for most academic and mid-sized engineering teams.
While recent work has attempted to distill existing pre-trained Transformers into hybrid models, these methods still require tens to hundreds of billions of tokens. Worse, the resulting models typically suffer from severe performance degradation when evaluated on long-context tasks—the exact scenario where hybrid models are supposed to excel.
Methods
The authors tackle these challenges with a two-part solution: an efficient distillation pipeline (HALO) and a length-generalizing hybrid architecture (HypeNet).
1. The HALO Distillation Pipeline
HALO converts a pre-trained Transformer into a hybrid model in three data-efficient stages:
- Initialization & Weight Transfer: The weights of the teacher Transformer's attention layers are mapped directly to initialize the student's RNN layers.
- Stage 1 (Hidden State Alignment): Each RNN layer is trained independently to mimic the output of its corresponding attention layer using a small amount of data (320M tokens) while keeping the rest of the network frozen.
- Layer Selection: Instead of converting all layers, HALO uses a novel importance metric to decide which layers to keep as standard attention. It selects layers whose conversion causes a massive drop in data recall but a minimal drop in common-sense reasoning. Typically, 25% of the layers are retained as attention.
- Stage 2 & 3 (Distillation & Finetuning): The full hybrid network undergoes end-to-end knowledge distillation (1B tokens) followed by long-context finetuning (1B tokens).
2. The HypeNet Architecture
To fix the long-context degradation common in distilled models, the authors introduced several architectural modifications:
- HyPE (Hybrid Position Encoding): Standard hybrids either use Rotary Position Embedding (RoPE) everywhere or omit it entirely (NoPE). HyPE applies RoPE only to the RNN layers and NoPE to the attention layers.
- Attention Logits Scaling: To prevent attention entropy from exploding over long sequences, logits are dynamically scaled during inference using a position-dependent factor: $s_t = \log_a(t + a)$.
- GQA to MHA Conversion: Grouped-Query Attention (GQA) head weights are decoupled into Multi-Head Attention (MHA) structures when initializing RNN layers to maximize RNN expressivity.
- Output Gating & QK-Norm: Randomly initialized data-dependent output gates and Query-Key normalization are added to the RNN layers to stabilize training and boost capacity.
Datasets
- Training: The model was distilled and finetuned using a randomly sampled 10B token subset of FineWeb-edu, a high-quality web scraping corpus optimized for educational content.
- Evaluation:
- Common-Sense Reasoning (CSR): Evaluated using standard zero-shot benchmarks including HellaSwag, ARC-Easy, ARC-Challenge, WinoGrande, PIQA, LAMBADA, and MMLU.
- Long-Context Recall: Evaluated using the Needle-in-a-Haystack (NIAH) tasks from the RULER benchmark.
- Layer Selection Metrics: SQuAD, FDA, and SWDE datasets were leveraged to calculate recall drops during the layer selection phase.
Key Insights and Ideas
- The Receptive Field Split: RNN layers have a naturally limited "receptive field" and excel at modeling short-range local context. Because they become agnostic to context length beyond this field, the model's long-context length generalization depends entirely on its attention layers.
- Why HyPE Works: By removing RoPE from the attention layers (NoPE), the attention mechanism generalizes flawlessly to unseen sequence lengths. Meanwhile, keeping RoPE in the RNN layers ensures the model retains rich, local positional awareness.
- Data-Independent Gates Generalize Better: When testing various RNN choices (Mamba2, GLA, RWKV-7), the authors found that Lightning Attention performed best. This is because it utilizes data-independent forget gates, preventing the model from aggressively discarding long-history information over massive contexts.
Key Results
The authors applied HALO to the Qwen3 model series, creating HypeNet variants:
- Extreme Data Efficiency: The entire conversion process required only 2.3B tokens, which represents less than 0.01% of the data used to pre-train the original base models.
- Throughput & Prefill Speedups: At a 512K context length, HypeNet achieved a 3.0× decoding speedup and a 3.4× prefilling speedup compared to the pure-transformer Qwen3 base model.
- Memory Efficiency: HypeNet successfully processed contexts up to 1M tokens on a single GPU, whereas the original Qwen3 model ran out of memory (OOM) past 512K tokens.
Limitations and Future Work
- Alignment Degradation: Because the distillation process relies strictly on pre-training style data (FineWeb-edu), any instruction-following or chat-alignment behaviors present in the original teacher model are diminished or lost. Finding a way to efficiently preserve or recover post-training alignment during cross-architecture distillation remains an open challenge.
- Architecture Specificity: The HALO pipeline is custom-tailored for converting standard Transformer architectures. Extending this protocol to handle other non-transformer base architectures will require further research.
Summary updated