arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2402.08073cs.LGcs.PLcs.SE
收藏

基于输入-输出规范的数据科学代码生成

Grounding Data Science Code Generation with Input-Output Specifications

University of Texas at Austin(得克萨斯大学奥斯汀分校);Google Inc.(谷歌公司)

Yeming Wen, Pengcheng Yin, Kensen Shi, Henryk Michalewski, Swarat Chaudhuri, Alex Polozov

AI总结:

针对自然语言模糊导致代码生成与输入-输出规范不一致的问题,提出GIFT4Code方法,利用执行反馈进行指令微调,在Arcade和DS-1000基准上显著提升代码生成质量。

摘要:

大型语言模型(LLMs)近期展现出从自然语言(NL)提示生成代码的卓越能力。然而,在现实世界中,自然语言往往过于模糊,难以捕捉编程问题背后的真实意图,因此需要额外的输入-输出(I/O)规范。不幸的是,LLMs 可能难以使其输出同时与自然语言提示和 I/O 规范保持一致。在本文中,我们针对数据科学编程这一场景提出了一种缓解该问题的方法,在该场景中,任务需要明确的 I/O 规范以确保清晰性。具体而言,我们提出了 GIFT4Code,一种针对 I/O 规范进行 LLM 指令微调的新方法。我们的方法利用 LLM 自身生成的合成数据,并将基于执行结果的反馈作为关键学习信号。这种反馈以程序 I/O 规范的形式提供给 LLM,以促进指令微调。我们在两个具有挑战性的数据科学基准测试 Arcade 和 DS-1000 上评估了我们的方法。结果表明,LLM 生成不仅可执行而且与用户规范准确对齐的代码的能力显著提升,大幅提高了复杂数据科学任务中代码生成的质量。

英文摘要:

Large language models (LLMs) have recently demonstrated a remarkable ability to generate code from natural language (NL) prompts. However, in the real world, NL is often too ambiguous to capture the true intent behind programming problems, requiring additional input-output (I/O) specifications. Unfortunately, LLMs can have difficulty aligning their outputs with both the NL prompt and the I/O specification. In this paper, we give a way to mitigate this issue in the context of data science programming, where tasks require explicit I/O specifications for clarity. Specifically, we propose GIFT4Code, a novel approach for the instruction fine-tuning of LLMs with respect to I/O specifications. Our method leverages synthetic data produced by the LLM itself and utilizes execution-derived feedback as a key learning signal. This feedback, in the form of program I/O specifications, is provided to the LLM to facilitate instruction fine-tuning. We evaluated our approach on two challenging data science benchmarks, Arcade and DS-1000. The results demonstrate a significant improvement in the LLM's ability to generate code that is not only executable but also accurately aligned with user specifications, substantially improving the quality of code generation for complex data science tasks.

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

↑