Your Institute @yourname Sep 21, 2026

The Woodbury Identity (identity)

Demo note. This note demonstrates what the SciDraft Hugo theme can do for academic and scientific publishing — for research institutions, researchers and students. Its content is demonstration material only: readers should ignore whether the demo content is correct.

The Woodbury identity rewrites the inverse of a matrix plus a low-rank correction in terms of the inverse of the original matrix and a much smaller inverse. It is the algebraic fact behind every method that updates a large system cheaply.

The sizes are what makes it useful: the correction inverse is of the order of the rank rather than of the matrix, so an update of rank \(r\) costs \(r^{3}\) work instead of \(n^{3}\).

Identity (Woodbury). Let \(A \in \mathbb{R}^{n \times n}\) be invertible, and let \(U \in \mathbb{R}^{n \times r}\), \(C \in \mathbb{R}^{r \times r}\) and \(V \in \mathbb{R}^{r \times n}\) with \(C\) and \(A + UCV\) invertible. Then

$$ \left(A + UCV\right)^{-1} = A^{-1} - A^{-1} U \left(C^{-1} + V A^{-1} U\right)^{-1} V A^{-1}, $$

where the middle inverse is \(r \times r\). The identity is verified by multiplying the right-hand side by \(A + UCV\) and collecting terms; the special case \(C = I\), \(V = U^{\top}\) gives the update used when a low-rank term is added to a covariance.

In a model, the pattern shows up whenever a large linear system is modified by something thin — a new adapter, a few constrained directions, a rank-limited edit — since the identity turns the cost of the update from the size of the matrix into the size of the change.

Your Institute @yourname Sep 21, 2026

Features Are Directions (conjecture)

Demo note. This note demonstrates what the SciDraft Hugo theme can do for academic and scientific publishing — for research institutions, researchers and students. Its content is demonstration material only: readers should ignore whether the demo content is correct.

The linear representation hypothesis conjectures that the concepts a network has learned are encoded as directions in activation space, so that adding a concept vector to an activation moves the computation in a meaningful way.

The evidence is a body of interventions that behave as the conjecture predicts: a single direction can be amplified or suppressed with roughly monotone effects on the output, and differences between activations carry information the probe can read linearly.

Conjecture (linear representation). For a concept \(c\) there exists a direction \(u_c\) in the residual stream such that changing an activation \(h\) to \(h + \lambda u_c\) changes the model’s behaviour with respect to \(c\) in a way that is monotone in \(\lambda\), and such that the projection \(u_c^{\top} h\) predicts the presence of the concept across contexts.

Stated in that form the conjecture is falsifiable in the way a mathematical statement should be: it predicts that the projection is a sufficient statistic for the concept, which is a claim a probe can test against held-out contexts.

The conjecture is used constantly in practice — steering vectors, concept erasure and activation arithmetic all assume it — which is a reminder that a useful assumption does not have to be a proved one.

Your Institute @yourname Sep 21, 2026

The KV Cache Is Exact (claim)

Demo note. This note demonstrates what the SciDraft Hugo theme can do for academic and scientific publishing — for research institutions, researchers and students. Its content is demonstration material only: readers should ignore whether the demo content is correct.

Caching keys and values is standard practice, and the claim that justifies it is strong: incremental decoding gives exactly the same outputs as recomputing attention over the whole sequence, not an approximation of them.

Stated for the arithmetic of the model rather than for floating-point hardware, the claim is what licenses treating the cache as an optimisation. The caveat about floating point is worth stating alongside it, because it is where a literal reading of the claim fails.

Claim. Let a decoder attend over a prefix of length \(t\), and let the same decoder attend over the prefix extended to length \(t + 1\) with the additional key \(k_{t+1}\) and value \(v_{t+1}\) appended to the cached matrices. Then

$$ \operatorname{softmax}\!\left(\frac{q_{t+1} K_{1:t+1}^{\top}}{\sqrt{d_h}}\right) V_{1:t+1} = \left[\operatorname{softmax}\!\left(\frac{Q_{1:t+1} K_{1:t+1}^{\top}}{\sqrt{d_h}}\right) V_{1:t+1}\right]_{t+1} $$

the left side being the incremental step that uses only the cached keys and values and the current query, and the right side being row \(t + 1\) of the full computation over the whole prefix. The equality holds because the cache stores exactly the keys and values the full computation would use, and the softmax at a causal position depends only on those and on the current query.

The claim is about the mathematical function, and it is exact there; in floating point the two orders of summation can differ in the last bits, which is why a cache and a recomputation may differ in the eighth decimal place while computing the same mathematical quantity.

Your Institute @yourname Sep 21, 2026

Attention Variants by Cost and Cache (quadrant chart)

Demo note. This note demonstrates what the SciDraft Hugo theme can do for academic and scientific publishing — for research institutions, researchers and students. Its content is demonstration material only: readers should ignore whether the demo content is correct.

Choosing an attention variant is a two-constraint problem rather than a ranking: the score cost decides how long a sequence can be trained on, and the per-token cache decides how long a sequence can be served, and the two orderings of the variants are not the same.

This note uses a quadrant chart, which is the right shape for two independent axes with no third quantity to show. Positions are qualitative — ranked rather than measured — and the axes run from cheap to expensive on both counts.

quadrantChart
    title Attention variants by score cost and cache size
    x-axis Cheap scores --> Expensive scores
    y-axis Small cache --> Large cache
    quadrant-1 Expensive, large cache
    quadrant-2 Expensive, small cache
    quadrant-3 Cheap, small cache
    quadrant-4 Cheap, large cache
    Full attention: [0.9, 0.85]
    Sliding window: [0.45, 0.8]
    Block sparse: [0.62, 0.58]
    Kernel linear: [0.2, 0.18]
    State space: [0.25, 0.1]

The chart makes the usual trade-off visible in one picture: every variant that reduces the score cost by sparsifying still pays the full cache, so it lands in the right-hand column, while the variants that replace the pairwise structure move to the bottom left and pay instead in expressiveness.

Your Institute @yourname Sep 21, 2026

A Transformer Training Step (flowchart)

Demo note. This note demonstrates what the SciDraft Hugo theme can do for academic and scientific publishing — for research institutions, researchers and students. Its content is demonstration material only: readers should ignore whether the demo content is correct.

One training step is a fixed cycle: the model predicts, the predictions are scored against the targets, the error is propagated backwards, and the parameters move a little in the direction that reduces it. The diagram below shows that cycle; the repetition is the whole of training.

In notation, the step computes a loss \(L(\theta)\) over a batch, obtains the gradient \(\nabla_\theta L\) by backpropagation, and applies an update \(\theta \leftarrow \theta - \eta \nabla_\theta L\), where \(\eta\) is the learning rate. Adaptive optimisers such as Adam rescale that update per parameter, but the loop structure is unchanged.

flowchart TD
    A["Input batch: tokens X, targets Y"] --> B["Forward pass: logits Z = f_theta(X)"]
    B --> C["Loss: L = -sum log p_theta(Y | X)"]
    C --> D["Backward pass: gradients of L wrt theta"]
    D --> E["Optimiser step: theta := theta - eta * grad"]
    E --> F{"More steps?"}
    F -- "yes" --> A
    F -- "no" --> G["Frozen parameters theta*"]

Reading the diagram. Step 1–2 is the forward pass: the same computation used at inference time, with the loss attached at the end. Steps 3–4 are the part that exists only during training — backpropagation applies the chain rule layer by layer to obtain one gradient per parameter. The branch at the bottom is where practice departs from theory: the batch is a sample, so each step moves the parameters along a noisy estimate of the true gradient, and the learning rate schedule decides how large those moves may be.

Your Institute @yourname Sep 21, 2026

Kolmogorov Axioms for a Token Distribution (axiom)

Demo note. This note demonstrates what the SciDraft Hugo theme can do for academic and scientific publishing — for research institutions, researchers and students. Its content is demonstration material only: readers should ignore whether the demo content is correct.

An axiom is an assumption taken as given, and the ones that hold up a language model are Kolmogorov’s three: probabilities are non-negative, the whole space has probability one, and disjoint events add. Everything else about token distributions is derived from them rather than assumed.

Stating them for a finite vocabulary is enough here, because the sample space of a language model at one position is exactly the token set.

Axiom (probability space of a token distribution). Let \(\mathcal{V}\) be a finite vocabulary and \(p\) a function from \(\mathcal{V}\) to the real numbers. Then \(p\) is a probability distribution when

$$ p_v \geq 0 \quad \text{for every } v, \qquad \sum_{v \in \mathcal{V}} p_v = 1 . $$

Countable additivity is the third axiom of the general theory; on a finite vocabulary it is automatic, and the two conditions above are the whole content.

The axioms are what make the softmax the natural output layer: it is the parameterisation that satisfies the first two conditions by construction, for any real-valued scores.

Your Institute @yourname Sep 21, 2026

Softmax of Three Scores (example)

Demo note. This note demonstrates what the SciDraft Hugo theme can do for academic and scientific publishing — for research institutions, researchers and students. Its content is demonstration material only: readers should ignore whether the demo content is correct.

An example is where a formula stops being notation, and this one is small enough to check by hand: three scores, one softmax, three probabilities that must sum to one.

The numbers below are the ones the companion snippet prints, so the arithmetic here and the output of a few lines of code can be compared directly.

Example. Take the score vector \(z = (2.0,\, 1.0,\, 0.1)\). Exponentiating and normalising,

$$ (e^{2.0},\, e^{1.0},\, e^{0.1}) = (7.389,\, 2.718,\, 1.105), \qquad \sum_i e^{z_i} = 11.212 , $$

so the probabilities are

$$ p = (0.659,\, 0.242,\, 0.099), $$

which sum to one to the precision shown. The largest score, only twice the smallest, still receives more than six times its probability, because the exponential amplifies ratios rather than differences.

Two things become visible at this size that are hard to see in general form: the ordering of the scores is preserved exactly by the softmax, and the gap between the first and second probability is much wider than the gap between the first two scores.

Your Institute @yourname Sep 21, 2026

A Bound on the Attention Output Norm (corollary)

Demo note. This note demonstrates what the SciDraft Hugo theme can do for academic and scientific publishing — for research institutions, researchers and students. Its content is demonstration material only: readers should ignore whether the demo content is correct.

Reading a bound off a proposition is the standard use of a corollary, and the one worth having here is a ceiling on how large an attention output can be. Since the output is a convex combination of value vectors, its length can never exceed the longest of them.

The consequence is a stability statement that does not depend on the queries at all: however sharp the attention distribution becomes, the outputs stay inside a ball whose radius is set by the values.

Corollary. If the attention weights of row \(i\) form a probability distribution \(A_{i\cdot}\) and \(o_i = \sum_j A_{ij} v_j\), then for any norm

$$ \lVert o_i \rVert \leq \max_j \lVert v_j \rVert , $$

with equality when the row is concentrated on a value vector of maximal norm.

The proof is the triangle inequality together with \(\sum_j A_{ij} = 1\): \(\lVert \sum_j A_{ij} v_j \rVert \leq \sum_j A_{ij} \lVert v_j \rVert \leq \max_j \lVert v_j \rVert\).

A bound of this kind is what licenses the common practice of normalising the value projection rather than the output: controlling the radius of the value vectors controls the radius of everything downstream.