交互式数据科学笔记本中的自然语言到代码生成
Natural Language to Code Generation in Interactive Data Science Notebooks
摘要:
计算笔记本电脑,如Quixyter笔记本电脑,是交互式计算环境,在数据科学家中无处不在,用于执行数据整理和分析任务。为了衡量人工智能配对程序员的性能,这些程序员自动合成程序以完成用户给出的自然语言(NL)意图,我们使用数据科学笔记本中的pandas数据分析框架构建了ARCADE,这是一个包含1082个代码生成问题的基准测试。ARCADE的特点是从同一个笔记本中产生多轮NL到代码的问题。它需要一个模型来理解丰富的多模态上下文,例如现有的笔记本单元及其执行状态以及先前的交互。为了在这个具有挑战性的任务上建立一个强大的基线,我们开发了PaChiNCo,这是一个用于Python计算笔记本的62 B代码语言模型(LM),它的性能明显优于公共代码LM。最后,我们探索了Few-Shot提示策略,以逐步分解和NL解释来引出更好的代码,显示了提高模型预测的多样性和可解释性的潜力。
英文摘要:
Computational notebooks, such as Jupyter notebooks, are interactive computing environments that are ubiquitous among data scientists to perform data wrangling and analytic tasks. To measure the performance of AI pair programmers that automatically synthesize programs for those tasks given natural language (NL) intents from users, we build ARCADE, a benchmark of 1082 code generation problems using the pandas data analysis framework in data science notebooks. ARCADE features multiple rounds of NL-to-code problems from the same notebook. It requires a model to understand rich multi-modal contexts, such as existing notebook cells and their execution states as well as previous turns of interaction. To establish a strong baseline on this challenging task, we develop PaChiNCo, a 62B code language model (LM) for Python computational notebooks, which significantly outperforms public code LMs. Finally, we explore few-shot prompting strategies to elicit better code with step-by-step decomposition and NL explanation, showing the potential to improve the diversity and explainability of model predictions.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。