Backpropagation answers one precise question:
If the model's prediction is wrong, how much did each trainable parameter contribute to that error?
In Strange Matter Engine, it is the mechanism that can teach the shared local graph-cellular-automaton rule. The rule is applied to every atom and reused at every generation, so a parameter can influence the final prediction through many atoms and many points in time.
Backpropagation is an efficient application of the chain rule. It calculates derivatives; an optimiser uses those derivatives to update parameters.
For molecule
where:
-
$G_m$ is the molecular graph; -
$X_m^{(0)}\in\mathbb R^{n_m\times d}$ contains the initial states of its$n_m$ atoms; -
$F_\theta$ is the shared CA update rule; -
$X_m^{(t)}$ is the state of all atoms at generation$t$ ; -
$z_m\in\mathbb R^p$ is the trajectory-derived dynamical fingerprint; -
$\widehat y_m$ is predicted pIC50; and -
$y_m$ is experimental pIC50.
The ridge readout solves coefficients torch.linalg.solve, through the support and query fingerprints, and through all
For a scalar function
measures the local change in
If
For many parameters
It points in the direction of steepest local increase of the loss
Suppose
The parameter
The three local derivatives are
Hence
Backpropagation evaluates chains like this from the loss backwards, reusing intermediate results rather than repeatedly expanding every possible path.
Let
Here,
- the forward pass uses the current parameter values to produce a prediction and measure its error;
- the backward pass calculates how sensitive that error is to each trainable parameter; and
- the parameter update uses those sensitivities to choose new parameter values.
The forward pass follows information from input to loss. It answers: with the parameters as they are now, what does the model predict, and how wrong is that prediction? No parameter is changed during this pass.
First, the input is transformed into the pre-activation
The activation function then converts
Finally, the prediction is compared with the target
The intermediate values
The backward pass starts at the loss and follows the chain of dependencies in reverse. It does not make another prediction. It calculates how a small change in each parameter would locally change the loss:
The gradient supplies a direction and a local sensitivity, but we still need to decide how far to move the parameter. The learning rate, written
Gradient descent uses
The minus sign moves against the gradient, towards lower loss. The learning rate scales that move:
- a very small
$\eta$ produces cautious but potentially slow learning; - an excessively large
$\eta$ can overshoot a useful value and make optimisation oscillate or diverge; and - an appropriate
$\eta$ makes meaningful progress while keeping updates stable.
The learning rate is not learned by backpropagation. It is selected as an optimisation hyperparameter using training behaviour and validation, without consulting blind test outcomes.
For this worked example, choose
The gradient is negative, so subtracting it increases
The scalar teaching model uses
Here
-
$\theta_{\rm self}$ : persistence of the atom's own state; -
$\theta_{\rm neighbour}$ : strength and sign of neighbour influence; -
$\theta_{\rm bias}$ : a uniform offset before the nonlinearity.
For one update, the direct local derivatives are
These are direct effects for one atom at one generation. The total derivative must also include indirect effects through earlier states and neighbouring atoms.
The repeated rule creates a recurrence:
After
Unrolling this recurrence makes a computational graph with
Let the adjoint
mean the sensitivity of the final loss to the state at generation
Because
It also sums over atoms because the rule is shared spatially. One parameter therefore learns from every molecular neighbourhood, every generation, and every training molecule.
Consider the simplified recurrence
with target
Since
we can differentiate directly:
At
The backpropagated calculation finds the same answer while exposing both uses of
At
Suppose the regression prediction is
and the per-molecule squared-error loss is
Then
so
If fingerprint extraction is differentiable, the chain continues:
This is how an error measured in pIC50 can teach a local rule acting on atoms.
Some useful scientific summaries—such as a hard first-threshold crossing for convergence time—are not smoothly differentiable. We may therefore use differentiable approximations during end-to-end learning, retain non-differentiable quantities for analysis, or adopt staged training. This is a model-design decision to validate, not conceal.
The planned model has a regression loss for pIC50 and a classification loss for time-dependent inhibition (TDI). A combined objective can be written
where
The gradient of the shared rule is
Thus both experimental tasks can shape the common dynamics. Whether joint learning helps must be established on held-out molecules.
Backpropagation through
If their effective magnitudes are repeatedly below one, gradients shrink: vanishing gradients. Early generations then receive little learning signal. If they are repeatedly above one, gradients may grow: exploding gradients. Optimisation becomes unstable.
Relevant controls include:
- sensible parameter initialisation;
- bounded nonlinearities and awareness of tanh saturation;
- gradient-norm monitoring and clipping;
- an appropriate number of generations;
- smaller learning rates when necessary; and
- reporting the dynamics produced, not only predictive loss.
These numerical behaviours are connected to dynamical stability. A strongly contracting system can erase initial information; an expansive system can amplify perturbations and gradients.
Backpropagation may learn:
- CA message and update weights
$\theta$ ; - parameters of differentiable fingerprint transformations; and
- in a joint differentiable design, readout parameters.
Validation selects hyperparameters such as:
- generation count
$T$ ; - state dimension
$d$ ; - learning rate and optimiser settings;
- regularisation strengths;
- task weights; and
- early-stopping rules.
Chemical identity, bond connectivity, experimental labels, and train/validation membership are data or experimental design—not quantities the optimiser is allowed to rewrite.
An analytical derivative can be tested against a centred finite difference:
Compare it with
using relative error
Agreement for several parameters and small test graphs provides evidence that the chain rule has been implemented correctly. It does not establish that the scientific model is useful; held-out validation addresses that question.
Successful optimisation means the chosen loss decreased. Scientific success requires more:
- improved performance on molecules excluded from fitting;
- comparison against chemically meaningful descriptor baselines;
- stable results across seeds and splits;
- interpretable and reproducible dynamical fingerprints;
- examination of learned attractors, oscillations, transients, and perturbation response; and
- strict isolation of blind test labels.
Backpropagation is the route by which experimental error can shape the automaton. Validation determines whether the learned dynamics contain transferable chemical information.
- Emergence introduces local rules and collective behaviour.
- Dynamics defines the trajectories being differentiated.
- Ridge Regression explains the pIC50 readout.
- Validation and Statistics explains how learning claims are tested.