arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2308.01240cs.CLcs.AI
收藏

评估指令微调大型语言模型在代码理解与生成上的表现

Evaluating Instruction-Tuned Large Language Models on Code Comprehension and Generation

Fudan University(复旦大学)

Zhiqiang Yuan, Junwei Liu, Qiancheng Zi, Mingwei Liu, Xin Peng, Yiling Lou

AI总结:

本文在四个代码理解与生成任务上评估了10个开源指令微调LLM,发现其在零样本下极具竞争力,少样本和微调能进一步提升性能,并据此提出了模型选择与权衡的实际建议。

摘要:

在本工作中,我们在四个具有代表性的代码理解和生成任务上评估了10个开源的指令微调LLM。我们有以下主要发现。首先,在零样本设置下,指令微调LLM在代码理解和生成任务上极具竞争力,有时甚至优于在每个下游任务上专门微调的小型SOTA模型。我们还发现,在代码相关任务上,较大的指令微调LLM并不总是更好。其次,在少样本设置下,我们发现添加示例显著有助于指令微调LLM在大多数代码理解和生成任务上表现更好;然而,这些示例有时会导致不稳定甚至更差的性能。此外,我们发现广泛使用的基于BM25的样本选择策略仅在生成问题上显著优于基本的随机选择或固定选择。第三,在微调设置下,我们发现与零样本/单样本性能相比,微调可以进一步提高模型在下游代码理解和生成任务上的性能。此外,在相同的下游任务数据集上进行微调后,指令微调LLM的表现优于小型SOTA模型和未经指令微调的同等规模LLM。基于我们的发现,我们进一步提出了关于模型和使用建议、性能与成本权衡以及未来方向的实际启示。

英文摘要:

In this work, we evaluate 10 open-source instructed LLMs on four representative code comprehension and generation tasks. We have the following main findings. First, for the zero-shot setting, instructed LLMs are very competitive on code comprehension and generation tasks and sometimes even better than small SOTA models specifically fine-tuned on each downstream task. We also find that larger instructed LLMs are not always better on code-related tasks. Second, for the few-shot setting, we find that adding demonstration examples substantially helps instructed LLMs perform better on most code comprehension and generation tasks; however, the examples would sometimes induce unstable or even worse performance. Furthermore, we find widely-used BM25-based shot selection strategy significantly outperforms the basic random selection or fixed selection only on generation problems. Third, for the fine-tuning setting, we find that fine-tuning could further improve the model performance on downstream code comprehension and generation tasks compared to the zero-shot/one-shot performance. In addition, after being fine-tuned on the same downstream task dataset, instructed LLMs outperform both the small SOTA models and similar-scaled LLMs without instruction tuning. Based on our findings, we further present practical implications on model and usage recommendation, performance and cost trade-offs, and future direction.

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

↑