构建动态代码同步系统,评估大模型应对库更新的能力
CODESYNC: Synchronizing Large Language Models with Dynamic Code Evolution at Scale
- 设计数据引擎实时捕捉第三方库的代码变更模式
- 建立覆盖220个API的3300个测试用例基准测试集
- 揭示主流大模型在代码演进面前普遍存在滞后问题
大型语言模型在软件工程中表现卓越,但难以适应持续演进的代码知识,尤其在第三方库API频繁更新时。这一局限源于静态预训练数据集,常导致生成代码不可执行或存在安全与效率缺陷。为此,本文提出CODESYNC,一个用于识别过时代码模式并从Python第三方库中收集实时代码知识更新的数据引擎。基于CODESYNC,我们构建了CODESYNCBENCH,一个全面评估大模型代码演化同步能力的基准测试,涵盖六个Python库的220个API的真实更新。该基准包含3300个测试用例及三个评估任务,并提供由2200个样本组成的更新感知指令微调数据集。对14个先进大模型的实验表明,即便使用DPO、ORPO和SimPO等先进知识更新方法,它们仍难以应对动态代码演进。我们相信该基准将为未来实时代码知识更新方法的发展提供坚实基础。实验代码与数据集已开源:https://github.com/Lucky-voyage/Code-Sync。
原文摘要 · Abstract (English)
Large Language Models (LLMs) have exhibited exceptional performance in software engineering yet face challenges in adapting to continually evolving code knowledge, particularly regarding the frequent updates of third-party library APIs. This limitation, stemming from static pre-training datasets, often results in non-executable code or implementations with suboptimal safety and efficiency. To this end, this paper introduces CODESYNC, a data engine for identifying outdated code patterns and collecting real-time code knowledge updates from Python third-party libraries. Building upon CODESYNC, we develop CODESYNCBENCH, a comprehensive benchmark for assessing LLMs' ability to stay synchronized with code evolution, which covers real-world updates for 220 APIs from six Python libraries. Our benchmark offers 3,300 test cases across three evaluation tasks and an update-aware instruction tuning dataset consisting of 2,200 training samples. Extensive experiments on 14 state-of-the-art LLMs reveal that they struggle with dynamic code evolution, even with the support of advanced knowledge updating methods (e.g., DPO, ORPO, and SimPO). We believe that our benchmark can offer a strong foundation for the development of more effective methods for real-time code knowledge updating in the future. The experimental code and dataset are publicly available at: https://github.com/Lucky-voyage/Code-Sync.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。