IOPO: Empowering LLMs with Complex Instruction Following via Input-Output Preference Optimization

Xinghua Zhang, Haiyang Yu, Cheng Fu, Fei Huang, Yongbin Li

TL;DR

The paper introduces IOPO (Input-Output Preference Optimization), a novel alignment method that enhances an LLM's ability to follow complex, multi-constraint instructions by optimizing for both input (instruction) and output (response) preferences simultaneously. Alongside this algorithm, the authors release TRACE, a large-scale benchmark featuring over 120K instruction-following samples across 26 distinct constraint dimensions to train and evaluate these capabilities.

What Problem Does This Paper Address?

As large language models (LLMs) are increasingly deployed as autonomous agents and integrated into sophisticated workflows, they are expected to handle highly intricate instructions. These instructions often contain multiple fine-grained constraints—such as specific formatting rules (e.g., "output in JSON"), stylistic choices ("use a formal tone"), or explicit exclusions ("do not mention X").

Current alignment paradigms, like Direct Preference Optimization (DPO), focus entirely on output preferences. They train models by comparing a winning response ($y_{\text{win}}$) against a losing response ($y_{\text{loose}}$) for a single, fixed input instruction ($x$). The authors argue that this approach makes it difficult for models to truly perceive and parse subtle constraint variations within the instruction itself. Furthermore, the community lacks both dedicated optimization algorithms and large-scale training datasets tailored specifically for complex instruction following.

Methods

To bridge this gap, the authors propose Input-Output Preference Optimization (IOPO). Instead of evaluating different outputs for the same input, IOPO constructs a four-way preference group consisting of two distinct instructions ($x_1, x_2$) and their corresponding successful responses ($y_1, y_2$).

The instructions $x_1$ and $x_2$ contain subtle constraint differences that require completely different outputs. This allows the training process to contrast matched pairs—$(x_1, y_1)$ and $(x_2, y_2)$—against mismatched pairs—$(x_1, y_2)$ and $(x_2, y_1)$.

Figure 1: Alignment Paradigms (a) Existing DPO Series vs. (b) Proposed IOPO. The green arrow indicates that y matches x while the red one indicates a mismatch.

Mathematically, the IOPO loss function elegantly splits the optimization objective into two core components:

  1. Output Preference Modeling: Standard DPO-style learning that pushes the model to prefer the correct response over the incorrect one for a given prompt.
  2. Input Preference Modeling: A novel component that forces the model to recognize which specific instruction matches a given response, sharpening its sensitivity to fine-grained prompt constraints.

Datasets

The paper introduces TRACE, a comprehensive benchmark designed to improve and evaluate complex instruction-following capabilities.

  • The Dataset: TRACE consists of 119,345 training samples and 1,042 human-verified evaluation samples. The instructions range from 1 to 15 constraints, averaging roughly 4.4 constraints per instruction in training and 4.9 in evaluation.
  • The Pipeline: The dataset was built using a five-stage automated workflow: defining a taxonomy of 26 constraint dimensions across 5 major types (Content, Situation, Style, Format, Example), expanding simple instructions into complex ones, structuring the prompts, performing automated quality control, and finally generating/evaluating responses using GPT-4o.
Figure 2: Construction Pipeline of TRACE, which consists of five key stages: 1) Taxonomy of Constraint, 2) Constraint Expansion, 3) Instruction Structuring, 4) Quality Control, and 5) Response Generation & Evaluation.

To test generalization, the authors also evaluate their models on popular out-of-domain benchmarks: IFEval, CFBench, and COMPLEXBENCH.

Key Insights and Ideas

  • Inputs are Preferences Too: The core "aha moment" of the paper is that instruction-following is a two-way street. An LLM cannot generate a perfectly compliant response unless it deeply understands how a shift in the prompt alters the expected output space. Treating the input prompt as a preference variable forces this exact behavior.
  • It’s the Architecture, Not Just the Tokens: One might wonder if IOPO performs better simply because it processes more tokens during training (four pairs instead of two). To test this, the authors created token-matched baselines ($\text{DPO}^*$ and $\text{SFT}^*$). IOPO still consistently outperformed them, proving that its constraint-aware mathematical formulation is what drives the quality leap.
  • Strong Cross-Domain Generalization: Even though the models were aligned purely on the TRACE training set, they showed substantial performance gains on entirely separate benchmarks like IFEval, indicating that IOPO teaches a fundamental, transferable skill rather than just dataset-specific shortcuts.

Key Results

The authors evaluated IOPO using Qwen2-7B-Instruct and LLaMA3.1-8B-Instruct as backbones.

  • In-Domain (TRACE): Compared to standard DPO, IOPO improved single-constraint accuracy (IF-S) by 3.0% and multi-constraint accuracy (IF-M) by 1.7% on the Qwen2 backbone.
  • Out-of-Domain (IFEval): IOPO achieved massive gains on IFEval, boosting strict prompt-level accuracy (S-Acc) by 7.2% for Qwen2 and 6.7% for LLaMA3.1 over DPO.
  • Closing the Gap to Frontier Models: While massive proprietary models like OpenAI o1 and Claude 3.5 Sonnet still lead the benchmarks, aligning 7B/8B models with IOPO significantly narrowed the performance gap.
  • Computational Trade-off: IOPO requires roughly 4x the GPU memory of standard SFT (and 2x that of DPO) due to the four-way pair calculations. However, because the model architecture remains unchanged, inference speed is completely unaffected.

Limitations and Future Work

The authors note that while the TRACE evaluation set underwent rigorous human verification, the 120K training set was generated entirely automatically to keep costs manageable. They acknowledge that further cleaning and refining of the training set would likely yield even better generalization.

For future work, the authors aim to integrate more explicit, in-depth reasoning processes (reminiscent of chain-of-thought or test-time compute scaling) directly into the constraint-satisfaction pipeline to handle even more convoluted instructions.

Summary updated

Abstract

In the realm of large language models (LLMs), the ability of models to accurately follow instructions is paramount as more agents and applications leverage LLMs for construction, where the complexity of instructions are rapidly increasing. However, on the one hand, there is only a certain amount of complex instruction evaluation data; on the other hand, there are no dedicated algorithms to improve the ability to follow complex instructions. To this end, this paper introduces TRACE, a benchmark for improving and evaluating the complex instructionfollowing ability, which consists of 120K training data and 1K evaluation data. Furthermore, we propose IOPO (Input-Output Preference Optimization) alignment method which takes both input and output preference pairs into consideration, where LLMs not only rapidly align with response preferences but also meticulously explore the instruction preferences. Extensive experiments on both in-domain and outof-domain datasets confirm the effectiveness of IOPO, showing 8.15%, 2.18% improvements on in-domain data and 6.29%, 3.13% on outof-domain data compared to SFT and DPO respectively.
BibTeX
@inproceedings{zhang2025iopo,
  author = {Xinghua Zhang and Haiyang Yu and Cheng Fu and Fei Huang and Yongbin Li},
  title = {{IOPO: Empowering LLMs with Complex Instruction Following via Input-Output Preference Optimization}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2025},
  url = {https://openreview.net/forum?id=2hyILNQoaH},
}
Figure