TRAIL-UKB maps a disease-trajectory transformer into 7,712 features
The authors of an arXiv paper present TRAIL-UKB, an atlas of features pulled from inside a model of disease trajectories. The model is a masked-event transformer inspired by Delphi-2M, trained on 5.1 million first-occurrence ICD-10 diagnosis events from 502,383 UK Biobank participants. To look inside it, the team used sparse autoencoders (SAEs), which break the model's internal representations into sparse features that can be interpreted one at a time.
An automated pipeline writes a card for each feature. A card combines clinical context, temporal patterns, genotype associations, effects on the model's output, logical activation rules and a natural-language description. Because a feature may fire because of a diagnosis, the context around it, or both, the authors compare the context observed for each feature with what its diagnoses alone would lead one to expect. In that baseline, each diagnosis's usual context is weighted by its share of the feature's activation mass.
The atlas holds 7,712 features. They represent diagnosis indicators, comorbidity and temporal contexts, patient strata, genotype-linked enrichments and recording artifacts. SAE reconstructions explain over 99.7% of hidden-state variance and keep the model's top-ranked predictions at over 98% of evaluated positions. Across three independently trained SAE fits, 53% of supported feature instances recur in at least two.
The authors also use counterfactuals to test how sensitive feature activation is, steer along decoder directions to measure effects on predictions, and compare against alternative sparse decompositions to assess representation quality. As a final demonstration, they take a retrospective classification of treatment-resistant depression (TRD), derived from prescriptions, and show how downstream model scores can be traced to interpretable SAE features through decoder folding and dependence-aware analysis. The release covers the analysis pipeline and privacy-screened feature cards for selected TRD-associated features.
Key facts
- TRAIL-UKB is a sparse-autoencoder atlas of a Delphi-2M-inspired transformer trained on 5.1 million first-occurrence ICD-10 events from 502,383 UK Biobank participants.
- The atlas contains 7,712 features, covering diagnoses, comorbidity and temporal contexts, patient strata, genotype-linked enrichments and recording artifacts.
- SAE reconstructions explain over 99.7% of hidden-state variance and preserve top-ranked predictions at over 98% of evaluated positions.
- Across three independently trained SAE fits, 53% of supported feature instances recur in at least two.
- The authors release the analysis pipeline and privacy-screened feature cards for selected features associated with treatment-resistant depression.
Why it matters
A transformer that learns from sequences of diagnoses holds its knowledge in internal states that are hard to read directly. TRAIL-UKB turns those states into a catalogue of separate features, each with a card describing its clinical and temporal context, genotype associations and effect on model output.
One methodological point stands out. A feature's context can look distinctive simply because the diagnoses that activate it usually occur in that context. The authors address this by comparing what they observe with a diagnosis-conditioned expectation, which is meant to isolate any additional contextual selectivity. The treatment-resistant depression example then shows a route from a downstream classification score back to interpretable features.
Who it affects
The work is most relevant to researchers who study interpretability, especially those applying sparse autoencoders to models of health records. Teams building disease-trajectory models on ICD-10 histories get a worked example of how to inspect what such a model represents, including features that stem from recording artifacts. Researchers interested in treatment-resistant depression get feature cards for selected features associated with it.
How to use it
The authors release two things: the analysis pipeline, and privacy-screened feature cards for selected TRD-associated features. The cards cover that selection, so do not expect all 7,712 from this release as described. No repository link or license is given in the abstract text used here, and no release of model weights or participant data is mentioned.
The methods can also serve as a checklist for similar projects: measure how faithfully the SAE reconstructs the model, check which features recur across independent fits, compare feature context against a diagnosis-conditioned baseline, and test features with counterfactuals and steering.
How solid is it
This account rests on the abstract of an arXiv paper. The reconstruction figures are high: over 99.7% of hidden-state variance explained and top-ranked predictions preserved at over 98% of evaluated positions. These measure how well the SAE stands in for the transformer's internal states. No performance figures are given for the transformer's disease prediction.
Stability is more modest, with 53% of supported feature instances recurring in at least two of three SAE fits. The abstract describes counterfactual tests, decoder-direction steering and comparisons with alternative sparse decompositions but states no results for them. It also gives no accuracy or other metric for the depression classification, and mentions no validation on a cohort other than UK Biobank.
Risks and caveats
A feature that activates on a diagnosis may be responding to the diagnosis, to its surroundings, or to both, so a short label can mislead. Some features represent recording artifacts, which reflect how data were captured and should not be read as medicine.
With only 53% of supported feature instances recurring in a second or third fit, an individual feature should be checked for stability before anyone builds an argument on it. Genotype links are described as associations and enrichments; the source does not say they reflect causal genetic effects or disease mechanisms. The depression classification is retrospective and derived from prescriptions, offered as a demonstration of how scores connect to features, and no clinical application is mentioned.
“A feature's activation may reflect a diagnosis, its surrounding context, or both.”
— TRAIL-UKB authors, arXiv abstract