基于密度的软上下文压缩与半动态压缩比
Density-aware Soft Context Compression with Semi-Dynamic Compression Ratio
AI总结:
本文提出半动态上下文压缩框架,通过离散比率选择器根据信息密度预测压缩比,提升长上下文处理效率,优于静态基线。
摘要:
基于密度的软上下文压缩通过将长上下文编码为更少的潜在令牌来减少LLM处理长上下文的计算负担。然而,现有框架采用统一的压缩比,未能考虑自然语言信息密度的极端变化。虽然采用密度感知的动态压缩比似乎直观,但实证研究揭示模型在参数由输入依赖的连续结构超参数参数化的情况下存在固有困难。为解决这一缺陷,我们引入了半动态上下文压缩框架。我们的方法特征一个离散比率选择器,根据内在信息密度预测压缩目标,并将其量化为预定义的离散压缩比集合。它高效地与压缩器在合成数据上联合训练,以摘要长度作为代理来创建压缩比预测的标签。广泛评估证实,我们的密度感知框架,采用均值池化作为基础,始终优于静态基线,为上下文压缩技术建立了稳健的帕累托前沿。我们的代码、数据和模型权重可在https://github.com/yuyijiong/semi-dynamic-context-compress获取
英文摘要:
Soft context compression reduces the computational workload of processing long contexts in LLMs by encoding long context into a smaller number of latent tokens. However, existing frameworks apply uniform compression ratios, failing to account for the extreme variance in natural language information density. While adopting a density-aware dynamic compression ratio seems intuitive, empirical investigations reveal that models struggle intrinsically with operations parameterized by input dependent, continuous structural hyperparameters. To resolve this pitfall, we introduce Semi-Dynamic Context Compression framework. Our approach features a Discrete Ratio Selector, which predicts a compression target based on intrinsic information density and quantizes it to a predefined set of discrete compression ratios. It is efficiently jointly trained with the compressor on synthetic data, with the summary lengths as a proxy to create labels for compression ratio prediction. Extensive evaluations confirm that our density-aware framework, utilizing mean pooling as the backbone, consistently outperforms static baselines, establishing a robust Pareto frontier for context compression techniques. Our code, data and model weights are available at https://github.com/yuyijiong/semi-dynamic-context-compress
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。