LatentPress:超越文本与视觉的上下文压缩
研究论文 · 2026/09/04
LatentPress 提出了一种新的上下文压缩方法,将对话历史和长文档压缩为连续的记忆令牌,冻结的解码器可直接通过输入嵌入接口读取,无需在推理时重建文本。该方法仅训练一个小型适配器(4.2M-26.2M参数,约为解码器的0.1%),实现4-16倍压缩。在LongMemEval上,LatentPress在7.70倍压缩下达到0.504的准确率,优于未压缩证据(0.490)、文本摘要(0.184)和OCR压缩(0.426-0.312)。在LongBench-QA上,域内写入器在4-8倍压缩下达到或超过原始上下文阅读性能,16倍压缩略逊。写入速度每对话43毫秒,比文本摘要或OCR重建快约一个数量级,读取速度比原始上下文或缓存OCR快5-9倍。实验验证了两种迁移设置下的接口有效性,表明直接软令牌可作为超越文本和视觉的实用机器面向上下文接口。代码已开源。
该文章提出了一种新颖的上下文压缩方法,直接生成软令牌供语言模型读取,避免了文本或图像重建的开销,在多个基准上展示了显著的优势,并验证了跨任务迁移的可行性,对于提高长上下文处理的效率和实用性具有重要意义。
Compressed context is usually carried as human-readable text or as rendered images that must be decoded, even when its consumer is a language model. We introduce LatentPress, which writes conversational histories and long documents into a third representation: continuous memory tokens that a frozen decoder reads directly through its input-embedding interface, with no text reconstruction at inference. A small reader-matched writer compresses 4-16times while training only an adapter (4.2M-26.2M parameters, sim!0.1% of the decoder). On LongMemEval, LatentPress reaches 0.504 accuracy at 7.70times compression versus 0.490 for uncompressed evidence, outperforming text summaries (0.184) and OCR-based compression (0.426 to 0.312). On LongBench-QA, in-domain writers match or exceed raw-context reading at 4-8times compression, while 16times trails raw. Writing takes 43ms per conversation, roughly an order of magnitude faster than text summarization or OCR reconstruction, and reading is 5-9times faster than raw context or cached OCR. We validate the interface under two transfer settings, zero-shot from UltraChat to LongMemEval memory QA and from LongMemEval-derived QA to unseen LongBench document domains, establishing direct soft tokens as a practical machine-facing context interface beyond text and vision. The implementation of the experiments could be found at: https://github.com/xuyd16ai/context_softtoken_compress .