# Small Steps Towards Proving Stochastic → Deterministic Natural Latent

The story so far
================

We (Alfred and Jeremy) started a Dovetail project on Natural Latents in order to get some experience with the proofs. Originally we were going to take a crack at [this bounty](https://www.lesswrong.com/posts/e9KwDDdAxborNSuCd/usd500-bounty-problem-are-approximately-deterministic), but just before we got started John and David published [a proof](https://www.lesswrong.com/posts/Gd36HT7qLr684SYuQ/stochastic-natural-latent-implies-deterministic-natural?utm_campaign=post_share&utm_source=link), closing the bounty. This proof involves a series of transformations that can take any stochastic latent, and transform it into a deterministic latent, where each step can only increase the error by a small multiple. We decided to work through the proof and understand each step, and attempt to improve the bound. After 20 hours or so working through it, we found a [fatal flaw](https://www.lesswrong.com/posts/cpxxfagD92ivLZCp4/resampling-conserves-redundancy-approximately?commentId=L6dpFjFmgpEtNuycc) in one step of the proof, and spent the next several days understanding and verifying it. With David’s help, the counterexamples we found [were strengthened](https://www.lesswrong.com/posts/cpxxfagD92ivLZCp4/resampling-conserves-redundancy-approximately?commentId=GTEWrKsD4FgyrxwwE) to show that this transformation step had unbounded error on some cases. We started using sympy for arbitrary precision evaluation of counterexamples, and along the way found a [bug in sympy](https://www.lesswrong.com/posts/cpxxfagD92ivLZCp4/resampling-conserves-redundancy-approximately?commentId=ojRfmKGrqH5jHEkJM) that occasionally caused us some problems. We switched to Mathematica.

Since then, we’ve been working part time on trying to prove the bounty conjecture ourselves (or show that the conjecture is false). Ultimately we’ve been unsuccessful so far, but it still feels tantalizingly within reach. Perhaps an automated theorem prover will crack it in the next year or two. It makes a good test case.

Empirical evidence suggests the conjecture is true
--------------------------------------------------

We still think the overall bounty conjecture \[(∃ Stochastic Natural Latent) Implies (∃ Deterministic Natural Latent)\] is true. In fact, the largest difference in errors that we can find empirically is around 1.82. (i.e. optimal deterministic sum of errors < 1.82 * optimal stochastic sum of errors).

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/a6ec496194445ec29f5a0f134bfc19e6daf733bd15f0d645.png)

In our quest, we made lots of graphs like the above. Each point on the orange and blue curve is the score of a numerically optimized latent distribution $P[\Lambda|X,Y]$, for a fixed $P[X,Y]$. For simplicity, all three of $\Lambda, X,Y$ are binary variables. In this graph, the maximal difference between the blue and orange lines is ~1.82. On the x-axis, Delta represents the correlation between X and Y. For this graph, the marginal distributions are fixed at $P[X] = P[Y] = \{0.5,0.5\}$. Changing the marginals has some effect on the graphs, but doesn’t seem to increase the difference between Stochastic and Deterministic scores.

### Larger N

One way the conjecture could fail is by larger X and Y variables allowing larger differences. This is more difficult to reliably check numerically, because we’ve found there are a lot of local optima for our numerical optimizer to get stuck on, and this problem gets quickly much worse as N increases.

We did a long running Bayesian optimization outer loop over 3x3 $P[X,Y]$ distributions, and an inner loop to find the optimal stochastic and optimal deterministic latent. The largest differences found clustered around 1.79 (apart from a few larger ones that turned out to bad local minima on the inner loop).

So we think there are several lines of evidence suggesting the conjecture is true. 1. We’ve failed to find a counterexample despite putting a lot of time into it, 2. the conjecture seems to be true [using Jensen-Shannon divergences](https://www.lesswrong.com/posts/JXsZRDcRX2eoWnSxo/resampling-conserves-redundancy-and-mediation-approximately), and 3. [it’s true in the 0 error cases](https://www.lesswrong.com/posts/e9KwDDdAxborNSuCd/usd500-bounty-problem-are-approximately-deterministic).

We are impressed by how tantalizingly, frustratingly simple this problem is while being so difficult to prove.

The Problem
===========

The problem that we are trying to solve can be stated as follows.

Consider two variables X and Y with a joint probability distribution $P(X,Y)$. A latent variable $\Lambda$ is defined by a conditional probability distribution $P(\Lambda|X,Y)$.

A variable $\Lambda$ is called a stochastic natural latent if the joint distribution $P(X,Y,\Lambda)$ satisfies the three natural latent conditions to within an ‘error’ $\epsilon$ :

Redundancy 1: $I(X;\Lambda|Y) \leq \epsilon$

Redundancy 2: $I(Y;\Lambda|X) \leq \epsilon$

Mediation: $I(X;Y|\Lambda)\leq \epsilon$

Note: Here we are expressing the conditions as [conditional mutual information](https://en.wikipedia.org/wiki/Conditional_mutual_information), as Aram did in [this post](https://www.lesswrong.com/posts/BueBzKFHqwioS9i3a/stability-of-natural-latents-in-information-theoretic-terms). These are equivalent to the conditions when stated in terms of KL divergences [^r3e4rmgkjce].

We want to show that if a stochastic natural latent exists, then there also exists a latent $\Lambda_D$ (defined by a conditional distribution $P(\Lambda_D|X,Y)$ ) whose joint distribution $P(X,Y,\Lambda_D)$ satisfies the ‘deterministic natural latent conditions’ to within $n\epsilon$. The deterministic natural latent conditions are:

Deterministic Redundancy 1: $H(\Lambda_D|X) \leq n \epsilon$

Deterministic Redundancy 2: $H(\Lambda_D|Y) \leq n \epsilon$

Mediation : $I(X;Y|\Lambda_D)\leq n\epsilon$

We would like $n>1$ to be a reasonably small number (for some definition of ‘reasonably small’).

Upper bounds on deterministic errors
====================================

One way in which the conjecture could be false is if there existed $P(X,Y)$ distributions for which all deterministic natural latents had very large errors (compared to the optimal stochastic latents). It is therefore useful to identify some simple families of deterministic latents and find upper bounds on how large their errors can be.

Constant Latents
----------------

One of the simplest kind of latents we can imagine is the constant latent. This is a latent which only takes one value, regardless of the X,Y values. Notice that in this case, we have $H(\Lambda_D)=0$, as well as $H(\Lambda_D|X)=0$ and $H(\Lambda_D|Y)=0$ so the constant latent perfectly satisfies the two deterministic redundancy conditions. Conditioning on the latent does not affect the $P(X,Y)$ distribution so the conditional mutual information$I(X;Y|\Lambda_D)$ simply equals the mutual information between X and Y. This means that the only nonzero error for this latent is the mediation error which is $I(X;Y)$.

Copy Latents
------------

Another kind of latent we can consider is the ‘copy latent’ where $\Lambda_D$ simply deterministically ‘copies’ one of the variables (X or Y). This will always perfectly satisfy one of the deterministic redundancy conditions. For example if $\Lambda$ copies X then $\Lambda_D=X$and we have:

Deterministic Redundancy 1: $H(\Lambda_D|X) = H(X|X)=0$

The other deterministic redundancy condition will be satisfied to an error equal to the condition entropy $H(X|Y)$:

Deterministic Redundancy 2: $H(\Lambda_D|Y) = H(X|Y)$

The mediation condition will also be satisfied perfectly:

Mediation: $I(X;Y|\Lambda_D) = H(X|\Lambda_D)-H(X|\Lambda_D,Y) = H(X|X)-H(X|X,Y)=0$

If instead we choose a latent which copies Y so $\Lambda_D=Y$ then the mediation and Deterministic Redundancy 2 conditions will be perfectly satisfied and the Deterministic Redundancy 1 error will be $H(Y|X)$.

Deterministic Functions of X,Y
------------------------------

We can also consider the family of latents where $\Lambda_f=f(X,Y)$ is a deterministic function of the X,Y pair (though not necessarily a deterministic function of X or Y in isolation). All latents in this family satisfy the deterministic redundancy conditions with errors bounded by the conditional entropies of X and Y:

Deterministic Redundancy 1: $H(\Lambda_f |Y) \leq H(X|Y)$

Deterministic Redundancy 2: $H(\Lambda_f |X) \leq H(Y|X)$

A proof of this can be found in [this shortform](https://www.lesswrong.com/posts/BdLga7gFW4W5Hii34/alfred-harwood-s-shortform?commentId=FBvDLvut5dYxYmA2E).

The worst case upper bound on the mediation is the same as that of the constant latent, $I(X;Y)$.

General Upper Bound
-------------------

Notice that three of the latents considered above (’constant’, ‘copy X’ and ‘copy Y’) can be applied to any initial $P(X,Y)$ distribution. This means that we can always find a deterministic natural latent with maximum error $\min[I(X;Y),H(X|Y),H(Y|X)]$. In general, one of the copy latents will be best for $P(X,Y)$ distributions where X,Y are highly correlated (so that $H(X|Y)$ or $H(Y|X)$ is low) and the constant latent will be best for distributions where (X,Y) are independent or have low correlation (so that $I(X;Y)$ is low). 

We have some numerical evidence that in many cases, the optimal deterministic latent has an error very close to $\min[I(X;Y),H(X|Y),H(Y|X)]$, suggesting that this bound is quite tight (for example, in the first graph in this post, the optimal deterministic latent hugs the $\min[I(X;Y), H(Y|X)]$ line perfectly). We know that this bound isn't tight when the $P(X)$ or $P(Y)$ is far from 0.5 (but it isn't extremely loose).

Unfortunately, proving these upper bounds on the deterministic error is not sufficient to prove the conjecture. In order to prove the conjecture, we need to relate upper bounds on the deterministic error to the error achievable using a stochastic latent. 

To complete the proof this way, an upper bound on the deterministic error needs to be combined with a lower bound on the stochastic error. Numerical evidence suggests that distributions for which $\epsilon_D =\min[I(X;Y),H(X|Y),H(Y|X)]$ is high are also distributions with higher stochastic natural latent errors so this approach seems like a reasonable thing to attempt. For example, take a look at the first graph in this post. The stochastic error is lower than the deterministic error but they both follow similar shapes. In the middle of the graph, the stochastic error and deterministic error both peak at approximately (but not exactly) the same point (around $\delta=0.19$) and follow similar decreasing paths as $\delta$ moves away from this point.

If we could prove a lower bound on the error of the stochastic latents of the form $\epsilon_{S} > \frac{1}{n}\min[I(X;Y),H(X|Y),H(Y|X)]$, then we would have proved the conjecture. This is because, for any distribution, we could find a deterministic latent with error $\epsilon_D \leq \min[I(X;Y),H(X|Y),H(Y|X)] \leq n \epsilon_S$ . So if a latent with stochastic error $\epsilon_S$ existed, we could always find a latent (’constant’, ‘copy X’ or ‘copy Y’) with an error only $n$ times greater.

### Lower Bounding the Stochastic Latent error

We tried a couple of ways of lower bounding the stochastic latent error but were not successful. First, we tried assuming that there was a stochastic latent which achieved an error of less than $\frac{1}{n}\min[I(X;Y),H(X|Y),H(Y|X)]$ and seeing if this implied a contraction. We tried to derive a contradiction from these three inequalities:

Redundancy 1: $I(X;\Lambda|Y) \leq \frac{1}{n}\min[I(X;Y),H(X|Y),H(Y|X)]$

Redundancy 2: $I(Y;\Lambda|X) \leq \frac{1}{n}\min[I(X;Y),H(X|Y),H(Y|X)]$

Mediation: $I(X;Y|\Lambda)\leq \frac{1}{n}\min[I(X;Y),H(X|Y),H(Y|X)]$

i.e. we wanted to show that satisfying two of these inequalities necessarily meant violating the third (for some distribution over X and Y).

If we could do this, we would have proved a lower bound on the stochastic error. Unfortunately, we failed, but this does feel like an approach someone could take if they were more comfortable than us at manipulating information-theoretic inequalities.

Mixing Latents and Reverse Jensen inequalities
----------------------------------------------

Here is another attempt we made at lower bounding the stochastic error.

Suppose we took two latents, defined by conditional distributions $R(\Lambda|X,Y)$ and $S(\Lambda|X,Y)$ and created a new latent using a probabilistic mixture of the two:

$P(\Lambda|X,Y) = a R(\Lambda |X,Y) + (1-a)R(\Lambda |X,Y)$

with $0\leq a \leq 1$.

If we applied the mixed latent to a distribution $P(X,Y)$, the joint $P(X,Y,\Lambda)$distribution would be also be a mixture of $R(X,Y,\Lambda)$and $S(X,Y,\Lambda)$.

We can also consider the refactored distribution $P_{red}(X,Y,\Lambda)$, used to calculated the redundancy error:

$\begin{align} P_{red} & = P(Y)P(X|Y)P(\Lambda|X) \&= P(X,Y) [a R(\Lambda|X) + (1-a)S(\Lambda|X)]\ &= a R_{red} + (1-a)S_{red}\end{align}$

Where $R_{red}$ and $S_{red}$ indicate the refactored versions of $R$ and $S$ respectively.

This means that the KL divergence for the redundancy error of P is given by:

$D_{KL}(P(X,Y,\Lambda)||P_{red}(X,Y,\Lambda)) = D_{KL}\big(a R + (1-a)S|| a R_{red} + (1-a)S_{red}\big)$

(Note: writing the KL as a mixture in both of its arguments works for both redundancy conditions, but not the mediation condition. So even if we got this proof strategy to work, we would still need to tie up the loose end of the mediation condition.)

Next, since the KL divergence is [convex in both its arguments](https://en.wikipedia.org/wiki/Kullback%E2%80%93Leibler_divergence#Properties), we can use this convexity to write a [Jensen inequality](https://en.wikipedia.org/wiki/Jensen%27s_inequality):

$D_{KL}(P||P_{red})\leq a D_{KL}(R||R_{red}) + (1-a)D_{KL}(S||S_{red})$

This is potentially interesting for two reasons. First, we can often (always?) write stochastic latents as probabilistic mixtures of deterministic latents, so if R and S are deterministic latents, then this expression links the stochastic error $D_{KL}(P||P_{red})$ with the two deterministic errors $D_{KL}(R||R_{red})$ and $D_{KL}(S||S_{red})$ which is almost the kind of thing we are trying to do.

Unfortunately, this inequality is the wrong way round. We are looking for a lower bound on the stochastic errors in terms of the deterministic error of the form $\frac{\epsilon_{Det}}{\epsilon_{Stoch}}\leq n$. But the inequality from the convexity of the KL divergence gives us an upper bound on stochastic errors instead.

We hoped that ‘Reverse Jensen Inequalities’ such as the ones found [here](http://elib.mi.sanu.ac.rs/files/journals/publ/105/n099p107.pdf) might be helpful. These are ways of bounding the ‘Jensen gap’ between the KL divergences of the mixture and the mixture of the KL divergences. However, when we attempted this, we got results of the form:

$\epsilon_{Stoch} \geq k \epsilon_{Det} - c$

with $k,c>0 $. This gives a ratio $\frac{\epsilon_{Stoch}}{\epsilon_{Det}} \leq \frac{1}{k} (1+\frac{c}{\epsilon_{Stoch}})$ which unfortunately diverges as $\epsilon_{Stoch}$ tends to zero.

Characterizing the optimal stochastic latent
--------------------------------------------

If we define $P[X,Y]$ using four parameters:

${{p11,p12},{p21,p22}}$

and $P[\Lambda|X,Y] $ using another four parameters:

{{{l11,1-l11},{l12,1-l12}},{{l21,1-l21},{l22,1-l22}}}

where lij is $P(\Lambda=1|X=i, Y=j)$.

Then we can write out the full error equations in terms of these parameters:

Mediation error:

$\frac{(1-\text{l11}) \text{p11} \log \left(\frac{(1-\text{l11}) \text{p11}    ((1-\text{l11}) \text{p11}+(1-\text{l12}) \text{p12}+(1-\text{l21})    \text{p21}+(1-\text{l22}) \text{p22})}{((1-\text{l11}) \text{p11}+(1-\text{l12})    \text{p12}) ((1-\text{l11}) \text{p11}+(1-\text{l21}) \text{p21})}\right)}{\log    (2)}+\frac{(1-\text{l12}) \text{p12} \log \left(\frac{(1-\text{l12}) \text{p12}    ((1-\text{l11}) \text{p11}+(1-\text{l12}) \text{p12}+(1-\text{l21})    \text{p21}+(1-\text{l22}) \text{p22})}{((1-\text{l11}) \text{p11}+(1-\text{l12})    \text{p12}) ((1-\text{l12}) \text{p12}+(1-\text{l22}) \text{p22})}\right)}{\log    (2)}+\frac{(1-\text{l21}) \text{p21} \log \left(\frac{(1-\text{l21}) \text{p21}    ((1-\text{l11}) \text{p11}+(1-\text{l12}) \text{p12}+(1-\text{l21})    \text{p21}+(1-\text{l22}) \text{p22})}{((1-\text{l11}) \text{p11}+(1-\text{l21})    \text{p21}) ((1-\text{l21}) \text{p21}+(1-\text{l22}) \text{p22})}\right)}{\log    (2)}+\frac{(1-\text{l22}) \text{p22} \log \left(\frac{(1-\text{l22}) \text{p22}    ((1-\text{l11}) \text{p11}+(1-\text{l12}) \text{p12}+(1-\text{l21})    \text{p21}+(1-\text{l22}) \text{p22})}{((1-\text{l12}) \text{p12}+(1-\text{l22})    \text{p22}) ((1-\text{l21}) \text{p21}+(1-\text{l22}) \text{p22})}\right)}{\log    (2)}+\frac{\text{l11} \text{p11} \log \left(\frac{\text{l11} \text{p11}    (\text{l11} \text{p11}+\text{l12} \text{p12}+\text{l21} \text{p21}+\text{l22}    \text{p22})}{(\text{l11} \text{p11}+\text{l12} \text{p12}) (\text{l11}    \text{p11}+\text{l21} \text{p21})}\right)}{\log (2)}+\frac{\text{l12} \text{p12}    \log \left(\frac{\text{l12} \text{p12} (\text{l11} \text{p11}+\text{l12}    \text{p12}+\text{l21} \text{p21}+\text{l22} \text{p22})}{(\text{l11}    \text{p11}+\text{l12} \text{p12}) (\text{l12} \text{p12}+\text{l22}    \text{p22})}\right)}{\log (2)}+\frac{\text{l21} \text{p21} \log    \left(\frac{\text{l21} \text{p21} (\text{l11} \text{p11}+\text{l12}    \text{p12}+\text{l21} \text{p21}+\text{l22} \text{p22})}{(\text{l11}    \text{p11}+\text{l21} \text{p21}) (\text{l21} \text{p21}+\text{l22}    \text{p22})}\right)}{\log (2)}+\frac{\text{l22} \text{p22} \log    \left(\frac{\text{l22} \text{p22} (\text{l11} \text{p11}+\text{l12}    \text{p12}+\text{l21} \text{p21}+\text{l22} \text{p22})}{(\text{l12}    \text{p12}+\text{l22} \text{p22}) (\text{l21} \text{p21}+\text{l22}    \text{p22})}\right)}{\log (2)}$

Redundancy1 error:

$\frac{(1-\text{l11}) \text{p11} \log \left(\frac{(1-\text{l11})    (\text{p11}+\text{p21})}{(1-\text{l11}) \text{p11}+(1-\text{l21})    \text{p21}}\right)}{\log (2)}+\frac{(1-\text{l21}) \text{p21} \log    \left(\frac{(1-\text{l21}) (\text{p11}+\text{p21})}{(1-\text{l11})    \text{p11}+(1-\text{l21}) \text{p21}}\right)}{\log (2)}+\frac{\text{l11}    \text{p11} \log \left(\frac{\text{l11} (\text{p11}+\text{p21})}{\text{l11}    \text{p11}+\text{l21} \text{p21}}\right)}{\log (2)}+\frac{\text{l21} \text{p21}    \log \left(\frac{\text{l21} (\text{p11}+\text{p21})}{\text{l11}    \text{p11}+\text{l21} \text{p21}}\right)}{\log (2)}+\frac{(1-\text{l12})    \text{p12} \log \left(\frac{(1-\text{l12}) (\text{p12}+\text{p22})}{(1-\text{l12})    \text{p12}+(1-\text{l22}) \text{p22}}\right)}{\log (2)}+\frac{(1-\text{l22})    \text{p22} \log \left(\frac{(1-\text{l22}) (\text{p12}+\text{p22})}{(1-\text{l12})    \text{p12}+(1-\text{l22}) \text{p22}}\right)}{\log (2)}+\frac{\text{l12}    \text{p12} \log \left(\frac{\text{l12} (\text{p12}+\text{p22})}{\text{l12}    \text{p12}+\text{l22} \text{p22}}\right)}{\log (2)}+\frac{\text{l22} \text{p22}    \log \left(\frac{\text{l22} (\text{p12}+\text{p22})}{\text{l12}    \text{p12}+\text{l22} \text{p22}}\right)}{\log (2)}$

One thing we want here is to characterize the optimal latent (minimizes sum of Mediation error, Redundancy1 error and Redundancy2 error) at any given setting of the $P[X,Y]$ parameters. Mathematica can’t handle this analytically, so we tried restricting the $P[X,Y] $ distribution such that both marginals were always 50%. Then the distribution can be parameterized by one variable, $\delta \in [-\frac{1}{4}, \frac{1}{4}]$, like so:

$P[X,Y] = \left( \begin{array}{cc} \frac{1}{4}+\delta & \frac{1}{4}-\delta \ \frac{1}{4}-\delta & \frac{1}{4}+\delta \ \end{array} \right)$

We can plot the numerical optimal latents for each value of $\delta$ (same as the image at the top of the post, but with each error plotted):

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/e6878b2b596ea8ed538500251f2e2153d0bbc6d0b0e12444.png)

By looking at these numerically optimal latents, we can also hardcode some of the latent parameters to values that we’ve empirically observed are optimal. When $\delta < 1/8,$ the latent is 0.5 everywhere (independent of X and Y, so equivalent to the constant latent). When $\delta > 1/8$, we observed that l12 and l21 are always 0.5, and l11 = 1-l22. These leaves only one parameter free.

Hardcoding these simplifies each error, so we can get each error as a function of $\delta$ and l22. For example the mediation error:

$\frac{2 \left(d+\frac{1}{4}\right) (1-\text{l22}) \log \left(\frac{\left(d+\frac{1}{4}\right) (1-\text{l22}) \left(\left(d+\frac{1}{4}\right) (1-\text{l22})+\left(d+\frac{1}{4}\right) \text{l22}-d+\frac{1}{4}\right)}{\left(\left(d+\frac{1}{4}\right) (1-\text{l22})+\frac{1}{2} \left(\frac{1}{4}-d\right)\right)^2}\right)}{\log (2)}+\frac{2 \left(d+\frac{1}{4}\right) \text{l22} \log \left(\frac{\left(d+\frac{1}{4}\right) \text{l22} \left(\left(d+\frac{1}{4}\right) (1-\text{l22})+\left(d+\frac{1}{4}\right) \text{l22}-d+\frac{1}{4}\right)}{\left(\left(d+\frac{1}{4}\right) \text{l22}+\frac{1}{2} \left(\frac{1}{4}-d\right)\right)^2}\right)}{\log (2)}+\frac{2 \left(\frac{1}{4}-d\right) \log \left(\frac{\left(\frac{1}{4}-d\right) \left(\left(d+\frac{1}{4}\right) (1-\text{l22})+\left(d+\frac{1}{4}\right) \text{l22}-d+\frac{1}{4}\right)}{2 \left(\left(d+\frac{1}{4}\right) (1-\text{l22})+\frac{1}{2} \left(\frac{1}{4}-d\right)\right) \left(\left(d+\frac{1}{4}\right) \text{l22}+\frac{1}{2} \left(\frac{1}{4}-d\right)\right)}\right)}{\log (2)}$

Note that in this equation and the following one, we use $d$ in place of $\delta$.

Now it’s simple enough that Mathematica (with some cajoling) can analytically find the l22 (as a function of d) such that the total error is minimized:

$\text{Root}\left[\text{$\#$1}^6 \left(4096 d^4+4096 d^3+1536 d^2+256 d+16\right)+\text{$\#$1}^5 \left(-12288 d^4-12288 d^3-4608 d^2-768 d-48\right)+\text{$\#$1}^4 \left(18432 d^4+12288 d^3+3840 d^2+768 d+72\right)+\text{$\#$1}^3 \left(-16384 d^4-4096 d^3-256 d-64\right)+\text{$\#$1}^2 \left(8448 d^4-1280 d^3-672 d^2+48 d+17\right)+\text{$\#$1} \left(-2304 d^4+1280 d^3-96 d^2-48 d+7\right)+256 d^4-256 d^3+96 d^2-16 d+1\&,2\right]$

It’s the second root of a degree 6 polynomial, whose parameters each contain a degree 4 polynomial. It looks like this:

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/0d4507263388b52d6068a9655fb3a9e98a41cc3e431d3901.png)

This is for $\delta \in [\frac{1}{8},\frac{1}{4}]. $ In $\delta \in [0,\frac{1}{8}]$, l22 simply equals 0.5.

By analytically calculating the gradient and hessian with respect to the total error, and showing the eigenvalues of the hessian are positive for all $\delta$, we know that every local movement of the latent increases the error, so this latent that we’ve described is definitely *locally* minimal. We think it is also globally minimal, but haven’t shown this. Presumably it won’t be too hard to prove this by going through every other 0 gradient solution and showing that it has a larger error.

Mathematica can plot the total stochastic error (it’s missing the first half, but we know that the first half is equal to the optimal deterministic error, because we checked the eigenvalues of the hessian):

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/eb1f3611a564d42a1f818faac64085886309ecca11c995d5.png)

And using our known values for the optimal deterministic latents, we can plot the optimal deterministic error:

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/c94323f784029aea5188b86da22c4d483f684d290faaedc4.png)

And we can plot the ratio of these:

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/e1b7a60e6a0f847c0760b6271d8b0a715aed3a0cba0ee3c8.png)

And (numerically) find that the peak is ratio=1.81792, {$\delta=0.194986$}. 

Summary
-------

This isn't the most satisfying conclusion, but we have achieved a partial success. We have (almost) a proof that the conjecture is true for the special case of a 2x2, when the marginals of X and Y are 0.5. And in this case, the ratio $n$ is ~1.82. We failed to find a worse ratio empirically in the general 2x2 case and the general 3x3 case (despite extensive manual effort, and running 10s of hours of automated searches). We think this is moderately strong evidence that the conjecture is true in general.

But we don't have any good leads on methods to prove this in general. 

*Acknowledgement: Alfred's contribution to this work was funded by the* [*Advanced Research + Invention Agency (ARIA)*](https://www.aria.org.uk/) *through project code MSAI-SE01-P005*

[^r3e4rmgkjce]: When stated in terms of KL divergences, these conditions are:Redundancy 1: \(D_{KL}(P(X,Y,\Lambda)||P(X,Y) P(\Lambda|Y)) \leq \epsilon\)Redundancy 2: \(D_{KL}(P(X,Y,\Lambda)||P(X,Y) P(\Lambda|X)) \leq \epsilon\)Mediation:  \(D_{KL}(P(X,Y,\Lambda)||P(\Lambda)P(Y|\Lambda) P(X|\Lambda)) \leq \epsilon\)