一句话:提出 OCD 上下文蒸馏与轻量压缩模型,推理时把代码上下文压缩约 6×,提升 LLM 修 issue 的成功率。
基于 LLM 的 GitHub issue 解决常因上下文过度近似而输入庞大且噪声充斥,造成成本高、效果差:通用压缩器破坏代码语义,代码专用工具又不感知代码结构与任务。本文提出两阶段框架:先用 Oracle 引导的上下文蒸馏(OCD),结合遗传搜索与 delta debugging 把代码上下文约简为成功修复所需的最小充分子序列;再用该数据微调轻量模型,使其在推理时压缩上下文、滤除噪声并保留修复要素。在 SWE-bench Verified 上对三个前沿 LLM 评估:压缩率稳定约 6×,token 预算较未压缩降低 51.8%–71.3%,issue 解决率提升 5.0%–9.2%,在效果、压缩率与延迟间取得优于现有基线的综合权衡。
Large Language Models (LLMs) are now capable of resolving real-world GitHub issues. However, current approaches overapproximate the code context and suffer from two compounding problems: the prohibitive cost of processing massive inputs, and low effectiveness as noise floods the context window and distracts the model from the bug-fixing signal. Existing compression techniques fail to resolve this tension: generic compressors compromise the semantic integrity of code, while code-specific tools lack awareness of code structure and task context to preserve essential patch ingredients. To address this, we propose a novel framework consisting of two components. First, Oracle-guided Context Distillation (OCD), a context distillation algorithm that combines genetic search and delta debugging to systematically reduce code contexts to their minimal sufficient subsequence — retaining only the ingredients required for a successful fix. We use this distilled data to fine-tune , a lightweight model that learns to compress code context at inference time, filtering noise and combating distraction while preserving fix ingredients. Evaluated on SWE-bench Verified across three frontier LLMs, maintains a stable compression rate of about 6× across models, reduces the total token budget by 51.8%–71.3% relative to the uncompressed setting, improves issue resolution rates by 5.0%–9.2%, and delivers the best overall balance among effectiveness, compression ratio, and latency compared with state-of-the-art context compression baselines.