arXiv:2601.19929cs.CLcs.AI2026-01

用分层树结构压缩代码上下文,18倍缩减量仍保高准确率。

Stingy Context: 18:1 Hierarchical Code Compression for LLM Auto-Coding

  • 构建树状分块压缩机制,逐层提炼代码关键信息
  • 23.9万词元代码压缩至1.1万,任务成功率94%~97%
  • 适合长代码生成、模型推理优化的开发者使用

我们提出Stingy Context,一种基于分层树结构的压缩方案,在自动编码任务中实现18:1的上下文压缩比。通过TREEFRAG分解策略,将一个实际的23.9万词元源码库压缩至1.1万词元,同时保持任务准确性。在12个前沿模型上的实验证明,该方法在40个真实问题上成功率可达94%至97%,成本极低,优于平面压缩方法,并有效缓解‘中间迷失’问题。

原文摘要 · Abstract (English)

We introduce Stingy Context, a hierarchical tree-based compression scheme achieving 18:1 reduction in LLM context for auto-coding tasks. Using our TREEFRAG exploit decomposition, we reduce a real source code base of 239k tokens to 11k tokens while preserving task fidelity. Empirical results across 12 Frontier models show 94 to 97% success on 40 real-world issues at low cost, outperforming flat methods and mitigating lost-in-the-middle effects.

代码生成上下文压缩大模型优化

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