Abstract
With the development of large language models (LLMs), their ability to follow simple instructions has significantly improved. However, adhering to complex instructions remains a major challenge. Current approaches to generating complex instructions are often irrelevant to the current instruction requirements or suffer from limited scalability and diversity. Moreover, methods such as back-translation, while effective for simple instruction generation, fail to leverage the rich knowledge and formatting in human-written documents. In this paper, we propose a novel Automatic Iterative Refinement (AIR) framework to generate complex instructions with constraints, which not only better reflects the requirements of real scenarios but also significantly enhances LLMs' ability to follow complex instructions. The AIR framework consists of two stages: 1) Generate an initial instruction from a document; 2) Iteratively refine instructions with LLM-as-judge guidance by comparing the model's output with the document to incorporate valuable constraints. Finally, we construct the AIR-10K dataset with 10K complex instructions and demonstrate that instructions generated with our approach significantly improve the model's ability to follow complex instructions, outperforming existing methods for instruction generation.
Introduction
While modern Large Language Models (LLMs) excel at simple tasks, they often struggle with complex instructions involving multiple constraints. For instance, a user might require a specific word count, a particular tone, and the inclusion of specific keywords. Current methods for generating training data to address this "complexity gap" typically rely on manual curation, which is unscalable, or automatic rewriting (e.g., Evol-Instruct), which can result in synthetic-feeling constraints that lack real-world diversity.
The AIR framework addresses these issues by treating human-written documents—such as manuals, blogs, and legal texts—as "constraint gold mines." These documents naturally follow complex rules of formatting and logic. By iteratively extracting these implicit constraints, AIR generates training data that is both grounded and challenging for the model.
The AIR Framework
The AIR framework operates in two distinct stages to bridge the gap between simple instructions and complex, document-aligned requirements.
Stage 1: Initial Instruction Generation (IIG)
The process begins with Instruction Back-translation. High-quality documents are sampled from the Dolma corpus using a density-based mechanism to ensure diversity. A guidance model then predicts the simple instruction that would have generated the specific document. This provides a baseline task linked to a high-quality human reference.
Stage 2: Iterative Instruction Refinement (IIR)
This stage is the core innovation of the framework. Rather than adding multiple constraints at once, AIR mimics human feedback loops:
- Model Response: An LLM generates a response to the current instruction.
- LLM-as-Judge: A judge model compares the LLM's response to the original human-written document.
- Constraint Identification: The judge identifies a specific constraint (e.g., tone, length, or content) that the document satisfies but the model missed.
- Refinement: This constraint is added to the instruction, and the cycle repeats for up to five iterations.
This iterative approach ensures that the added constraints specifically target the model's current weaknesses, making the resulting training data highly effective.
Experimental Results and Insights
The researchers constructed the AIR-10K dataset, comprising 10,000 complex instructions across 20 domains. Fine-tuning Llama-3-8B and Qwen2.5-7B on this dataset yielded significant performance gains:
- Complex Instruction Following: On FollowBench, the AIR-trained Llama-3-8B improved its Hard Constraint Success Rate (HSR) from 41.04 to 50.69, outperforming Evol-Instruct.
- General Performance: On AlpacaEval2, the model's score jumped from 8.86 to 21.00, suggesting that mastering complex instructions enhances general reasoning and task performance.
- Efficiency and Robustness: The framework proved effective even when using smaller guidance models (e.g., 14B parameters), and showed that linguistic diversity (measured by unique trigrams) increases as instructions become more complex through iteration.
Conclusion
The AIR framework demonstrates that human-written documents are an underutilized resource for teaching LLMs to follow complex instructions. By using an iterative refinement process guided by these documents, AIR produces high-quality, diverse, and realistic training data. The resulting AIR-10K dataset significantly narrows the complexity gap, providing a scalable path toward more capable and instruction-compliant AI systems.
Summary updated