UniCoder: Scaling Code Large Language Model via Universal Code

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Sun, Tao, Chai, Linzheng, Yang, Jian, Yin, Yuwei, Guo, Hongcheng, Liu, Jiaheng, Wang, Bing, Yang, Liqun, Li, Zhoujun
Format: Preprint
Published: 2024
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866914846977556480
author Sun, Tao
Chai, Linzheng
Yang, Jian
Yin, Yuwei
Guo, Hongcheng
Liu, Jiaheng
Wang, Bing
Yang, Liqun
Li, Zhoujun
author_facet Sun, Tao
Chai, Linzheng
Yang, Jian
Yin, Yuwei
Guo, Hongcheng
Liu, Jiaheng
Wang, Bing
Yang, Liqun
Li, Zhoujun
contents Intermediate reasoning or acting steps have successfully improved large language models (LLMs) for handling various downstream natural language processing (NLP) tasks. When applying LLMs for code generation, recent works mainly focus on directing the models to articulate intermediate natural-language reasoning steps, as in chain-of-thought (CoT) prompting, and then output code with the natural language or other structured intermediate steps. However, such output is not suitable for code translation or generation tasks since the standard CoT has different logical structures and forms of expression with the code. In this work, we introduce the universal code (UniCode) as the intermediate representation. It is a description of algorithm steps using a mix of conventions of programming languages, such as assignment operator, conditional operator, and loop. Hence, we collect an instruction dataset UniCoder-Instruct to train our model UniCoder on multi-task learning objectives. UniCoder-Instruct comprises natural-language questions, code solutions, and the corresponding universal code. The alignment between the intermediate universal code representation and the final code solution significantly improves the quality of the generated code. The experimental results demonstrate that UniCoder with the universal code significantly outperforms the previous prompting methods by a large margin, showcasing the effectiveness of the structural clues in pseudo-code.
format Preprint
id arxiv_https___arxiv_org_abs_2406_16441
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle UniCoder: Scaling Code Large Language Model via Universal Code
Sun, Tao
Chai, Linzheng
Yang, Jian
Yin, Yuwei
Guo, Hongcheng
Liu, Jiaheng
Wang, Bing
Yang, Liqun
Li, Zhoujun
Computation and Language
Intermediate reasoning or acting steps have successfully improved large language models (LLMs) for handling various downstream natural language processing (NLP) tasks. When applying LLMs for code generation, recent works mainly focus on directing the models to articulate intermediate natural-language reasoning steps, as in chain-of-thought (CoT) prompting, and then output code with the natural language or other structured intermediate steps. However, such output is not suitable for code translation or generation tasks since the standard CoT has different logical structures and forms of expression with the code. In this work, we introduce the universal code (UniCode) as the intermediate representation. It is a description of algorithm steps using a mix of conventions of programming languages, such as assignment operator, conditional operator, and loop. Hence, we collect an instruction dataset UniCoder-Instruct to train our model UniCoder on multi-task learning objectives. UniCoder-Instruct comprises natural-language questions, code solutions, and the corresponding universal code. The alignment between the intermediate universal code representation and the final code solution significantly improves the quality of the generated code. The experimental results demonstrate that UniCoder with the universal code significantly outperforms the previous prompting methods by a large margin, showcasing the effectiveness of the structural clues in pseudo-code.
title UniCoder: Scaling Code Large Language Model via Universal Code
topic Computation and Language
url https://arxiv.org/abs/2406.16441