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
Fine-tuning Large Language Models (LLMs) for coding often relies on synthetic data generation. The current state-of-the-art method, Evol-Instruct, evolves simple "seed" instructions into complex ones by iteratively adding constraints. However, this approach faces three critical "ceilings":
- Over-escalating Constraints: Instructions eventually become so convoluted that even teacher models struggle to provide correct responses.
- Difficulty Gaps: Adding multiple constraints at once creates steep learning curves, missing the intermediate steps necessary for effective training.
- Limited Diversity: Evolution stays within the scope of the original seed, failing to explore the broader space of possible programming tasks.
Methodology: Instruction Fusion
To overcome these limitations, we introduce Instruction Fusion (IF), a method inspired by biological hybridization. Instead of evolving a single instruction in isolation, IF takes two random seed instructions and utilizes a "Teacher LLM" (such as GPT-4 Turbo) to act as a Prompt Fusion Specialist.
The fusion process follows specific rules to ensure quality:
- Integration: Merging the core logic of both prompts into one cohesive task.
- Complexity Control: Maintaining a complexity level similar to the parents to avoid the over-escalation trap.
- Solvability: Discarding logically incoherent or unsolvable prompts.
- Language Consistency: Ensuring the final task is executable in a single programming language.
Analysis of Semantic Diversity
A key advantage of Instruction Fusion is its ability to populate the "semantic void" left by standard evolution methods. By combining disparate tasks, the model learns to bridge concepts naturally. We analyzed the semantic distribution using t-SNE plots to visualize the high-dimensional task landscape.
The visualization demonstrates that Instruction Fusion populates empty areas in the task landscape, creating a more uniform and diverse training set. This increased "instruction uncertainty" forces the model to be more sensitive to specific prompt nuances, leading to superior generalization.
Experimental Results
Instruction Fusion consistently outperformed the baseline Evol-Instruct and other prominent models across major benchmarks:
- HumanEval Performance: The IF-CL 34B model achieved 78.7%, significantly higher than the 73.2% achieved by WizardCoder-CLP 34B.
- Efficiency: The 13B version of the IF model outperformed several 34B baselines, suggesting that data quality via fusion is a massive force multiplier.
- Multi-language Mastery: On the MultiPL-E benchmark, the IF-CL 13B model showed a substantial lead, particularly in languages like JavaScript and C++, proving that the diversity gained from fusion translates effectively across different syntaxes.
Conclusion
Instruction Fusion represents a significant advancement in prompt engineering for Code LLMs. By hybridizing instructions, we create a smoother difficulty gradient and higher semantic diversity than traditional evolution methods. While the generation process involves higher API costs and lower success rates for cross-language fusions, the resulting performance gains across diverse benchmarks validate IF as a robust strategy for developing specialized coding models.
Summary updated