2025-02-28 · 专家 · 机器学习 · 数据科学

CODESYNC: Synchronizing Large Language Models with Dynamic Code Evolution at Scale

本文提出CODESYNC,一个用于收集实时代码知识更新的数据引擎,并开发CODESYNCBENCH,一个评估大型语言模型适应代码进化的基准,以解决大型语言模型在适应不断变化的代码知识方面的挑战。

更新于 2025-02-28。作者:Chenlong Wang、Zhaoyang Chu、Zhengxiang Cheng、Xuyi Yang、Kaiyue Qiu、Yao Wan、Zhou Zhao、Xuanhua Shi、Dongping Chen。

中文摘要

大型语言模型(LLMs)在软件工程领域表现出色,但在适应不断发展的代码知识方面面临挑战,尤其是关于第三方库API的频繁更新。这种限制源于静态预训练数据集,通常会导致无法执行的代码或安全性、效率不佳的实现。为此,本文介绍了一种名为CODESYNC的数据引擎,用于识别过时的代码模式并从Python第三方库收集实时代码知识更新。在CODESYNC的基础上,我们开发了CODESYNCBENCH,这是一个全面基准,用于评估LLMs保持与代码进化同步的能力,涵盖了六个Python库中220个API的现实世界更新。我们的基准提供了涵盖三个评估任务和包含2,200个训练样本的更新感知指令调整数据集的3,300个测试案例。在14个最先进的LLMs上的大量实验表明,即使在高级知识更新方法(例如DPO、ORPO和SimPO)的支持下,它们在动态代码进化方面仍然存在困难。我们相信,我们的基准可以为未来开发更有效的实时代码知识更新方法提供坚实的基础。实验代码和数据集可在以下网址公开获取:https://github.com/Lucky-voyage/Code-Sync。

英文摘要

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.

解读

一句话总结

本文提出CODESYNC,一个用于收集实时代码知识更新的数据引擎,并开发CODESYNCBENCH,一个评估大型语言模型适应代码进化的基准,以解决大型语言模型在适应不断变化的代码知识方面的挑战。

问题1:这篇论文想要解决什么具体问题?

问题2:论文的核心创新点是什么?

问题3:实验结果如何验证了方法的有效性?

问题4:这个研究的实际应用价值是什么?

来源