通过智能筛选关键输入片段,提升长文本处理的效率与性能。
APCE: Adaptive Progressive Context Expansion for Long Context Processing
- 基于语义相似度动态选择重要输入块,减少冗余计算。
- 仅用50%-70%输入序列即达到与全量处理相当的摘要效果。
- 无需依赖特定硬件,适配多种部署环境,适合长文本任务研究者。
部署实用的长上下文变换器模型(LCTMs)面临两大挑战:(1)自注意力机制导致内存占用随序列长度呈二次增长,键值缓存(KV-cache)线性增加;(2)上下文旋转现象(ContextRot)表明,随着上下文长度增加,模型性能下降。鉴于二者均依赖输入,我们提出能否通过精准选择关键输入块来协同解决内存开销与性能退化问题。本文以长文本摘要任务为例,提出自适应渐进式上下文扩展(APCE),通过低维语义相似度匹配当前查询,从输入中筛选最相关部分。该方法直接作用于输入,不依赖特定硬件或CUDA环境,具备良好可扩展性。实验表明,使用50%-70%输入序列时,APCE在摘要质量上优于或等同于全量密集基线,同时显著降低KV-cache和自注意力内存消耗。结果为长上下文模型的上下文感知高效解决方案提供了新思路。
原文摘要 · Abstract (English)
Deploying useful Long-Context Transformer Models (LCTMs) requires addressing two key challenges: (1) A growing memory footprint due to quadratic self-attention and linear KV-cache scaling in memory as sequence length increases; (2) the ContextRot phenomena where empirical evidence suggests that transformer architecture's performance degrades with increasing context length. Given the shared dependency on the input, a natural question arises: Can we surgically select the most important input chunks for processing to synergistically (a) reduce the memory footprint, and (b) mitigate the ContextRot effects? In this paper, we answer this question in the affirmative for long-context summarization tasks. We propose APCE as a context-aware solution to select the most important input chunks through low-dimensional semantic similarity matching with the current query. By directly operating on the input, APCE decouples from strict dependency on underlying hardware or CUDA environments, promising a compatible solution scalable to different deployment systems. Our empirical evaluations have demonstrated superior or on-par summarization performance for APCE compared to the full dense baseline using a fraction (50%-70%) of the input sequence resulting in KV-cache and self-attention memory efficiency improvements. We hope our findings inspire further research on context-aware efficiency solutions for LCTMs geared towards other relevant long-context tasks.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。