arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2602.18196cs.LG
收藏

RAT+:密集训练,稀疏推理——用于扩张推理的循环增强注意力

RAT+: Train Dense, Infer Sparse -- Recurrence Augmented Attention for Dilated Inference

CLAIRE lab at EPFL, Lausanne, Switzerland(EPFL 拉沃斯实验室)

Xiuying Wei, Caglar Gulcehre

AI总结:

提出RAT+架构,通过密集预训练和循环增强注意力,使模型在推理时可灵活切换为稀疏扩张注意力,大幅降低计算和缓存开销,同时保持高精度。

摘要:

结构化扩张注意力具有吸引人的推理效率调节旋钮:它将注意力的FLOPs和KV缓存大小减少扩张大小D的倍数,同时保持长程连接。虽然先前的工作通过从头训练每个配置来研究它,但直接将预训练注意力模型稀疏化为扩张模式会导致严重的精度下降,阻碍跨推理场景的灵活重用。我们引入RAT+,一种密集预训练架构,通过全序列循环和主动循环学习增强注意力。单个RAT+模型密集预训练一次,然后可以在推理时灵活切换到扩张注意力(可选局部窗口)或混合层/头组合,仅需短期的10亿token分辨率适应,而无需重新训练单独的稀疏模型。在100B token上训练的1.5B参数模型中,RAT+在D=16时紧密匹配密集精度,在D=64时在常识推理和LongBench任务上下降约2-3个点。我们进一步扩展到2.6B和7.6B参数,观察到更有希望的性能(例如,在注意力FLOPs和KV缓存大小减少64倍的情况下,平均精度损失1个点)。代码可在https://github.com/wimh966/rat-plus获取。

英文摘要:

Structured dilated attention has an appealing inference-time efficiency knob: it reduces the FLOPs of attention and the KV cache size by a factor of the dilation size D, while preserving long-range connectivity. While prior work studies it by training each configuration from scratch, directly sparsifying a pretrained attention model into a dilated pattern leads to severe accuracy degradation, preventing flexible reuse across inference scenarios. We introduce RAT+, a dense-pretraining architecture that augments attention with full-sequence recurrence and active recurrence learning. A single RAT+ model is pretrained densely once and can then be flexibly switched at inference time to dilated attention (optionally with local windows) or hybrid layer/head compositions, requiring only a short 1B-token resolution adaptation rather than retraining separate sparse models. At 1.5B parameters trained on 100B tokens, RAT+ closely matches dense accuracy at D = 16, and drops by about 2-3 points at D = 64 on commonsense reasoning and LongBench tasks. We further scale to 2.6B and 7.6B parameters and observe even more promising performance (e.g., a 1-point average accuracy loss with a 64x reduction in attention FLOPs and KV cache size). Code is available at https://github.com/wimh966/rat-plus.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑