Lyra: A Benchmark for Turducken-Style Code Generation

Fuente: arXiv
Guardado en:
Detalles Bibliográficos
Autores principales: Liang, Qingyuan, Sun, Zeyu, Zhu, Qihao, Zhang, Wenjie, Yu, Lian, Xiong, Yingfei, Zhang, Lu
Formato: Preprint
Publicado: 2021
Materias:
Acceso en línea:
Etiquetas: Agregar Etiqueta
Sin Etiquetas, Sea el primero en etiquetar este registro!
_version_ 1866910790541377536
author Liang, Qingyuan
Sun, Zeyu
Zhu, Qihao
Zhang, Wenjie
Yu, Lian
Xiong, Yingfei
Zhang, Lu
author_facet Liang, Qingyuan
Sun, Zeyu
Zhu, Qihao
Zhang, Wenjie
Yu, Lian
Xiong, Yingfei
Zhang, Lu
contents Recently, neural techniques have been used to generate source code automatically. While promising for declarative languages, these approaches achieve much poorer performance on datasets for imperative languages. Since a declarative language is typically embedded in an imperative language (i.e., the turducken-style programming) in real-world software development, the promising results on declarative languages can hardly lead to significant reduction of manual software development efforts. In this paper, we define a new code generation task: given a natural language comment, this task aims to generate a program in a base imperative language with an embedded declarative language. To our knowledge, this is the first turducken-style code generation task. For this task, we present Lyra: a dataset in Python with embedded SQL. This dataset contains 2,000 carefully annotated database manipulation programs from real-world projects. Each program is paired with both a Chinese comment and an English comment. In our experiment, we adopted Transformer, BERT-style, and GPT-style models as baselines. In the best setting, the generation performance of GPT-style models is better than others, where the AST exact matching accuracy is 24% and 25.5% when using Chinese and English comments, respectively. Therefore, we believe that Lyra provides a new challenge for code generation. Yet, overcoming this challenge may significantly boost the applicability of code generation techniques for real-world software development.
format Preprint
id arxiv_https___arxiv_org_abs_2108_12144
institution arXiv
publishDate 2021
record_format arxiv
spellingShingle Lyra: A Benchmark for Turducken-Style Code Generation
Liang, Qingyuan
Sun, Zeyu
Zhu, Qihao
Zhang, Wenjie
Yu, Lian
Xiong, Yingfei
Zhang, Lu
Software Engineering
Artificial Intelligence
Recently, neural techniques have been used to generate source code automatically. While promising for declarative languages, these approaches achieve much poorer performance on datasets for imperative languages. Since a declarative language is typically embedded in an imperative language (i.e., the turducken-style programming) in real-world software development, the promising results on declarative languages can hardly lead to significant reduction of manual software development efforts. In this paper, we define a new code generation task: given a natural language comment, this task aims to generate a program in a base imperative language with an embedded declarative language. To our knowledge, this is the first turducken-style code generation task. For this task, we present Lyra: a dataset in Python with embedded SQL. This dataset contains 2,000 carefully annotated database manipulation programs from real-world projects. Each program is paired with both a Chinese comment and an English comment. In our experiment, we adopted Transformer, BERT-style, and GPT-style models as baselines. In the best setting, the generation performance of GPT-style models is better than others, where the AST exact matching accuracy is 24% and 25.5% when using Chinese and English comments, respectively. Therefore, we believe that Lyra provides a new challenge for code generation. Yet, overcoming this challenge may significantly boost the applicability of code generation techniques for real-world software development.
title Lyra: A Benchmark for Turducken-Style Code Generation
topic Software Engineering
Artificial Intelligence
url https://arxiv.org/abs/2108.12144