The potential for pre-trained large language models (LLMs) to use natural language feedback at inference time has been an exciting recent development. We build upon this observation by formalizing an algorithm for learning from natural language feedback at training time instead, which we call Imitation learning from Language Feedback (ILF). ILF requires only a small amount of human-written feedback during training and does not require the same feedback at test time, making it both user-friendly and sample-efficient. We further show that ILF can be seen as a form of minimizing the KL divergence to the ground truth distribution and demonstrate a proof-of-concept on a neural program synthesis task. We use ILF to improve a Codegen-Mono 6.1B model's pass@1 rate by 38% relative (and 10% absolute) on the Mostly Basic Python Problems (MBPP) benchmark, outperforming both fine-tuning on MBPP and fine-tuning on repaired programs written by humans. Overall, our results suggest that learning from human-written natural language feedback is both more effective and sample-efficient than training exclusively on demonstrations for improving an LLM's performance on code generation tasks.
翻译:最近,预训练大语言模型(LLMs)在推理时使用自然语言反馈的潜力是一个令人兴奋的发展。我们在这个观察的基础上,通过正式算法来在训练时从自然语言反馈中学习,我们称之为来自语言反馈的模仿学习(ILF)。ILF在训练过程中只需要少量的人工编写反馈,而不需要在测试时提供相同的反馈,这使其既易于使用又样本有效。我们进一步展示了ILF可以被看作是最小化基础真理分布的KL散度的形式,并在神经程序综合任务上展示了概念证明。我们使用ILF将Codegen-Mono 6.1B模型的一级通过率在Mostly Basic Python Problems(MBPP)基准测试上相对提高了38%(绝对提高了10%),超过了在MBPP上微调和在人类编写的已修复程序上微调的效果。总的来说,我们的结果表明,与仅依靠演示来提高LLM在代码生成任务上性能相比,从人类编写的自然语言反馈中学习既更有效又样本有效。