ML from the beginning: the story and the formulas

Methods note · last updated 27 November 2026 · one of three: MD · DFT · ML “from the beginning”

Contents

ML in one paragraph

Machine learning (ML, 机器学习) builds a function from data instead of from a derivation. You choose a family of functions f(x; θ) with adjustable parameters θ (参数), define a loss function (损失函数) that measures how badly the function fits the data, and let an optimiser (优化器) change θ until the loss is small. Everything else is a choice: what the data are (labelled or not), what the function family is (a straight line, a neural network, a graph of neighbours), and what the loss rewards.

The contrast with the MD note is direct. In MD the function is written down first (the force field, Eqs. 2.9 and 2.11 of my thesis) and the computer works out its consequences. In ML the consequences are given (the data) and the computer works out the function. A force field sits between the two: its form was derived, but its parameters (k_r, ϵ_ij, the partial charges) were fitted to quantum-chemical and experimental data, which is a regression problem. The main limit of ML follows from the definition: a fitted function is only reliable near the data it was fitted on.

My thesis, §2.3 Where it appears in this note
§2.3 opening: definition of ML; supervised, unsupervised and semi-supervised learning “1805–1958” (learning with labels) and “1901–2018” (learning without labels)
§2.3 opening: deep learning; neurons and layers; CNNs, autoencoders, transformers “1986–2012” and “2014–2020”
§2.3.1 Dimensionality reduction: PCA and UMAP “1901–2018”
§2.3.2 Clustering: HDBSCAN “1901–2018”
§2.3.3 AlphaFold: pLDDT, static snapshots, models as hypotheses “2018–2024”
Not in the thesis: ML interatomic potentials and graph networks “2007–2022” (my current work)
Not in the thesis: train/test splits, overfitting, data leakage “What ML cannot see”

How this note is built. My thesis applied these methods and described them in words; §2.3 has no equations. This note sets out the mathematics behind them, in the order it was invented.

Timeline

Milestones of machine learning, 1958 to 2024

Read each road from left to right. Filled marks are the tools I used in my thesis; all five date from 2013 or later. Marks with a dot are methods I am working with now. On the first road the ideas waited decades: backpropagation is from 1986, and AlexNet (2012) is the point where data and GPUs caught up with it.

1805–1958: a line, a loss, and the first learning machine

In my thesis: the opening of §2.3, “Supervised learning”: the model is trained on labelled data, and “the goal is to learn a mapping from inputs to known outputs”.

Supervised learning (监督学习) needs a model, a loss and an optimiser. All three existed before the word “machine learning” did.

1805: least squares (最小二乘法). Adrien-Marie Legendre published the method in 1805. Carl Friedrich Gauss published it in 1809 and said he had used it since 1795; his fit to the few observations of Ceres, discovered on 1 January 1801, let astronomers find it again. The model is a straight line, and the loss is the mean squared error (均方误差). It is the formula behind “a mapping from inputs to known outputs” in §2.3:

y^n=w⋅xn+b,L(w,b)=1N∑n=1N(yn−y^n)2 \hat y_n = \mathbf w \cdot \mathbf x_n + b, \qquad L(\mathbf w, b) = \frac{1}{N}\sum_{n=1}^{N}\left(y_n - \hat y_n\right)^2

Here x_n is the input of example n, written as a list of numbers called features (特征). y_n is the known answer, the label (标签). y^n\hat y_n is the model’s output. The weights (权重) w and the bias (偏置) b are the parameters. Training (训练) means finding the parameters that make the loss L as small as possible. If the label is a number the task is regression (回归); if it is a category the task is classification (分类).

1847: gradient descent (梯度下降法). For a straight line the best parameters can be solved exactly. For any other model they cannot, and Augustin-Louis Cauchy’s method of 1847 is used instead:

θ  ←  θ−η ∂L∂θ \theta \;\leftarrow\; \theta - \eta\,\frac{\partial L}{\partial \theta}

θ stands for all the parameters and η is the learning rate (学习率), the size of each step. The gradient ∂L/∂θ points uphill on the loss, so each update moves the parameters downhill. This is the steepest-descent energy minimisation that starts every MD run (§4.2.3 of my thesis), with the loss L in place of the potential energy U and the parameters θ in place of the coordinates. The force of thesis Eq. 2.6, F = −∂U/∂r, is the same downhill direction.

1951: the stochastic version (随机梯度下降, SGD). Herbert Robbins and Sutton Monro introduced stochastic approximation in 1951. In SGD the gradient is computed on a small random batch of the data at each step, not on all of it. Each step is cheap and noisy, and the noise averages out over many steps. Every neural network is trained this way. It is also the “stochastic gradient descent” that optimises the UMAP embedding in §2.3.1 of my thesis.

1958: the perceptron (感知机). Warren McCulloch and Walter Pitts described an artificial neuron (神经元) in 1943. Frank Rosenblatt made one that learns: he simulated the perceptron on an IBM 704 in 1957, published it in 1958, and built it as hardware (the Mark I Perceptron) in 1959–1960. The IBM 704 is the machine type on which Alder and Wainwright ran the first MD in 1957. This is the “neuron” of §2.3:

y^=σ ⁣(w⋅x+b) \hat y = \sigma\!\left(\mathbf w \cdot \mathbf x + b\right)

A neuron is the linear model of 1805 followed by a non-linear activation function (激活函数) σ. In the perceptron σ is a step: the output is 1 if w·x + b is positive and 0 otherwise, so the neuron sorts inputs into two classes. Rosenblatt’s learning rule changed w after each wrong answer, which is SGD applied to one neuron.

1959: the name. Arthur Samuel at IBM, who wrote a program that learned to play checkers, coined the term “machine learning”.

1901–2018: finding structure without labels

In my thesis: §2.3 “unsupervised learning”, §2.3.1 Dimensionality reduction and §2.3.2 Clustering; applied in §4.2.4 and §4.3.1 (Fig. 4.12).

Unsupervised learning (无监督学习) has inputs x_n and no labels. The loss can no longer compare an output with a known answer, so each method defines its own target: keep the variance, keep the neighbours, or find the dense regions.

The data. A trajectory becomes a table with one row per frame and one column per feature. In my thesis (§4.2.4) the features were the distances between backbone beads, taken every five residues, of the TREM2 helix and each DAP12 helix. Each frame is then one point x_n in a space of D dimensions, where D is the number of distances. With large D the distances between points become nearly equal, and “conventional distance metrics lose their discriminative power” (§2.3.1). This is the curse of dimensionality (维数灾难), a term from Richard Bellman.

1901: principal component analysis (主成分分析, PCA). Karl Pearson invented it in 1901, and Harold Hotelling developed and named it independently in the 1930s. This is the “eigendecomposition of the covariance matrix” of §2.3.1:

C=1N−1∑n=1N(xn−xˉ)(xn−xˉ)T,C vk=λk vk \mathbf C = \frac{1}{N-1}\sum_{n=1}^{N}\left(\mathbf x_n - \bar{\mathbf x}\right)\left(\mathbf x_n - \bar{\mathbf x}\right)^{\mathsf T}, \qquad \mathbf C\,\mathbf v_k = \lambda_k\,\mathbf v_k

C is the covariance matrix (协方差矩阵) of the features and xˉ\bar{\mathbf x} is the mean frame. Its eigenvectors v_k are the principal components (主成分), and each eigenvalue λ_k is the variance of the data along v_k. Keeping the two components with the largest λ_k gives the 2D picture that retains the most variance. PCA can only rotate the axes and drop some of them. It is linear, which is the limit stated in §2.3.1.

1957–1967: k-means (k 均值聚类). Clustering (聚类) assigns points to groups. Stuart Lloyd proposed the standard algorithm at Bell Labs in 1957 (published 1982), and James MacQueen named it in 1967:

min⁡S1,…,Sk  ∑j=1k  ∑xn∈Sj∥xn−μj∥2 \min_{S_1,\dots,S_k}\;\sum_{j=1}^{k}\;\sum_{\mathbf x_n \in S_j}\left\lVert \mathbf x_n - \boldsymbol\mu_j \right\rVert^2

S_j is cluster j and μ_j is its centre. The number of clusters k must be chosen in advance, every point is assigned to a cluster, and the result favours round clusters of similar size. For MD frames this is a poor fit: frames in transit between two states are forced into one of them.

1996: density-based clustering. DBSCAN, by Martin Ester, Hans-Peter Kriegel, Jörg Sander and Xiaowei Xu, defines a cluster as a region where points are dense. It has two parameters, a radius ε and a minimum number of points, and it labels points in sparse regions as noise (噪声点). Its limit is the single radius: one density threshold for the whole data set.

2013: HDBSCAN. Campello, Moulavi and Sander removed the single threshold by examining all density levels at once. The Python library hdbscan (thesis ref. 184) followed in 2017. These two definitions are the “local density” and the “distance-weighted graph” of §2.3.2:

corem(a)=distance from a to its m-th nearest neighbourdmreach(a,b)=max⁡ ⁣{corem(a), corem(b), d(a,b)} \begin{aligned} \mathrm{core}_m(a) &= \text{distance from } a \text{ to its } m\text{-th nearest neighbour} \\ d_{\mathrm{mreach}}(a,b) &= \max\!\left\{\mathrm{core}_m(a),\ \mathrm{core}_m(b),\ d(a,b)\right\} \end{aligned}

2008 and 2018: t-SNE and UMAP. Laurens van der Maaten and Geoffrey Hinton published t-SNE in 2008. Leland McInnes, John Healy and James Melville published UMAP in 2018. Both are non-linear dimensionality reduction (降维): they place the points in 2D so that neighbours stay neighbours. These are the “weighted graph” and the embedding optimised by SGD in §2.3.1:

wj∣i=exp⁡ ⁣(−dij−ρisi)for the n_neighbors nearest neighbours j of iqij=11+A ∥ui−uj∥2BL=∑i≠j[ wij ln⁡wijqij+(1−wij)ln⁡1−wij1−qij] \begin{aligned} w_{j|i} &= \exp\!\left(-\frac{d_{ij} - \rho_i}{s_i}\right) \quad \text{for the } \texttt{n\_neighbors} \text{ nearest neighbours } j \text{ of } i \\ q_{ij} &= \frac{1}{1 + A\,\lVert \mathbf u_i - \mathbf u_j \rVert^{2B}} \\ L &= \sum_{i \neq j}\left[\, w_{ij}\,\ln\frac{w_{ij}}{q_{ij}} + \left(1 - w_{ij}\right)\ln\frac{1 - w_{ij}}{1 - q_{ij}} \right] \end{aligned}

Three consequences follow from the formulas.

Why density suits MD. The MD note gave F(ξ) = −k_B T ln P(ξ): a region that is densely populated is a free-energy basin. A density-based cluster in a good feature space is therefore a candidate metastable state. The populations are equilibrium populations only if the sampling has converged.

Two meanings of “cluster”. In self-assembly, cluster analysis asks which molecules are in contact and how large each aggregate is. That is a connected-components calculation on a contact graph. It is a different method from the conformational clustering in this chapter.

1986–2012: deep learning

In my thesis: the “Deep learning” paragraph of §2.3: multilayered networks, neurons organised into layers, CNNs and autoencoders.

1969: the limit of one neuron. Marvin Minsky and Seymour Papert showed in their book Perceptrons that a single layer of perceptrons cannot learn the XOR function, because one neuron can only separate two classes with a straight line. Several layers can do it, but nobody had an efficient way to train the layers in the middle. Interest in neural networks fell for more than a decade.

A network of layers (神经网络). This is “neurons, which are organised into layers” in §2.3:

h(l)=σ ⁣(W(l) h(l−1)+b(l)),h(0)=x,y^=h(Llayers) \mathbf h^{(l)} = \sigma\!\left(\mathbf W^{(l)}\,\mathbf h^{(l-1)} + \mathbf b^{(l)}\right), \qquad \mathbf h^{(0)} = \mathbf x, \qquad \hat{\mathbf y} = \mathbf h^{(L_{\text{layers}})}

Each layer is the 1958 neuron applied many times in parallel. h(l)\mathbf h^{(l)} is the output of layer l, W(l)\mathbf W^{(l)} is its table of weights and b(l)\mathbf b^{(l)} its biases. The layers between input and output are the hidden layers (隐藏层). Without the activation function σ, any stack of layers would reduce to one linear model, so the non-linearity is what makes depth useful. “Deep” (深度学习) means many layers.

1986: backpropagation (反向传播). David Rumelhart, Geoffrey Hinton and Ronald Williams showed in Nature that hidden layers can be trained by applying the chain rule (链式法则) backwards from the loss. The mathematical method, reverse-mode automatic differentiation (自动微分), had been published by Seppo Linnainmaa in 1970:

∂L∂W(l)=∂L∂h(Llayers)  ∂h(Llayers)∂h(Llayers−1)  ⋯  ∂h(l+1)∂h(l)  ∂h(l)∂W(l) \frac{\partial L}{\partial \mathbf W^{(l)}} = \frac{\partial L}{\partial \mathbf h^{(L_{\text{layers}})}}\; \frac{\partial \mathbf h^{(L_{\text{layers}})}}{\partial \mathbf h^{(L_{\text{layers}}-1)}}\;\cdots\; \frac{\partial \mathbf h^{(l+1)}}{\partial \mathbf h^{(l)}}\; \frac{\partial \mathbf h^{(l)}}{\partial \mathbf W^{(l)}}

One forward pass computes the output, and one backward pass gives the gradient of the loss with respect to every weight, at about the cost of the forward pass. Gradient descent then works for models with millions of parameters. The same operation later gives ML potentials their forces: F = −∂E/∂r is a gradient of one number with respect to many inputs.

1988–1989: what a network can represent. George Cybenko, and Kurt Hornik with co-workers, proved that a network with one hidden layer can approximate any continuous function if the layer is wide enough. The theorem says a good set of weights exists. It does not say that training will find it, or that the result will hold outside the training data.

1980–1998: convolutional networks (卷积神经网络, CNN). Kunihiko Fukushima’s neocognitron (1980) introduced the layer type. Yann LeCun’s group trained such networks by backpropagation in 1989 to read handwritten postcodes, and published LeNet-5 in 1998:

(x∗k)i=∑jkj xi+j (\mathbf x * \mathbf k)_i = \sum_{j} k_j\, x_{i+j}

A small filter k is slid along the input, and the same weights are used at every position. The network then needs far fewer parameters, and a pattern is recognised wherever it occurs. This is the first case of building a symmetry of the problem into the model. For images the symmetry is translation. For atoms it will be rotation (chapter “2007–2022”).

Autoencoders (自编码器). An autoencoder is a network trained to reproduce its own input through a narrow middle layer. The middle layer is then a learned low-dimensional description of the data. With linear layers it gives the same subspace as PCA; Mark Kramer described the non-linear version in 1991 as “nonlinear PCA”. It is unsupervised, which is why §2.3 lists it under representation learning.

Classification: softmax and cross-entropy.

pc=ezc∑c′ezc′,L=−∑n=1Nln⁡pcn(xn) p_c = \frac{e^{z_c}}{\sum_{c'} e^{z_{c'}}}, \qquad L = -\sum_{n=1}^{N} \ln p_{c_n}(\mathbf x_n)

The network gives one score z_c per class, and softmax turns the scores into probabilities p_c that sum to 1. The loss is the negative log-probability of the correct class c_n: the cross-entropy that UMAP also uses. Softmax is the Boltzmann distribution of the MD note with z_c = −E_c / k_B T. The name is from John Bridle (1989).

Overfitting (过拟合). A network with more parameters than data points can reproduce the training data exactly, including its noise, and still fail on new data. Two standard counter-measures:

Ltotal=Ldata+γ∑kθk2 L_{\text{total}} = L_{\text{data}} + \gamma \sum_{k} \theta_k^2

Neither replaces a test on data the model has never seen (chapter “What ML cannot see”).

2009–2012: data and GPUs. Fei-Fei Li’s group presented ImageNet in 2009; it grew to more than 14 million labelled images. In 2012 AlexNet, a CNN by Alex Krizhevsky, Ilya Sutskever and Geoffrey Hinton, was trained on two GPUs and won the ImageNet challenge with a top-5 error of 15.3%, more than 10.8 percentage points ahead of the runner-up. The ideas were from 1986–1998. What changed was the amount of labelled data and the hardware.

2014–2020: attention, transformers and diffusion models

In my thesis: “transformer models, which have revolutionised natural language processing tasks” (§2.3). Both ideas in this chapter are the machinery inside AlphaFold (§2.3.3).

The problem: long-range relations. A sentence and a protein sequence share one difficulty. Two positions far apart in the sequence can depend strongly on each other: two residues 100 positions apart may be in contact in the folded structure. A CNN sees only a short window, and earlier sequence models passed information along one step at a time and lost it over long distances.

2014 and 2017: attention (注意力机制). Dzmitry Bahdanau, Kyunghyun Cho and Yoshua Bengio introduced attention for machine translation in 2014. In 2017 Ashish Vaswani and co-authors published “Attention Is All You Need”, a network built from attention alone: the transformer. This is the core of the “transformer models” of §2.3:

Attention(Q,K,V)=softmax ⁣(Q KTdk)V \mathrm{Attention}(\mathbf Q, \mathbf K, \mathbf V) = \mathrm{softmax}\!\left(\frac{\mathbf Q\,\mathbf K^{\mathsf T}}{\sqrt{d_k}}\right)\mathbf V

Every token can take information from every other token in one step, however far apart they are, and the weights are learned from data. The cost is one weight per pair of tokens, so memory grows with the square of the sequence length. This is why structure predictors run out of GPU memory on long sequences.

For proteins, an attention weight between residues i and j is a learned, soft statement that the two residues matter to each other. Its role is close to that of an entry in a contact map computed from MD, with one difference: it is learned from data and has no distance cut-off.

2018: language models and self-supervised learning (自监督学习). BERT and the first GPT model were transformers trained on plain text: BERT by hiding words and predicting them, GPT by predicting the next word. The labels come from the data itself, so no human labelling is needed. This differs from the semi-supervised learning (半监督学习) of §2.3, which mixes a few labelled examples with many unlabelled ones. The same training applied to millions of protein sequences gives protein language models (蛋白质语言模型). Their internal vectors for each residue can be used as input features for a small supervised model.

2015 and 2020: diffusion models (扩散模型). A generative model (生成模型) learns the distribution of the data and produces new samples from it. Jascha Sohl-Dickstein and co-authors introduced diffusion models in 2015, using ideas from non-equilibrium thermodynamics. Jonathan Ho, Ajay Jain and Pieter Abbeel gave the form now in use (DDPM) in 2020:

xt=αˉt  x0+1−αˉt  ε,ε∼N(0,I),L=E ∥ε−εθ(xt,t)∥2 \mathbf x_t = \sqrt{\bar\alpha_t}\;\mathbf x_0 + \sqrt{1 - \bar\alpha_t}\;\boldsymbol\varepsilon, \qquad \boldsymbol\varepsilon \sim \mathcal N(\mathbf 0, \mathbf I), \qquad L = \mathbb E\,\big\lVert \boldsymbol\varepsilon - \boldsymbol\varepsilon_\theta(\mathbf x_t, t) \big\rVert^2

The forward process is a random walk of the data point, the same mathematics as Brownian motion. The reverse process is a stochastic dynamics driven by a learned force. For a Boltzmann distribution P∝exp⁡(−U/kBT)P \propto \exp(-U / k_B T), the gradient of ln P is −∇U / k_B T, the physical force in units of k_B T. The quantity a diffusion model learns is this gradient for the distribution of its training data.

Two practical consequences:

2007–2022: ML meets atoms

In my thesis: not covered. This chapter attaches to Fig. 2.1 in §2.1 (the gap between AIMD and all-atom MD), to the sentence there that machine learning is beginning to make AIMD-level accuracy feasible for larger systems, and to the force field of Eqs. 2.9 and 2.11, which it replaces.

The problem. DFT gives accurate energies and forces, but its cost grows roughly with the cube of the number of electrons. A force field is fast, but its form is fixed: fixed partial charges, harmonic bonds that cannot break. A machine-learned interatomic potential (机器学习势, MLIP) is a regression model between the two. Its input is the positions and elements of the atoms, its label is the DFT energy, and once trained it is used in MD in place of the force field.

2007: Behler and Parrinello. Neural networks had been fitted to potential-energy surfaces of small systems since the 1990s. Jörg Behler and Michele Parrinello made the approach work for systems of any size:

E=∑i=1NatomsEi ⁣(Gi),F⃗i=−∂E∂r⃗i E = \sum_{i=1}^{N_{\text{atoms}}} E_i\!\left(\mathbf G_i\right), \qquad \vec F_i = -\frac{\partial E}{\partial \vec r_i}

Symmetry (对称性). The energy of a molecule does not change when the molecule is moved or rotated, or when two identical atoms are swapped, and the forces rotate with the molecule. For any rotation R:

E(R r1,…,R rN)=E(r1,…,rN)F⃗i(R r1,…,R rN)=R F⃗i(r1,…,rN) \begin{aligned} E(\mathbf R\,\mathbf r_1, \dots, \mathbf R\,\mathbf r_N) &= E(\mathbf r_1, \dots, \mathbf r_N) \\ \vec F_i(\mathbf R\,\mathbf r_1, \dots, \mathbf R\,\mathbf r_N) &= \mathbf R\,\vec F_i(\mathbf r_1, \dots, \mathbf r_N) \end{aligned}

The first property is invariance (不变性) and the second is equivariance (等变性). A model that does not have them built in must learn them from many rotated copies of the same data. Behler and Parrinello built invariance into the descriptor, using functions of distances and angles only. In 2010 Albert Bartók, Mike Payne, Risi Kondor and Gábor Csányi combined local descriptors with Gaussian process regression (the Gaussian approximation potential, GAP).

2017: message passing on a graph (消息传递). A molecule is treated as a graph (图): atoms are the nodes (节点), and each pair of atoms closer than r_c is joined by an edge (边). Graph neural networks (图神经网络) date from 2009. Justin Gilmer and co-authors applied them to quantum chemistry in 2017 under the name message passing:

mi(l+1)=∑j∈N(i)ψ ⁣(hi(l), hj(l), r⃗ij),hi(l+1)=ϕ ⁣(hi(l), mi(l+1)) \mathbf m_i^{(l+1)} = \sum_{j \in \mathcal N(i)} \psi\!\left(\mathbf h_i^{(l)},\, \mathbf h_j^{(l)},\, \vec r_{ij}\right), \qquad \mathbf h_i^{(l+1)} = \phi\!\left(\mathbf h_i^{(l)},\, \mathbf m_i^{(l+1)}\right)

The descriptor is now learned, not designed by hand. The same network can be trained to predict a property of each atom (a partial charge, a Fukui function) or of the whole molecule, in place of the energy.

2021–2022: equivariant networks (等变神经网络). NequIP (Simon Batzner and co-authors, 2021) and MACE (Ilyes Batatia and co-authors, 2022) carry vectors and higher tensors in h_i that rotate with the molecule. They reach a given accuracy with far less training data. Since about 2023, potentials of this type have been trained on millions of DFT calculations covering much of the periodic table and released as general-purpose (“foundation”) models. Fine-tuning (微调) means continuing the training of such a model on a small set of your own DFT data.

What an ML potential inherits.

ML/MM. By analogy with QM/MM (Fig. 2.1 of my thesis), an ML potential can describe a small reactive region while the force field describes the rest.

2018–2024: ML meets proteins

In my thesis: §2.3.3 AlphaFold structure prediction; used in Chapter 3 (the AF_TD model) and in §4.2.1 (seven TREM2 variants, Figs. 4.1–4.7).

The problem and the test. Predicting the 3D structure of a protein from its sequence (结构预测) has had a blind test since 1994: CASP, held every two years, in which groups predict structures that have been solved but not yet released. Neural networks had been used for secondary structure since the 1980s; PSIPRED (thesis ref. 174) is of this kind.

2011: co-evolution (共进化). Two residues that touch in the folded protein tend to mutate together during evolution. In a multiple sequence alignment (多序列比对, MSA) of many related sequences, pairs of columns that vary together therefore point to contacts. In 2011 this signal was shown to be enough to predict a protein’s fold. It is the main input of AlphaFold, and thesis ref. 177 uses the same signal to predict mutation effects.

2018 and 2020: AlphaFold. AlphaFold 1 from DeepMind placed first at CASP13 in 2018. AlphaFold 2 won CASP14 in 2020 with a median score of 92.4 on the 100-point GDT scale, close to experimental accuracy for many targets. The paper and the code appeared in July 2021. AlphaFold 2 is a supervised model: the input is the sequence with its MSA, the label is the experimental structure from the PDB, and the network uses attention between the sequences of the MSA and between pairs of residues.

2022: ColabFold. Milot Mirdita and co-authors combined AlphaFold 2 with a much faster sequence search (MMseqs2) and made it run in a notebook. This is the tool I used, at version 1.5.2.

Reading the output. Figs. 4.1–4.7 of my thesis show three panels for each TREM2 mutant. Each corresponds to one idea.

pLDDT (panel B). This is the “residue-level confidence metric” of §2.3.3:

LDDT=14∑τ ∈ {0.5, 1, 2, 4 A˚}(fraction of local distances with ∣dpred−dtrue∣<τ) \mathrm{LDDT} = \frac{1}{4}\sum_{\tau \,\in\, \{0.5,\,1,\,2,\,4\ \text{\AA}\}} \Big(\text{fraction of local distances with } \left|d_{\text{pred}} - d_{\text{true}}\right| < \tau\Big)

LDDT compares a predicted structure with the true one. For each residue it takes the distances to atoms within 15 Å and counts how many are reproduced within four tolerances. It needs no superposition, so it measures local accuracy only. pLDDT is the network’s own prediction of this score, from 0 to 100, made without knowing the true structure. Above 90 is very high confidence, 70–90 is confident, and below 50 often indicates disorder, as §2.3.3 says.

PAE (panel A). The predicted aligned error (预测对齐误差) is a table with one entry for each pair of residues. Entry (i, j) is the expected position error of residue j, in ångström, when the predicted and true structures are superposed on residue i. Low PAE between two helices or two chains means their relative placement is predicted with confidence. For a complex, this is the quantity to read. pLDDT says nothing about how two chains sit relative to each other.

MSA coverage (panel C). This is the number of aligned sequences at each position. Where the alignment is shallow, the co-evolution signal is weak and confidence falls.

Five models (rank_1 to rank_5). AlphaFold 2 has five separately trained sets of parameters. ColabFold runs all five and ranks the results by confidence.

A consequence for point mutants. A point mutant has almost the same MSA as the wild type. AlphaFold 2 therefore tends to return almost the same structure for both, with almost the same confidence. Similar predictions for K186A and the wild type are not evidence that the mutation leaves the structure unchanged. My thesis does not rely on such evidence: the AlphaFold models were “initial conformational hypotheses for docking”, and the effect of each mutation was assessed by coarse-grained self-assembly and all-atom MD (§4.2.1).

What the model does not contain. §2.3.3 already lists it: one static structure, no membrane, no dynamics, and low confidence that often reflects flexibility and not error.

2021–2024: complexes and ligands. AlphaFold-Multimer (October 2021) was trained on protein complexes. AlphaFold 3 (May 2024) predicts proteins together with nucleic acids, ligands and ions, and generates the atom coordinates with a diffusion model. Predicting a protein and its ligand together is called co-folding (共折叠). Open-source models of the same type have followed. For ligands, these models are most reliable when similar ligands and pockets are in their training data, and they can return poses with wrong stereochemistry or atomic clashes.

2024: two Nobel Prizes. The Chemistry prize went half to David Baker for computational protein design and half to Demis Hassabis and John Jumper for AlphaFold. The Physics prize went to John Hopfield and Geoffrey Hinton for foundational work on neural networks. Hopfield’s 1982 network has an energy function of the Ising type from statistical physics, and Hinton’s Boltzmann machine samples its states from the Boltzmann distribution.

What ML cannot see, and how to test a model honestly

In my thesis: the closing sentences of §2.3.2 (hyperparameters are tuned and clusters “validated against physical criteria”), the caveat on semi-supervised learning in §2.3, and §2.3.3 (models as “structurally informed hypotheses”).

A fitted function knows only its training data. Every limit in this chapter follows from that sentence.

Training, validation and test sets (训练集、验证集、测试集):

Ltrain=1Ntrain∑n∈trainℓ(yn,f(xn;θ)),Ltest=1Ntest∑n∈testℓ(yn,f(xn;θ)) L_{\text{train}} = \frac{1}{N_{\text{train}}}\sum_{n \in \text{train}} \ell\big(y_n, f(\mathbf x_n;\theta)\big), \qquad L_{\text{test}} = \frac{1}{N_{\text{test}}}\sum_{n \in \text{test}} \ell\big(y_n, f(\mathbf x_n;\theta)\big)

ℓ\ell is the loss for one example. The parameters θ are fitted on the training set. The hyperparameters (超参数), which are the settings chosen by the user such as the learning rate, the number of layers, n_neighbors or min_cluster_size, are chosen on a separate validation set. The test set is used once, at the end. L_test estimates how the model performs on new data, which is called generalisation (泛化). A large gap between L_test and L_train is the measurable sign of overfitting. With little data, cross-validation (交叉验证) rotates the roles: the data are cut into k parts and each part serves once as the test set.

Data leakage (数据泄漏). The test is valid only if the test set is independent of the training set. Three cases matter in molecular modelling.

The number of independent samples in a trajectory is much smaller than the number of frames:

Neff≈Tsim2 τ N_{\text{eff}} \approx \frac{T_{\text{sim}}}{2\,\tau}

T_sim is the length of the trajectory and τ is the correlation time of the quantity of interest. If a ligand binds and unbinds only a few times in 1 µs, N_eff for binding is a few, however many frames were saved.

Interpolation and extrapolation (内插与外推). A model is reliable between its training points and unreliable beyond them, and it gives no warning of its own. The CGenFF penalty score is a hand-made warning of this kind for a force field. For ML potentials a common warning is the disagreement between several models trained on the same data.

Confidence is not accuracy. pLDDT and PAE are themselves outputs of a trained network. They are calibrated on proteins like those in the PDB. For inputs far from that set, a prediction can be confident and wrong.

Unsupervised methods have no test set. There are no labels, so there is no L_test. Three checks stand in for it:

My thesis applies the third check: the clusters are characterised by contact maps and representative structures (Figs. 4.13–4.19). Looking back, two things could be stronger. Contact maps are closely related to the distance features that defined the clusters, so the check is only partly independent; the all-atom simulations started from each cluster are the better test. And the hyperparameters were chosen “iteratively to yield physically meaningful conformational clusters”, which leaves the number of clusters partly a choice. What I would add today is a scan showing how the number of clusters changes over a grid of settings.

Baselines (基线). A model’s error means little alone. It has to be compared with the simplest method that could work: the mean of the training labels, a linear fit on one physical descriptor, or the nearest training example.

Claim Test that supports it Common failure
These clusters are real conformational states same clusters with other settings, seeds and subsets; an independent observable separates them clusters produced by the embedding or by tuning
The model predicts a property for new molecules test molecules from chemical families absent from training random split of close analogues
A model trained on MD frames generalises split by trajectory or replica random split of frames
The predictor distinguishes two mutants difference larger than the spread over seeds and models; known positive and negative controls comparing single predictions
The ML potential is accurate for my system energies and forces against DFT on frames from my own MD; a stable long run validated on a public benchmark only
The predicted complex is correct an experimental structure; failing that, agreement of independent methods plus physical checks a high confidence score taken as proof

How the three notes fit together. DFT gives accurate energies for small systems, which serve as labels. MD gives sampling, which serves as data. ML fits functions to either. It can analyse MD (as in my thesis), replace the force field (ML potentials) or propose starting structures (AlphaFold), and in each role it is tested against the physics and not the other way round.

Where the ideas meet my work

Each row is a tool or setting from my thesis or my current work, traced to the idea behind it.

Tool or setting In my thesis and papers In current work Idea, and where it starts
One feature vector per frame bead–bead distances, §4.2.4 distance and contact features for PHA systems a trajectory as a data table; “1901–2018”
PCA described as the linear method, §2.3.1 a first look at any feature table eigenvectors of the covariance matrix; 1901
UMAP, n_neighbors 50 and 10 §2.3.1, §4.2.4, Fig. 4.12 PHA simulations neighbour graph, cross-entropy, SGD; 2018
HDBSCAN, min_cluster_size 50, selection epsilon 2.0 and 1.5 §2.3.2, §4.2.4, Fig. 4.12 PHA simulations mutual reachability distance, minimum spanning tree; 2013
Stochastic gradient descent inside UMAP, §2.3.1 training of any model 1847 and 1951
Steepest-descent minimisation start of every run, §4.2.3 start of every run gradient descent on U; 1847
Force-field parameters CHARMM36m, §2.2.2 GAFF2 and CGenFF for PHA least-squares fitting and extrapolation; 1805
ColabFold v1.5.2 (AlphaFold 2) Chapter 3 (AF_TD); §4.2.1 – supervised training on the PDB, attention; 2020–2022
pLDDT, PAE, MSA coverage §2.3.3, Figs. 4.1–4.7 – a learned confidence; “2018–2024”
AlphaFold 3 a reference for complex assembly, §4.2.1 – diffusion model; 2015–2024
Structure–property regression not used PHA datasets: structure in, MD property out (in progress) least squares and honest splits; 1805
DFT results as labels not used reference data for an ML potential (in progress) supervised regression; 2007
ML potential one sentence in §2.1 DFT-to-ML-potential workflow with active learning (in progress) Behler–Parrinello, message passing; 2007–2022
Independent replicas three per all-atom system data split by trajectory, not by frame independent samples; “What ML cannot see”

Symbol key

§2.3 of my thesis has no equations, so every symbol here is new except r_i, F_i and r_c, which keep their meaning from Chapter 2 of the thesis. Some letters carry two meanings: k is the number of clusters in k-means, the index of an eigenvector, and the filter in a convolution; h is the output of a layer and the feature vector of an atom; σ is the activation function here and the Lennard-Jones distance σ_ij in the MD note.

Symbol Meaning Chapter 中文
x_n, y_n, y^n\hat y_n input (feature vector) of example n; its label; the model’s output 1805–1958 输入(特征向量);标签;预测值
N, D number of examples (frames); number of features 1805–1958 样本数;特征数(维数)
θ; w, b all parameters of a model; weights and bias 1805–1958 参数;权重、偏置
L; ℓ\ell loss over a data set; loss for one example 1805–1958 损失函数
η learning rate 1805–1958 学习率
σ(·) activation function 1805–1958 激活函数
C, xˉ\bar{\mathbf x} covariance matrix of the features; mean of the data 1901–2018 协方差矩阵;均值
v_k, λ_k eigenvector k of C (a principal component); its eigenvalue 1901–2018 特征向量(本征向量);特征值(本征值)
S_j, μ_j, k cluster j; its centre; number of clusters 1901–2018 簇;簇中心;簇数
core_m(a) distance from point a to its m-th nearest neighbour 1901–2018 核心距离
d(a,b), d_mreach(a,b) distance between two points; mutual reachability distance 1901–2018 距离;相互可达距离
d_ij, ρ_i, s_i UMAP: distance between frames i and j; distance from i to its nearest neighbour; local scale of frame i 1901–2018 距离;最近邻距离;局部尺度
w_ij, q_ij UMAP: neighbour weight in the original space; in the 2D embedding 1901–2018 边权重
u_i; A, B 2D point that represents frame i; constants set by min_dist 1901–2018 嵌入坐标
h(l)\mathbf h^{(l)}, W(l)\mathbf W^{(l)}, b(l)\mathbf b^{(l)} output, weights and biases of layer l 1986–2012 第 l 层的输出、权重、偏置
L_layers number of layers 1986–2012 层数
z_c, p_c score and probability of class c 1986–2012 得分;概率
γ strength of the regularisation term 1986–2012 正则化系数
Q, K, V; d_k queries, keys and values; length of a key vector 2014–2020 查询、键、值
x_0, x_t a data point; the same point after t noise steps 2014–2020 原始数据;加噪后的数据
ε, ε_θ, αˉt\bar\alpha_t added noise; the network’s prediction of it; fraction of the signal left at step t 2014–2020 噪声;预测噪声
E, E_i, G_i total energy; energy assigned to atom i; descriptor of its neighbourhood 2007–2022 总能量;原子能量;描述符
r_i, F_i, r_c position of atom i; force on it (thesis Eq. 2.6); cut-off radius 2007–2022 位置;力;截断半径
R a rotation 2007–2022 旋转
h_i, m_i, N(i) feature vector of atom i; message it receives; its neighbours 2007–2022 节点特征;消息;近邻
ψ, φ message function; update function 2007–2022 消息函数;更新函数
LDDT, pLDDT local distance difference test; its predicted value, 0–100 2018–2024 局部距离差异测试;预测值
PAE(i, j) predicted aligned error of residue j when aligned on residue i 2018–2024 预测对齐误差
L_train, L_test loss on the training set; on the test set What ML cannot see 训练误差;测试误差
τ, T_sim, N_eff correlation time; trajectory length; number of independent samples What ML cannot see 相关时间;模拟时长;有效样本数

Glossary: English–中文

Variants are in brackets. The third column gives where the term appears in my thesis; a dash means it does not. One clash to know: 特征向量 is used both for “feature vector” and for “eigenvector”. Physics and quantum chemistry texts avoid it by writing 本征向量 and 本征值 for the eigen terms.

Learning and models

English 中文 Thesis
Machine learning 机器学习 §2.3
Supervised learning 监督学习(有监督学习) §2.3
Unsupervised learning 无监督学习(非监督学习) §2.3
Semi-supervised learning 半监督学习 §2.3
Self-supervised learning 自监督学习 –
Deep learning 深度学习 §2.3
Neural network; neuron 神经网络;神经元 §2.3
Layer; hidden layer 层;隐藏层(隐含层) §2.3
Feature; label 特征;标签 §2.3 (labelled data)
Parameter; weight; bias 参数;权重;偏置 –
Hyperparameter 超参数 §2.3.2
Training 训练 §2.3
Regression; classification 回归;分类 §2.3.1 (classification)
Loss function 损失函数 –
Mean squared error 均方误差 –
Least squares 最小二乘法 –
Gradient descent 梯度下降法 –
Stochastic gradient descent 随机梯度下降 §2.3.1
Learning rate 学习率 –
Perceptron 感知机(感知器) –
Activation function 激活函数 –
Backpropagation 反向传播 –
Chain rule; automatic differentiation 链式法则;自动微分 –
Convolutional neural network; filter 卷积神经网络;卷积核 §2.3
Autoencoder 自编码器(自动编码器) §2.3
Softmax usually left as softmax(归一化指数函数) –
Cross-entropy 交叉熵 –
Attention 注意力机制 –
Transformer usually left as Transformer §2.3
Token 词元(标记) –
Language model; protein language model 语言模型;蛋白质语言模型 –
Generative model; diffusion model 生成模型;扩散模型 –
Random seed 随机种子 –

Structure without labels

English 中文 Thesis
Dimensionality reduction 降维 §2.3.1
Curse of dimensionality 维数灾难(维度灾难) §2.3.1 (described)
Principal component analysis 主成分分析 §2.3.1
Covariance matrix 协方差矩阵 §2.3.1
Eigenvalue; eigenvector 特征值(本征值);特征向量(本征向量) §2.3.1 (eigendecomposition)
Manifold 流形 §2.3.1
Embedding 嵌入 §2.3.1
Clustering; cluster 聚类;簇 §2.3.2
k-means k 均值聚类 –
Density-based clustering 基于密度的聚类 §2.3.2
Core distance 核心距离 –
Mutual reachability distance 相互可达距离(互达距离) –
Minimum spanning tree 最小生成树 §2.3.2
Noise point 噪声点 §2.3.2

Atoms and proteins

English 中文 Thesis
Machine-learned interatomic potential 机器学习势(机器学习原子间势、机器学习力场) –
Descriptor 描述符 –
Symmetry; invariance; equivariance 对称性;不变性;等变性 –
Gaussian process regression 高斯过程回归 –
Graph neural network 图神经网络 –
Message passing; node; edge 消息传递;节点;边 –
Foundation model; fine-tuning 基础模型;微调 –
Structure prediction 结构预测 §2.3.3
Multiple sequence alignment 多序列比对 Figs. 4.1–4.7
Co-evolution 共进化(协同进化) §2.3 (co-variation)
Confidence 置信度 §2.3.3
Predicted aligned error 预测对齐误差(预测比对误差) Figs. 4.1–4.7
Co-folding 共折叠 –

Testing a model

English 中文 Thesis
Training, validation and test set 训练集、验证集、测试集 –
Cross-validation 交叉验证 –
Generalisation 泛化 –
Overfitting 过拟合 –
Regularisation 正则化 –
Dropout usually left as Dropout(随机失活) –
Data leakage 数据泄漏(数据泄露) –
Interpolation; extrapolation 内插(插值);外推 –
Baseline; benchmark 基线;基准(基准测试) –

Sources and further reading

My thesis and papers.

Reviews I started from (all cited in my thesis).

Papers behind the formulas.

Names and dates were checked in November 2026 against the English Wikipedia articles on each topic: Least squares, Gradient descent, Stochastic gradient descent, Perceptron, Machine learning, Backpropagation, Universal approximation theorem, Convolutional neural network, AlexNet, ImageNet, Autoencoder, Dilution (dropout), Softmax function, Principal component analysis, Curse of dimensionality, k-means clustering, DBSCAN, t-SNE, Nonlinear dimensionality reduction, Transformer, Diffusion model, Machine-learned interatomic potential, Graph neural network, AlphaFold, CASP, Protein structure prediction, David Baker, Hopfield network, Boltzmann machine.

Companion notes. MD from the beginning and DFT from the beginning.

About this note. Drafted with the help of an AI assistant (Claude).