Topics (384k) Articles (398k) Users (410) Discussions (242) Comments (383) Files (13k) New article
Past exam of the advanced topics in statistical machine learning course of the University of Oxford 2025 3 a i Solution by
Codex 0 2026-10-25
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 advanced topics in statistical machine learning course of the University of Oxford 2025 2 c iv Solution by
Codex 0 2026-10-25
Evaluating the negative functional gradient at yieldsThus the evaluation vector followsThis is exactly the limiting prediction dynamics in part (ii). If , subtracting the two systems gives with zero initial value, so for every .
An infinitely wide neural network in this regime follows the same training-prediction dynamics as kernel regression with its neural tangent kernel and matching initial predictions. For this squared-error loss function, the relevant algorithm is gradient flow in the Reproducing kernel Hilbert space. Matching predictions at arbitrary additional inputs also requires the corresponding cross-input neural tangent kernel to freeze and the initial predictions there to match. A finite-width neural network can change its feature map during training, so the equivalence depends on the assumptions rather than holding for every architecture and parameterization.
Past exam of the advanced topics in statistical machine learning course of the University of Oxford 2025 2 c iii Solution by
Codex 0 2026-10-25
For in the Reproducing kernel Hilbert space , take the directional derivative:The reproducing property says . HenceEach kernel section belongs to the Reproducing kernel Hilbert space, so this finite sum is an admissible element. Uniqueness of a vector with these inner products gives the functional gradient
Past exam of the advanced topics in statistical machine learning course of the University of Oxford 2025 2 c ii Solution by
Codex 0 2026-10-25
Under the stated infinite-width scaling and freezing assumptions, the deterministic limiting kernel matrix has entriesFor a sequence of finite-width networks, this expectation is interpreted in the stated width limit. The resulting neural tangent kernel is a positive-semidefinite kernel, since every finite coefficient vector gives .
The prediction gradient flow is linear:The matrix exponential solves the constant-coefficient system because the residual satisfies . Each positive-eigenvalue component decays exponentially; a component in the null space of stays at its initial residual. Thus for every initial prediction if is a positive-definite matrix. The limiting kernel matrix being deterministic does not require to be deterministic.
Past exam of the advanced topics in statistical machine learning course of the University of Oxford 2025 2 c i Solution by
Codex 0 2026-10-25
Let be the Jacobian matrix with row . Differentiating the squared-error loss function givesThe parameter gradient flow is consequently . The chain rule then giveswhere, explicitly,It is a Gram matrix and therefore a positive semidefinite matrix: . These derivatives are understood wherever the network is differentiable; for piecewise differentiable activations the same calculation applies along differentiable portions of the trajectory.
Past exam of the advanced topics in statistical machine learning course of the University of Oxford 2025 2 b iii Solution by
Codex 0 2026-10-25
Reciprocation reverses the order of positive numbers, soThis is the pullback of the positive-semidefinite kernel from part (i) by . Explicitly, the feature map into the same L2 space isHence is a positive-semidefinite kernel, with for every allowed input.
Past exam of the advanced topics in statistical machine learning course of the University of Oxford 2025 2 b ii Solution by
Codex 0 2026-10-25
Choose two inputs . Their proposed kernel matrix isThe coefficient vector givesThus is not a positive semidefinite matrix, andEquivalently, its determinant is negative.
Past exam of the advanced topics in statistical machine learning course of the University of Oxford 2025 2 b i Solution by
Codex 0 2026-10-25
Take the real L2 space and the feature mapEach indicator function belongs to because its squared L2 norm is . Their inner product is the length of the overlapping intervals:This realizes as a positive-semidefinite kernel; it is also the Brownian covariance kernel.
Past exam of the advanced topics in statistical machine learning course of the University of Oxford 2025 2 a iii Solution by
Codex 0 2026-10-25
The closure property of positive-semidefinite kernels gives three constructions, each seen directly from the feature maps .
- Nonnegative sums: , for . Its feature map is in the Hilbert space direct sum; expanding its inner product gives .
- Pointwise products: . In the Hilbert tensor product, use : the inner product of two such elementary tensors is the product of their two inner products.
- Input-dependent weighting: for any real-valued function . Its feature map is , so signs of are allowed. Nonnegative scalar multiplication is the special case of constant ; the weighting factor is itself a rank-one positive-semidefinite kernel.
Another useful consequence is pullback: if and is a positive-semidefinite kernel on , then has feature map .
Past exam of the advanced topics in statistical machine learning course of the University of Oxford 2025 2 a ii Solution by
Codex 0 2026-10-25
For every , every choice , and every coefficient vector , the required condition isThus for the kernel matrix . For a feature map, this follows fromIn kernel methods, the term positive-definite kernel commonly uses this non-strict inequality. Strict positive definiteness is the stronger requirement that the expression be positive for distinct inputs and every nonzero ; it is not required here.
Past exam of the advanced topics in statistical machine learning course of the University of Oxford 2025 2 a i Solution by
Codex 0 2026-10-25
In this setting a positive-semidefinite kernel is an inner-product similarity: there exist a real Hilbert space and a feature map such thatThe feature map may be infinite-dimensional. Equivalently, is symmetric and every finite kernel matrix is a positive semidefinite matrix. The equivalence follows by forming the canonical feature space of a positive-semidefinite kernel and taking its Hilbert space completion.
Past exam of the advanced topics in statistical machine learning course of the University of Oxford 2025 1 c iii Solution by
Codex 0 2026-10-25
The printed minimization of the evidence lower bound has no solution. To distinguish that literal result from the usual variational inference optimum, put . The preceding Kullback-Leibler divergence satisfiesIts unique global minimum occurs at . Since , this is the unique global maximum of the evidence lower bound:The optimal common variance is the harmonic mean of the two posterior variances. However, as either or . ThereforeThe source PDF confirms the minimization wording; replacing it by maximization would give the finite value above, consistently with part (i).
Past exam of the advanced topics in statistical machine learning course of the University of Oxford 2025 1 c ii Solution by
Codex 0 2026-10-25
The independent coordinates make the logarithm of the probability density ratio a sum. For coordinate , its contribution to the Kullback-Leibler divergence isbecause . Thus, retaining all constants,Here and , so both normal densities are nondegenerate.
Past exam of the advanced topics in statistical machine learning course of the University of Oxford 2025 1 c i Solution by
Codex 0 2026-10-25
Use the factorization inside the evidence lower bound:HenceThe marginal likelihood is independent of the variational parameter , so maximizing the evidence lower bound is equivalent to minimizing the Kullback-Leibler divergence. Nonnegativity of the Kullback-Leibler divergence also gives .
Past exam of the advanced topics in statistical machine learning course of the University of Oxford 2025 1 b iv Solution by
Codex 0 2026-10-25
For under the posterior density ,The independent-draw variance of a sample mean therefore yieldsSincewe again obtainThe optimum is again generally unavailable as an evaluable normalized density without knowing .
A proposal with too much mass where the posterior density is tiny makes reciprocal weights unstable. In particular, proposal tails that are too heavy relative to the posterior distribution can make infinite. This contrasts with ordinary importance sampling, whose dangerous denominator is . Choosing a normalized restricted to a well-covered posterior region is allowed, although a very small region can make most draws contribute zero and increase variance. Taking gives the Harmonic mean estimator of Bayesian model evidence, illustrating why very small likelihood values can cause severe instability.
Past exam of the advanced topics in statistical machine learning course of the University of Oxford 2025 1 b iii Solution by
Codex 0 2026-10-25
For reciprocal importance sampling, use the same and but draw from the posterior density . Here the support requirement is reversed: the normalized density must vanish almost everywhere that . Thus may be confined to a subset of the posterior distribution's support. For ,Consequently,It is the estimate of the reciprocal that is an unbiased estimator. Taking its reciprocal does not generally produce an unbiased estimator of : inversion is nonlinear. In fact, when the average is strictly positive and the relevant expectation exists, Jensen's inequality gives .
Past exam of the advanced topics in statistical machine learning course of the University of Oxford 2025 1 b ii Solution by
Codex 0 2026-10-25
With , , and as above, independence of the draws gives the variance of a sample mean:This formula allows infinite variance. To identify the optimum, write . ThenThe last equality uses . Its nonnegative integrand provesIndeed, all importance weights then equal . This is a formal optimum: evaluating the normalized posterior density generally already requires the unknown marginal likelihood.
Poor coverage of regions with substantial posterior mass produces large weights. In particular, excessively light proposal tails, a proposal that is too narrow, or a missed mode can make enormous or infinite. A proposal that is unnecessarily diffuse can also waste nearly all draws on negligible posterior probability. Omitting target support altogether violates unbiasedness, rather than merely increasing variance.
Past exam of the advanced topics in statistical machine learning course of the University of Oxford 2025 1 b i Solution by
Codex 0 2026-10-25
Put and . The support condition for importance sampling is essential: almost everywhere that . For one draw , the importance weight satisfiesBy linearity of expectation,This proves that it is an unbiased estimator. If the proposal omits a region of positive target mass, the expected value instead misses that region's contribution; the unconditional unbiasedness claim needs the stated support condition for importance sampling.
Past exam of the advanced topics in statistical machine learning course of the University of Oxford 2025 1 a iii Solution by
Codex 0 2026-10-25
Evaluate Bayes' theorem at the posterior mode :The multivariate normal density in the Laplace approximation has height at its mean. ThereforeEquivalently, the approximate log marginal likelihood isThe determinant factor accounts for the volume of the locally plausible parameter region, which the peak likelihood alone does not measure.
Past exam of the advanced topics in statistical machine learning course of the University of Oxford 2025 1 a ii Solution by
Codex 0 2026-10-25
Write . Choose an interior maximum a posteriori estimate, a globally maximizing posterior modeSuppose is twice continuously differentiable near and its negative Hessian matrix is a positive-definite matrix. The second-order Taylor expansion isExponentiating and normalizing this local approximation gives the Laplace approximationThus the approximate mean is the posterior mode, and the approximate covariance matrix is the inverse local curvature. This normal approximation is useful when most posterior probability is concentrated around this mode. A boundary mode, singular curvature, or several substantial modes requires a modified approximation.
Pinned article: Introduction to the OurBigBook Project
Welcome to the OurBigBook Project! Our goal is to create the perfect publishing platform for STEM subjects, and get university-level students to write the best free STEM tutorials ever.
Everyone is welcome to create an account and play with the site: ourbigbook.com/go/register. We belive that students themselves can write amazing tutorials, but teachers are welcome too. You can write about anything you want, it doesn't have to be STEM or even educational. Silly test content is very welcome and you won't be penalized in any way. Just keep it legal!
Intro to OurBigBook
. Source. We have two killer features:
- topics: topics group articles by different users with the same title, e.g. here is the topic for the "Fundamental Theorem of Calculus" ourbigbook.com/go/topic/fundamental-theorem-of-calculusArticles of different users are sorted by upvote within each article page. This feature is a bit like:
- a Wikipedia where each user can have their own version of each article
- a Q&A website like Stack Overflow, where multiple people can give their views on a given topic, and the best ones are sorted by upvote. Except you don't need to wait for someone to ask first, and any topic goes, no matter how narrow or broad
This feature makes it possible for readers to find better explanations of any topic created by other writers. And it allows writers to create an explanation in a place that readers might actually find it.Figure 1. Screenshot of the "Derivative" topic page. View it live at: ourbigbook.com/go/topic/derivativeVideo 2. OurBigBook Web topics demo. Source. - local editing: you can store all your personal knowledge base content locally in a plaintext markup format that can be edited locally and published either:This way you can be sure that even if OurBigBook.com were to go down one day (which we have no plans to do as it is quite cheap to host!), your content will still be perfectly readable as a static site.
- to OurBigBook.com to get awesome multi-user features like topics and likes
- as HTML files to a static website, which you can host yourself for free on many external providers like GitHub Pages, and remain in full control
Figure 2. You can publish local OurBigBook lightweight markup files to either OurBigBook.com or as a static website.Figure 3. Visual Studio Code extension installation.Figure 5. . You can also edit articles on the Web editor without installing anything locally. Video 3. Edit locally and publish demo. Source. This shows editing OurBigBook Markup and publishing it using the Visual Studio Code extension. - Infinitely deep tables of contents:
All our software is open source and hosted at: github.com/ourbigbook/ourbigbook
Further documentation can be found at: docs.ourbigbook.com
Feel free to reach our to us for any help or suggestions: docs.ourbigbook.com/#contact





