Adversarial Structured Prediction for Multivariate Measures

Hong Wang, Ashkan Rezaei, Brian D. ZiebartarXiv 2017

Abstract: Structured prediction tasks such as Named Entity Recognition (NER) and Word Alignment are typically evaluated using complex, non-decomposable multivariate measures like F-score and Alignment Error Rate (AER). Traditional approaches rely on surrogate losses (e.g., hinge loss) that do not directly optimize these metrics, leading to a lack of Fisher consistency. This paper presents a game-theoretic framework that directly optimizes target measures by formulating the learning process as a zero-sum game between a predictor and an adversary. We demonstrate that this approach achieves superior performance, particularly in low-data regimes, while maintaining computational tractability through efficient best-response approximations.

Introduction

In many natural language processing (NLP) applications, the primary goal is to predict structured outputs where evaluation criteria are non-linear and non-decomposable. For instance, the F-score in NER and the AER in machine translation alignment cannot be broken down into independent per-token losses. Standard learning algorithms like Conditional Random Fields (CRFs) or Structured Support Vector Machines (SSVMs) optimize surrogate losses (log-loss or hinge loss) for mathematical convenience. However, these surrogates are often inconsistent with the actual evaluation metrics, meaning that even with infinite data, the model may fail to reach the Bayes optimal prediction for the desired measure.

The Adversarial Framework

To address this mismatch, we propose Adversarial Structured Prediction. Instead of approximating the loss function, we adversarially approximate the training data distribution. The learning problem is framed as a zero-sum game where the Predictor aims to select labels that maximize expected performance according to the true metric, while the Adversary seeks to choose labels that minimize this performance. The Adversary is constrained to match the empirical feature expectations of the training data, ensuring the "worst-case" labels remain structurally relevant. This formulation ensures Fisher consistency: the predictor's strategy at equilibrium is guaranteed to be optimal for the specific multivariate measure used in the game.

Optimization and Efficiency

A significant challenge in structured prediction is the exponential size of the output space. We employ the Double Oracle algorithm to find the Nash equilibrium by iteratively adding only the most effective strategies for both players. The efficiency of this approach hinges on finding the "best response" (BR) for each player. For the F-score, the exact best response calculation has a complexity of $O(m^2n^3)$, where $n$ is the sequence length and $m$ is the number of labels. To make this practical, we developed a Viterbi-based approximation with $O(nm^2)$ complexity.

Computational efficiency of the approximate best response algorithm compared to the exact method.

As illustrated above, the approximate best response provides a significant speedup—often exceeding an order of magnitude—as sequence length increases, with negligible impact on final model accuracy.

Experimental Evaluation

We evaluated the framework on two primary benchmarks: Word Alignment and Named Entity Recognition.

Word Alignment

Using the NAACL 2003 Hansards dataset, our adversarial model ($ADV_{aer}$) achieved an AER of 7.28%, nearly halving the error of the Structured SVM (13.34%). Interestingly, we found that relaxing bipartite constraints during training allowed the model to focus more effectively on the AER metric itself.

Visualization of the word alignment task between English and French, showing 'Sure' (S) and 'Possible' (P) labels.

Named Entity Recognition

On the CoNLL-2003 benchmark, the adversarial approach ($ADV_{f1}$) showed remarkable robustness in low-data scenarios. When trained on only 300 sentences, the F1 score for the "Person" (PER) tag improved from 17.88 (CRF) to 29.64 (ADV). This suggests that direct metric optimization is particularly beneficial when labeled data is scarce.

Conclusion

Adversarial Structured Prediction provides a theoretically sound and practically effective method for optimizing non-decomposable multivariate measures. By bypassing inconsistent surrogate losses and directly incorporating the evaluation metric into a game-theoretic training objective, we achieve substantial performance gains in key NLP tasks. Future work will explore extending this framework to other domains, such as computer vision, where complex structural metrics are prevalent.

Summary updated

BibTeX
@misc{wang2017adversarial,
  author = {Hong Wang and Ashkan Rezaei and Brian D. Ziebart},
  title = {{Adversarial Structured Prediction for Multivariate Measures}},
  year = {2017},
  eprint = {1712.07374},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1712.07374},
}
Figure