跳到正文
arXiv cs.CL· Ning Yang, Hengyu Zhong, Wentao Wang, Baoliang Tian, Yuan Zhou, Haijun Zhang, Jun Wang·· 13 小时前AI 评分40

LinearARD:用线性内存注意力蒸馏恢复 RoPE,仅需 1.6% token 预算

LinearARD: Linear-Memory Attention Distillation for RoPE Restoration

AI 导读

LinearARD 提出一种恢复式蒸馏方法,通过对齐冻结原生 RoPE 教师模型最终注意力层的 Q/Q、K/K、V/V 自关系矩阵行分布,将 RoPE 缩放后的学生模型恢复至长上下文能力。

正文 · 原文

View PDF HTML (experimental)

Abstract:The extension of context windows in Large Language Models is typically facilitated by scaling positional encodings followed by Continued Pre-Training (CPT). While effective, this paradigm is notoriously data-hungry and computationally expensive, requiring massive long-text corpora to recalibrate the model to the shifted positional distribution. We propose LinearARD, a restoration distillation method that restores Rotary Position Embedding (RoPE)-scaled students through attention-structure consistency with a frozen native-RoPE teacher. Rather than next-token prediction or opaque hidden-state matching, LinearARD aligns row-wise distributions of dense $Q/Q$, $K/K$, and $V/V$ self-relation matrices from the final attention layer to directly supervise attention dynamics. To remove the quadratic memory bottleneck of $n \times n$ relation maps, we introduce a linear-activation-memory kernel that stores only per-token log-sum-exp statistics and recomputes logits in the backward pass to obtain exact Kullback-Leibler divergence gradients. Across LLaMA2-7B, LLaMA3-8B, and Mistral-7B-v0.1 extended to 32K context, LinearARD recovers 93.1%/94.2%/94.3% of native short-context performance and achieves strong long-context robustness on RULER using only 4.25M tokens---amounting to just 1.6% (a $\sim$60$\times$ reduction) of the 256M-token budget required by state-of-the-art baselines. Under this severely constrained budget, CPT and LongReD remain near zero on RULER, demonstrating that relation-level restoration provides a substantially better efficiency-quality tradeoff. Our code is available at this https URL.
Subjects: Computation and Language (cs.CL); Artificial Intelligence (cs.AI)
Cite as: arXiv:2604.00004 [cs.CL]
  (or arXiv:2604.00004v3 [cs.CL] for this version)
  https://doi.org/10.48550/arXiv.2604.00004

arXiv-issued DOI via DataCite

Submission history

From: Hengyu Zhong [view email]
[v1] Mon, 9 Mar 2026 10:51:01 UTC (4,047 KB)
[v2] Thu, 23 Jul 2026 07:35:13 UTC (3,544 KB)
[v3] Mon, 26 Oct 2026 06:15:39 UTC (3,553 KB)

来源:arXiv cs.CL · arxiv.org