arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2504.05759cs.CL
收藏

RETROcode:利用代码数据库改进自然语言到代码生成

RETROcode: Leveraging a Code Database for Improved Natural Language to Code Generation

Université de Paris(巴黎大学);CNRS(法国国家科学研究中心)

Nathanaël Beau, Benoît Crabbé

AI总结:

本文提出 RETROcode,将 RETRO 架构适配到序列到序列代码生成中,通过检索大型代码数据库作为辅助记忆,在较小模型和数据集规模下取得接近 Codex 的效果。

摘要:

随着文本和代码资源的不断扩展,大规模预训练模型在代码生成任务中展现出有前景的能力,通常采用问题陈述-程序对的监督微调方式。然而,为了提升性能而增加模型规模和数据量,也带来了更高的计算需求和过拟合风险。针对这些挑战,我们提出了 RETROcode,这是对 RETRO 架构的一种新颖适配,用于序列到序列模型,利用大型代码数据库作为辅助扩展方法。该方法不同于简单地扩大模型和数据集规模,使 RETROcode 能够利用庞大的代码数据库进行预测,通过整合广泛记忆来提升模型效率。我们的研究结果表明,RETROcode 不仅在测试集上优于同等规模的传统架构,而且尽管是在一个小得多的数据集上从零开始训练,其效果也接近规模大得多的 Codex 模型。

英文摘要:

As text and code resources have expanded, large-scale pre-trained models have shown promising capabilities in code generation tasks, typically employing supervised fine-tuning with problem statement-program pairs. However, increasing model size and data volume for performance gains also raises computational demands and risks of overfitting. Addressing these challenges, we present RETROcode, a novel adaptation of the RETRO architecture \cite{RETRO} for sequence-to-sequence models, utilizing a large code database as an auxiliary scaling method. This approach, diverging from simply enlarging model and dataset sizes, allows RETROcode to leverage a vast code database for prediction, enhancing the model's efficiency by integrating extensive memory. Our findings indicate that RETROcode not only outperforms similar-sized traditional architectures on test sets but also approaches the effectiveness of the much larger Codex model, despite being trained from scratch on a substantially smaller dataset.

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

↑