Docs / Pragmatics / Probabilistic / Speaker

The speaker of the Rational Speech Act model

import Linglib.Pragmatics.Probabilistic.Speaker · namespace RSA

The speaker believes a measure on states, addresses a listener, and is the softmax of her utility, the expected log of the listener's mass under her belief less a cost. Written without logarithms, her weight for an utterance is the geometric mean of the listener's mass over her belief, to the power of the rationality, times the cost weight. A speaker who knows the state believes the point mass there and weighs an utterance by the listener's mass at the state.

Implementation notes

  • Rationality and cost are arguments, so findings quantify over them.
  • The decision rule is Kernel.softmax, so a speaker whose utility is not an expected log-probability, such as a question- or politeness-weighted one, is that rule at her own score, with ⊥ marking the utterances she cannot use.

References

The speaker

A speaker believes a measure on states and addresses a listener. Her weight for an utterance is the exponential of the rationality times its utility: the expected log of the listener's mass under her belief, less a real cost. Written without logarithms, the weight is the geometric mean of the listener's mass over her belief, to the power of the rationality, times the cost weight exp (-(α * C u)).

The utility of an utterance to a speaker who believes β is the expected log of its listener's mass under β, less its cost: Bergen et al. 2016's equation (3), and with no cost the expectation in Goodman & Stuhlmüller 2013's equation (2) of their utility (3). A state she entertains and the listener rules out makes it ⊥.

utilityL65–70
noncomputable def RSA.utility {W : Type u_1} {U : Type u_2} [MeasurableSpace W] [Fintype W] (C : U → ℝ) (L : U → MeasureTheory.Measure W) (β : MeasureTheory.Measure W) (u : U) :
EReal
  • utility C L β u = ∑ w : W, ↑(β.real {w}) * ((L u) {w}).log - ↑(C u)

Used by speaker, utility_of_absolutelyContinuous, utility_dirac

Used in Pragmatics/Probabilistic/KullbackLeibler, Pragmatics/Probabilistic/Maximin

The speaker at rationality α soft-maximizes her utility against the listener L, believing b o at o: the decision rule of Goodman & Stuhlmüller 2013's equation (2).

speakerL72–76
noncomputable def RSA.speaker {W : Type u_1} {U : Type u_2} {O : Type u_3} [MeasurableSpace W] [MeasurableSpace U] [MeasurableSpace O] [Fintype W] [Fintype U] [Countable O] [MeasurableSingletonClass O] (α : ℝ) (C : U → ℝ) (L : U → MeasureTheory.Measure W) (b : O → MeasureTheory.Measure W) :
ProbabilityTheory.Kernel O U

Built from

Used by speaker_eq_ofWeights, instIsFiniteKernelSpeaker, instIsZeroOrProbabilityMeasureCoeKernelMeasureSpeaker, speaker_apply_univ_le_one, speaker_real_singleton_le_one, speaker_apply_singleton, sum_speaker_real_singleton_le_one, speaker_real_singleton_lt_one, speaker_apply_singleton_eq_mul_of_apply_eq, speaker_eq_softmax_sum_log, isProbabilityMeasure_speaker, isMarkovKernel_speaker, speaker_apply_singleton_ne_zero, speaker_real_singleton_lt_iff, speaker_real_singleton_div, speaker_apply_singleton_eq_zero_iff, speaker_apply_singleton_eq_zero_iff_not_ac, speaker_dirac_eq_ofWeights, speaker_dirac_eq_softmax, isProbabilityMeasure_speaker_dirac, isMarkovKernel_speaker_dirac, speaker_dirac_apply_singleton, speaker_dirac_zero_apply_singleton, speaker_dirac_apply_singleton_of_equiv, speaker_dirac_apply_singleton_eq_zero, speaker_dirac_apply_singleton_ne_zero, speaker_dirac_apply_singleton_ne_zero_iff, speaker_dirac_apply_singleton_eq_one, speaker_dirac_real_singleton, speaker_dirac_zero_real_singleton, speaker_dirac_real_singleton_lt_iff, speaker_dirac_real_singleton_div, speaker_dirac_real_singleton_lt_iff_log, speaker_dirac_real_singleton_of_pair, tendsto_speaker_dirac_real_singleton_atTop, tendsto_speaker_dirac_real_singleton_nhdsGT_zero

Used in Pragmatics/Probabilistic/AlternatingMaximization, Pragmatics/Probabilistic/KullbackLeibler, Pragmatics/Probabilistic/Literal, Pragmatics/Probabilistic/Maximin, Pragmatics/Probabilistic/Parse and 38 more

Her weight for an utterance is the geometric mean of its listener's mass over her belief, to the power α, times the cost weight.

theorem speaker_eq_ofWeightsL78–85
{W : Type u_1} {U : Type u_2} {O : Type u_3} [MeasurableSpace W] [MeasurableSpace U] [MeasurableSpace O] [Fintype W] [Fintype U] [Countable O] [MeasurableSingletonClass O] (α : ℝ) (C : U → ℝ) (L : U → MeasureTheory.Measure W) (b : O → MeasureTheory.Measure W) :
speaker α C L b = ProbabilityTheory.Kernel.ofWeights fun (o : O) (u : U) => ((b o).geomMean fun (w : W) => (L u) {w}) ^ α * ENNReal.ofReal (Real.exp (-(α * C u)))

Built from

L91
L93–94
L96–98
L100–103
L107–112
L114–118
L121–125
L131–144
L149–157
L159–163
L165–169
L171–173
L177–181
L183–189
L191–215
L217–223
L225–229

The speaker who knows the state

The speaker of eqs. 2/6–7 knows the state, so she believes the point mass there, and her weight for an utterance is the listener's mass at the state to the power α, times the cost weight.

A speaker who knows the state weights an utterance by its listener's mass there to the power α, times the cost weight exp (-(α * C u)).

theorem speaker_dirac_eq_ofWeightsL244–249
{W : Type u_1} {U : Type u_2} [MeasurableSpace W] [MeasurableSpace U] [MeasurableSingletonClass W] [Fintype W] [Fintype U] (α : ℝ) (C : U → ℝ) (L : U → MeasureTheory.Measure W) :
speaker α C L MeasureTheory.Measure.dirac = ProbabilityTheory.Kernel.ofWeights fun (w : W) (u : U) => (L u) {w} ^ α * ENNReal.ofReal (Real.exp (-(α * C u)))

Built from

L252–254
L256–259
L261–265
L267–269
L273–277
L279–282
L284–290
L292–295
L297–299
L301–304
L306–312
L314–320
L322–326
L328–336
L338–344
L346–357
L359–369
L383–398
L401–412