The variation that comes with a seed
Worth reading first: The same program, twice · A bound that holds with probability · The dimension does not appear.
This field has spent sixteen essays showing that a computation’s answer is not a single number. The randomised field got there first, by a different route and on purpose.
A bound that holds with probability is where this site’s guarantee changes kind: a randomised low-rank approximation’s error is a draw, its bound holds with a probability rather than always, and every figure in that field draws a band rather than a line. A reader of it is already accustomed to an answer that varies between runs, and to recording a seed so it does not.
So the question this essay exists for: how do the two variations compare?
The draw moves the answer by up to 31%. The machine moves it by about 10⁻¹⁵. Between them, at every decay rate measured, at least 4.4·10¹³.
Reading the figure
Five spectra, from a geometric decay of 0.7 per index — fast, so a rank-8 approximation is nearly exact — to 0.94, which is slow enough that eight directions capture little of the matrix.
The upper curve is not monotone, and the shape is worth a sentence. At a fast decay the leading subspace is so dominant that any random sketch finds it and the draw matters little: 6.3%. At a slow decay everything is nearly equally important, so a sketch that misses one direction has missed something no larger than what it caught: 9.4%. In between, at 0.82, the matrix has a leading subspace that a sketch can either find or miss, and the draw matters most: 31%.
The lower curve is flat at about 10⁻¹⁵ across all five, which is what a quantity made of roundings does when the problem changes and the precision does not.
The comforting reading, and its limit
The comforting reading is the correct one and it should be stated first. In this field the fifth author is already dominated. A practitioner who reports a randomised method’s error as a band across seeds is reporting a band whose width is fourteen orders larger than anything a thread count contributes, so the machine’s disagreement is invisible inside a figure that was already honest about being a distribution.
That is a genuine limit on the field this essay sits in. Not every computation needs an order-independent reduction, and the ones whose answer is already a distribution need it least.
The limit of the comfort is the word dominated. The machine’s contribution is not zero: at every decay rate, four to seven of the seven partitionings return distinct values. It is small, and small is not the same as absent, and the difference matters in exactly one place — a comparison.
What the seed does and does not fix
The practice of recording a seed is a reproducibility practice, and it is worth being precise about which reproducibility it buys.
A seed fixes the draw: the sketch matrix Ω is a deterministic function of it, so two machines given the same seed sample the same subspace and pursue the same approximation. That removes the 31%, which is the large term, and it is why the practice exists.
It does not fix the arithmetic. Y = AΩ is a matrix product, which is a set of inner products, which is a set of reductions — so two machines given the same seed compute slightly different Y, take the QR of slightly different matrices, and return slightly different answers. The seed is upstream of the randomness and the reduction is downstream of it.
So seeded is not deterministic, and a test asserting bitwise equality of a seeded randomised routine’s output will fail on a machine with a different thread count, for a reason that has nothing to do with the seed. That is a specific and avoidable confusion: the failure looks like a broken seed and is not one.
The other randomised methods, and where they sit
The measurement is on a randomised SVD, and the field has three other constructions whose position on this scale is worth predicting — and, where the site has already measured the first term, stating.
A sketch-and-solve least squares. Its error is dominated by the sketch’s distortion, which is a draw and is per cents — what a sketch costs in accuracy measures it. Same picture: the draw is enormous compared with the machine.
A sketch-and-precondition solve. Here the draw affects only the preconditioner, and the answer is computed by an iteration to a tolerance, so the seed’s influence on the final answer is nearly nil — it changes the number of iterations rather than the result. That inverts the ratio: the seed’s contribution to the answer is small and the machine’s is what a stopping test is a race measures, which is not small. The two randomised methods sit at opposite ends of this essay’s figure, for a reason that is about where the randomness enters rather than about randomness.
A Hutchinson trace estimator. The probe is a draw and the variance across probes is the field’s whole subject — counting what cannot be looked at prices it. The reduction inside zᵀAz has κ = 42 by the census, so the machine’s term is tiny. Same picture again.
The pattern: when the randomness decides the answer, it dominates; when it decides only the route to an answer, it does not, and the machine is back. That is a more useful classification than randomised or deterministic, and it is not one the literature’s vocabulary makes easy to state.
Why the two are so far apart
The mechanism is worth a paragraph because the ratio is enormous and it is not a coincidence.
The seed’s variation is first order in the sampling. A different Ω samples a different subspace, and how good a random subspace is at capturing the leading directions varies by an amount the Halko–Martinsson–Tropp analysis puts at a constant factor — per cents, for the oversampling used here, which is what the upper curve measures.
The machine’s variation is first order in the rounding. A different partitioning perturbs Y in its last bits, the subspace it spans moves by a relative u/gap, and the resulting error moves by about that.
One is a statement about geometry and the other about arithmetic, and their ratio is roughly (a per cent) ÷ u ≈ 10¹⁴. Nothing about the problem chooses that ratio; it is what separates a deliberate approximation from a rounding, which is the same separation the fifth author puts between the fourth author and the fifth. An approximation somebody typed is large; a rounding the machine committed is not.
The rank sweeps the gap and does not close it
The drag runs the rank from 4 to 16 and the upper curve falls: a larger rank leaves less for the draw to get wrong, because the approximation is closer to the optimum and the variance of a near-optimal thing is smaller. The lower curve does not move, because it is a property of the arithmetic rather than of the approximation.
So the gap narrows with the rank and stays enormous. There is no rank at which they meet on a problem of this size, and the honest form of that claim is that the two quantities have different mechanisms rather than a law relating them — a much larger problem, or a much better conditioned sketch, could close the gap further, and this measurement does not say by how much.
What a probabilistic bound has to say about it
The randomised field’s guarantee is a bound that holds with a probability, and it is fair to ask whether that framework already covers the machine’s term.
It does not, and the reason is the one a bound every answer satisfies gives for the deterministic case, in probabilistic clothing. The Halko–Martinsson–Tropp bound is a statement about the distribution of the error over draws of Ω, with the arithmetic assumed exact. Every partitioning of a fixed draw satisfies it, because they all differ from the exact-arithmetic answer for that draw by 10⁻¹⁵ and the bound has per cents of room. So the bound covers the machine’s variation the way a motorway covers a bicycle: completely, and without being about it.
What would be needed to cover it properly is a bound over the joint distribution of the draw and the implementation, and nobody has written one because the second has no distribution anybody has described. The scheduler is not a random variable with a known law; it is a fact about an afternoon.
Which is worth stating because it closes a loop with the field’s first essay. There, the classical error bound could not identify an ordering because it contained no term for the order. Here, the probabilistic bound cannot either, for the same reason — and the probabilistic framework, which exists precisely to talk about answers that vary, still has nothing to say about the one source of variation nobody chose.
What had to change to measure it
A note on the instrument, because the measurement needed one thing this site did not have.
Every routine here takes an arithmetic context — the object that decides how a number is rounded, which is how precision as the knob puts the mantissa on a slider. The randomised routine did not: it computed its two matrix products in binary64, hard-coded, because until this field existed there was no reason for them to be anything else.
Threading the context through was three lines, and the interesting part is what it revealed about the
one below it. The site’s matrix product accumulates its inner products in a loop rather than calling
the context’s own inner product, and the two are the same arithmetic written twice — so the product
could not be given a divided reduction without either duplicating it or noticing that the loop and the
context’s dot compute the identical sequence of operations.
They do, exactly, for every context this site has. So the product now uses the context’s inner product when the context declares itself divided, and the loop otherwise, and every figure written before this draws the same picture. That is the shape of change this collection’s rules ask for: the fix goes where the gap is, it is opt-in so nothing existing moves, and the reason is written down where the branch is.
Where it would matter
Two cases, and naming them keeps the essay from being purely reassuring.
A rank decision from the sketch. If the singular values the randomised method returns are compared with a threshold, the comparison is the one a rank that depends on the thread count measures, and the machine’s 10⁻¹⁶ can decide it. But so can the seed’s 31%, and by far more — so the honest diagnosis there is that a rank read from a randomised approximation is a draw before it is a machine-dependent quantity, and the repair is more oversampling or a different method rather than a summation policy.
A comparison against a stored answer. A test suite that stores the output of a seeded randomised routine and compares bitwise will fail, and this is the case worth watching for, because everything about the setup says it should not. The seed is recorded, the algorithm is deterministic given the seed, and the answers still differ — which is exactly the sequence that produces an afternoon spent looking for a bug in the random number generator. What a regression test can ask for is the general answer: compare against a measured tolerance, not against bits.
What a band should be a band over
One recommendation, and it is a change to a habit rather than to any code.
A randomised method’s figure is a band across seeds because the seed is the acknowledged source of variation. This measurement says there is a second one, fourteen orders smaller, and the useful consequence is not that the band should be widened — it should not; the second term is invisible inside the first — but that the band’s definition should say what it is a band over.
The error over eight draws and the error over eight runs are different statements, and on a parallel machine the second contains the first plus a term nobody mentioned. They agree to fourteen digits here and they would not agree on a computation whose reductions are worse conditioned than a sketch’s — a randomised method applied to a residual, say, or a stochastic trace estimator on a badly scaled matrix, where the vector that hides it’s census puts the reduction at the dangerous end.
So the habit worth having is the one this site already applies to everything else: say which quantity was varied. A band over seeds is a statement about the method. A band over runs is a statement about the method and the machine, and only the second is what a reader reproducing the figure will get.
The reading for the rest of the field
This essay is the field’s own boundary, and boundaries are worth stating as clearly as claims.
Where an answer is already a distribution, the machine is not the interesting term. Randomised methods, Monte Carlo, stochastic rounding, anything whose figure is a band. Report the band, record the seed, and do not spend three operations an element on a term that is fourteen orders below the one already being reported.
Where an answer is supposed to be a number, it is. A solve, a factorisation, a rank, a definiteness verdict. Those are the fifteen essays before this one.
And the way to tell the two situations apart is not the algorithm’s name — it is whether the computation draws anything. A method that consults a random number generator has a variation it announces. A method that does not has one it does not, and the whole of this field is about the second.
One line
A seed fixes which random matrix was drawn and not how its products were summed, so a seeded randomised method is reproducible in the term that matters by a factor of 10¹⁴ and irreproducible in the term that a bitwise test reads.
At other settings
Shares its objects with
Essays that name at least two of the same things, and that neither author linked.
- An answer that changes with the seed — both name oversampling, probabilistic bounds, randomised svd, sketching
- Sketching what is never unfolded — both name oversampling, randomised svd, seeded generator, sketching
- An inner product with no fixed sign — both name bitwise reproducibility, reduction order, run-to-run variation
- The length that changes the kernel — both name bitwise reproducibility, reduction order, run-to-run variation
- The tolerance that buys no agreement — both name bitwise reproducibility, reduction order, run-to-run variation
- Built from products alone — both name oversampling, randomised svd
Named objects
A flat tag is an object no other essay names yet.
Bitwise reproducibilityOversamplingProbabilistic boundsRandomised SVDReduction orderRun-to-run variationSeeded generatorSketching