This post walks through the math for a theorem. It’s intended to be a reference post, which we’ll link back to as-needed from future posts. The question which first motivated this theorem for us was: “Redness of a marker seems like maybe a natural latent over a bunch of parts of the marker, and redness of a car seems like maybe a natural latent over a bunch of parts of the car, but what makes redness of the marker ‘the same as’ redness of the car? How are they both instances of one natural thing, i.e. redness? (or ‘color’?)”. But we’re not going to explain in this post how the math might connect to that use-case; this post is just the math.
Suppose we have multiple distributions P1,…,Pk over the same random variables X1,…,Xn. (Speaking somewhat more precisely: the distributions are over the same set, and an element of that set is represented by values (x1,…,xn).) We take a mixture of the distributions: P[X]:=∑jαjPj[X], where ∑jαj=1 and α is nonnegative. Then our theorem says: if an approximate natural latent exists over P[X], and that latent is robustly natural under changing the mixture weights α, then the same latent is approximately natural over Pj[X] for all j.
Mathematically: the natural latent over P[X] is defined by (x,λ↦P[Λ=λ|X=x]), and naturality means that the distribution (x,λ↦P[Λ=λ|X=x]P[X=x]) satisfies the naturality conditions (mediation and redundancy).The theorem says that, if the joint distribution (x,λ↦P[Λ=λ|X=x]∑jαjPj[X=x]) satisfies the naturality conditions robustly with respect to changes in α, then (x,λ↦P[Λ=λ|X=x]Pj[X=x]) satisfies the naturality conditions for all j. “Robustness” here can be interpreted in multiple ways - we’ll cover two here, one for which the theorem is trivial and another more substantive, but we expect there are probably more notions of “robustness” which also make the theorem work.
Trivial Version
First notion of robustness: the joint distribution (x,λ↦P[Λ=λ|X=x]∑jαjPj[X=x]) satisfies the naturality conditions to within ϵ for all values of α (subject to ∑jαj=1 and α nonnegative).
Then: the joint distribution (x,λ↦P[Λ=λ|X=x]∑jαjPj[X=x]) satisfies the naturality conditions to within ϵ specifically for αj=δjk, i.e. α which is 0 in all entries except a 1 in entry k. In that case, the joint distribution is (x,λ↦P[Λ=λ|X=x]Pk[X=x]), therefore Λ is natural over Pk. Invoke for each k, and the theorem is proven.
... but that's just abusing an overly-strong notion of robustness. Let's do a more interesting one.
Nontrivial Version
Second notion of robustness: the joint distribution (x,λ↦P[Λ=λ|X=x]∑jαjPj[X=x]) satisfies the naturality conditions to within ϵ, and the gradient of the approximation error with respect to (allowed) changes in α is (locally) zero.
We need to prove that the joint distributions (x,λ↦P[Λ=λ|X=x]Pj[X=x]) satisfy both the mediation and redundancy conditions for each j. We’ll start with redundancy, because it’s simpler.
Redundancy
We can express the approximation error of the redundancy condition with respect to Xi under the mixed distribution as
DKL(P[Λ,X]||P[X]P[Λ|Xi])=EX[DKL(P[Λ|X]||P[Λ|Xi])]
where, recall, P[Λ,X]:=P[Λ|X]∑jαjPj[X].
We can rewrite that approximation error as:
EX[DKL(P[Λ|X]||P[Λ|Xi])]
=∑jαjPj[X]DKL(P[Λ|X]||P[Λ|Xi])
=∑jαjEjX[DKL(P[Λ|X]||P[Λ|Xi])]
Note that Pj[Λ|X]=P[Λ|X] is the same under all the distributions (by definition), so:
In other words: if ϵji is the redundancy error with respect to Xi under distribution j, and ϵi is the redundancy error with respect to Xi under the mixed distribution P, then
ϵi≥∑jαjϵji
The redundancy error of the mixed distribution is at least the weighted average of the redundancy errors of the individual distributions.
Since the αjϵji terms are nonnegative, that also means
ϵji≤1αjϵi
which bounds the approximation error for the ith redundancy condition under distribution j. Also note that, insofar as the latent is natural across multiple α values, we can use the α value with largest αj to get the best bound for ϵji.
Mediation
Mediation relies more heavily on the robustness of naturality to changes in α. The gradient of the mediation approximation error with respect to α is:
∂∂αjDKL(P[Λ,X]||P[Λ]∏iP[Xi|Λ])
=∑X,ΛP[Λ|X]Pj[X]lnP[Λ,X]P[Λ]∏iP[Xi|Λ]
(Note: it’s a nontrivial but handy fact that, in general, the change in approximation error of a distribution P[Y] over some DAG dDKL(P[Y]||∏iP[Yi|Ypa(i)]) under a change dP is ∑YdP[Y]lnP[Y]∏iP[Yi|Ypa(i)].)
Note that this gradient must be zero along allowed changes in α, which means the changes must respect ∑jαj=1. That means the gradient must be constant across indices j:
constant=∑X,ΛP[Λ|X]Pj[X]lnP[Λ,X]P[Λ]∏iP[Xi|Λ]
To find that constant, we can take a sum weighted by αj on both sides:
constant=∑jαj∑X,ΛP[Λ|X]Pj[X]lnP[Λ,X]P[Λ]∏iP[Xi|Λ]
=DKL(P[Λ,X]||P[Λ]∏iP[Xi|Λ])
So, robustness tells us that the approximation error under the mixed distribution can be written as
Next, we’ll write out P[Λ,X] as a mixture weighted by α, and use Jensen’s inequality on that mixture and the logarithm:
=Ej[ln∑jαjP[Λ|X]Pj[X]P[Λ]∏iP[Xi|Λ]]
≥Ej[∑jαjlnP[Λ|X]Pj[X]P[Λ]∏iP[Xi|Λ]]
=∑jαjDKL(Pj[Λ,X]||P[Λ]∏iP[Xi|Λ])
Then factorization transfer gives:
≥∑jαjDKL(Pj[Λ,X]||Pj[Λ]∏iPj[Xi|Λ])
Much like redundancy, if ϵji is the mediation error with respect to Xi under distribution j (note that we’re overloading notation, ϵ is no longer the redundancy error), and ϵi is the mediation error with respect to Xi under the mixed distribution P, then the above says
ϵi≥∑jαjϵji
Since the αjϵji terms are nonnegative, that also means
ϵji≤1αjϵi
which bounds the approximation error for the ith mediation condition under distribution j.
Let's interpret the set X as the set of all possible visual sensory experiences x=(x1,…,xn), where xi defines the color of the ith pixel.
Different distributions over elements of this set correspond to observing different objects; for example, we can have Pcar(X) and Papple(X), corresponding to us predicting different sensory experiences when looking at cars vs. apples.
Let's take some specific specific set of observations XO⊂X, from which we'd be trying to derive a latent.
We assume uncertainty regarding what objects generated the training-set observations, getting a mixture of distributions Qα(XO)=αPcar(XO)+(1−α)Papple(XO).
We derive a natural latent Λ for Qα(XO) such that Qα(XO|Λ)=Πx∈XOQα(XO=x|Λ) for all allowed α.
This necessarily implies that Λ also induces independence between different sensory experiences for each individual distribution in the mixture: Pcar(XO|Λ)=Πx∈XOPcar(XO=x|Λ) and Papple(XO|Λ)=Πx∈XOPapple(XO=x|Λ).
If the set XO contains some observations generated by cars and some observations generated by apples, yet a nontrivial latent over the entire set nonetheless exists, then this latent must summarize information about some feature shared by both objects.
For example, perhaps it transpired that all cars depicted in this dataset are red, and all apples in this dataset are red, so Λ=Λredness ends up as "the concept of redness".
This latent then could, prospectively, be applied to new objects. If we later learn of the existence of Pink(X) – an object seeing which predicts yet another distribution over visual experiences – then Λredness would "know" how to handle this "out of the box". For example, if we have a set of observations XO′ such that it contains some red cars and some red ink, then Λredness would be natural over this set under both distributions, without us needing to recompute it.
This trick could be applied for learning new "features" of objects. Suppose we have some established observation-sets Xcars and Xapples, which have nontrivial natural latents Λcar and Λapple. To find new "object-agnostic" latents, we can try to form new sets of observations from subsets of those observations, define corresponding distributions, and see if mixtures of distributions over those subsets have nontrivial latents.
Formally: Xtest=Xspecific-cars∪Xspecific-apples where Xspecific-cars⊂Xcars and Xspecific-apples⊂Xapples, then Hα(Xtest)=αPcar(Xtest)+(1−α)Papple(Xtest), and we want to see if we have a new Λ that induces (approximate) independence between all x∈Xtest both under the "apple" and the "car" distributions.
Though note that it could be done the other way around as well: we could first learn the latents of "redness" and e. g. "greenness" by grouping all red-having and green-having observations, then try to find some subsets of those sets which also have nontrivial natural latents, and end up deriving the latent of "car" by grouping all red and green objects that happen to be cars.
(Which is to say, I'm not necessarily sure there's a sharp divide between "adjectives" and "nouns" in this formulation. "The property of car-ness" is interpretable as an adjective here, and "greenery" is interpretable as a noun.)
I'd also expect that the latent over Xred-cars, i. e. Λred-car, could be constructed out of Λcar and Λredness (derived, respectively, from a pure-cars dataset and an all-red dataset)? In other words, if we simultaneously condition a dateset of red cars on a latent derived from a dataset of any-colored cars and a latent derived from a dateset of red-colored objects, then this combined latent Λredness⋅Λcar would induce independence across Xred-cars (which Λcar wouldn't be able to do on its own, due to the instances sharing color-related information in addition to car-ness)?
All of this is interesting mostly in the approximate-latent regime (this allows us to avoid the nonrobust-to-tiny-mixtures trap), and in situations in which we already have some established latents which we want to break down into interoperable features.
In principle, if we have e. g. two sets of observations that we already know correspond to nontrivial latents, e. g. Xcars and Xapples, we could directly try to find subsets of their union that correspond to new nontrivial latents, in the hopes of recovering some features that'd correspond to grouping observations along some other dimension.
But if we already have established "object-typed" probability distributions Pcar(X) and Papple(X), then hypothesizing that the observations are generated by an arbitrary mixture of these distributions allows us to "wash out" any information that doesn't actually correspond to some robustly shared features of cars-or-apples.
That is: consider if Xtest is 99% cars, 1% apples. Then an approximately correct natural latent over it is basically just Λcar, maybe with some additional noise from apples thrown in. This is what we'd get if we used the "naive" procedure in (1) above. But if we're allowed to mix up the distributions, then "ramping" up the "apple" distribution (defining Qα=0.01(X), say) would end up with low probabilities assigned to all observations corresponding to cars, and now the approximately correct natural latent over this dataset would have more apple-like qualities. The demand for the latent to be valid on arbitraryα∈[0,1] then "washes out" all traces of car-ness and apple-ness, leaving only redness.
Is this about right? I'm getting a vague sense of some disconnect between this formulation and the OP...
This post walks through the math for a theorem. It’s intended to be a reference post, which we’ll link back to as-needed from future posts. The question which first motivated this theorem for us was: “Redness of a marker seems like maybe a natural latent over a bunch of parts of the marker, and redness of a car seems like maybe a natural latent over a bunch of parts of the car, but what makes redness of the marker ‘the same as’ redness of the car? How are they both instances of one natural thing, i.e. redness? (or ‘color’?)”. But we’re not going to explain in this post how the math might connect to that use-case; this post is just the math.
Suppose we have multiple distributions P1,…,Pk over the same random variables X1,…,Xn. (Speaking somewhat more precisely: the distributions are over the same set, and an element of that set is represented by values (x1,…,xn).) We take a mixture of the distributions: P[X]:=∑jαjPj[X], where ∑jαj=1 and α is nonnegative. Then our theorem says: if an approximate natural latent exists over P[X], and that latent is robustly natural under changing the mixture weights α, then the same latent is approximately natural over Pj[X] for all j.
Mathematically: the natural latent over P[X] is defined by (x,λ↦P[Λ=λ|X=x]), and naturality means that the distribution (x,λ↦P[Λ=λ|X=x]P[X=x]) satisfies the naturality conditions (mediation and redundancy).The theorem says that, if the joint distribution (x,λ↦P[Λ=λ|X=x]∑jαjPj[X=x]) satisfies the naturality conditions robustly with respect to changes in α, then (x,λ↦P[Λ=λ|X=x]Pj[X=x]) satisfies the naturality conditions for all j. “Robustness” here can be interpreted in multiple ways - we’ll cover two here, one for which the theorem is trivial and another more substantive, but we expect there are probably more notions of “robustness” which also make the theorem work.
Trivial Version
First notion of robustness: the joint distribution (x,λ↦P[Λ=λ|X=x]∑jαjPj[X=x]) satisfies the naturality conditions to within ϵ for all values of α (subject to ∑jαj=1 and α nonnegative).
Then: the joint distribution (x,λ↦P[Λ=λ|X=x]∑jαjPj[X=x]) satisfies the naturality conditions to within ϵ specifically for αj=δjk, i.e. α which is 0 in all entries except a 1 in entry k. In that case, the joint distribution is (x,λ↦P[Λ=λ|X=x]Pk[X=x]), therefore Λ is natural over Pk. Invoke for each k, and the theorem is proven.
... but that's just abusing an overly-strong notion of robustness. Let's do a more interesting one.
Nontrivial Version
Second notion of robustness: the joint distribution (x,λ↦P[Λ=λ|X=x]∑jαjPj[X=x]) satisfies the naturality conditions to within ϵ, and the gradient of the approximation error with respect to (allowed) changes in α is (locally) zero.
We need to prove that the joint distributions (x,λ↦P[Λ=λ|X=x]Pj[X=x]) satisfy both the mediation and redundancy conditions for each j. We’ll start with redundancy, because it’s simpler.
Redundancy
We can express the approximation error of the redundancy condition with respect to Xi under the mixed distribution as
DKL(P[Λ,X]||P[X]P[Λ|Xi])=EX[DKL(P[Λ|X]||P[Λ|Xi])]
where, recall, P[Λ,X]:=P[Λ|X]∑jαjPj[X].
We can rewrite that approximation error as:
EX[DKL(P[Λ|X]||P[Λ|Xi])]
=∑jαjPj[X]DKL(P[Λ|X]||P[Λ|Xi])
=∑jαjEjX[DKL(P[Λ|X]||P[Λ|Xi])]
Note that Pj[Λ|X]=P[Λ|X] is the same under all the distributions (by definition), so:
=∑jαjDKL(Pj[Λ,X]||P[Λ|Xi]Pj[X])
and by factorization transfer:
≥∑jαjDKL(Pj[Λ,X]||Pj[Λ|Xi]Pj[X])
In other words: if ϵji is the redundancy error with respect to Xi under distribution j, and ϵi is the redundancy error with respect to Xi under the mixed distribution P, then
ϵi≥∑jαjϵji
The redundancy error of the mixed distribution is at least the weighted average of the redundancy errors of the individual distributions.
Since the αjϵji terms are nonnegative, that also means
ϵji≤1αjϵi
which bounds the approximation error for the ith redundancy condition under distribution j. Also note that, insofar as the latent is natural across multiple α values, we can use the α value with largest αj to get the best bound for ϵji.
Mediation
Mediation relies more heavily on the robustness of naturality to changes in α. The gradient of the mediation approximation error with respect to α is:
∂∂αjDKL(P[Λ,X]||P[Λ]∏iP[Xi|Λ])
=∑X,ΛP[Λ|X]Pj[X]lnP[Λ,X]P[Λ]∏iP[Xi|Λ]
(Note: it’s a nontrivial but handy fact that, in general, the change in approximation error of a distribution P[Y] over some DAG dDKL(P[Y]||∏iP[Yi|Ypa(i)]) under a change dP is ∑YdP[Y]lnP[Y]∏iP[Yi|Ypa(i)].)
Note that this gradient must be zero along allowed changes in α, which means the changes must respect ∑jαj=1. That means the gradient must be constant across indices j:
constant=∑X,ΛP[Λ|X]Pj[X]lnP[Λ,X]P[Λ]∏iP[Xi|Λ]
To find that constant, we can take a sum weighted by αj on both sides:
constant=∑jαj∑X,ΛP[Λ|X]Pj[X]lnP[Λ,X]P[Λ]∏iP[Xi|Λ]
=DKL(P[Λ,X]||P[Λ]∏iP[Xi|Λ])
So, robustness tells us that the approximation error under the mixed distribution can be written as
DKL(P[Λ,X]||P[Λ]∏iP[Xi|Λ])=constant=∑X,ΛP[Λ|X]Pj[X]lnP[Λ,X]P[Λ]∏iP[Xi|Λ]
for any j.
Next, we’ll write out P[Λ,X] as a mixture weighted by α, and use Jensen’s inequality on that mixture and the logarithm:
=Ej[ln∑jαjP[Λ|X]Pj[X]P[Λ]∏iP[Xi|Λ]]
≥Ej[∑jαjlnP[Λ|X]Pj[X]P[Λ]∏iP[Xi|Λ]]
=∑jαjDKL(Pj[Λ,X]||P[Λ]∏iP[Xi|Λ])
Then factorization transfer gives:
≥∑jαjDKL(Pj[Λ,X]||Pj[Λ]∏iPj[Xi|Λ])
Much like redundancy, if ϵji is the mediation error with respect to Xi under distribution j (note that we’re overloading notation, ϵ is no longer the redundancy error), and ϵi is the mediation error with respect to Xi under the mixed distribution P, then the above says
ϵi≥∑jαjϵji
Since the αjϵji terms are nonnegative, that also means
ϵji≤1αjϵi
which bounds the approximation error for the ith mediation condition under distribution j.