Back to Classic ML Mind Map
中文·English
📊 Classic MLID: crf

Linear-Chain CRF

线性链条件随机场
🎯Core Definition
A linear-chain CRF is a discriminative probabilistic model for sequence labeling that models the conditional probability P(yx)P(y \mid x) directly rather than the joint P(x,y)P(x, y). Given observations xx, the probability of a label sequence yy is
📌Overview
P(yx)=1Z(x)exp(tkλkfk(yt1,yt,x,t)),P(y \mid x) = \frac{1}{Z(x)} \exp\Bigl(\sum_{t} \sum_{k} \lambda_k f_k(y_{t-1}, y_t, x, t)\Bigr),
📌Overview
where fkf_k are feature functions (transition features fk(yt1,yt,x,t)f_k(y_{t-1},y_t,x,t) and state features fl(yt,x,t)f_l(y_t,x,t) under one index) that may combine arbitrary overlapping observation features; the partition function Z(x)=yexp()Z(x) = \sum_y \exp(\cdot) sums over all label sequences to normalize the distribution. Parameters λ\lambda are learned by maximizing the conditional log-likelihood with L2 regularization — a convex objective — and decoding the best sequence uses Viterbi.
💡Use Cases
POS tagging, named-entity recognition, segmentation, and shallow parsing; interviews frequently contrast CRFs with HMMs and probe the label-bias problem.
Key Problems Solved
HMMs are generative — they must model the observation distribution with conditionally independent outputs and cannot use overlapping features; more seriously, the locally normalized transitions of HMM/MEMM cause label bias: probability mass is normalized at each state, gets “sucked” toward states with fewer outgoing transitions, and favors low-branching paths. CRFs eliminate label bias through global normalization by Z(x)Z(x), allow rich overlapping features over the observation context, and their convex conditional objective guarantees a global optimum; the cost is iterative training (e.g. L-BFGS / gradient ascent), computing Z(x)Z(x) during inference, and slower training than HMMs.
🎯5 High-Frequency Exam Points
1
Write the linear-chain CRF potential P(yx)=1Z(x)exp(tkλkfk(yt1,yt,x,t))P(y \mid x) = \frac{1}{Z(x)}\exp(\sum_t \sum_k \lambda_k f_k(y_{t-1},y_t,x,t)) and the role of Z(x)Z(x)?
2
How do CRFs and HMMs differ (discriminative vs generative, overlapping features, normalization)?
3
What is the label-bias problem? Why do MEMM/HMM suffer from it and how does CRF fix it?
4
What is the CRF training objective, why is it convex, and which algorithm performs inference?
5
How is the CRF partition function Z(x)Z(x) computed, and how does its complexity relate to the HMM forward algorithm?
📖 In-depth Guide:📄 probabilistic-models
Updated 2026-08-12
🎯
Test Your Knowledge: Practice Questions for "Linear-Chain CRF"
Single choice pitfall questions with instant feedback and mistake tracking.
🚀 Start Card Practice
Previous CardBaum-Welch (HMM EM)Next CardConfusion Matrix

🔗 More Classic ML Knowledge Cards

AdaBoost DerivationBagging & Random ForestGBDT Negative GradientK-Fold Cross-Validation