arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2501.07892cs.SEcs.AI
收藏

利用元记忆智能体增强大语言模型的无数据代码生成

Leveraging Metamemory Agent for Enhanced Data-Free Code Generation in Large Language Models

College of Computing and Data Science, Nanyang Technological University, Singapore(南洋理工大学计算机与数据科学学院,新加坡);School of Computer Science, National Engineering Research Center for Multimedia Software, Wuhan University, Wuhan, China(多媒体软件国家工程研究中心计算机学院,武汉大学,中国);The University of Sydney, Sydney, Australia(悉尼大学,澳大利亚);Yunnan United Vision Technology Company Ltd., China(云南联合视界技术有限公司,中国);School of Computer Science, Wuhan University, Wuhan, China(武汉大学计算机学院,中国);School of Information Science and Engineering, Yunnan University, Kunming, China(云南大学信息科学与工程学院,中国)

Shengsheng Zhou, Shuai Wang, Liang Ding, Yibing Zhan, Yong Luo, Zheng He, Fu Lin, Dapeng Tao

AI总结:

提出元记忆智能体,通过引导模型回忆、评估和选择性利用相关知识,无需外部示例即可提升无数据场景下的单次代码生成质量。

摘要:

大型语言模型(LLMs)在自动化代码生成方面表现出色,少样本提示因其简单有效而被广泛使用。然而,少样本方法依赖于精心策划或手动构建的参考示例,限制了其在无数据编码场景(如真实世界的无数据编码场景和没有训练集的基准测试)中的适用性。现有的通过背诵或类比生成参考示例的方法无法保证其真实性和准确性。受人类元记忆的启发,我们提出了一种新颖的元记忆智能体,以增强无数据编码场景中的一次性代码生成。该智能体引导LLMs回忆相关的先验知识,评估回忆信息的置信度,并选择性地利用可靠内容来解决问题。该智能体消除了对外部参考示例的需求,提高了回忆知识的真实性和准确性,并自适应地为每个任务定制回忆和评估过程。大量实验表明,所提出的元记忆智能体在无数据编码场景中显著提高了一次性代码生成的质量。AI贡献在于元记忆智能体,它通过置信度评估和选择使自我回忆的示例变得可靠;工程应用是无数据自动化代码生成,已在八个公共基准测试上得到验证。

英文摘要:

Large language models (LLMs) have shown strong performance in automated code generation, with few-shot prompting widely used for its simplicity and effectiveness. However, few-shot methods depend on curated or manually crafted reference examples, limiting their applicability in data-free coding scenarios such as real-world data-free coding scenarios and benchmarks without training sets. Existing methods that generate reference examples via recitation or analogy cannot guarantee their authenticity or accuracy. Inspired by human metamemory, we propose a novel metamemory agent to enhance one-time code generation in data-free coding scenarios. The agent guides LLMs to recall relevant prior knowledge, evaluate confidence in recalled information, and selectively exploit reliable content for problem solving. This agent removes the need for external reference examples, improves the authenticity and accuracy of recalled knowledge, and adaptively tailors the recall\&evaluation process to each task. Extensive experiments demonstrate that the proposed metamemory agent significantly improves one-time code generation quality across data-free coding scenarios. The AI contribution is the metamemory agent, which makes self-recalled examples reliable through confidence evaluation and selection; the engineering application is data-free automated code generation, validated on eight public benchmarks.

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

↑