Self-Infilling Code Generation

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Zheng, Lin, Yuan, Jianbo, Zhang, Zhi, Yang, Hongxia, Kong, Lingpeng
Format: Preprint
Published: 2023
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866911887660154880
author Zheng, Lin
Yuan, Jianbo
Zhang, Zhi
Yang, Hongxia
Kong, Lingpeng
author_facet Zheng, Lin
Yuan, Jianbo
Zhang, Zhi
Yang, Hongxia
Kong, Lingpeng
contents This work introduces self-infilling code generation, a general framework that incorporates infilling operations into auto-regressive decoding. Our approach capitalizes on the observation that recent infilling-capable code language models can self-infill: whereas infilling operations aim to fill in the middle based on a predefined prefix and suffix, self-infilling sequentially generates both such surrounding context and the infilled content. We utilize this capability to introduce novel interruption and looping mechanisms in conventional decoding, evolving it into a non-monotonic process. Interruptions allow for postponing the generation of specific code until a definitive suffix is established, enhancing control over the output. Meanwhile, the looping mechanism, which leverages the complementary nature of self-infilling and left-to-right decoding, can iteratively update and synchronize each piece of generation cyclically. Extensive experiments are conducted to demonstrate that our proposed decoding process is effective in enhancing both regularity and quality across several code generation benchmarks.
format Preprint
id arxiv_https___arxiv_org_abs_2311_17972
institution arXiv
publishDate 2023
record_format arxiv
spellingShingle Self-Infilling Code Generation
Zheng, Lin
Yuan, Jianbo
Zhang, Zhi
Yang, Hongxia
Kong, Lingpeng
Programming Languages
Computation and Language
Machine Learning
This work introduces self-infilling code generation, a general framework that incorporates infilling operations into auto-regressive decoding. Our approach capitalizes on the observation that recent infilling-capable code language models can self-infill: whereas infilling operations aim to fill in the middle based on a predefined prefix and suffix, self-infilling sequentially generates both such surrounding context and the infilled content. We utilize this capability to introduce novel interruption and looping mechanisms in conventional decoding, evolving it into a non-monotonic process. Interruptions allow for postponing the generation of specific code until a definitive suffix is established, enhancing control over the output. Meanwhile, the looping mechanism, which leverages the complementary nature of self-infilling and left-to-right decoding, can iteratively update and synchronize each piece of generation cyclically. Extensive experiments are conducted to demonstrate that our proposed decoding process is effective in enhancing both regularity and quality across several code generation benchmarks.
title Self-Infilling Code Generation
topic Programming Languages
Computation and Language
Machine Learning
url https://arxiv.org/abs/2311.17972