atlas

Research map / Architectures and efficiency / Attention and transformers

On-the-Fly Adaptive Distillation of Transformer to Dual-State Linear Attention for Long-Context LLM Serving

ICML 2025 · Architectures and efficiency › Attention and transformers · approach: Sparse attention for long-context LLMs

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Proposes dual-state linear attention (DSLA) and DSLA-Serve, an on-the-fly adaptive distillation framework that progressively converts Llama2-7B Transformer layers into DSLA layers using sensitivity-based ordering and chained fine-tuning.

Problem

Long-context LLM serving is bottlenecked by quadratic self-attention compute and KV-cache memory, while linear attention alternatives overemphasize recent tokens and static hybrid architectures cannot trade accuracy for efficiency under changing load.

Approach

Each linear-attention layer keeps two hidden states (history and recency gates) blended by a learnable per-layer coefficient, trained with a contrastive regularizer that de-correlates the gates; layers are converted to DSLA in ascending sensitivity order at inference time, with chained fine-tuning so each newly converted layer matches the already-converted configuration.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
replace self-attention with DSLA in 25% of layersLlama2-7B · HotpotQAaccuracy: 5.63 -> 11.07Helped
replace self-attention with DSLA in 25% of layersLlama2-7B · 2WikiMQAaccuracy: 10.24 -> 14.20Helped
replace self-attention with DSLA in 25% of layersLlama2-7B · TriviaQAaccuracy: 86.19 -> 87.46Helped
replace self-attention with DSLA in 25% of layersLlama2-7B · WikiText-2perplexity: 8.79 -> 9.26Hurt
replace self-attention with DSLA in 25% of layersLlama2-7B · CNN/DailyMailROUGE-1: 30.13% -> 30.01%Hurt
replace self-attention with DSLA in 25% of layersLlama2-7B · XSumROUGE-L: 24.51% -> 24.70%Helped
replace self-attention with DSLA in 25% of layersLlama2-7B · lm eval tasksaverage score: 57.2% -> 56.3%Hurt
adaptively convert layers with DSLA-ServeLlama2-7B · end-to-end request servinglatency: 93.64ms -> 40.83msHelped
add a second specialized hidden state instead of using one state (ablation)GLA converted from Llama-3.2-1B-Instruct · CoLA validationaccuracy: 78.97 -> 81.19Helped
use four hidden states instead of two (ablation)GLA converted from Llama-3.2-1B-Instruct · CoLA validationaccuracy: 81.19 -> 81.44No clear effect
use eight hidden states instead of two (ablation)GLA converted from Llama-3.2-1B-Instruct · CoLA validationaccuracy: 81.19 -> 80.96Hurt

Surprising findings

Limitations

Experimental setup

Datasets: SlimPajama C4 CoLA

Benchmarks: WikiText-2 Lambada HotpotQA 2WikiMQA LCC Repobench TREC Samsum TriviaQA CNN/DailyMail XSum WinoGrande

Metrics: perplexity accuracy ROUGE normalized end-to-end latency prefill latency decoding latency

Baselines: Llama2-7B GLA-7B Mamba-7B Zamba-7B RetNet-6.7B LoLCATs Phi-Mamba

Builds on: Gated Linear Attention LoLCATs

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy