Training
Differentiable, so trained by gradient descent: a modulated version of Adam minimising a cross-entropy loss.
In plain words
Training is nudging. Start with random numbers inside the formula and the vortices. Measure how wrong the current predictions are, using a standard score called cross-entropy. Adjust every number a little in the direction that reduces the score. Repeat, 32 examples at a time, until the training set is classified perfectly.
The nudging is done by Adam, the same optimiser that trains most neural networks, which the replicant can use because its formula is differentiable. The paper adds one tweak: each step is capped so that a single unusually large gradient cannot throw the model off course.
Why gradient descent
It is not possible in general to identify a minimiser of a discontinuous function. The logic replicant is differentiable (its derivative is discontinuous at the fold points of the absolute values, but continuous elsewhere), so quasi-Newton or gradient methods apply and converge towards a good local or global optimum. Gradient descent is also efficient and scalable in high-dimensional parameter spaces, and differentiable models lend themselves to sensitivity analysis. Grid search or evolutionary strategies would be computationally impractical here.
Adam
The chosen optimiser is the adaptive moment estimation variant of stochastic gradient descent. For every coefficient \(\alpha\) of the model it keeps exponentially forgetting estimates of the first and second moments of the gradient:
where \(\nabla_\alpha H^{(t)}\) is the partial derivative of the cross-entropy at iteration \(t\) and the forgetting factors are fixed at \(\beta_1=0.9\), \(\beta_2=0.99\).
Loss
The loss is the cross-entropy between predictions \(\boldsymbol{Y}=(y_{ij})\) and targets \(\boldsymbol{T}=(t_{ij})\), both \(N\times|C|\) matrices for \(N\) instances and \(|C|\) classes:
Here \(u_{ij}=U_j(L(\boldsymbol{x}_i))\) is the scalar field of class \(j\) evaluated at instance \(i\), \(\boldsymbol{u}_i\) collects the \(|C|\) class fields, and \(\sigma\) is the softmax over them.
Modulated moments
To converge faster and avoid extreme gradient values, the moment updates are modulated by dividing the gradient by a value \(a\):
with \(a=\max\big(1,|\nabla_{\alpha_1}H^{(t)}|,|\nabla_{\alpha_2}H^{(t)}|,\dots\big)\) taken over all parameters at iteration \(t\). This guarantees that the increments of \(m\) and \(v\) in every iteration are not greater than \(1-\beta_1\) and \(1-\beta_2\), and symmetrically not more negative than \((\beta_1-1)\) and \((\beta_2-1)\).
Batch size \(N=32\). Training stops when the cross-entropy of the whole dataset is 0. Parameters are initialised at random, which is a source of run-to-run variability, most noticeable for small configurations such as the 32-parameter parity replicant.