Thomas Gärtner and Shankar Vembu
Abstract
Standard structured output learning algorithms, such as Structural SVMs and Max-Margin Markov Networks, rely on the assumption that finding the highest-scoring output (inference) is computationally efficient. However, for many complex tasks like route prediction, this inference step is NP-hard, rendering traditional training methods intractable. This paper introduces a counting-based alternative that replaces the optimization-heavy inference step with combinatorial counting. By utilizing a quadratic upper bound on ranking loss, the proposed framework—Counting-based Structured Output Prediction (CSOP)—enables efficient training for problems where finding the optimal structure is hard but counting structures is easy. Experiments on multi-label, hierarchical, and route prediction tasks demonstrate that CSOP is both efficient and effective, often outperforming approximation-based optimization methods.
1. Introduction
Structured prediction is the task of predicting complex objects, such as sequences in natural language processing, 3D folds in protein folding, or paths in a graph. Most state-of-the-art methods for these tasks require solving an internal optimization problem during training: given an input and the current model parameters, the algorithm must find the "best" (highest-scoring) output from an exponentially large set of possibilities. This is known as the inference or decoding problem.
While efficient for structures like trees or sequences (via dynamic programming), this assumption fails for many other combinatorial structures. Gärtner and Vembu (2009) address this gap by proposing a shift from optimization-based training to a counting-based framework that bypasses the need for solving NP-hard optimization problems during the training phase.
2. The Inference Bottleneck
The primary challenge identified is that for many seemingly simple problems, finding the most violated constraint—a requirement for updating models in Structural SVMs—is NP-complete.
A central example provided is route prediction, which involves finding a cyclic path through various points of interest. The authors prove that for route prediction, finding the best structure is NP-hard. If a training algorithm requires solving an NP-hard problem at every iteration, it cannot scale to real-world datasets. When standard algorithms like SVM-Struct are forced to use approximate decoding (such as random sampling), the resulting models are often unstable and perform poorly.
3. Counting-based Structured Output Prediction (CSOP)
To solve this, the authors propose Counting-based Structured Output Prediction (CSOP). Instead of the standard hinge loss, which focuses on the single most problematic output, CSOP uses a quadratic upper bound on the ranking loss. This objective function ensures that the "true" output is ranked higher than all other possible outputs in the set $\mathcal{Y}$.
3.1 Super-structure Counting
The core innovation lies in the use of combinatorial counting. The authors demonstrate that for many complex structures, while finding the maximum value over a set might be NP-hard, calculating the average or variance (the counts) often has a closed-form polynomial solution. To optimize the quadratic loss, the algorithm only requires three statistics from the exponentially large output set:
- The total number of possible outputs ($|\mathcal{Y}|$).
- The sum of the feature vectors across all possible outputs ($\Phi$).
- The sum of the outer products of those feature vectors ($C$).
By calculating these "super-structure counts," the training objective becomes a smooth, unconstrained optimization problem. This allows the use of efficient solvers like Newton’s method or Conjugate Gradient, which are significantly faster than the iterative "cutting-plane" methods used in traditional structured learning.
4. Experimental Evaluation
The authors evaluated CSOP across three distinct tasks to demonstrate its versatility and efficiency:
- Multi-label Classification: Using the Yeast dataset (1,500 instances, 14 labels), CSOP was compared against standard multi-label SVMs. It proved competitive with state-of-the-art specialized kernels while maintaining a simpler training routine.
- Hierarchical Classification: On the WIPO-alpha patent dataset (1,352 instances, 188 categories), CSOP achieved superior performance, outperforming specialized hierarchical algorithms like H-M3 and H-RLS in terms of both zero-one loss and hierarchical loss.
- Route Prediction: In a simulated task where the goal was to reconstruct a hidden reward matrix from observed cyclic tours, CSOP significantly outperformed SVM-Struct. Because SVM-Struct could not solve the NP-hard inference problem exactly, its reliance on approximate decoding led to inferior results compared to the exact counting approach of CSOP.
5. Discussion and Conclusion
The most profound insight of this work is the Optimization-Counting Duality: the realization that combinatorial optimization and combinatorial counting have different difficulty levels. A problem can be "hard" to solve (find the max) but "easy" to count (find the sum).
5.1 The Prediction Gap
A notable limitation of this approach is the "prediction gap." While CSOP makes training efficient for NP-hard cases, it does not solve the prediction problem. To use the model on new data, one must still eventually find the "best" output. However, the authors argue that by training the model exactly using counting, we can then apply standard approximation algorithms (like simulated annealing) for the final prediction step with higher confidence in the underlying model weights.
In summary, CSOP provides a general-purpose alternative for structured output tasks. It bypasses the inference bottleneck by leveraging the efficiency of combinatorial counting, offering a robust framework for training models on complex, NP-hard structures that were previously inaccessible to exact optimization methods.
Summary updated