Stella Nova
How AlphaFold works

Machine learning · structural biology

How AlphaFold works

AlphaFold does not fold a protein. It reads a sequence and its evolutionary relatives, builds a learned picture of which residues sit near which, and writes down one set of 3D coordinates. No physics runs, no time passes, no pathway exists. The word fold in the name describes the answer, not the process.

48Evoformer blocks
8structure layers
(shared weights)
3recycles
at inference
256cm MSA channels
128cz pair channels
384cs single channels

Running example: human SUMO1 (UniProt P63165, 101 residues). Structure, pLDDT and PAE are the real AlphaFold DB model AF-P63165-F1-model_v6. Tap or click any stage to jump.

01

Input: a sequence, and its relatives

The only required input is 101 letters. Everything else is searched for.

Multiple sequence alignment

Synthetic MSA · illustrative
MSA depth

Rows are homologous sequences, columns are aligned positions, row 0 is the query. The bar on top is conservation (1 − entropy). Tap a column: arcs join it to the columns whose letters change together with it — green arcs land on a real contact in the structure, red arcs do not.

Co-variation → contact

true contact, Cβ < 8 Å (upper)top coupling, hit (lower)top coupling, miss

If residue 34 is buried against residue 87, a mutation that enlarges one is tolerated only when the other shrinks. Over evolution the two columns drift together. Score every column pair for that dependence (here: mutual information with APC correction) and the top pairs trace the contact map. Cut the MSA depth and the signal drowns in noise.

Genetic search

CPU · minutes to hours
query
101 aa
jackhmmer → UniRef90
jackhmmer → MGnify clusters
HHblits → BFD + Uniclust30
HHsearch → PDB70 templates
MSA
Nseq × Nres
≤ 4 templates
coords + aligned

At inference the MSA is clustered: 512 cluster centres go to the main MSA stack, up to 5120 further rows go to a lighter "extra MSA" stack. Templates are known structures of similar proteins. They help, but AlphaFold 2 is accurate without them for most targets with a deep MSA.

What the network actually receives

FeatureShapeContent
msa_featNclust × Nres × 49one-hot residue + gap + mask (23), deletion flags and values, cluster profile (23)
extra_msaNextra × Nres × 25the unclustered rows, one-hot + deletions
target_featNres × aaquery residue type, one-hot
residue_indexNresposition in the chain (for relative position)
template_*Ntempl × Nres × …template atom positions, distogram, torsions

No coordinates of the target, no force field, no energy. The sequence and the alignment carry the information; the weights carry everything learned from ~170 000 PDB structures (plus self-distillation on predicted structures).

02

Embedding: two tensors

AlphaFold thinks in two representations at once: an MSA representation and a pair representation.

The working tensors

Float, per crop
384

Sizes for one copy in fp32. The pair tensor grows as N², triangle attention logits as N³. That is why training used crops of 256 residues (then 384 in fine-tuning), and why long proteins need chunking and a big GPU.

Pair initialisation

One channel shown

zij starts as "what is i" + "what is j" + "how far apart in sequence" (clipped to ±32, one-hot over 65 bins). The left panel uses a hydropathy value as a stand-in for one learned channel. Nothing about 3D distance is in z yet.

Recycled inputs

On cycles after the first, the previous first MSA row, the previous pair tensor and the previous predicted pseudo-Cβ distances (one-hot over 15 distance bins) are added back in. The same weights run again. See 05.

03

Evoformer: 48 blocks, two tracks

Each block updates the MSA track and the pair track, and lets them talk. 48 blocks, separate weights.

One Evoformer block

Tap an operation

Teal: MSA track m ∈ ℝNseq×Nres×256. Amber: pair track z ∈ ℝNres×Nres×128. Two bridges: the pair track biases MSA row attention; the outer product mean writes MSA statistics into the pair track. Every operation is residual (x ← x + f(x)).

—

—

The triangle update: the key idea

Tap a cell · drag across the matrix

Treat zij as a belief about the edge i–j. Edges i–k and j–k for a third residue k constrain it: three distances must form a triangle. The bar shows the bound that the true distances of every k already seen put on dij; it shrinks onto the true value as k sweeps. AlphaFold does not compute this bound. The triangle operations give each edge exactly the wiring — all k at once — to learn consistency of this kind, and 48 blocks repeat it.

04

Structure module: a gas of rigid frames

Each residue is a rigid body — a rotation and a translation. All start at the origin.

From the "black hole" to a fold

Real final frames · illustrative path
8

Layer 0: every frame is the identity at the origin. Each of the 8 layers (one set of shared weights) runs IPA, then predicts a small rotation and shift per residue and composes it onto the frame. After layer 8, predicted torsion angles place the side-chain atoms. Final frames are the real model's (from N, Cα, C); the in-between layers are drawn as a smooth path for illustration — the real network's intermediate states are not in the DB file.

Frames

The frame of residue i has its origin on Cα, x-axis toward C, and N in the x–y plane. The update is a quaternion with first component fixed to 1 (so it starts near no rotation) plus a translation, both read from the single representation si (Nres × 384).

7 torsions per residue, each predicted as an unnormalised 2D vector (sin, cos) so no angle wraps. Torsions build 8 rigid groups per residue from idealised geometry, and so all heavy atoms.

Invariant Point Attention

Move the whole protein
0°

Each residue proposes query and key points in its own local frame (4 query points, 8 value points per head, 12 heads). The point term compares them in global space. A global move Tg moves both points by the same rigid motion, and distances do not change — so the logits and the update do not depend on where the protein sits or how it is turned. The strip computes both terms live for residue 50: the IPA row stays fixed while you turn the protein; a naive score on raw global coordinates does not.

Backbone torsions of the model

Computed from coordinates

φ and ψ for every residue, read off the predicted backbone and coloured by pLDDT. Confident residues fall in the helix and strand basins; the floppy N-terminal tail scatters. Tap a dot.

05

Recycling and training losses

The whole network runs again on its own output — then a loss in frame space tells it how wrong it was.

Recycling

Illustrative maps
0

Inference does 1 + 3 passes through the same weights. In training the number of cycles is sampled (1–4) and the gradient flows only through the last, so the net learns to improve any earlier guess. The map here is the model's real Cβ distance matrix blurred less with each cycle — a picture of the idea, not of real intermediates.

FAPE: frame aligned point error

Computed live
30°

For every frame i, express every atom j in that frame, in both prediction and truth, and compare. A rigid move of the whole prediction costs nothing. A mirror image has an identical distance matrix (dRMSD = 0) but its frames are reflected, so FAPE punishes it: FAPE sees chirality, distance losses do not. Each error is clamped at 10 Å so one wrong domain cannot dominate.

The loss, term by term

TermWeightSupervisesHead
FAPE (final, all atoms)0.5final structure in every framestructure module
aux (every layer, backbone)0.5backbone FAPE + torsions at each of 8 layersstructure module
distogram0.3Cβ distance, 64 bins over 2–22 Åpair → linear
masked MSA2.0recover 15% masked MSA letters (BERT-style)MSA → linear
pLDDT (conf)0.01per-residue lDDT-Cα of its own predictionsingle → MLP
violation (fine-tune)1.0bond lengths, angles, steric clashesstructure
exp. resolved (fine-tune)0.01was each atom seen in the experimentsingle
PAE / pTM (fine-tune)0.1error of j in frame i, 64 binspair → linear

Confidence heads learn to predict the network's own error. They do not feed back into the structure.

06

Outputs: one structure, two kinds of doubt

Real AlphaFold DB data for SUMO1. Mean pLDDT 78.3.

Predicted structure

AF-P63165-F1 v6
> 90 very high70–90 confident50–70 low< 50 very low

Predicted aligned error

Tap a cell

Tap or hover the map: residue i is the frame aligned on, j is the residue scored.

pLDDT per residue

Tap a bar

pLDDT means

  • The network's own estimate of how well the local environment of each Cα (within 15 Å) would match the true structure (lDDT-Cα, 0–100).
  • Local. A domain can be > 90 everywhere and still sit at the wrong angle to its neighbour — ask PAE.
  • Very low pLDDT often marks intrinsic disorder (here the first ~19 residues), drawn as an extended ribbon.

pLDDT does not mean

  • Not flexibility or B-factor, though they correlate.
  • Not a folding order, rate or pathway. Nothing folds; there is no time axis.
  • Not stability or ΔG. A destabilising mutation can keep a high pLDDT.

PAE means

  • Expected position error of residue j, in Å, after the predicted and true structures are aligned on the frame of residue i.
  • Not symmetric: aligning on i and scoring j differs from the reverse.
  • Low-error blocks are rigid units; here the whole core (≈ 20–92) is one block, the tails float.

PAE does not mean

  • Not a contact map, and not a measure of motion: high PAE between two domains says "unsure of the placement", not "they move".
07

AlphaFold 3: pairs, then diffusion

Same pair-centric trunk idea; a generative head over raw atom coordinates instead of frames.

Denoising atom coordinates

Illustrative denoiser
200

All 809 heavy atoms of the model start as Gaussian noise. Each step the denoiser Dθ, conditioned on the trunk's single and pair tensors, predicts clean coordinates; the sampler moves part of the way there and lowers the noise. 200 steps at inference. Here the "denoiser" is the known answer — the real one is a learned network.

What changed

AlphaFold 2AlphaFold 3
trunkEvoformer ×48 (MSA + pair)MSA module ×4, then Pairformer ×48 (single + pair)
MSAfull track every blocksmall early module; MSA is not carried through the trunk
headstructure module: frames, IPA, torsionsdiffusion module on raw atom coordinates
symmetrybuilt in (IPA, FAPE)learned, with random rotation/translation augmentation
moleculesproteinprotein, DNA, RNA, ligands, ions, modified residues
tokensresiduesresidues / nucleotides; one token per atom for ligands
outputone structure per modelsamples from a distribution

A generative head can hallucinate: in disordered regions it may invent tidy-looking helices. AF3 was trained on AF2 predictions (cross-distillation), where disorder appears as extended ribbons, to suppress this.

08

Limits: what it does not do

An accurate static structure predictor is not a simulator of proteins.

It does not simulate folding

No forces, no solvent, no time steps, no pathway, no kinetics, no chaperones. The output is one set of coordinates; the order in which a real chain folds is not in it. For folding physics see molecular dynamics — a separate field.

Point mutations barely register

Rhodopsin P23H misfolds in cells and causes retinitis pigmentosa. AlphaFold has no folding-energy term, and the MSA behind the query does not change, so its P23H prediction looks like the wild-type fold. Studies of AF2 on missense variants (for example Buel & Walters 2022) find it largely insensitive to destabilising single mutations. Use stability predictors or experiment.

MSA depth sets the ceiling

Accuracy falls steeply when the alignment is shallow (in the AF2 paper, below a median of about 30 effective sequences per residue). Orphan proteins, fast-evolving viral proteins and many designed proteins have few relatives. The curve above is the coupling score of 01 on the synthetic MSA, subsampled: the same cliff, in miniature.

Disorder is not a structure

About a third of human proteins contain long disordered regions. AlphaFold draws them as low-pLDDT ribbons — the SUMO1 tail in 06 is one. The ribbon's shape is not a prediction; only its low confidence is information.

One state, not an ensemble

Proteins that switch folds (RfaH's C-terminal domain flips from a helical hairpin to a β-barrel) or move between conformations get one answer, usually the state best represented in the PDB. Sub-sampling the MSA can sometimes expose a second state; it is a trick, not a feature.

AF2: protein only

No ligands, metals, cofactors, glycans, post-translational modifications or nucleic acids; pH and binding partners do not exist for it. A holo pocket may appear because holo structures dominate the training data — not because the ligand was modelled. AF3 adds many of these, with its own failure modes.