用自举法训练模型学会修代码,提升生成质量且更省数据。
Dr. Boot: Bootstrapping Program Synthesis Language Models to Perform Repairing
- 通过自举算法让模型学会修复代码错误,模拟人类迭代开发过程。
- 小模型经自举后表现媲美大68%的普通微调模型,数据效率更高。
- 适合研究程序合成、降低模型训练成本或关注代码修复的开发者。
程序合成语言模型通常在编程竞赛数据集(如MBPP、APPS)上训练和评估,但这些数据集规模小、质量有限,而语言模型又极度依赖数据。此外,模型的代码生成方式与人类不符:人类借助编译器逐步调试,而现有模型多一次性生成。为此,本文提出一种支持代码修复的自举算法。实验证明,自举法持续优于常规微调。相比其他工作,本方法训练出的模型性能可媲美大68%的微调模型。值得注意的是,含修复能力的自举在推理时还提升了非修复任务表现,但直接采样更多解仍优于推理阶段修复。此外,我们发现APPS数据集训练部分存在示例测试用例问题,对修复与强化学习方法有重要影响,建议社区关注。
原文摘要 · Abstract (English)
Language models for program synthesis are usually trained and evaluated on programming competition datasets (MBPP, APPS). However, these datasets are limited in size and quality, while these language models are extremely data hungry. Additionally, the language models have a misaligned program synthesis process compared to humans. While humans iteratively develop code with the help of a compiler, most program synthesis models currently produce code in one go. To solve these issues, we introduce a bootstrapping algorithm for program synthesis, that supports teaching models how to repair. We show that bootstrapping consistently outperforms regular fine-tuning. Compared to other work, our bootstrapped model performs on par with fine-tuned models that are 68\% larger. Notably, bootstrapping with repairing also improves non-repairing performance compared to regular bootstrapping during inference. However, on our models, repairing during inference is likely inferior to simply sampling the same number of solutions. Furthermore, we find that there are issues with the example test cases in the training portion of the APPS dataset that are valuable to the community, as many repairing and reinforcement learning methods rely on them.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。