Search-based structured prediction

Hal Daumé Iii, John Langford, Daniel Marcu

Abstract

Structured prediction involves predicting outputs with complex internal dependencies, such as sequences, trees, or graphs. Traditional methods like Conditional Random Fields (CRFs) and Max-Margin Markov Networks ($M^3Ns$) often struggle with non-decomposable loss functions and computational constraints imposed by Markov assumptions. This paper presents SEARN (Search + Learning), a meta-algorithm that transforms structured prediction into a sequence of cost-sensitive classification tasks. By treating prediction as a search process and iteratively training a classifier to minimize regret, SEARN allows for the optimization of arbitrary loss functions and the use of global features while maintaining strong theoretical guarantees.

Introduction

In many real-world applications, such as machine translation, image parsing, and document summarization, the output is not a single scalar but a structured object. The primary challenge in structured prediction is managing the dependencies between different parts of the output. Existing approaches typically rely on dynamic programming or graph-based optimization, which require the loss function to decompose over the structure (e.g., Hamming loss). Furthermore, these models often suffer from "exposure bias," where a model trained only on ground-truth data fails to recover from errors made during inference.

SEARN addresses these issues by reducing the structured prediction problem to a search problem. It leverages the power of standard classification algorithms to make local decisions that collectively form a global structure, effectively bridging the gap between simple classification and complex structured output.

The SEARN Meta-Algorithm

SEARN operates by viewing the production of a structured output as a path through a search space. Each step in this path represents a decision made by a policy (a classifier). The algorithm follows an iterative training procedure:

  1. Search as Prediction: The algorithm generates a trajectory of decisions using the current policy. Initially, this policy is often derived from the "gold" labels.
  2. Regret Estimation: For every state encountered in the trajectory, SEARN evaluates every possible action. It estimates the "regret"—the difference in final loss between taking a specific action and taking the optimal action—by completing the remaining path using the current policy.
  3. Cost-Sensitive Classification: A new classifier is trained to minimize this regret. This classifier learns not just what the "correct" next step is, but also how to mitigate the costs of previous errors.
  4. Stochastic Interpolation: To ensure stability and convergence, the new classifier is not used in isolation. Instead, it is slowly mixed into the current policy using a parameter $\beta$, preventing the model from oscillating between drastically different policies.

Advantages of Search-Based Prediction

SEARN offers several distinct advantages over traditional global optimization models:

  • Loss Function Agnosticism: Since SEARN only requires the calculation of a final loss at the end of a search path, it can optimize for any metric, including non-decomposable ones like F-score, ROUGE, or BLEU. This is critical for NLP tasks where these metrics are the standard for evaluation.
  • Feature Flexibility: Unlike CRFs, which often require Markov assumptions to keep inference tractable, SEARN's local classifiers can utilize features from the entire input and any previously made decisions. This allows the model to capture long-range dependencies without increasing computational complexity.
  • Error Recovery: By training on its own generated trajectories rather than just the gold standard, SEARN learns to navigate states that result from its own mistakes, making it more robust during test-time inference.

Experimental Evaluation

The authors evaluated SEARN across a variety of tasks, categorized into sequence labeling and complex structure generation.

Sequence Labeling

On tasks such as Handwriting Recognition, Spanish Named Entity Recognition (NER), and Syntactic Chunking, SEARN demonstrated performance competitive with or superior to state-of-the-art models like CRFs and $M^3Ns$. Notably, SEARN showed superior scalability. On a large handwriting dataset, SEARN achieved an accuracy of 90.91%, whereas $M^3Ns$ failed to complete the task due to memory and time constraints.

Document Summarization

To test SEARN on non-linear structures, the authors applied it to the DUC 2005 multi-document summarization task. Using a "vine-growth" model to produce dependency structures, SEARN-based models outperformed standard baselines and approached the performance of oracle systems, demonstrating its versatility in handling complex, non-sequential outputs.

Discussion and Limitations

While SEARN provides a robust framework, it is not without challenges. The authors noted that the learned policy can occasionally overfit the training trajectories, leading to a performance gap on unseen data. Potential mitigations include the use of cross-validation during the training phase. Additionally, the choice of the initial "gold" policy can influence the speed of convergence, particularly in noisy environments where the ground truth might not represent the most efficient search path.

Conclusion

SEARN represents a significant shift in structured prediction, moving away from rigid global optimization toward a flexible, search-based learning framework. By reducing complex problems to simple classification decisions, it enables the use of arbitrary loss functions and rich feature sets while providing a scalable solution for large-scale structured prediction tasks.

Summary updated

BibTeX
@article{iii2009search,
  author = {Hal Daumé III and John Langford and Daniel Marcu},
  title = {{Search-based structured prediction}},
  journal = {Machine Learning},
  year = {2009},
  doi = {10.1007/s10994-009-5106-x},
}
Figure