Exploring Data-Efficient Adaptation of Large Language Models for Code Generation

Fuente: arXiv
Enregistré dans:
Détails bibliographiques
Auteurs principaux: Jiang, Xue, Dong, Yihong, Fan, Zhiyuan, Jin, Zhi, Jiao, Wenpin, Li, Ge
Format: Preprint
Publié: 2024
Sujets:
Accès en ligne:
Tags: Ajouter un tag
Pas de tags, Soyez le premier à ajouter un tag!
_version_ 1866908603839938560
author Jiang, Xue
Dong, Yihong
Fan, Zhiyuan
Jin, Zhi
Jiao, Wenpin
Li, Ge
author_facet Jiang, Xue
Dong, Yihong
Fan, Zhiyuan
Jin, Zhi
Jiao, Wenpin
Li, Ge
contents Although Large Language Models (LLMs) have made significant progress in code generation, they still struggle with code generation tasks in specific scenarios. These scenarios usually necessitate the adaptation of LLMs to fulfill specific needs, but the limited training data available in practice leads to poor code generation performance. Therefore, how to effectively adapt LLMs to new scenarios with few training data is a major challenge for current code generation. In this paper, we propose a novel adaptation approach named DEED, which stands for Data-Efficient adaptation with Error-Driven learning for code generation. DEED leverages the errors made by LLMs as learning opportunities, using error revision to overcome their own shortcomings, thus achieving efficient learning. Specifically, DEED involves identifying error code generated by LLMs, employing Self-Revise for code revision, optimizing the model with revised code, and iteratively adapting the process for continuous improvement. Experimental results show that, compared to other mainstream fine-tuning approaches, DEED achieves superior performance with few training data, showing an average relative improvement of 46.2% in Pass@1 on multiple code generation benchmarks. We also validate the effectiveness of Self-Revise, which generates revised code that optimizes the model more efficiently compared to the code samples from datasets. Moreover, DEED consistently demonstrates strong performance across various LLMs, underscoring its applicability.
format Preprint
id arxiv_https___arxiv_org_abs_2403_00046
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Exploring Data-Efficient Adaptation of Large Language Models for Code Generation
Jiang, Xue
Dong, Yihong
Fan, Zhiyuan
Jin, Zhi
Jiao, Wenpin
Li, Ge
Software Engineering
Artificial Intelligence
Computation and Language
Although Large Language Models (LLMs) have made significant progress in code generation, they still struggle with code generation tasks in specific scenarios. These scenarios usually necessitate the adaptation of LLMs to fulfill specific needs, but the limited training data available in practice leads to poor code generation performance. Therefore, how to effectively adapt LLMs to new scenarios with few training data is a major challenge for current code generation. In this paper, we propose a novel adaptation approach named DEED, which stands for Data-Efficient adaptation with Error-Driven learning for code generation. DEED leverages the errors made by LLMs as learning opportunities, using error revision to overcome their own shortcomings, thus achieving efficient learning. Specifically, DEED involves identifying error code generated by LLMs, employing Self-Revise for code revision, optimizing the model with revised code, and iteratively adapting the process for continuous improvement. Experimental results show that, compared to other mainstream fine-tuning approaches, DEED achieves superior performance with few training data, showing an average relative improvement of 46.2% in Pass@1 on multiple code generation benchmarks. We also validate the effectiveness of Self-Revise, which generates revised code that optimizes the model more efficiently compared to the code samples from datasets. Moreover, DEED consistently demonstrates strong performance across various LLMs, underscoring its applicability.
title Exploring Data-Efficient Adaptation of Large Language Models for Code Generation
topic Software Engineering
Artificial Intelligence
Computation and Language
url https://arxiv.org/abs/2403.00046