TL;DR
STILL is a novel linearization framework that converts pretrained Large Language Models (LLMs) into efficient, linear-time models using an intra-layer hybrid attention mechanism. By dynamically routing globally important tokens to full softmax attention using a local "Self-Saliency Score" and preserving original feature magnitudes via a Norm-Preserved Feature Map, STILL achieves up to 45% memory reduction and a 28% decoding speedup while maintaining strong long-context reasoning capabilities.
What Problem Does This Paper Address?
Standard Transformer models rely on softmax self-attention, which scales quadratically ($O(N^2)$) in time and memory relative to sequence length. This creates a massive bottleneck for long-context applications.
To solve this, researchers often "linearize" pretrained LLMs by replacing softmax attention with linear attention variants. Recent state-of-the-art approaches use intra-layer hybrid attention, combining a local sliding-window softmax attention with a global linear attention branch. However, existing methods suffer from two major flaws:
- Position-biased routing: They route tokens to the high-fidelity softmax branch based purely on position (e.g., a fixed sliding window), completely missing critical tokens that fall outside this window (see Figure 1).
- Norm distortion: Linear attention feature maps (often implemented via MLPs) inadvertently distort the vector magnitudes (norms) of pretrained representations, breaking the "norm-aware" property that pretrained models rely on to gauge token importance.
Methods
The authors introduce STILL (Selecting Tokens for Intra-Layer Hybrid Attention to Linearize LLMs), which tackles these challenges through three core components:
- Self-Saliency Score: Instead of static window-based routing, STILL computes a score for each token within a local window by measuring how sensitive its local attention distribution is to its own self-attention term. Tokens with the highest scores are promoted to the full softmax attention branch, even if they are far away in the historical context.
- Norm-Preserved Feature Map (NP-Map): To prevent the linear attention branch from distorting pretrained features, the NP-Map explicitly decouples a feature's direction from its magnitude during the learnable MLP transformation. It then reinjects the original pretrained norm, ensuring the linear kernel aligns with the model's original representational intensity.
- Chunk-Wise Parallel Form & Delayed Selection: To avoid the hardware inefficiency of token-by-token routing, STILL groups sequences into chunks. Token selection is delayed and performed at the chunk level, enabling highly parallelized training and inference (see Figure 2).
Datasets
- Training: The model is fine-tuned using a two-stage procedure (Attention Transfer and Low-Rank Linearization) on the Cleaned Alpaca dataset for only 20M to 40M tokens with a sequence length of 1024.
- Evaluation:
- Commonsense & General Reasoning: PIQA, ARC-Easy, ARC-Challenge, HellaSwag, WinoGrande, and MMLU.
- Long-Context Benchmarks: RULER (including Needle-in-a-Haystack retrieval and extended state-tracking tasks) and BABILong (complex reasoning over long, noisy contexts) up to 4K context lengths.
Key Insights and Ideas
- Local-Global Consistency: A key discovery is that a token's importance within a local sliding window strongly correlates with its importance across the entire global context (Figure 3). This allows STILL to accurately select globally salient tokens using only cheap, local computations.
- What makes a token salient? Qualitative analysis (Figure 4) reveals that the Self-Saliency Score naturally prioritizes functional operators like negations (not, no, never), modality (will, would, may), and quantifiers (all, any, nothing). These tokens inherently require high-fidelity softmax attention to resolve precise, context-specific interactions.
Key Results
- Efficiency Gains: Compared to training subquadratic models from scratch (which requires 1000+B tokens), STILL requires only 0.04B tokens of fine-tuning. For sequences over 8K tokens, it achieves an average memory reduction of 45% and a 28% decoding speedup (Figures 5 and 6).
- Reasoning Performance: On general reasoning tasks, STILL outperforms prior linearized baselines. For instance, using a Llama 3.1 8B teacher, STILL scores 61.3% on MMLU, vastly superior to Liger-GLA's 46.9%.
- Long-Context Recovery: On the RULER benchmark at a 4K context length, STILL recovers 86.2% of full-attention performance while using substantially fewer softmax tokens, a regime where previous hybrid models completely fail.
| Prefilling Efficiency | Decoding Efficiency |
|---|---|
| Prefilling Efficiency from 1K to 64K. | Decoding Efficiency from 1K to 64K. |
Limitations and Future Work
While STILL significantly pushes the boundaries of linearized LLMs, some limitations remain:
- Extreme Context Degradation: Although STILL drastically outperforms prior linearized models on long contexts, there is still a noticeable performance drop when moving from 1K to 4K contexts on complex state-tracking tasks (e.g., S-NIAH-3 accuracy drops significantly under tight token budgets).
- Dependence on Two-Stage Tuning: The framework still relies on a distinct attention distillation phase followed by LoRA fine-tuning, which requires careful hyperparameter balancing.
Future work could explore extending STILL to even larger model scales (e.g., 70B+ parameters) and evaluating it on ultra-long context lengths beyond 64K tokens.
Summary updated