arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2604.03632cs.SEcs.AI
收藏

持久的跨尝试状态优化用于仓库级代码生成

Persistent Cross-Attempt State Optimization for Repository-Level Code Generation

Ruwei Pan, Jiangshuai Wang, Qisheng Zhang, Yueheng Zhu, Linhao Wu, Zixiong Yang, Yakun Zhang, Lu Zhang, Hongyu Zhang

AI总结:

本文提出LiveCoder框架,通过跨尝试知识优化提升仓库级代码生成效率,通过保留任务特定状态提升生成效果,实验表明在RAL-Bench上功能得分提升22.94个百分点,仓库复用率提升至81.58%。

摘要:

大型语言模型(LLMs)在仓库级代码生成中取得了显著进展。然而,解决相同任务往往需要多次尝试,而现有方法仍孤立优化每次尝试,未能在尝试间保留或重用任务特定状态。本文提出LiveCoder,一种基于跨尝试知识优化的仓库级代码生成新框架。LiveCoder通过维护先前尝试的任务特定状态来引导后续生成。这些状态包括成功知识(捕捉来自先前强仓库的可重用信号)、失败知识(记录失败结果及其诊断信号)以及历史最佳仓库(保存迄今最强的结果以防止退化)。这些组件共同将重复的仓库生成转化为持续的知识驱动优化过程。我们使用四个前沿LLMs在两个代表性仓库级代码生成基准上评估LiveCoder。广泛实验结果证明了LiveCoder的有效性和效率,在RAL-Bench上功能得分提升最高22.94个百分点,仓库复用率提升至81.58%,成本降低最高53.63%,同时保持非功能质量总体稳定。

英文摘要:

Large language models (LLMs) have achieved substantial progress in repository-level code generation. However, solving the same repository-level task often requires multiple attempts, while existing methods still optimize each attempt in isolation and do not preserve or reuse task-specific state across attempts. In this paper, we propose LiveCoder, a novel framework for repository-level code generation based on cross-attempt knowledge optimization. LiveCoder maintains persistent task-specific state from prior attempts to guide subsequent generation. This state includes success knowledge, which captures reusable signals from previously strong repositories, failure knowledge, which records unsuccessful outcomes and their diagnostic signals, and a historical-best repository, which preserves the strongest result found so far and prevents regression. These components collectively transform repeated repository generation into a persistent, knowledge-driven optimization process. We evaluate LiveCoder using four frontier LLMs on two representative repository-level code generation benchmarks. Extensive experimental results demonstrate the effectiveness and efficiency of LiveCoder, improving the functional score by up to 22.94 percentage points, increasing repository reuse to 81.58%, and reducing cost by up to 53.63% on RAL-Bench while maintaining broadly stable non-functional quality.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑