Abstract
Hybrid Transformer architectures, which combine softmax attention blocks and recurrent neural networks (RNNs), have shown a desirable performance-throughput tradeoff for long-context modeling, but their adoption and studies are hindered by the prohibitive cost of large-scale pre-training from scratch. Some recent studies have shown that pre-trained softmax attention blocks can be converted into RNN blocks through parameter transfer and knowledge distillation. However, these transfer methods require substantial amounts of training data (more than 10B tokens), and the resulting hybrid models also exhibit poor long-context performance, which is the scenario where hybrid models enjoy significant inference speedups over Transformer-based models. In this paper, we present HALO (Hybrid Attention via Layer Optimization), a pipeline for distilling Transformer models into RNN-attention hybrid models. We then present HypeNet, a hybrid architecture with superior length generalization enabled by a novel position encoding scheme (named HyPE) and various architectural modifications. We convert the Qwen3 series into HypeNet using HALO, achieving performance comparable to the original Transformer models while enjoying superior long-context performance and efficiency. The conversion requires just 2.3B tokens, less than 0.01% of their pre-training data.
Introduction
Standard Transformer models, while dominant in modern AI, suffer from a "quadratic bottleneck": as input sequences grow, computational costs and memory requirements increase quadratically. This makes processing extremely long contexts (e.g., 1 million tokens) prohibitively expensive. Recurrent Neural Networks (RNNs) and State Space Models (SSMs) offer linear scaling, but often struggle with "recall"—the ability to retrieve specific information from a vast context.
Hybrid models, which integrate a small number of attention layers with many RNN layers, aim to provide the best of both worlds. However, training these models from scratch is computationally expensive. Existing distillation methods that attempt to convert pre-trained Transformers into hybrid models often require massive datasets (up to 400B tokens) and fail to maintain performance on the very long-context tasks where hybrid models should excel. This paper introduces HALO and HypeNet to solve these efficiency and performance gaps.
Methods: HALO and HypeNet
HALO Distillation Pipeline
The authors propose HALO (Hybrid Attention via Layer Optimization), a three-stage pipeline designed for extreme data efficiency. Unlike previous methods that require hundreds of billions of tokens, HALO achieves superior results with just 2.3B tokens—less than 0.01% of the original pre-training data.
The pipeline consists of:
- Initialization: Mapping Transformer weights directly to RNN weights.
- Stage 1 (Alignment): Training RNN layers individually to mimic the outputs of the original attention layers.
- Layer Selection: A critical step where a novel metric identifies which layers are most essential for recall. These are kept as attention layers, while others are converted to RNNs.
- Stage 2 & 3 (Distillation & Finetuning): Refining the full model on a mix of general and long-context data.
HypeNet Architecture
To further improve length generalization, the researchers developed HypeNet, which utilizes a novel scheme called HyPE (Hybrid Positional Encoding). While standard models apply Rotary Positional Encoding (RoPE) globally, HypeNet applies RoPE only to RNN layers to handle short-range dependencies. Attention layers use NoPE (No Positional Encoding), allowing them to generalize to sequences far longer than those seen during training. Additionally, Attention Logits Scaling is employed to maintain focus as context length increases.
Key Results
Efficiency and Performance Tradeoffs
Evaluations show that HypeNet-2B (distilled from Qwen3-1.7B) maintains comparable common-sense reasoning scores while significantly outperforming the teacher model on long-context tasks.
As shown in the figures above, HypeNet provides substantial gains in efficiency:
- Speed: At a 512K context length, HypeNet is 3.0x faster at decoding and 3.4x faster at prefilling than the original Transformer.
- Memory: HypeNet remains stable at 1 million tokens, whereas the original Qwen3 model exceeds GPU memory limits.
- Throughput: The model achieves significantly higher tokens-per-second while maintaining high performance levels.
Length Generalization
One of the most striking results is HypeNet's ability to generalize. Models trained on only 4K context lengths maintained high accuracy on benchmarks like RULER and Needle-in-a-Haystack for contexts up to 256K tokens. This demonstrates that the HyPE scheme effectively decouples the model's reasoning ability from the specific sequence lengths encountered during distillation.
Conclusion
HALO and HypeNet represent a significant step forward in making long-context AI both efficient and accessible. By reducing the data required for model conversion by orders of magnitude, this work enables researchers to create high-performance hybrid models without industrial-scale computing resources. Future work will focus on improving instruction-following capabilities and extending the HALO protocol to other linear-time architectures.
Summary updated