Semi-Instruct: Bridging Natural-Instruct and Self-Instruct for Code Large Language Models

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Luo, Xianzhen, Zhu, Qingfu, Zhang, Zhiming, Wang, Xu, Yang, Qing, Xu, Dongliang, Che, Wanxiang
Format: Preprint
Published: 2024
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866917601417887744
author Luo, Xianzhen
Zhu, Qingfu
Zhang, Zhiming
Wang, Xu
Yang, Qing
Xu, Dongliang
Che, Wanxiang
author_facet Luo, Xianzhen
Zhu, Qingfu
Zhang, Zhiming
Wang, Xu
Yang, Qing
Xu, Dongliang
Che, Wanxiang
contents Instruction tuning plays a pivotal role in Code Large Language Models (Code LLMs) for the task of program synthesis. Presently, two dominant paradigms for collecting tuning data are natural-instruct (human-written) and self-instruct (automatically generated). Natural-instruct includes diverse and correct codes but lacks instruction-code pairs, and exists improper code formats like nested single-line codes. In contrast, self-instruct automatically generates proper paired data. However, it suffers from low diversity due to generating duplicates and cannot ensure the correctness of codes. To bridge the both paradigms, we propose \textbf{Semi-Instruct}. It first converts diverse but improper codes from natural-instruct into proper instruction-code pairs through a method similar to self-instruct. To verify the correctness of generated codes, we design a novel way to construct test cases by generating cases' inputs and executing correct codes from natural-instruct to get outputs. Finally, diverse and correct instruction-code pairs are retained for instruction tuning. Experiments show that semi-instruct is significantly better than natural-instruct and self-instruct. Furthermore, the performance steadily improves as data scale increases.
format Preprint
id arxiv_https___arxiv_org_abs_2403_00338
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Semi-Instruct: Bridging Natural-Instruct and Self-Instruct for Code Large Language Models
Luo, Xianzhen
Zhu, Qingfu
Zhang, Zhiming
Wang, Xu
Yang, Qing
Xu, Dongliang
Che, Wanxiang
Computation and Language
Instruction tuning plays a pivotal role in Code Large Language Models (Code LLMs) for the task of program synthesis. Presently, two dominant paradigms for collecting tuning data are natural-instruct (human-written) and self-instruct (automatically generated). Natural-instruct includes diverse and correct codes but lacks instruction-code pairs, and exists improper code formats like nested single-line codes. In contrast, self-instruct automatically generates proper paired data. However, it suffers from low diversity due to generating duplicates and cannot ensure the correctness of codes. To bridge the both paradigms, we propose \textbf{Semi-Instruct}. It first converts diverse but improper codes from natural-instruct into proper instruction-code pairs through a method similar to self-instruct. To verify the correctness of generated codes, we design a novel way to construct test cases by generating cases' inputs and executing correct codes from natural-instruct to get outputs. Finally, diverse and correct instruction-code pairs are retained for instruction tuning. Experiments show that semi-instruct is significantly better than natural-instruct and self-instruct. Furthermore, the performance steadily improves as data scale increases.
title Semi-Instruct: Bridging Natural-Instruct and Self-Instruct for Code Large Language Models
topic Computation and Language
url https://arxiv.org/abs/2403.00338