arXiv:2602.13980cs.AIcs.LG2026-02

用分块注意力加速软提示压缩,提升长文本处理效率

Cognitive Chunking for Soft Prompts: Accelerating Compressor Learning via Block-wise Causal Masking

  • 通过分块因果掩码限制记忆令牌的感知范围,降低压缩器训练难度
  • 在64倍压缩下,问答任务F1提升29.8%,准确率提升40.7%
  • 训练时间减少约40%,特别适合高压缩比场景

通过提示提供大量上下文对发挥大语言模型能力至关重要,但长上下文会显著增加推理延迟,因自注意力计算成本随序列长度呈平方增长。为缓解此问题,上下文压缩——尤其是软提示压缩——成为广泛研究的解决方案,即通过训练压缩器将长上下文转换为较短的记忆嵌入。现有方法通常无差别地将整个上下文压缩为一组记忆标记,要求压缩器捕捉全局依赖关系,需大量预训练数据学习有效模式。受人类工作记忆分块机制及记忆嵌入空间特异性观察启发,本文提出并行迭代压缩(PIC)。仅通过修改Transformer注意力掩码,使记忆标记的感知范围显式限制在连续局部块内,从而降低压缩器训练难度。多下游任务实验表明,PIC持续优于对比基线,尤其在高压缩场景中表现突出:在64×压缩比下,问答任务F1得分相对提升29.8%,准确率(EM)提升40.7%。此外,PIC显著加快训练进程,训练16×压缩器时,其性能超越基线峰值,同时训练时间减少约40%。

原文摘要 · Abstract (English)

Providing extensive context via prompting is vital for leveraging the capabilities of Large Language Models (LLMs). However, lengthy contexts significantly increase inference latency, as the computational cost of self-attention grows quadratically with sequence length. To mitigate this issue, context compression-particularly soft prompt compressio-has emerged as a widely studied solution, which converts long contexts into shorter memory embeddings via a trained compressor. Existing methods typically compress the entire context indiscriminately into a set of memory tokens, requiring the compressor to capture global dependencies and necessitating extensive pre-training data to learn effective patterns. Inspired by the chunking mechanism in human working memory and empirical observations of the spatial specialization of memory embeddings relative to original tokens, we propose Parallelized Iterative Compression (PIC). By simply modifying the Transformer's attention mask, PIC explicitly restricts the receptive field of memory tokens to sequential local chunks, thereby lowering the difficulty of compressor training. Experiments across multiple downstream tasks demonstrate that PIC consistently outperforms competitive baselines, with superiority being particularly pronounced in high compression scenarios (e.g., achieving relative improvements of 29.8\% in F1 score and 40.7\% in EM score on QA tasks at the $64\times$ compression ratio). Furthermore, PIC significantly expedites the training process. Specifically, when training the 16$\times$ compressor, it surpasses the peak performance of the competitive baseline while effectively reducing the training time by approximately 40\%.

大模型压缩软提示注意力机制高效训练

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。