Showing posts with label thermodynamics. Show all posts
Showing posts with label thermodynamics. Show all posts

Causation and semi-supervised learning

Table of contents

  • Semi-supervised learning
  • Semi-supervised learning and causation
  • Independent noise and causation
  • Hierarchical models and transfer learning

Semi-supervised learning

We have previously discussed that machine learning can both be considered to be an information theoretic problem of finding an optimal representation. Most of it had to do with unsupervised learning, while supervised learning requires a notion of optimality with respect to some target variable (formalized via the information bottleneck). In particular, we're interested if the unsupervised representations are correlated with the supervised ones.

More specifically, suppose you're trying to classify points into some number of categories (i.e. learn a (random) function $f:X\to Y$), and have some number of labeled points (values of $f(x)$ for some $x$). Then when -- if ever -- will a further sampling from $X$ (i.e. without labels) help you achieve greater classification accuracy? Does $P(X)$ provide information on $P(Y\mid X)$?

Image source

So for example, if you believe that clustered $x$ tend to have similar labels, then $P(X)$ gives information on $P(Y\mid X)$. Formally, we have a belief distribution $\phi_{p_{x,y}}$ on the possible distributions $p_{x,y}$ that generate $X, Y$ -- so the above hypothesis represents a high prior probability for distributions $p_{x,y}$ that predict a high probability for nearby $x$ to produce nearby $y$. The random distributions $p_x$ and $p_{x\mid y}$ can be extracted as function(al)s of the random distribution $p_{x,y}$, and so it makes sense to talk about their independence -- and if they are independent, semi-supervised learning doesn't work.

Semi-supervised learning and causation

One may think about the physical mechanisms underlying such data. Suppose that $P(Y\mid X)$ does give us information about $P(X)$ -- e.g. we believe that if $Y$ tends to cluster with $X$ then $X$ has a correspondingly clustered process -- then that tells us that either $X$ and $Y$ have a common cause, or that $Y$ causes $X$.

Why? Let's be a bit more concrete about this and suppose that $X$ and $Y$ represent altitude and temperature (of some weather stations) respectively. And suppose we believe that observing a distribution like this for $X$:


Made it likely for the relationship between $X$ and $Y$ to follow the same clustering, i.e. to look like this:


Would that then be consistent with a model in which altitude causes temperature?

No. In fact, one way to think about "our belief about a distribution" is to consider that distribution as parameterized by (conditioned on) some third variable $Z$ and think about or beliefs on $Z$. For $P(X)$ and $P(Y\mid X)$ to be "independent" means that there is no $Z$ such that $P(X)$ and $P(Y\mid X)$ both depend on $Z$, i.e. for all variables $Z$, either $X$ and $Z$ are independent, or $Y$ and $Z$ are independent conditioned on $X$:

$$\forall Z, (X\perp\!\!\!\perp Z)\lor (Y\perp\!\!\!\perp Z\mid X)$$

<=> For any $Z$ correlated with $X$, $Z$ affects $Y$ only through $X$.

<=> If there is an unblocked causal path between $X$ and some $Z$, then conditioning on $X$ blocks all causal paths between $Y$ and $Z$.

<=> If there are unblocked causal paths between some $Z$ and $X$, $Y$, then the paths between $Z$ and $Y$ contain $X$ as either a mediator or a common cause. 

<=> If there are unblocked causal paths between some $Z$ and $X$, $Y$, then the paths between $Z$ and $Y$ contain $X$, and $X$ is a cause of $Y$.

<=> $X$ causes $Y$ and they have no common causes.

This is called the "Principle of Independent Causal Mechanisms" -- if semi-supervised learning doesn't add anything, then there is a defined causal direction $X\to Y$.

(Our treatment of the Principle of Independent Causal Mechanisms is similar to that by Sokolovska & Wuillemin [1]. We have not covered the algorithmic formulation of the principle -- worth reading: in this regard Janzing et al on what ICM translates to in physics [2], Besserve et al on group-theoretic formulation [3]. Furthermore, semi-supervised learning can be considered a special case of transfer learning, relevant papers in this area/on the theory of transfer learning include: [4] [5] [6 -- p. 177])

Independent noise and causation

Although we have formulated the notion of $P(X)$ and $P(Y\mid X)$ being independent in terms of our beliefs about what those distributions might be, such beliefs can also be updated by data. Indeed the characterization above, in which the variable $Z$ is used for parameterization, is one such formulation. 

If there are unblocked causal paths between some $Z$ and $X$, $Y$, then the paths between $Z$ and $Y$ contain $X$ as either a mediator or a common cause. 

The contrapositive of this reads:

If $Y$ depends on $Z$ not through $X$, then $X$ and $Z$ must be independent.

<=> $X$ is independent of the noise term in $Y$.

Indeed, this is one of the most common characterizations used to establish causation when a full picture of the causal model and its specific variables is not known. The idea is that the noise term captures the relevant stuff from the unknown variables in the true causal model.

(See Goudet et al [4] for the standard treatment of causal inference from noise.)

Why are negative temperatures hot?

You've probably heard the statement "negative temperatures are hot!", referring of course to negative absolute temperatures.

But why are they hot? Well, a common explanation is that it's not really the temperature $T$ that is the fundamental quantity, but rather the statistical beta, or "coldness" $\beta=1/T$. So negative temperatures have negative coldness, which is hotter than any positive temperature, since even the hottest positive temperature is only going to give you a small, but positive coldness. So the fact that negative temperatures are hot is a result of the fact that $1/x$ is not really decreasing everywhere, due to its discontinuity.

But why? Why is $\beta$ the fundamental quantity? Why should we arbitrarily consider this to be our metric of hotness and coldness, and not $T$?

This is a really interesting example to teach people to think in a positivist way in physics, and to operationalise things. What does it mean for something to be hot?

Well, you touch it and you say "Ouch!"

Seriously, that's all there is -- if you touch something hot, you say "Ouch!", if you touch something cold, you say "Whee!", or something. That's the fundamental, positivist definition of hotness -- "Does it feel hot?"

Well, why would something feel hot? Because it transfers heat to you. And this is our operational, positivistic definition of hotness -- if one body transfers heat to another body, it is said to be hotter than the other body.

So we need to find out a criterion to decide the direction of heat flow between two bodies. In the past, you've probably taken for granted that heat is transferred from a body with higher temperature to that with lower temperature, but that's just a crappy high school definition. What really causes heat diffusion? Well, when there are a lot of fast-moving particles in one place and slow-moving particles in another, it turns out that a state where the particles are more uniformly spread-out is more likely to happen in future. This is just the requirement that entropy must increase -- it's the second law of thermodynamics.

So if we have body 1 with temperature $T_1$ and body 2 with temperature $T_2$, with heat flow of $Q$ from body 1 to body 2, then the second law of thermodynamics is stated as:

$$\Delta S_1+\Delta S_2>0$$
$$-\Delta Q/T_1+\Delta Q/T_2>0$$
$$\Delta Q\left(\frac1{T_2}-\frac1{T_1}\right)>0$$
In other words -- if $\Delta Q>0$, i.e. if the heat flow is really from body 1 to body 2, then we require $1/T_2>1/T_1$, and if the heat flow is from body 2 to body 1 ($\Delta Q<0$), we require $1/T_1>1/T_2$.

And there you have it! Heat does not flow from the body with higher temperature to the body with lower temperature -- it flows from the body with lower $1/T$ to the body with higher $1/T$. For positive temperatures, these are the same thing -- but negative temperatures have the lowest $1/T$, and are thus hotter.



So those of you want the U.S. to switch to Celsius, or those who report temperatures in Kelvin for no good reason except intellectual signalling... perhaps start reporting statistical betas in 1/Kelvins instead.

...
"Hey, Alexa, is it chilly outside?"
"The coldness in your area is 0.00375 anti-Kelvin."

"...I think I'll just risk freezing to death."