Documentation

Studies.Jaeger2007

Jäger (2007): Maximum Entropy Models and Stochastic Optimality Theory #

This file formalizes Jäger's result that Boersma's Gradual Learning Algorithm (GLA) for Stochastic Optimality Theory is stochastic gradient ascent on the log-likelihood of a maximum entropy model of the kind Goldwater and Johnson propose. The expected GLA adjustment is the plasticity times the excess of the expected violations over the observed, which is the gradient of the log-likelihood once violations are read as non-positive features. Since that log-likelihood is concave, the maximum entropy learner reaches its global maximum, the guarantee Stochastic OT lacks. The file also reruns Boersma and Levelt's acquisition simulation over five syllable-structure constraints.

Main results #

Implementation notes #

References #

The Gradual Learning Algorithm as Stochastic Gradient Ascent #

noncomputable def Jaeger2007.glaSign (r η : ℝ) (obs hyp : ℕ) :
ℝ

The GLA update of Section 2 on a single rank, which adds the plasticity times the sign of the excess of the sampled hypothesis's violations over the observation's.

Equations
Instances For
    def Jaeger2007.glaUpdate (r η : ℝ) (obs hyp : ℕ) :
    ℝ

    The GLA update of a rank on binary constraints, which adds the plasticity times the excess of the sampled hypothesis's violations over the observation's, raising a constraint that favours the observation and lowering one that favours the hypothesis.

    Equations
    Instances For
      theorem Jaeger2007.glaSign_eq_glaUpdate (r η : ℝ) {obs hyp : ℕ} (ho : obs ≤ 1) (hh : hyp ≤ 1) :
      glaSign r η obs hyp = glaUpdate r η obs hyp

      On binary constraints the sign is idle, and the GLA update is the plain excess.

      theorem Jaeger2007.expected_glaUpdate {O : Type u_1} [Fintype O] (p : O → ℝ) (hp : ∑ h : O, p h = 1) (c : O → ℕ) (o : O) (r η : ℝ) :
      ∑ h : O, p h * glaUpdate r η (c o) (c h) = r + η * (∑ h : O, p h * ↑(c h) - ↑(c o))

      Over a distribution on the hypotheses, the expected GLA update of a rank is the plasticity times the excess of the expected violations over the observed (equation (1)).

      theorem Jaeger2007.expected_glaUpdate_eq_self_iff {O : Type u_1} [Fintype O] (p : O → ℝ) (hp : ∑ h : O, p h = 1) (c : O → ℕ) (o : O) (r : ℝ) {η : ℝ} (hη : η ≠ 0) :
      ∑ h : O, p h * glaUpdate r η (c o) (c h) = r ↔ ∑ h : O, p h * ↑(c h) = ↑(c o)

      The learner is at rest exactly when the expected and the observed violations agree, the convergence criterion of Section 4 shared by the GLA and Stochastic Gradient Ascent.

      theorem Jaeger2007.hasDerivAt_log_maxEnt_update {O : Type u_1} [Fintype O] {I : Type u_2} [MeasurableSpace O] [MeasurableSingletonClass O] {n : ℕ} (con : OptimalityTheory.ConstraintSet (I × O) (Fin n)) (w : Fin n → ℝ) (j : Fin n) (i : I) (o : O) (t : ℝ) :
      HasDerivAt (fun (t : ℝ) => Real.log ((HarmonicGrammar.maxEnt (OptimalityTheory.ConstraintSet.comap (fun (x : O) => (i, x)) con).violations (Function.update w j t)).real {o})) ((∫ (o' : O), (OptimalityTheory.ConstraintSet.comap (fun (x : O) => (i, x)) con).violations o' ∂HarmonicGrammar.maxEnt (OptimalityTheory.ConstraintSet.comap (fun (x : O) => (i, x)) con).violations (Function.update w j t)) j - ↑(con j (i, o))) t

      With the other weights held fixed, the derivative of the log probability of an observation in weight j is its expected violations of constraint j less the observed ones, which is the observed feature less its expectation once violations are read as non-positive features (equation (2)).

      def Jaeger2007.sgaUpdate (r η observed sampled : ℝ) :
      ℝ

      The Stochastic Gradient Ascent step of Section 4 on a single weight, which follows the gradient (2) with the empirical expectation replaced by the observed feature value and the model's expectation by the feature value of a sampled hypothesis.

      Equations
      Instances For
        theorem Jaeger2007.gla_eq_sga (r η : ℝ) (obs hyp : ℕ) :
        glaUpdate r η obs hyp = sgaUpdate r η (-↑obs) (-↑hyp)

        The GLA update is the Stochastic Gradient Ascent step once violations are read as the non-positive features of the maximum entropy model (Section 4).

        The Dutch syllable types of Table 1 #

        @[reducible, inline]

        A syllable type, given by the numbers of consonants in its onset and its coda, at most two each.

        Equations
        Instances For

          The nine types of Table 1.

          Equations
          Instances For
            Equations
            Instances For
              Equations
              Instances For
                Equations
                Instances For
                  Equations
                  Instances For
                    Equations
                    Instances For
                      Equations
                      Instances For
                        Equations
                        Instances For
                          Equations
                          Instances For
                            def Jaeger2007.Row.ofDatum (e : Datum) :
                            Option (Syl × ℕ)

                            The row of Table 1 recorded by an example, a syllable type with its frequency in permyriad.

                            Equations
                            • Jaeger2007.Row.ofDatum e = do let on ← e.nat? "onset" let co ← e.nat? "coda" let f ← e.nat? "permyriad" if h : on < 3 ∧ co < 3 then some ((⟨on, ⋯⟩, ⟨co, ⋯⟩), f) else none
                            Instances For
                              def Jaeger2007.rows :
                              List (Syl × ℕ)

                              Table 1.

                              Equations
                              Instances For

                                The constraints of Section 5 #

                                *CODA, which penalizes a coda.

                                Equations
                                Instances For

                                  ONSET, which penalizes a vowel-initial syllable.

                                  Equations
                                  Instances For

                                    *COMPLEXCODA, which penalizes a complex coda.

                                    Equations
                                    Instances For

                                      *COMPLEXONSET, which penalizes a complex onset.

                                      Equations
                                      Instances For

                                        FAITH, which penalizes an output that differs from its input.

                                        Equations
                                        Instances For

                                          The constraint set, in the order of the converged ranking FAITH ≫ *COMPLEXONSET ≫ *COMPLEXCODA ≫ ONSET ≫ *CODA.

                                          Equations
                                          Instances For
                                            def Jaeger2007.cands :
                                            Syl → Finset Syl

                                            Every syllable type is a candidate output for every input.

                                            Equations
                                            Instances For
                                              theorem Jaeger2007.faithful_iff (σ : OptimalityTheory.Ranking (Fin 5) 5) (i : Syl) :
                                              OptimalityTheory.PicksAt cands con σ i i ↔ ∀ (k : Fin 5), con k (i, i) = 1 → σ.Dominates 0 k

                                              A ranking produces an input faithfully exactly when every markedness constraint the input violates is ranked below FAITH.

                                              def Jaeger2007.produced (S : Finset (Fin 5)) :
                                              Finset Syl

                                              The syllable types produced faithfully once the markedness constraints in S are below FAITH, namely those violating no other markedness constraint.

                                              Equations
                                              Instances For
                                                theorem Jaeger2007.mem_produced_iff (σ : OptimalityTheory.Ranking (Fin 5) 5) (i : Syl) :
                                                i ∈ produced (Finset.filter (σ.Dominates 0) Finset.univ) ↔ OptimalityTheory.PicksAt cands con σ i i

                                                The types a ranking produces faithfully are those of the stage it is at.

                                                theorem Jaeger2007.produced_stages :
                                                produced ∅ = {cv} ∧ produced {4} = {cv, cvc} ∧ produced {4, 3} = {cv, cvc, v, vc} ∧ produced {4, 3, 2} = {cv, cvc, v, vc, cvcc, vcc} ∧ produced {4, 3, 2, 1} = Finset.univ

                                                The stages at which FAITH overtakes *CODA, ONSET, *COMPLEXCODA and *COMPLEXONSET in turn produce the syllable types in the nested order CV; CVC; V, VC; CVCC, VCC; CCV, CCVC, CCVCC.

                                                theorem Jaeger2007.cv_unmarked (i : Syl) (k : Fin 5) :
                                                k ≠ 0 → con k (i, cv) = 0

                                                CV violates no markedness constraint.

                                                theorem Jaeger2007.initial_glaUpdate (r η : ℝ) (o : Syl) (k : Fin 5) (hk : k ≠ 0) :
                                                ∑ h : Syl, Pi.single cv 1 h * glaUpdate r η (con k (o, o)) (con k (o, h)) = r - η * ↑(con k (o, o))

                                                A learner producing CV with certainty, the initial state with FAITH at 0 and the markedness constraints at 10, lowers each markedness rank by the plasticity times the observation's violations, (1).

                                                def Jaeger2007.corpusRate (k : Fin 5) :
                                                ℕ

                                                The violation rate of a constraint in the corpus of Table 1, in permyriad.

                                                Equations
                                                Instances For

                                                  FAITH is never violated in the corpus, and the markedness ranks fall fastest for *CODA, then ONSET, *COMPLEXCODA and *COMPLEXONSET, the order in which FAITH overtakes them.