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

LongAttnComp:跨族上下文压缩用于长上下文推理

LongAttnComp: Cross-Family Context Compression for Long-Context Reasoning

SambaNova Systems, Inc.(SambaNova系统公司)

Mengmeng Ji, Ravi Shanker Raju, Jonathan Lingjie Li, Chen Wu

AI总结:

提出LongAttnComp方法,通过微调轻量级交叉注意力评分层并引入令牌级分块、令牌预算top-p算法、位置重排序和格式无关查询解析器,结合两阶段微调策略,在长上下文推理任务中实现与全上下文相当或更优的准确率。

摘要:

随着实际应用越来越需要处理10万+令牌的输入,上下文长度与推理效率之间的差距已成为关键瓶颈。上下文压缩提供了一种在保持任务准确性的同时降低预填充成本的方法。然而,现有的无训练注意力方法在代码推理等要求高的长上下文任务中留下了显著差距。我们提出了LongAttnComp,这是AttnComp的长上下文适配,它微调了一个轻量级的交叉注意力评分层,并引入了令牌级分块、令牌预算top-p算法、位置重排序和格式无关的查询解析器。我们进一步为压缩器设计了两阶段微调方案:阶段1从NIAH风格数据构建通用检索基础,阶段2通过多跳和推理数据扩展,以覆盖更广泛的长上下文任务。在InfiniteBench Code-Debug上,LongAttnComp匹配或超过全上下文准确率,显著优于无训练基线,并在来自三个族的四个目标模型上迁移。在LongBench v2上,两阶段方案在很大程度上缩小了阶段1在多文档推理上的差距,同时保持了Code-Debug的性能。

英文摘要:

As real-world applications increasingly require processing inputs of 100k+ tokens, the gap between context length and inference efficiency has become a critical bottleneck. Context compression offers a way to reduce prefill costs while preserving task accuracy. However, existing training-free attention-based methods leave substantial gaps in demanding long-context tasks such as code reasoning. We present LongAttnComp, a long-context adaptation of AttnComp that fine-tunes a lightweight cross-attention scoring layer and introduces tokenlevel chunking, a token-budget top-p algorithm, positional reordering, and a formatagnostic query parser. We further design a two-stage fine-tuning recipe for the compressor: Stage 1 builds a general retrieval foundation from NIAH-style data, and Stage 2 extends it with multi-hop and reasoning data for broader long-context task coverage. On InfiniteBench Code-Debug, LongAttnComp matches or exceeds full-context accuracy, substantially outperforms training-free baselines, and transfers across four target models from three families. On LongBench v2, the two-stage recipe largely closes the Stage 1 gap on multi-document reasoning while preserving Code-Debug performance.

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

↑