On Correcting Inputs: Inverse Optimization for Online Structured Prediction

Hal Daumé Iii, Samir Khuller, Manish Purohit, Gregory Sanders

Introduction: The Challenge of Structured Prediction

In many machine learning tasks, the goal is not just to predict a single label, but a complex structure—such as a parse tree for a sentence or a matching between words in different languages. This is known as structured prediction. Traditionally, models are trained by adjusting parameters so that the "true" structure receives a higher score than others.

However, standard "black-box" learning algorithms often struggle with precision. They treat the underlying optimization solver (e.g., a max-flow or shortest-path algorithm) as an opaque box. When the model makes an error, these algorithms typically perform a blunt update: they slightly increase the score of the correct structure and decrease the score of the predicted error. This approach ignores the internal logic of the solver, potentially missing more efficient ways to "correct" the input weights to ensure the target structure becomes optimal.

Inverse Optimization with a Margin

This paper introduces a framework for inverse optimization with a margin. In inverse optimization, we start with a desired output (the "ground truth") and seek the minimal perturbations to the input weights that would make this output optimal. The authors extend this by requiring a margin ($\delta$): the target output must not only be optimal but must outperform all alternatives by at least a defined gap.

The authors formulate this as a Quadratic Program (QP), minimizing the $L_2$ norm of weight changes subject to optimality constraints. A key technical contribution is deriving concise, polynomial-sized linear constraints for complex combinatorial problems like matroids and matroid intersections.

Exchange graph for matroid intersection

For instance, in matroid intersection, they leverage an "exchange graph" (shown above). They prove that $\delta$-optimality is equivalent to ensuring this auxiliary graph contains no directed cycles with a total weight less than $\delta$. By using an extended formulation with shortest-path distance variables, they keep the number of constraints manageable, allowing the model to "peek inside" the optimization logic during training.

Applications in Natural Language Processing

The researchers evaluated their approach on two classic NLP tasks that rely heavily on structured outputs:

  1. Dependency Parsing: Predicting the grammatical structure of a sentence by identifying dependencies between words.
  2. Word Alignment: Finding the correct mapping between words in a bilingual sentence pair, modeled as a bipartite matching problem.
Dependency parsing example

In dependency parsing (illustrated above), the goal is to find the optimal tree structure. By applying inverse optimization, the learning algorithm can determine exactly which edge weights in the sentence graph need to be adjusted to make the gold-standard tree the clear winner.

Results and Key Insights

The proposed method, integrated into an online learning framework based on the Passive-Aggressive MIRA algorithm, consistently outperformed standard baselines.

  • Superior Accuracy: In dependency parsing, the approach reached 85.1% accuracy, surpassing Structured SVM (84.4%) and the Structured Perceptron (82.7%). The gains were even more significant in word alignment, where the algorithm achieved 44.0% accuracy, nearly tripling the performance of 1-Best MIRA (13.76%).
  • The "Scalpel" vs. the "Blunt Instrument": While standard updates only compare the truth to a single error, the inverse optimization approach acts like a "scalpel." It adjusts parameters just enough to satisfy global optimality against the entire exponential space of possible structures simultaneously.
  • Local to Global: A major insight is that global optimality requirements can often be reduced to local constraints in auxiliary graphs, such as the cycle constraints in exchange graphs.

Conclusion and Future Directions

By leveraging the specific optimality conditions of combinatorial algorithms, this research demonstrates that "white-box" learning is significantly more effective than black-box methods for structured prediction.

However, challenges remain. Solving a Quadratic Program at every step of an online learning process is computationally expensive, making scaling to massive datasets difficult. Future work may explore more efficient solvers, the integration of decomposable loss functions (like Hamming distance), and extending these combinatorial guarantees to non-linear models like deep neural networks.

Summary updated

Abstract

Algorithm designers typically assume that the input data is correct, and then proceed to find "optimal" or "sub-optimal" solutions using this input data. However this assumption of correct data does not always hold in practice, especially in the context of online learning systems where the objective is to learn appropriate feature weights given some training samples. Such scenarios necessitate the study of inverse optimization problems where one is given an input instance as well as a desired output and the task is to adjust the input data so that the given output is indeed optimal. Motivated by learning structured prediction models, in this paper we consider inverse optimization with a margin, i.e., we require the given output to be better than all other feasible outputs by a desired margin. We consider such inverse optimization problems for maximum weight matroid basis, matroid intersection, perfect matchings, minimum cost maximum flows, and shortest paths and derive the first known results for such problems with a non-zero margin. The effectiveness of these algorithmic approaches to online learning for structured prediction is also discussed.
BibTeX
@inproceedings{iii2015correcting,
  author = {Hal Daumé III and Samir Khuller and Manish Purohit and Gregory Sanders},
  title = {{On Correcting Inputs: Inverse Optimization for Online Structured Prediction}},
  booktitle = {FSTTCS},
  year = {2015},
  url = {https://openreview.net/forum?id=gQXapAg0tb},
}
Figure