NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Structured learning with constrained conditional models

Ming-Wei Chang, Lev-Arie Ratinov, Dan Roth

Abstract

In many structured prediction tasks, such as information extraction and natural language processing, decisions involve complex, interdependent variables. While traditional statistical models like Hidden Markov Models (HMMs) and Conditional Random Fields (CRFs) excel at capturing local dependencies, they often struggle with global, non-local constraints. This paper presents Constrained Conditional Models (CCMs), a framework that allows for the injection of human knowledge into statistical models via declarative constraints. By separating local features from global rules, CCMs enable more accurate structured predictions. Furthermore, the authors introduce Constraint-Driven Learning (CoDL), a semi-supervised algorithm that leverages these constraints to effectively utilize unlabeled data, significantly reducing the need for extensive manual labeling.

Introduction

Structured prediction is a cornerstone of modern Natural Language Processing (NLP). Tasks such as citation parsing or advertisement extraction require the model to assign labels to a sequence of tokens where the labels are highly interdependent. For instance, in a bibliographic citation, if a word is labeled as "Author," the subsequent word is highly likely to share that label.

Traditional approaches typically rely on local dependencies (e.g., word-to-word transitions). However, they frequently fail to capture global requirements, such as "a citation must contain exactly one title" or "the date should appear only once." Incorporating these non-local dependencies directly into the model's graphical structure often leads to computational intractability during training and inference. Consequently, researchers are often forced to choose between simple, tractable models that produce globally inconsistent outputs and complex, task-specific models that are difficult to train. CCMs bridge this gap by treating global constraints as an optimization layer on top of statistical models.

The Constrained Conditional Model (CCM) Framework

The CCM framework decouples the learning of local features from the enforcement of global constraints. Instead of embedding every rule into a complex probability distribution, a CCM treats the problem as an optimization task: finding the assignment that maximizes a linear score while accounting for penalties associated with constraint violations.

Declarative Constraints

Constraints in a CCM are typically expressed as declarative rules, often using first-order logic. These constraints are "grounded" into the model and can be categorized as:

  • Hard Constraints: Rules that must never be violated (e.g., "a field cannot be both a Title and an Author").
  • Soft Constraints: Rules that are preferred but can be violated at a cost (e.g., "a Date usually appears near the end of a citation").

Implementation and Inference

A common implementation discussed is the HMM-CCM, which augments a generative HMM with a constraint violation score, effectively creating a "product of experts" where the HMM handles local transitions and the constraints handle global structure.

Because global constraints break the standard dynamic programming structures (like the Viterbi algorithm), the authors utilize several inference strategies to find the optimal global assignment, including:

  • Integer Linear Programming (ILP): For exact inference.
  • A* Search and Beam Search: For efficient approximate inference in larger search spaces.

Constraint-Driven Learning (CoDL)

One of the primary contributions of this work is CoDL, a semi-supervised learning algorithm. CoDL addresses the "data hunger" of statistical models by using constraints as a form of "cheap" supervision. The process begins with a small amount of labeled data to train an initial model. This model, guided by the global constraints, is then used to label a large pool of unlabeled data. This "pseudo-labeled" data—now more likely to be globally consistent due to the constraints—is then used to retrain and refine the model iteratively. This approach proves significantly more stable than standard Expectation-Maximization (EM) or "hard-EM," which can degrade if the model's initial assumptions are slightly off.

Experimental Evaluation

The CCM framework and CoDL algorithm were evaluated on two classic information extraction tasks:

  1. Citations: Identifying fields (Author, Title, Date, etc.) in a dataset of 500 labeled and 5,000 unlabeled bibliographic references.
  2. Apartment Advertisements: Extracting fields (Rent, Features, Neighborhood, etc.) from 302 labeled and 8,767 unlabeled Craigslist advertisements.

Key Insights and Results

Constraints as Supervision

The experiments demonstrated that logical constraints can act as a powerful substitute for labeled data. On the Citations task, using only 5 labeled examples, the addition of constraints increased accuracy from 58.48% to 71.64%. When CoDL was applied to incorporate unlabeled data alongside those 5 examples, accuracy further improved to 77.65%.

Efficiency and Modularity

In the Advertisements domain, a CCM trained on just 20 labeled samples outperformed a standard HMM trained on 100 samples, representing a 5x reduction in required human labeling. Furthermore, the modularity of the CCM framework allows researchers to add new rules to a pre-trained model without retraining the entire system, facilitating rapid iteration and the reuse of off-the-shelf components.

Comparison to Specialized Models

The general CCM framework achieved performance levels comparable to, and in some cases exceeding, highly engineered, task-specific models (such as semi-CRFs). This suggests that a general-purpose framework for injecting constraints can be as effective as building a custom model architecture for every new problem.

Conclusion and Future Work

Constrained Conditional Models provide a robust framework for combining the strengths of statistical learning with the precision of human-provided logic. By treating constraints as an optimization component rather than a structural one, CCMs maintain tractability while achieving high accuracy in complex domains.

Future research directions include exploring more principled semi-supervised algorithms for discriminative models like the Structured Perceptron and investigating sampling-based inference methods, such as Gibbs sampling, to handle increasingly complex constraint sets in even larger output spaces.

Summary updated

BibTeX
@article{chang2012structured,
  author = {Ming-Wei Chang and Lev-Arie Ratinov and Dan Roth},
  title = {{Structured learning with constrained conditional models}},
  journal = {Machine Learning},
  year = {2012},
  doi = {10.1007/s10994-012-5296-5},
}
Figure