Structured Prediction and Parsing Evaluation › Training Objectives for Structured Predictors
Language AI HandbookAll chapters The training objective shapes the scoring function. The following sections compare local cross-entropy, global likelihood, and margin-based objectives.
Local Cross-Entropy
A local approach treats each decision as an independent classification problem. For each token, predict a distribution over heads with a softmax, and minimize the cross-entropy against the gold head. For each arc, predict a distribution over labels and do the same.
This is local training: each head softmax is normalized over the possible heads of one dependent, so selecting from it already gives that word one head. What it does not impose is that all selected heads jointly form an acyclic tree with the required root convention. During supervised training, label cross-entropy can condition on a gold head, as in this biaffine dependency parser. During decoding, the trained label scorer can label selected candidate arcs; record the actual conditioning for the system. These are valid local conditional probabilities under the model, but multiplying them over all independent head choices does not generally give a normalized distribution restricted to legal trees. Local or global models can be miscalibrated on held-out data; consistency of the training annotations does not guarantee calibration.
Global Likelihood and the Inside Algorithm
A conditional random field defines a distribution over legal structures when its partition function satisfies .
where:
- : the conditional probability of structure given input
- : the model's score for structure
- : the set of valid structures for input
- : the partition function, summing over all valid
The inside algorithm sums derivation weights. To recover the structure weights in the definition above, sum the weights of all derivations representing each structure. Summing those grouped weights gives the intended when each group has its structure's intended weight. This holds, for example, if every legal structure has one derivation of the same weight. Training maximizes the gold tree’s log-likelihood. For the objective below to be finite, the gold tree must be legal and have a finite score.
For a fixed finite legal set and finite feature vectors, a linear score gives a negative log-likelihood gradient of expected feature counts minus observed feature counts.
Here is the complete structure's feature vector and the expectation ranges over the legal output set. Differentiating the positive log-likelihood reverses this sign. For decomposable features on the finite projective charts considered here, inside-outside marginals provide the expectations; differentiating a log-partition computation is another implementation route. A different output family can need a different partition-function algorithm. The Conditional Random Fields chapter introduces the corresponding negative log-likelihood objective for tag sequences. For a linear score, the negative log-likelihood gradient has the same expected-minus-observed form in both cases, with tree states replacing chain states for the expectation here.
The payoff is an explicitly normalized distribution over the selected legal structures, with marginals defined by that distribution. Its probabilities are only as useful as the model and data justify; global normalization alone does not establish calibration to real error frequencies. For the stated projective factorization, max decoding and sum-based partition computation have similar polynomial chart shapes, but local head normalization is a different computational problem and need not share their asymptotic cost.
Max-Margin and the Perceptron
The structured perceptron uses an online update: predict the highest-scoring structure and, when it differs from gold, add the gold-minus-predicted feature vector to the weights. With zero initialization, exact decoding, a positive separating margin on the finite training set, and bounded feature differences, the update makes only finitely many training mistakes. The same argument need not apply with approximate decoding or nonseparable data.
The structured SVM adds a margin and a loss term:
where:
- : the weight vector being learned
- : a positive weight on the hinge loss. A larger penalizes margin violations more relative to the squared norm.
- : an example (sentence) index, with gold structure and input
- : a legal candidate structure for , drawn from
- : the loss (for example Hamming or F1 loss) incurred by predicting when the gold is
- : the feature vector for a structure on input
The inner max is loss-augmented decoding: find the structure that maximizes score plus loss. For Hamming loss over aligned attachment decisions, add one to each incorrect candidate decision before maximizing, or equivalently subtract one from the gold decision up to a fixed additive constant. Boosting gold arcs would have the opposite effect. If the loss scores the root choice, apply the same adjustment when comparing the final root candidates. F1 loss generally does not decompose into independent arc penalties, so its loss-augmented inference needs a separately justified method.
The Loss-Metric Mismatch
These training objectives differ from the reported evaluation scores, even when the hinge uses a loss defined from one of those scores. With the same nonempty set of aligned scored words and the same root convention, head Hamming loss divided by the scored word count equals . Log-likelihood measures the probability assigned to gold structures on a log scale. UAS counts correct heads, and constituency F1 measures labeled constituent overlap. A model can improve likelihood while getting worse F1. Compare both on held-out data.
The mismatch has three practical consequences:
- Select with a declared development objective. If the deployment goal is LAS, monitor development LAS as well as loss and fix the model-selection rule before testing. Their optima need not occur at the same checkpoint.
- Measure calibration separately. Both local and globally normalized models produce probabilities in their specified domains. Check their reliability against observed outcomes if you intend to interpret confidence numerically.
- Separate training from decision rules. Minimum-risk inference chooses an output for a specified test-time loss. During margin-based training, loss-augmented inference finds a legal structure maximizing model score plus loss.
Comments
Add to the conversation
A question, a correction, or an example from your own work.
No comments yet. Be the first to share your thoughts!