Berger, Della Pietra and Della Pietra (1996): A Maximum Entropy Approach to Natural Language Processing #
Berger, Della Pietra and Della Pietra model a process that outputs y in a context x by the
most uniform conditional distribution consistent with the statistics of a sample. A statistic is
the expectation of a feature f(x, y); a model satisfies its constraint when its expectation of
the feature, averaged over the sample's contexts, is the sample's (4), and among the models
satisfying every constraint the maximum entropy principle chooses the one of greatest conditional
entropy (5)–(6). The maximizer of the Lagrangian (7) for fixed multipliers λ has the
exponential form (10), and the maximum entropy model is the member of that family that maximizes
the likelihood of the sample (§3.5).
The motivating example (§2) translates English in by one of five French phrases. With only the
phrases known the most uniform model is uniform; requiring p(dans) + p(en) = 3/10 makes it
3/20, 3/20, 7/30, 7/30, 7/30; adding p(dans) + p(à) = 1/2 gives the solution the paper leaves
to the reader (§3.4), with p(dans) = (9 − √51)/10.
Main results #
isGreatest_uniform,isGreatest_two,isGreatest_three: the maximum entropy models of §2.lagrangian_le_lagrangian_model: the modelp_λof (10) maximizes the Lagrangian (8).lagrangian_model_eq_neg_logLik: the value of the Lagrangian atp_λis minus the log-likelihood (13) ofp_λ.model_mem_constraints,isGreatest_condEntropy_model,condEntropy_model_eq_neg_logLik: the Kuhn–Tucker conclusion of §3.5. The parameters of greatest likelihood give the maximum entropy model inC, whose entropy is minus that likelihood.eq_model_of_condEntropy_eq: the maximum entropy model is unique at the observed contexts.concaveOn_logLik_model: the log-likelihood is concave in the parameters (§3.6).
Implementation notes #
- Features are real-valued,
f : X × Y → ι → ℝ, binary in the paper. The model (10) isHarmonicGrammar.condMaxEnt f (-λ), the substrate's harmony being minus the weighted statistic, and the paper's conditional entropy (5) isH[Prod.snd | Prod.fst ; p̃.fst ⊗ₘ q], its footnote 1'sH(Y | X)under the jointp̃(x) p(y|x). - With the Lagrangian (7), the value at its maximizer is
∑ p̃(x) log Z_λ(x) − λ · p̃(f), which is−L(p_λ); (11) prints this dual function with the opposite sign, asL(p_λ)(14), and so poses the dual as a maximization. The dual of (7) is minimized; maximizingL(p_λ)is the same problem. - §3.3 says the maximum entropy model in
Cis unique; it is unique at the contexts of positive empirical mass, and unconstrained at the others.
TODO #
- Footnote 2's unattained case, where the maximum entropy model is a limit of models
p_λ. - Improved iterative scaling (§3.6), feature selection (§4) and the applications of §5.
References #
The translation example (§2) #
Equations
- BergerDellaPietraDellaPietra1996.instDecidableEqPhrase x✝ y✝ = if h : x✝.ctorIdx = y✝.ctorIdx then isTrue ⋯ else isFalse ⋯
Equations
- One or more equations did not get rendered due to their size.
The feature of the second constraint, the expert choosing dans or en.
Equations
Instances For
The feature of the third constraint, the expert choosing dans or à.
Equations
Instances For
Knowing only the five phrases, the maximum entropy model is uniform. With no features, every distribution satisfies the constraints, and the uniform one has the greatest entropy.
The statistic of the first two constraints.
Equations
Instances For
The model maximizing entropy subject to p(dans) + p(en) = 3/10.
Equations
Instances For
Requiring p(dans) + p(en) = 3/10, the most uniform model gives dans and en 3/20 each
and the other three phrases 7/30 each.
The statistic of all three constraints.
Equations
Instances For
A positive distribution of the five phrases in which au cours de and pendant are equally
likely and p(en) p(à) = p(dans) p(au cours de) is the exponential model of threeFeatures, the
exponentials of the two multipliers being p(en)/p(au cours de) and p(à)/p(au cours de).
The model maximizing entropy subject to all three constraints, which §3.4 leaves to the reader.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Requiring also p(dans) + p(à) = 1/2, the most uniform model gives dans (9 − √51)/10.
Maximum entropy modeling (§3) #
The models satisfying the constraints (4), conditional distributions whose expectations of the features, averaged over the sample's contexts, are the sample's.
Equations
- BergerDellaPietraDellaPietra1996.constraints f p = {q : ProbabilityTheory.Kernel X Y | ProbabilityTheory.IsMarkovKernel q ∧ ∫ (z : X × Y), f z ∂p.fst.compProd q = ∫ (z : X × Y), f z ∂p}
Instances For
The exponential model (10) with multipliers θ, the paper's λ.
Equations
Instances For
The Lagrangian (7), the conditional entropy (5) plus each multiplier times its constraint's violation.
Equations
- BergerDellaPietraDellaPietra1996.lagrangian f p q θ = InformationTheory.condEntropy Prod.snd Prod.fst (p.fst.compProd q) + θ ⬝ᵥ (∫ (z : X × Y), f z ∂p.fst.compProd q - ∫ (z : X × Y), f z ∂p)
Instances For
The log-likelihood (13) of a conditional model on the sample.
Equations
- BergerDellaPietraDellaPietra1996.logLik p q = ∫ (z : X × Y), Real.log ((q z.1).real {z.2}) ∂p
Instances For
The model p_θ maximizes the Lagrangian for fixed multipliers (8), (10).
The value of the Lagrangian at its maximizer is minus the log-likelihood of p_θ.
The parameters of greatest likelihood give a model satisfying the constraints.
The Kuhn–Tucker conclusion of §3.5. The model in the parametric family that maximizes the
likelihood of the sample is the maximum entropy model in C.
The primal and dual values agree, the greatest entropy in C being minus the greatest
log-likelihood.
A model in C with the greatest entropy is the maximum entropy model at every context of
positive empirical mass.
The log-likelihood of the model is concave in the multipliers (§3.6).