Constraint Back-translation Improves Complex Instruction Following of Large Language Models

Yunjia Qi, Hao Peng, Xiaozhi Wang, Bin Xu, Lei Hou, Juanzi Li

TL;DR

Instead of forcing Large Language Models (LLMs) to generate text under complex constraints—a task they frequently fail at—this paper introduces constraint back-translation. By extracting implicit constraints from high-quality, pre-existing responses and adding them back into the instructions, the authors create a clean, low-noise dataset (CRAB) that significantly improves an LLM's ability to follow complex formatting, length, and stylistic rules without sacrificing general text quality.

What Problem Does This Paper Address?

Instruction tuning has successfully aligned LLMs with human intent, but these models still notoriously stumble when faced with complex, multi-layered constraints (e.g., "write a 550-word blog post in a formal tone with exactly four sections and no commas").

The standard approach to training models for these tasks is forward-synthesis: prompting a frontier model like GPT-4 with complex instructions to generate compliant responses. However, even the most advanced LLMs routinely violate complex constraints. This results in noisy training data that requires expensive, laborious filtering. Furthermore, forcing a model to generate text under heavy constraints often degrades the actual content quality—leading to robotic, less coherent, and shallow text.

Methods

The authors flip the standard data-generation pipeline on its head with Constraint Back-translation. The framework consists of three main steps:

  1. Implicit Constraint Extraction: They start with high-quality, existing instruction-response pairs. Even if the original instruction was simple (e.g., "Write a blog on French cuisine"), the high-quality response already implicitly satisfies multiple complex constraints regarding length, style, and structure.
  2. Hybrid Generation: They use a strong LLM (Llama3-70B-Instruct) to identify qualitative constraints (like writing style or hierarchical structure) and deterministic Python scripts to extract quantitative constraints (like exact word counts, keyword presence, or punctuation limits).
  3. Constraint Combination: They randomly bundle 6 to 8 of these discovered constraints and append them to the original instruction, creating a highly complex prompt perfectly paired with the pre-existing response.
Concept of implicit constraints in existing data

Beyond data generation, the authors introduce a novel Reverse Training Objective during fine-tuning. In addition to standard forward training (predicting the response given the instruction and constraints), the model is trained to predict the constraints given the instruction and response. This auxiliary task forces the model to deeply understand the relationship between the constraints and the text.

The framework of constraint back-translation

Datasets

  • Seed Datasets: High-quality pairs were sampled from four popular open datasets: Alpaca GPT4, Orca Chat, Evol Instruct, and OpenAssistant, filtering for responses longer than 300 words.
  • CRAB Dataset: The newly introduced dataset containing 13,500 complex instruction-response triples, averaging 7.1 constraints per instance across over 100 distinct constraint types.
  • Evaluation Benchmarks: The models were evaluated on IFEval (strict formatting/lexical constraints) and FollowBench (a fine-grained multi-constraint benchmark spanning levels L1 to L5), as well as AlpacaEval 2.0 for general instruction-following quality.

Key Insights and Ideas

  • Constraints as a Bottleneck for Creativity: The authors ran controlled experiments proving that when an LLM is forced to generate text while juggling heavy constraints, the text's core quality (fluency, coherence, engagingness) drops significantly. Back-translation avoids this trade-off by using unconstrained, high-quality text as the starting point.
  • Reverse Training Acts as a Regularizer: Teaching a model to identify constraints within a text significantly boosts its subsequent ability to follow those constraints during standard inference. Keeping forward and reverse training data separate yielded the best results to prevent overfitting.
  • Deterministic Scripts for Hard Constraints: LLMs are notoriously bad at counting words or characters. By offloading length and punctuation constraint generation to Python scripts, the authors eliminated a massive source of data noise common in pure-LLM synthesis pipelines.

Key Results

  • State-of-the-Art Constraint Following: Models fine-tuned on the CRAB dataset (Llama3-CRAB and Mistral-CRAB) showed massive improvements over their base models. On IFEval, Mistral-CRAB + DPO achieved an average score of 59.3%, outperforming specialized baselines like Conifer (55.7%).
  • Preserving General Capability: Crucially, on AlpacaEval 2.0 (general instruction following), Mistral-CRAB + DPO achieved a length-controlled win rate of 18.1%, significantly outperforming ConiferDPO (17.1%) and even beating the 70B version of WizardLM. This confirms that constraint back-translation preserves general conversational capability better than forward-generation methods.

Limitations and Future Work

  • Dependency on Seed Data Diversity: Because constraints are extracted from existing responses, if the seed dataset lacks stylistic variety (e.g., no text written in the style of Shakespeare), the back-translated dataset won't feature those constraints either. This was evident in FollowBench's style category, where CRAB models slightly lagged behind baselines.
  • Scale Limitations: Due to compute constraints, the authors only evaluated their method on smaller open-source backbones (7B/8B parameters). Testing the scalability of constraint back-translation on larger models (e.g., 70B+) remains future work.
  • DPO Data Generation: The current work focuses primarily on high-quality Supervised Fine-Tuning (SFT) data construction; developing a dedicated preference-optimization (DPO) data pipeline using back-translation is an open next step.

Summary updated

BibTeX
@inproceedings{qi2025constraint,
  author = {Yunjia Qi and Hao Peng and Xiaozhi Wang and Bin Xu and Lei Hou and Juanzi Li},
  title = {{Constraint Back-translation Improves Complex Instruction Following of Large Language Models}},
  booktitle = {ACM International Conference on Information and Knowledge Management},
  year = {2025},
  doi = {10.1145/3746252.3761324},
}
Figure