Papers

UVA 方法让代码智能体求助云端模型时不泄露私有代码

Teaching Code Agents to Ask Without Leaking Private Code

Why we picked it

本地编码 agent 想请教云端强模型,又怕把私有代码发出去,这篇 arXiv 论文给的 UVA 训练法把泄露降了 3.7 倍,修复率还从 25.3% 提到 37.6%。

arXiv 论文提出 utility-verified abstraction(UVA)训练方法,教本地编码智能体在向云端强模型咨询时,用角色和类型描述私有实体,而不是直接暴露代码。训练数据来自已解决的修复轨迹,重写后的问题只有同时满足"更少泄露"和"可复现修复"两个条件才保留。在仓库级 issue 修复基准上,训练后的智能体解决 37.6% 的 issue,对比同一模型单独工作的 25.3%。与未训练智能体相比,其提问泄露的私有实体减少 3.7 倍,逐字代码泄露减少 1.4 倍。

Original · arXiv cs.AI

Teaching Code Agents to Ask Without Leaking Private Code

Local coding agents can extend their reach by consulting a stronger cloud model. Such consultations, however, often expose the repository's private identifiers, file paths, and source code. Host-side masking hides recognized identifiers but leaves the surrounding code and the agent's phrasing unchanged, while training for less disclosure risks suppressing consultation or producing questions too vague to answer. We propose utility-verified abstraction (UVA), which teaches the agent to describe private entities by their role and type while retaining the technical details an expert needs. From solved repair trajectories, we rewrite each question into this form and keep the rewrite only if it discloses fewer private entities and the repair, replayed from the same execution state with the repair trajectories. Across two benchmarks, the trained agent consults more often than before training. On repository-level issue repair, it solves 37.6% of issues, against 25.3% for the same model working alone, a gain from the training as a whole rather than from consultation alone. Its questions disclose 3.7-fold fewer private entities and 1.4-fold less verbatim code than the untrained agent's questions to the same expert.