Instruction Fusion: Advancing Prompt Evolution through Hybridization (2024)

Abstract: The fine-tuning of Large Language Models (LLMs) specialized in code generation has seen notable advancements through the use of open-domain coding queries. Despite the successes, existing methodologies like Evol-Instruct encounter performance limitations, impeding further enhancements in code generation tasks. This paper examines the constraints of existing prompt evolution techniques and introduces a novel approach, Instruction Fusion (IF). IF innovatively combines two distinct prompts through a hybridization process, thereby enhancing the evolution of training prompts for code LLMs. Our experimental results reveal that the proposed novel method effectively addresses the shortcomings of prior methods, significantly improving the performance of Code LLMs across five code generation benchmarks, namely HumanEval, HumanEval+, MBPP, MBPP+ and MultiPL-E, which underscore the effectiveness of Instruction Fusion in advancing the capabilities of LLMs in code generation.

## introduction the field of automatic program writing has intrigued computer scientists since the 1960s @xcite . this period has seen substantial efforts to enable machines to autonomously write correct programs. the emergence of large language models (llms) @xcite @xcite has been a cornerstone in text generation @xcite , leading to the evolution of code large language models (code llms) which have notably advanced code generation tasks @xcite . early code llm research @xcite concentrated on the pre-training phase, utilizing a variety of code datasets to bolster the code generation capabilities of llms. a major breakthrough was achieved with instruction tuning @xcite , which enhanced the general applicability of llms by fine-tuning them with instructions rather than task-specific prompts. in pursuit of greater quantity, diversity, and creativity in instruction-response samples, @xcite introduced the self-instruct method, leveraging llms to generate their own synthetic instructions. this approach was notably adopted by code alpaca @xcite , based on stanford alpaca @xcite , transforming 21 basic code prompts into 20,000 high-quality instructions. building on this, @xcite further advanced code generation performance by employing evol-instruct on these instructions, expanding them to 78,000 through five dataset evolution heuristics. however, the evol-instruct method has its limitations on code llms, primarily its reliance on a set of five heuristics for generating new instructions. this approach leads to a pattern where the evolution is done primarily by adding more constraints to its seed instruction, which can cause three major issues. firstly, the evolving instructions may become excessively complex, challenging gpt's ability to respond effectively. secondly, the newly added constrains to the seed instruction may not exist in the original seed instruction, leading to an gap on difficulty gradient. finally, the evolutionary evaluations often remain confined within the scope of the original instruction, limiting diversity. addressing these challenges, we introduce a novel method named instruction fusion (if). this method leverages hybridization concepts to significantly improve prompt evolution, as demonstrated in figure 1 . it involves merging two distinct instructions into a single prompt using gpt-4 turbo, enhancing prompt complexity and diversity. this approach also facilitates a more gradual increase in difficulty for llms, optimizing learning and performance. to assess the efficacy of our instruction fusion method, we conducted experiments with code-llama @xcite , using humaneval @xcite , mbpp @xcite , humaneval + , mbpp + @xcite , and multipl-e @xcite as benchmark datasets. our results demonstrate a significant performance improvement of llms when training with the additional data generated by if. the contributions of this work can be summarized as follows: ## approach in this section, we first analyze the the limitation of current evolution method on code llms, then we elaborate on the details of the proposed instruction fusion method and analyze its advantages comparing to the existing instruction evolution method. the main process of the fusion is illustrated in figure 1 . ## experiments in this section, we report the experiment details of llms fine-tuned with instruction generated by if. we focused on the pass@1 performance under greedy generation settings across five benchmarks: four python benchmarks (humaneval @xcite , mbpp ( austin et al., 2021 ## conclusion in this paper, we introduce the instruction fusion technique, an advancement of evol-instruct specifically tailored for code generation tasks. this technique involves the fusion of two evolved instructions into a single, cohesive prompt. it excels in creating instruction sets that are reasonably complex, facilitating a progressive increase in difficulty which is achieved as objectives can be learned separately. the fused instructions also grants a better diversity of the instruction pool. notably, large language models (llms) fine-tuned with if have demonstrated superior performance across the top five benchmarks, setting new state-of-theart records.