You, too, can be an armchair epidemiologist - Clare Lyle
Posted on November 21, 2026

You, too, can be an armchair epidemiologist

A surprising symmetry between hazard ratios and preference learning.

AI researchers must prepare ourselves for two possible futures: either capabilities improve enough that AI takes over a significant chunk of the economy, including most likely our own jobs, or it fails to hit escape velocity, is unable to pay back the eye-watering capex of the past five years, and we plunge into another AI winter. In either case, now is the time to start developing useful, portable skills that we can leverage in the rapidly approaching era when nobody needs or wants AI researchers any more.

Having worked in AI for a few years, you have a few things going for you: you likely understand basic mathematics, can evaluate whether the code that your AI agent writes is fabricating results, and have a knack for identifying exponential growth. There are a few different domains where these skills might be useful, but the one most likely to allow you to atone for your participation in the {biggest bubble since the dot com crash || rogue AI takeover} is epidemiology. In fact, as I will show in this blog post, several of the methods epidemiologists use are practically identical to methods you already know from neural network training. Plus, since there’s no money in epidemiology which means no incentive to train LLMs to be good at it, your job will be safe for at least an additional 18 months.

To be more specific, I’m going to focus on one symmetry which is both surprising and oddly satisfying: hazard ratio estimation using Cox regression.

Hazard ratios

Epidemiologists are very interested in not just how many people get sick and die, but when they do so (after all, eventually the answer to the latter is ‘everyone’). One useful metric of whether one group of people is healthier than another is to look at their risk of illness or death at any particular instant. If people who only eat potatoes and lentils have a probability \(h\) of keeling over from a heart attack each day, then we can quantify the increase in heart attack risk from eating nothing but cheeseburgers by looking at the probability at which a cheeseburger-eater will have a fatal heart attack, and then compute the ratio of these two quantities.

This is called a hazard ratio.

Cox regression

Now suppose that we want to estimate how multiple different lifestyle factors influence some outcome (for simplicity, let’s assume we’re looking at all-cause-mortality, i.e. death).

Predicting the likelihood that any individual person, say Bob Smith, will die at time \(t\) is hard because you need to come up with a parametric model for how a person’s likelihood of death evolves over time. This is hard.

There are lots of estimation problems where it is very hard to compute or estimate the exact probability of an event happening, but easy to compute the relative likelihood of two events (the short reason for this is that integration is hard, but computing a ratio of instantaneous values is easy).

The Cox proportional hazards model takes this perspective to an extreme, by assuming that there is some base risk \[\lambda_0(t)\] which you don’t know. Then it assumes that an individual’s (with features \(x\)) risk of an event is given by the formula \[\lambda(t|x) = \lambda_0(t) \exp(\mathbf{\beta}^\top x)\]

Intuitively, this says “if your baseline risk of getting lung cancer is some value \(p\), the smoking increases that value by a factor of \(2\) and sleeping 6 hours a night increases that by another factor of \(1.5\), so someone who does both ends up with a rate of \(3p\)”.

\[h(t|X) = h_0(t) \exp(\mathbf{\beta}^\top X)\]

Suppose you have a dataset with a bunch of people, the time at which some event happened, and a (let’s assume constant for now) set of features for each person that tell you things like their BMI, whether they smoke, how much they exercise, etc. Then you can estimate the best-fit \(\mathbf{\beta}\) to predict their odds-ratio by using maximum likelihood estimation, using the likelihood function

\[L_i(\beta) = \frac{\exp(\beta^\top x_i)}{\sum \exp(\beta^\top x_j)} \text{ and } L(\beta) = \prod_{i=1}^K \frac{\exp(\beta^\top x_i)}{\sum_{j \in R(t_i)} \exp(\beta^\top x_j)}\; .\]

It’s not obvious from the equation above, but implicitly this is computing the likelihood that of all the people remaining in the dataset at the time that the event happened to person \(i\), person \(i\) would be the one it would happen to. We can then turn this likelihood into a log to get a nice sum over events \(\ell(\beta) = \sum_{i=1}^K \beta^\top x_i - \log \sum_{j \in R(t_i)}\beta^\top x_j ;.\)

Then follow some standard optimization process (statisticians like Newton-Raphson) on the parameters \(\beta\) to maximize the sum over data of this likelihood.

Comparison with the Bradley Terry model

Some of you might have noticed that the likelihood function being optimized looks suspiciously like the Bradley-Terry model used in RLHF. As a reminder, Bradley-Terry is a way of modeling the likelihood of one player beating another in some sort of head-to-head game; it’s agnostic to whether the entities it is modeling are human chess players or LLM essay-writers. In either case, the idea is to estimate some score function \(s(x)\) so that the probability that in a head-to-head matchup \(x\) beats \(y\) is

\[P(x_w) = \frac{\exp(s(x))}{\exp(s(x)) + \exp(s(y))}\;.\]

Then you can optimize the score function given a bunch of match-ups and results by maximizing the average likelihood under your model that the actual winner in each match will win.

If you squint, the Cox hazard model can also be interpreted as trying to estimate the winner of a matchup (where ‘winning’ means you die first) using a linear score function. In the case where the population only has two people, you get:

\[L(\beta) = \frac{\exp(\beta^\top X_w)}{\sum_{j=w, l} \exp(\beta^\top X_j)}\]

So RLHF researchers are already well-equipped to model hazard ratios in epidemiological data, at least when the dataset only has two people. The model you use to generalize Bradley-Terry to these multi-player “tournaments” just assumes that instead of there being a score that determines \[p(W(x)) = \frac{s(x)}{s(y) + s(x)}\] you instead have a score that gives \[p(D_t(x)|\texttt{DEATH}_t) = \frac{s(x)}{\sum_{y \in R(t)}s(y)}\]

where here you have to condition on the fact that somebody did indeed die / get sick at time \(t\). This is known as the Plackett-Luce model. Interestingly, one approach that’s intended to get rid of the non-monotonicity of the naive score function under the Plackett-Luce model does essentially turn the mortality dataset into a giant tournament of 1v1 games, where each participant is pitted against each other participant and `wins’ if they live longer. Using this objective to fit a score function avoids some weird pathologies of the set-valued version that arise because the denominator in the likelihood changes as more people die.

Application: epigenetic clocks

Hazard ratios are used all over the medical literature to quantify the effect of some lifestyle factor or intervention. This paper contains many such examples, such as risk of heart attack in patients with kidney failure, glaucoma progression, and all-cause mortality in mostly-healthy Italian retirees. Hazard ratios are unit-free, which can be a blessing and a curse in conveying the significance of a finding. Doubling the risk of a 1-in-a-million event vs a 1-in-2 event leads to a very different practical effect size, but the same hazard ratio.

In general, a hazard ratio associated with an observational study have to be taken with a grain of salt due to the risk of confounding. I discussed this extensively in a previous post, and won’t go into that extensively here. The main point is just that if your Cox regression comes back and says that being rich prevents heart disease, you can be reasonably confident that if you secretly put a billion dollars in a trust fund for Joe Schmoe but didn’t tell him about it, you should not expect his life expectancy to match that of his non-oblivious billionnaire peers.

One point where this becomes really interesting is in the study of epigenetic clocks. Your epi-genome is a set of molecular tags (mostly methyl groups) that stick to your DNA (in a process called methylation) and can either increase or decrease how much a particular gene is expressed. Over time, researchers have observed that the pattern of which genes are tagged or not changes somewhat predictably. An epigenetic clock uses this fact to estimate your age based on DNA methylation patterns. Interestingly, your predicted epigenetic age can be affected by lifestyle factors and genes that are known to drive faster aging, like smoking and mutations causing progeria. However, it can be difficult to disentangle whether methylation at one site on the genome causes you to age faster, or is a response to some environmental stimulus (e.g. up-regulating DNA repair proteins after radiation exposure).

The question of which changes cause vs react to cellular damage and disfunction is of huge importance to aging researchers. To the general public who just want to know whether they need to eat better and exercise more, they are irrelevant. What matters from an epidemiological health perspective is not whether their epigenome looks like that of someone five years older, but whether their risk of dying is that of someone five years older. With this goal in mind, the most useful epigenetic clocks will be the ones that tell us the hazard ratio of different population groups’ risk of cancer, heart disease, and all-cause mortality. And for this, we can use a Cox model to fit a linear predictor on methylation data to estimate the hazard ratio of a particular methylation site on mortality. So whereas early epigenetic clocks did standard L2 regression on an individual’s age based on their epigenome, newer generations instead try to predict risk of death using methods like Cox regression.

The fact that Cox coefficients capture correlation and not causation is important to keep in mind when you see advertisements for “cellular rejuvenation” peptides. You don’t want to accidentally shut off important cellular repair enzymes just because these tend to be most active in sick people. I think epigenetic clocks and epigenetic reporgramming is an enormously interesting research problem, but I am not endorsing taking random peptides on the basis of ‘reinvigorating’ your epigenome.