Table of Contents
Fetching ...

Exploring Language Model's Code Generation Ability with Auxiliary Functions

Seonghyeon Lee, Sanghwan Jang, Seongbo Jang, Dongha Lee, Hwanjo Yu

TL;DR

This work comprehensively evaluates the ability to utilize auxiliary functions encoded in recent code-pretrained language models and discovers the models' promising ability to utilize auxiliary functions including their self-improving behavior by implementing the two functions step-by-step.

Abstract

Auxiliary function is a helpful component to improve language model's code generation ability. However, a systematic exploration of how they affect has yet to be done. In this work, we comprehensively evaluate the ability to utilize auxiliary functions encoded in recent code-pretrained language models. First, we construct a human-crafted evaluation set, called HumanExtension, which contains examples of two functions where one function assists the other. With HumanExtension, we design several experiments to examine their ability in a multifaceted way. Our evaluation processes enable a comprehensive understanding of including auxiliary functions in the prompt in terms of effectiveness and robustness. An additional implementation style analysis captures the models' various implementation patterns when they access the auxiliary function. Through this analysis, we discover the models' promising ability to utilize auxiliary functions including their self-improving behavior by implementing the two functions step-by-step. However, our analysis also reveals the model's underutilized behavior to call the auxiliary function, suggesting the future direction to enhance their implementation by eliciting the auxiliary function call ability encoded in the models. We release our code and dataset to facilitate this research direction.

Exploring Language Model's Code Generation Ability with Auxiliary Functions

TL;DR

This work comprehensively evaluates the ability to utilize auxiliary functions encoded in recent code-pretrained language models and discovers the models' promising ability to utilize auxiliary functions including their self-improving behavior by implementing the two functions step-by-step.

Abstract

Auxiliary function is a helpful component to improve language model's code generation ability. However, a systematic exploration of how they affect has yet to be done. In this work, we comprehensively evaluate the ability to utilize auxiliary functions encoded in recent code-pretrained language models. First, we construct a human-crafted evaluation set, called HumanExtension, which contains examples of two functions where one function assists the other. With HumanExtension, we design several experiments to examine their ability in a multifaceted way. Our evaluation processes enable a comprehensive understanding of including auxiliary functions in the prompt in terms of effectiveness and robustness. An additional implementation style analysis captures the models' various implementation patterns when they access the auxiliary function. Through this analysis, we discover the models' promising ability to utilize auxiliary functions including their self-improving behavior by implementing the two functions step-by-step. However, our analysis also reveals the model's underutilized behavior to call the auxiliary function, suggesting the future direction to enhance their implementation by eliciting the auxiliary function call ability encoded in the models. We release our code and dataset to facilitate this research direction.
Paper Structure (36 sections, 5 figures, 3 tables)

This paper contains 36 sections, 5 figures, 3 tables.

Figures (5)

  • Figure 1: An illustrative example of HumanExtension. The function has_close_elements_in_array delegates their subroutine to the auxiliary function has_close_elements. Red bold text is the reference implementation written by humans.
  • Figure 2: The two types of generated implementations from CodeLLaMAPython 13B. Bold purple texts are generated by the model while the others are given. Some examples in the docstring are omitted for brevity.
  • Figure 3: Robustness analysis on two perturbations, renaming auxiliary function and removing docstring.
  • Figure 4: Pass@1 score comparison between black-box implementations (auxiliary function call) and white-box implementations (no auxiliary function call). The scale of dots represents their model size. Aqua dotted line indicates the performance on black-box and white-box implementations are the same.
  • Figure 5: Robustness analysis results with multiple auxiliary functions.