Ashish Vaswani 2026-11-05
Ashish Vaswani is a machine learning researcher and coauthor of the 2017 paper introducing the Transformer model. The paper's shared-contribution statement credits him with jointly designing and implementing the first Transformer models. It explicitly states that author order is random, so his first position should not be read as sole credit for the architecture.[ref]
Attention Is All You Need by Ashish Vaswani and others. Original byline and contribution footnote
The Transformer model uses self-attention to combine information from different positions in a sequence. In scaled dot-product attention, a query is compared with keys using dot products, then the softmax function supplies weights for combining the corresponding values. The model connects this mechanism to a complete neural network for tasks such as machine translation.[ref]
Attention Is All You Need by Ashish Vaswani and others. Sections3.2–3.2.3: attention computation and its uses
An original one-dimensional example makes the weighting concrete. Choose query , keys , , and values , . With key dimension , the scaled scores are and . The softmax function gives weights and , so the output is . The input values are mixed according to the query–key comparison; this invented example is not a learned translation result.
The original evaluation reported 28.4 BLEU for its large model on the English-to-German newstest2014 test. That is a result under a specific training and evaluation setup, rather than a universal score for all Transformer models.[ref]
Attention Is All You Need by Ashish Vaswani and others. Section6.1 and Table2: big-model translation evaluation
Causal self-attention 2026-10-25
Self-attention whose output at sequence position may depend only on positions at or before . In a score matrix, set forbidden future-position scores to negative infinity before applying the softmax function; the corresponding weights become zero. This permits parallel computation over a known training sequence without allowing future tokens to influence earlier predictions.
Finite-exponential Cole-Hopf solution 2026-10-14
For the negative-flux viscous Burgers equation , set . A sum of exponentials in the initial heat data evolves into , giving the displayed softmax function average. Two terms produce a traveling tanh shock from the lower to the higher state, with speed minus their mean.
Label smoothing 2026-11-05
Label smoothing replaces a sharply concentrated training target with a mixture that assigns some probability to alternative labels. For a -class example whose observed label is , a common uniform version usesHere is the predicted probability vector and controls smoothing. The target still sums to one. This is a regularization of the training objective, not a statement that the example is known to have several simultaneously correct labels.[ref]
Rethinking the Inception Architecture for Computer Vision by Christian Szegedy and others. Section 7: target mixture and uniform smoothing distribution.
With three classes and , the observed class receives and each other class . This convention differs from assigning to the observed class and splitting only among the incorrect classes. State the convention when reporting a smoothing parameter.
For a softmax function applied to logits , the categorical cross-entropy loss has gradient . With fixed smoothed targets and unconstrained probabilities, the loss is minimized at . The three-class example consequently has optimum true-versus-other logit gap , rather than requiring an unbounded gap to approach a one-hot target.[ref]
Rethinking the Inception Architecture for Computer Vision by Christian Szegedy and others. Section 7: cross-entropy gradient and motivation concerning overconfident training predictions.
The changed objective can discourage extreme training predictions. Its effect on generalization, calibration or another downstream task is an empirical question; the derivation alone does not guarantee improvement on every dataset. Evaluation should therefore retain the distinction between a training regularizer and the true, unknown distribution of labels.
Neural network logit 2026-11-05
A neural network logit is a real-valued class score produced before a probability transformation such as the softmax function. The vector of scores determines the class probabilities jointly; an isolated score is not itself a probability. Negative scores and scores larger than one are permitted.[ref]
On Calibration of Modern Neural Networks by Chuan Guo and others. §4.2, paragraph before Eq. (8), logits before the softmax layer
For scores , the softmax function givesAdding one common scalar to every coordinate leaves all probabilities unchanged:Consequently the absolute offset of a logit vector cannot be recovered from these probabilities.
For example, scores and both give first-class probability . The difference between the two scores, rather than the first coordinate alone, determines this binary probability. Indeed,This connects the binary score difference with the logit link function. It does not make every coordinate of a multiclass score vector a separately defined binary log-odds.
A common shift also differs from rescaling. Dividing by two gives and first-class probability . This is the transformation used in temperature scaling with temperature two. Positive scaling preserves the selected class within an example while changing confidence.[ref]
When interpreting a neural network logit, state its score vector and probability transformation. Comparing raw coordinates from independently shifted parameterizations can otherwise suggest a confidence change where the actual probability vector is identical.
A transformer block has two principal sublayers: multi-head attention and a positionwise feedforward neural network. Each sublayer has a residual connection and layer normalization. To make the components explicit, let contain the representations of sequence positions. For head , learned projections formThe scaled dot-product attention output iswhere the softmax function acts along each row and is an optional attention mask. For causal self-attention, disallowed future positions receive before the softmax function, giving zero attention weights. In self-attention, queries, keys, and values all come from the same input sequence. The multi-head attention output concatenates the heads and projects them:A standard post-normalization transformer block can then be writtenHere layer normalization normalizes the feature coordinates of each position separately, within each example, and applies learned scales and shifts. The positionwise feedforward neural network applies the same two affine maps and activation function at every position, for exampleThus attention mixes information between positions, while the feedforward sublayer transforms each position's features. The residual connections support propagation through a deep stack, and dropout is often used during training. Pre-normalization variants move layer normalization before the sublayer. A model's positional encoding supplies order information to the sequence representation or attention mechanism; a decoder in an encoder-decoder model also has a cross-attention sublayer between its self-attention and feedforward neural network sublayers.
Past exam of the computational neuroscience course of the University of Oxford 2022 6 Solution 2026-10-25
An actor-critic architecture learns a situation-to-action policy from rewards while a separate value network evaluates its consequences. It is a concrete reinforcement learning architecture: no supervisor supplies the correct action on each trial. In a finite Markov decision process, let encode the current situation, be the reward after action , and discount future rewards. The objective is expected return, . For an episodic undiscounted task, termination can instead make the return finite. State representation matters: if the sensory input does not identify the relevant situation, a memory of previous observations must be added.
The actor has preferences and selects actions using a softmax function,Sampling from this policy supplies exploration. The critic predicts , an estimate of future discounted reward under the current policy. Its temporal-difference learning signal iswith at a terminal state. The update changes the present prediction toward a reward-plus-next-prediction target. It is a semi-gradient update: it does not differentiate through the bootstrapped target. The temporal-difference principle assigns credit using successive predictions rather than waiting for a complete episode to end.[ref]
Learning to predict by the methods of temporal differences by Richard S. Sutton. Abstract and sections 2–3; Machine Learning 3, pp. 9–44: successive predictions and temporal credit assignment
A corresponding actor update isThe bracketed term is the gradient of the log policy with respect to the preference for action . A positive reward prediction error increases the probability of the selected action; a negative one decreases it. With an accurate critic, the conditional mean of given is the advantage of that action over the policy's average at that state. This motivates the update, while approximate values, changing policies and limited exploration can compromise learning. It is not a guarantee of the globally best behaviour for every choice of features and learning rates.
For an illustrative one-step calculation, start with two equally preferred actions, scalar feature , critic value , and a chosen first action followed by reward . Then . With actor learning rate , its two preference changes are and , so the next probability of the rewarded action is . These are chosen model values. A delayed reward can also modify recently active connections through an eligibility trace, for example for the critic, followed by . The actor needs its own policy-gradient eligibility. Traces must be reset or otherwise handled at episode boundaries.
The key biological hypothesis is a three-factor plasticity rule: presynaptic activity, postsynaptic or action-selection activity, and a modulatory reward prediction error. Cortical inputs to the striatum can provide situation features, action-related populations can supply the actor, and dopamine can modulate plasticity. This is a functional correspondence, not a one-to-one identification of all actor units with one anatomical compartment. The critic itself must be learned; delivering reward directly to every active connection would not explain prediction-dependent changes.
Recordings in monkeys trained through successive delayed-response tasks provide relevant primary evidence. Phasic responses of putative dopamine neurons to liquid reward were more common during learning than after task performance had become established, while significant stimuli continued to elicit responses. This is compatible with a learning signal sensitive to predictability rather than a permanent readout of reward consumption, but the study also emphasizes attentional and motivational interpretations.[ref]
Responses of monkey dopamine neurons to reward and conditioned stimuli during successive steps of learning a delayed response task by Wolfram Schultz and others. Abstract; Journal of Neuroscience 13, pp. 900–913: learning versus established performance
The canonical temporal-difference learning interpretation predicts increased signalling for an unexpectedly good outcome and decreased signalling when an expected reward fails to occur; it explains why cue and reward responses can change as predictions are learned. This is a quantitative interpretation of physiological evidence, not an assertion that all dopamine activity equals one scalar critic error.[ref]A neural substrate of prediction and reward by Wolfram Schultz and others. Abstract and reward-prediction-error interpretation; Science 275, pp. 1593–1599
The model also explains classical conditioning phenomena such as blocking. If an established cue already predicts the reward, adding another cue leaves little positive prediction error, so the new cue acquires little value. More causally informative experiments in rats stimulated dopamine neurons at reward delivery in blocking and extinction procedures. The stimulation, timed to mimic a positive prediction error, produced lasting increases in cue-elicited reward seeking. This supports a teaching role for phasic dopamine, rather than merely a correlation with successful behaviour. It does not identify every synapse or prove that a complete actor-critic algorithm is the only explanation.[ref]
A causal link between prediction errors, dopamine neurons and learning by Elizabeth E. Steinberg and others. Abstract and Figures 1–4: associative blocking, extinction and reward-timed dopamine-neuron stimulation
The simplest model-free actor-critic is consistent with important aspects of learning, but it does not exhaust animal behaviour. It gradually caches action preferences. It cannot immediately change an unvisited action's value after an outcome is devalued unless the state or reward representation supplies an additional route to that change. In an instrumental conditioning experiment in rats, lever pressing trained on interval schedules became insensitive to sucrose devaluation in sham controls, whereas dorsolateral-striatal lesions preserved sensitivity to devaluation. Consumption controls showed that devaluation itself was effective, and testing in extinction limited new reward learning. This dissociation supports a distinction between habitual and goal-directed control, rather than one universal cached policy.[ref]
Lesions of dorsolateral striatum preserve outcome expectancy but disrupt habit formation in instrumental learning by Henry H. Yin and others. Abstract, experiments 1–2; pp. 181–189: interval training, devaluation, extinction test and lesion controls
In humans, a two-stage task with common and rare state transitions separated simple reward-driven repetition from choices sensitive to the transition model. Behaviour and striatal prediction-error-related imaging signals showed both model-free reinforcement learning and model-based reinforcement learning influences. The imaging signal is not a direct measurement of individual dopamine spikes, and task performance alone does not uniquely identify a circuit, but it argues against treating every striatal value signal as purely model-free.[ref]
A stronger architecture can combine the learned actor-critic with a model of action–outcome transitions and current outcome value, and arbitrate between cached action selection and planning. The model's strength is its explicit account of exploration, delayed credit and prediction-dependent plasticity; its limits become visible in devaluation, latent learning and rapid replanning.
Past exam of the mathematics course of the University of Cambridge 2008 iii Paper 88 3 a Solution Created 2026-10-03 Updated 2026-10-14
Write and , with . Direct differentiation givesThus the Cole-Hopf transformation with this negative-flux convention maps the heat equation to the stated viscous Burgers equation. Conversely its residual is independent of and can be removed by multiplying by a function of .
Convolving each initial exponential with the Gaussian heat kernel givesThe resulting finite-exponential Cole-Hopf solution isIt is a softmax function average of the constant states, so and .
For , put and . Equality of the two exponents occurs atThereforeThis is an increasing viscous shock from to , moving at speed and with transition width of order . That speed agrees with the Rankine-Hugoniot condition for flux ; its concavity makes the increasing jump the entropy shock.
For general , use the shock frame . The leading coefficient in is . The endpoint coefficients coincide, and every interior coefficient is smaller by . The extremal-state asymptotics of exponential Burgers solutions therefore reduce the large- profile to the same tanh shock with states and centreAt a fixed , rather than in the moving frame, the endpoint of largest dominates. If , both endpoint rates coincide and the limiting shock is stationary. Intermediate plateaus disappear in the moving-frame limit.
Intermediate states disappear from the finite-exponential Burgers solution in the moving shock frame
. Details. Past exam of the mathematics course of the University of Cambridge 2017 iii Paper 217 4 Solution Created 2026-10-03 Updated 2026-10-06
The equal-variance form of Slepian's lemma is the following. If are centered vectors with multivariate normal distributions, for every , and whenever , thenfor every threshold vector . In particular . No nonsingularity of the covariance matrices is required.
Here the pointwise variances and differ. To make the comparison rigorous, use the increment form, namely the Sudakov-Fernique inequality: if centered multivariate normal distributions satisfy for every pair, then . Unlike the preceding form of Slepian's lemma, this statement has no equal-pointwise-variance hypothesis.
For completeness, the increment form follows by Gaussian integration by parts. Make independent, define for , and letThe are softmax function weights, with and . Direct differentiation gives and . The Gaussian integration by parts identity therefore yieldsThe last summands are nonnegative because . Sinceintegration in and the limit prove the Sudakov-Fernique inequality. All derivatives needed here are bounded for a fixed . Singular covariance matrices can be handled by adding small independent centered normal noise with the same variance to both vectors, proving the identity for the nonsingular vectors, and letting the noise variance decrease to zero.
Use the printed normalization of fractional Brownian motion, which omits the conventional factor . Its increment variance isFor and , . Enumerate by increasing finite subsets whose union is , with . The Sudakov-Fernique inequality givesBoth Gaussian processes vanish at zero almost surely. Thus these maxima are nonnegative and increase with ; monotone convergence theorem givesTheir continuous modifications agree with the original Gaussian processes simultaneously on the countable set , after discarding a single null event. Continuity and density of the rational parameters make each rational supremum equal to the supremum over for these modifications.
The expected suprema are finite. Indeed, the canonical distance of is . A Euclidean grid supplies a closed-ball metric covering number bound for . The Dudley entropy integral bound for an anchored centered separable Gaussian process isThe integral is finite since its integrand grows at most like a constant times near zero. The same argument applies to .
For any real path vanishing at zero,A centered Gaussian process has the same probability law as its negative. Combining this symmetry with the increment comparison gives the stronger boundIn particular the requested comparison isThe common normalization factor affects both sides equally. The comparison is valid for every , including the equality cases or in the increment bounds.
Past exam of the mathematics course of the University of Cambridge 2018 iii Paper 218 3 c Solution Created 2026-10-03 Updated 2026-10-05
The feedforward neural network has three input coordinates, two hidden sigmoid function units and two output softmax function units. Every input is connected to each hidden unit, and each hidden unit to each output unit; each hidden and output unit also has a bias. A layer diagram isAlgebraically, with ,with responses conditionally independent. The fourteen displayed weight and bias parameters comprise six input weights, two hidden biases, four output weights and two output biases. The one-hot encoding supplies targets , , and the categorical cross-entropy loss is the negative of . There is softmax non-identifiability under a common shift of both output logits, but the predicted probabilities are well defined.
Past exam of the mathematics course of the University of Cambridge 2018 iii Paper 218 3 d Solution Created 2026-10-03 Updated 2026-10-05
For one observation, let and define . Differentiating the softmax function and its log-likelihood gives . The sigmoid-softmax network gradients areThese equations are backpropagation: use the chain rule through the output affine map, then through the hidden units, then the input affine map.
For a learning rate , select one observation and update every parameter by , computing all entries of the gradient from the old parameters before applying the update. A uniformly selected observation gives an unbiased gradient of the average log-likelihood; multiplying by 3000 would instead estimate the gradient of the sum. Equivalently perform stochastic gradient descent on the negative log-likelihood. Batch size one makes one update per observation, and five epochs make five passes through the data, typically with a fresh random ordering on each pass.
Past exam of the mathematics course of the University of Cambridge 2021 iii Paper 218 4 a Solution Created 2026-09-28 Updated 2026-10-03
Past exam of the mathematics course of the University of Cambridge 2023 iii Paper 218 4 a Solution 2026-09-28
Past exam of the mathematics course of the University of Cambridge 2023 iii Paper 339 1 d Solution 2026-09-28
Define the softmax weightsThey obey and . The gradient is their weighted mean,Differentiating once more gives the covariance-form Hessian matrixFor every unit vector ,where . The Hessian is a covariance matrix, so it is positive semidefinite; the displayed upper bound also gives in the Loewner order. Consequently has a Lipschitz gradient with
Past exam of the mathematics course of the University of Cambridge 2025 iii Paper 218 4 a Solution Created 2026-09-24 Updated 2026-10-03
Encode the two classes by the standard basis vectors of . With rectified linear unit applied coordinatewise and softmax function , the fitted feedforward neural network iswhere , , , , , and . The number of trainable parameters is
Past exam of the mathematics course of the University of Cambridge 2026 iii Paper 218 5 a Solution Created 2026-09-24 Updated 2026-09-25
For standardized , model1 computesfollowed by logits and softmax function probabilitiesThe parameter count isFor one-hot labels , the categorical cross-entropy loss isThis is the negative conditional log-likelihood of independent categorical labels, equivalently Bernoulli labels in the two-class case.
Scaled dot-product attention 2026-10-25
With query and key dimension , form the score matrix , apply the softmax function row by row, and multiply by the values . If query and key coordinates have independent unit variance, their dot product has variance ; division by keeps that score scale of order one. Optional additive masks exclude forbidden keys before the softmax function.
Sudakov-Fernique inequality Created 2026-10-06 Updated 2026-11-05
For centered multivariate normal distributions, if for every pair, then the displayed comparison holds. For a quick proof, make independent and set . Apply Gaussian integration by parts to . With softmax function weights and , the derivative of is . Since , let . Singular covariance matrices follow by adding identical small independent normal noise to both vectors and taking a limit.
Temperature scaling 2026-11-05
Temperature scaling is a method of probability calibration that divides a model's neural network logits by one fitted positive scalar before applying the softmax function. The temperature is selected after model training, using labels in a held-out validation set to minimize the negative log-likelihood. It adjusts reported probabilities without retraining all model weights.[ref]
On Calibration of Modern Neural Networks by Chuan Guo and others. §4.2, Eq. (9), scalar temperature and validation negative log likelihood
For class scores and ,For the synthetic two-class scores , the first-class probability isThe selected class remains the first while its reported confidence decreases.
The preservation of the selected class follows directly: dividing by positive preserves every score ordering and equality, and exponentiation is strictly increasing. Thus the set of classes attaining the largest score is unchanged. This concerns ordering between classes within one example; it does not assert preservation of confidence ordering between different examples.
A motivating measurement in the original study compares reliability diagrams for a 110-layer image-classification network. Its reported expected calibration error changes from before calibration to after temperature scaling. This is a result for that experimental setup and binned metric, not a guarantee for every classifier or input distribution.[ref]
On Calibration of Modern Neural Networks by Chuan Guo and others. §5 and Fig. 4, CIFAR-100 ResNet-110 before/after reliability diagrams
Use separate data for fitting the temperature and for final evaluation. One scalar can improve an overall confidence mismatch but cannot represent every class-specific or input-dependent error. The name refers to this probability transformation; no physical temperature is being measured.
