NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Genetic Instruct: Scaling up Synthetic Generation of Coding Instructions for Large Language Models

Somshubra Majumdar, Vahid Noroozi, Mehrzad Samadi, Sean Narenthiran, Aleksander Ficek, Wasi Uddin Ahmad, Jocelyn Huang, Jagadeesh Balam, Boris Ginsburg

Abstract

Large Language Models (LLMs) require high quality instruction data for effective alignment, particularly in code generation tasks where expert curated datasets are expensive to produce. We present Genetic-Instruct, a scalable algorithm for synthesizing large-scale, high quality coding instructions using evolutionary principles. Starting from a small set of seed instructions, Genetic-Instruct generates diverse and challenging instruction-code pairs by leveraging an Instructor-LLM for generation, a Coder-LLM for code synthesis, and a Judge-LLM for automatic quality evaluation. Our proposed approach is highly parallelizable and effective even with a small seed data and weaker generator models. We generated more than 7.5 million coding instructions with the proposed approach. Then we evaluated it by fine-tuning LLMs with the synthetic samples and demonstrated a significant improvement in their code generation capability compared to the other synthetic generation approaches and publicly available datasets. Our results highlight the efficiency, scalability, and generalizability of the Genetic-Instruct framework.

Introduction

Aligning Large Language Models (LLMs) to follow complex instructions is a critical step in making them useful assistants. In the coding domain, this process is hindered by the scarcity of high-quality, diverse, and complex instruction-solution pairs, which are expensive to curate manually. While synthetic data generation methods like Self-Instruct or Evol-Instruct have been proposed, they often struggle to maintain diversity and complexity at scale.

Researchers at NVIDIA have introduced Genetic-Instruct, a framework that applies evolutionary principles—specifically crossover and mutation—to scale synthetic data generation. Starting from a tiny seed of just 512 instructions, the framework successfully generated over 7.5 million high-quality coding samples, enabling models to outperform state-of-the-art instruction-tuned baselines.

Methodology: The Genetic-Instruct Framework

Genetic-Instruct treats instruction generation as an evolutionary process involving three specialized LLM roles:

  1. Instructor-LLM (The Evolver): This model performs two primary operations to expand the instruction pool. Crossover blends multiple existing instructions to explore new topics and domains. Mutation modifies a single instruction to increase its complexity by adding constraints, deepening reasoning requirements, or introducing errors for the model to debug.
  2. Coder-LLM (The Worker): This model generates the corresponding Python code solutions for the newly evolved instructions.
  3. Judge-LLM (The Fitness Function): This model evaluates the generated instruction-code pairs for correctness, quality, and elegance. Only samples that meet the "fitness" criteria are added back to the population pool to serve as seeds for future generations.
The Genetic-Instruct pipeline uses an evolutionary loop of generation, synthesis, and judging to scale synthetic data.

To achieve massive scale, the authors employed a "multi-colony" approach, running multiple evolutionary processes in parallel. A final decontamination step using an LLM ensures that the synthetic data does not contain paraphrases of common evaluation benchmarks like HumanEval.

Experimental Results

The framework was evaluated by generating a dataset of 7.5 million samples and fine-tuning a Llama-3.1-8B model.

Performance Benchmarks

The Genetic-Instruct model achieved an average accuracy of 69.7% across major benchmarks (MBPP, MBPP+, HumanEval, HumanEval+), significantly outperforming the official Llama-3.1-8B-Instruct (65.9%). On the MBPP benchmark specifically, it reached 79.9%, compared to the base model's 73.0%. When compared to other synthetic methods like Self-Instruct (66.8%) and WizardCoder (65.7%) at a controlled scale of 4 million samples, Genetic-Instruct remained superior.

Scaling Laws and Ablations

A key finding of the study is the relationship between synthetic data volume and model performance. Accuracy improves sharply as the dataset grows to 3 million samples, with diminishing returns observed after 6 million samples.

Code accuracy improves significantly with the size of the synthetic SFT dataset, plateauing after 6 million samples.

Ablation studies confirmed the synergy between crossover and mutation. While mutation increases task difficulty, crossover is vital for maintaining diversity and preventing the model from stagnating in narrow domains. Furthermore, the quality of the "teacher" models (Instructor and Judge) directly impacts the "student" model's performance; using stronger models like Qwen-32B for these roles yielded better results.

Discussion and Conclusion

Genetic-Instruct demonstrates that a massive, high-quality dataset can be harvested from a very small human-curated seed. However, some limitations remain. The current study focused exclusively on Python, and the reliance on a Judge-LLM introduces potential biases. Future work could involve extending the framework to other programming languages and incorporating actual code execution into the fitness evaluation to provide more objective quality signals.

By releasing the 7.5 million sample dataset, the authors aim to provide a valuable resource for the open-source community to further improve LLM alignment in coding tasks.

Summary updated

BibTeX
@inproceedings{majumdar2025genetic,
  author = {Somshubra Majumdar and Vahid Noroozi and Mehrzad Samadi and Sean Narenthiran and Aleksander Ficek and Wasi Uddin Ahmad and Jocelyn Huang and Jagadeesh Balam and Boris Ginsburg},
  title = {{Genetic Instruct: Scaling up Synthetic Generation of Coding Instructions for Large Language Models}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2025},
  url = {https://openreview.net/forum?id=uMyLE8x6Js},
}
Figure