Recently, large language models (LLMs), especially those that are pretrained on code, have demonstrated strong capabilities in generating programs from natural language inputs in a few-shot or even zero-shot manner. Despite promising results, there is a notable lack of a comprehensive evaluation of these models language-to-code generation capabilities. Existing studies often focus on specific tasks, model architectures, or learning paradigms, leading to a fragmented understanding of the overall landscape. In this work, we present L2CEval, a systematic evaluation of the language-to-code generation capabilities of LLMs on 7 tasks across the domain spectrum of semantic parsing, math reasoning and Python programming, analyzing the factors that potentially affect their performance, such as model size, pretraining data, instruction tuning, and different prompting methods. In addition to assessing model performance, we measure confidence calibration for the models and conduct human evaluations of the output programs. This enables us to identify and analyze the typical failure modes across various tasks and models. L2CEval offers a comprehensive understanding of the capabilities and limitations of LLMs in language-to-code generation. We also release the evaluation framework and all model outputs, hoping to lay the groundwork for further future research in this domain.
翻译:近期,大型语言模型(LLMs),尤其是那些在代码上预训练的模型,已在少样本甚至零样本场景下展现出从自然语言输入生成程序的强大能力。尽管结果令人鼓舞,但目前对这些模型在语言到代码生成方面的能力仍缺乏全面评估。现有研究通常聚焦于特定任务、模型架构或学习范式,导致对整体格局的理解较为碎片化。在本工作中,我们提出L2CEval,系统评估LLMs在语义解析、数学推理与Python编程等7个任务域上的语言到代码生成能力,并分析可能影响其性能的因素,如模型规模、预训练数据、指令微调及不同提示方法。除评估模型性能外,我们还测量了模型的置信度校准,并对输出程序进行了人工评估,从而能够识别并分析各类任务和模型中的典型失败模式。L2CEval为理解LLMs在语言到代码生成中的能力与局限提供了全面视角。我们同时发布了评估框架及所有模型输出,期望为该领域的后续研究奠定基础。