Abstract
Structure learning of Conditional Random Fields (CRFs) can be cast into an L1-regularized optimization problem. To avoid optimizing over a fully linked model, gain-based or gradient-based feature selection methods start from an empty model and incrementally add top ranked features to it. However, for high-dimensional problems like statistical relational learning, training time of these incremental methods can be dominated by the cost of evaluating the gain or gradient of a large collection of candidate features. In this study we propose a fast feature evaluation algorithm called Contrastive Feature Induction (CFI), which only evaluates a subset of features that involve both variables with high signals (deviation from mean) and variables with high errors (residue). We prove that the gradient of candidate features can be represented solely as a function of signals and errors, and that CFI is an efficient approximation of gradient-based evaluation methods. Experiments on synthetic and real data sets show competitive learning speed and accuracy of CFI on pairwise CRFs, compared to state-of-the-art structure learning methods such as full optimization over all features, and Grafting.
Introduction
Conditional Random Fields (CRFs) are widely utilized for modeling dependencies in structured data. A critical challenge in deploying CRFs is structure learning—identifying the optimal set of features to include in the model. Traditional approaches generally fall into two categories: full optimization via L1-regularization, which is computationally intensive due to dense graph inference, and incremental feature induction (e.g., Grafting), which suffers from an "evaluation bottleneck" in high-dimensional spaces. In the latter, evaluating the potential gain of every candidate feature at each step becomes the primary computational cost.
Contrastive Feature Induction (CFI)
To address the evaluation bottleneck, we introduce Contrastive Feature Induction (CFI). This method is grounded in two theoretical developments:
- Mean Field Contrastive Divergence ($CD^{MF}$): We utilize a 1-step mean field approximation to the log-likelihood, providing a tractable objective function.
- Gradient Decomposition Theorem (GDT): We demonstrate that the gradient of a candidate feature can be decomposed into a function of Signals (deviation of a variable's state from its mean) and Errors (the difference between current model estimates and ground truth).
The CFI algorithm leverages this decomposition by only evaluating features that involve variables exceeding specific thresholds for signal ($t_{sig}$) and error ($t_{err}$). This heuristic significantly reduces the search space; for instance, if only 10% of variables are "active" based on these thresholds, the number of candidate features to evaluate decreases by two orders of magnitude.
As shown in Figure 1, the choice of threshold involves a trade-off between training speed and model quality. A threshold around 0.2 often provides a robust balance, maintaining high accuracy while drastically reducing the number of active features and total training time.
Experimental Evaluation
We evaluated CFI against Grafting and Full-L1 optimization using synthetic datasets (graph sizes $N=100$ to $500$) and real-world relational datasets (Animal and Nation). The synthetic data allowed for controlled testing of scalability and the ability to recover ground-truth structures.
Results and Discussion
CFI demonstrates superior scalability and efficiency compared to baseline methods. On the high-dimensional Nation dataset, CFI completed training in 0.54 minutes, compared to 4.2 minutes for Grafting and 6.5 minutes for Full-L1. Furthermore, CFI achieved an AUC of 93.6, outperforming both Full-L1 (88.8) and Grafting (90.2).
Figure 3 illustrates the scalability of CFI. As graph size $N$ increases, CFI maintains a significantly lower training time and a smaller number of active features compared to Full-L1, while achieving better or comparable log-likelihood (CLL) and AUC than Grafting. Interestingly, CFI often avoids overfitting to noisy gradients, leading to improved generalization performance.
Conclusion
Contrastive Feature Induction offers a principled and efficient approach to structure learning in CRFs. By focusing computation on "high-impact" variables—those with significant prediction errors or signals—CFI bypasses the evaluation bottleneck inherent in incremental methods. While currently validated on pairwise interactions and dependent on threshold tuning, the theoretical foundation of CFI suggests broad applicability to higher-order features and various graphical model architectures.
Summary updated