GAPO: Learning Preferential Prompt through Generative Adversarial Policy Optimization

Zhouhong Gu, Xingzhou Chen, Xiaoran Shi, Tao Wang, Suhang Zheng, Tianyu Li, Hongwei Feng, Yanghua Xiao

Abstract

Large Language Models (LLMs) often struggle to adhere to strict, fine-grained constraints in complex instructions. Traditional alignment techniques like Reinforcement Learning from Human Feedback (RLHF) and Direct Preference Optimization (DPO) focus on "Preferential Responses," which may fail to foster a deep understanding of constraints. This paper introduces Generative Adversarial Policy Optimization (GAPO), a framework that shifts the focus to "Preferential Prompts." By employing a GAN-based adversarial training loop with an encoder-only reward model, GAPO achieves superior instruction-following performance, significantly outperforming standard alignment methods on benchmarks like IFEval and the new Product Description Dataset (PDD).

Introduction

While modern LLMs are highly capable, they frequently encounter "constraint understanding" failures. When presented with prompts containing multiple specific requirements—such as exact word counts, professional tones, or mandatory keywords—models often hallucinate or fail to satisfy all criteria simultaneously.

Current alignment techniques typically rely on showing the model two different answers to the same prompt and asking it to prefer the better one. The authors argue that this approach does not effectively teach the model to understand the underlying constraints. Instead, models often adopt brittle patterns that fail under slight modifications. Furthermore, standard decoder-only architectures are inherently less efficient at detecting discrepancies between a prompt's constraints and a generated response due to their unidirectional attention mechanisms.

Methodology: Shifting the Alignment Paradigm

GAPO introduces two major shifts in training models for instruction following:

1. Preferential Prompt Learning

Rather than varying the response for a fixed prompt, GAPO varies the constraints within the prompt. By taking a valid prompt-response pair and slightly modifying the prompt's constraints to make the original response "invalid," the system creates high-quality negative samples. This forces the model to pay closer attention to subtle prompt details and fine-grained distinctions.

Comparison of Preferential Response vs. Preferential Prompt approaches.

2. Adversarial Training Loop (GAN-PPO)

The framework utilizes a Generative Adversarial Network (GAN) dynamic consisting of a Generator (the LLM being trained) and an encoder-only Reward Model (RM). Unlike traditional PPO, where the RM is frozen, GAPO allows the RM and Generator to evolve together. As the Generator improves, the RM is updated to become a stricter judge, creating a curriculum of increasing difficulty.

The Generative Adversarial Policy Optimization (GAPO) workflow.

3. Encoder-only Reward Model

GAPO employs an encoder-only architecture (specifically Longformer) for its reward model. This allows for bidirectional attention, enabling the model to better capture the intricate relationships between specific prompt constraints and the resulting text compared to standard decoder-only reward models.

Experimental Setup and Datasets

The researchers evaluated GAPO using two primary benchmarks:

  • IFEval (Instruction-Following Evaluation): A standard benchmark with 541 prompts containing verifiable constraints (e.g., "no capitalization," "at least two paragraphs").
  • Product Description Dataset (PDD): A new dataset introduced in this paper for e-commerce, containing over 93,000 property-value pairs. Models must generate descriptions including all provided facts without adding hallucinated information.

Key Results and Insights

GAPO demonstrated superior performance across all evaluations:

  • IFEval Dominance: GAPO achieved an overall score of 83.9%, significantly outperforming PPO (75.6%) and SFT (78.3%). It was particularly effective at handling "Combination" constraints involving multiple rules.
  • PDD Success: GAPO reached a score of 95.4%. Notably, popular methods like DPO, SimPO, and ORPO performed near zero on this dataset, suggesting they lack the granularity needed for strict factual and length constraints.
  • Scaling Efficiency: GAPO showed better scaling laws than PPO; increasing training data from 2,000 to 6,600 samples resulted in a performance jump of nearly 25 percentage points.

Conclusion and Limitations

GAPO represents a significant advancement in instruction-following alignment by prioritizing prompt sensitivity over simple response quality. However, the framework is more computationally intensive than offline methods like DPO due to its adversarial nature. Additionally, its success depends on the base model's initial ability to generate semantically coherent text. Future work may explore applying GAPO to multi-modal constraints or automated workflow agents where zero-failure adherence is critical.

Summary updated

BibTeX
@inproceedings{gu2025gapo,
  author = {Zhouhong Gu and Xingzhou Chen and Xiaoran Shi and Tao Wang and Suhang Zheng and Tianyu Li and Hongwei Feng and Yanghua Xiao},
  title = {{GAPO: Learning Preferential Prompt through Generative Adversarial Policy Optimization}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2025},
}
Figure