The floors

A result the size of its own noise

Sorting rotations by their first four characters beat the full Burrows–Wheeler transform by 0.022 bits a symbol. On sixteen streams of the same source the mean difference is 0.004 with a standard deviation of 0.011, and the short context is ahead on ten of them. The 1.2% was one draw. What survives is sharper than the result it replaces: from four characters upwards, every run break either rule makes is at a word boundary, and nothing above four characters decides anything at all.

The order inside a tie sorted a text’s rotations by their first kk characters rather than by everything that follows, and found that at k=4k = 4 the output clustered slightly better than the full Burrows–Wheeler transform: 1.780 bits a symbol against 1.802, from 63% of the character reads and at no cost to undo. It said so carefully. It called the 1.2% “small enough to be an accident of the source”, and it left a measurement to settle the question — two vocabulary sources, one whose words are drawn independently and one whose next word depends on the last letter of the one before, with a prediction that the full context would win on the second and lose on the first.

That measurement is here, and it settles a different question first. The two sources agree, and neither of them shows the effect at all.

Sorting rotations by their first k characters: 4.16 bits a symbol at k = 0, 1.780 at k = 4, and the full transform's 1.802 from k = 248,192 symbols of words from a fixed vocabulary, zeroth-order entropy 3.898 bits. The rotations of the text are sorted by their first k characters and the last column is put through move-to-front and charged at its zeroth-order entropy. With ties kept in text order: k = 0: 4.155, k = 1: 2.935, k = 2: 2.100, k = 3: 1.886, k = 4: 1.780, k = 6: 1.782, k = 8: 1.793, k = 12: 1.797, k = 16: 1.802, k = 32: 1.802. At k = 24 and above the output is the Burrows–Wheeler transform exactly, at 1.802. With ties sorted by the symbol emitted the stream alone costs 0.037, 0.129, 0.306, 0.582, 0.780, 1.218, 1.566, 1.777, 1.795, 1.802 at the same k — cheaper, because a tied group comes out as runs, and not free to undo. The horizontal axis is spaced by log₂(k + 1).01234characters of context the sort reads, kbits a symbol after move-to-front012481632the full transform, 1.802ties kept in text orderties sorted by symbol: the stream alonethe text's own floormodel: order 0 after move-to-front · Words from a fixed vocabularyexactly the transform from k = 24
Fig. 1 The plate the previous page ended on. Rotations sorted by their first k characters, the last column put through move-to-front and charged at its zeroth-order entropy: 4.16 bits a symbol at k = 0, a minimum of 1.780 at k = 4, and the full transform’s 1.802 from k = 24 upwards. One stream, one seed, 8,192 symbols.

Sixteen draws of the same thing

The quantity in question is a difference between two numbers that differ in the third decimal place, taken on one 8,192-symbol stream. The first thing to establish is what that difference does on a second stream.

The 0.022 bits, and the fifteen streams beside itEach dot is one stream of 8,192 symbols: the bits a symbol the full Burrows–Wheeler transform spends after move-to-front, minus what sorting the rotations by their first four characters spends. Positive means the short context won. The ringed dot on the top row is the stream the previous page measured, at +0.0218. The other fifteen of that source scatter either side of zero: the mean is +0.0038 with a standard deviation of 0.011, and the short context is ahead on 10 of 16. Below it, the source whose next word depends on the last letter of the one before — the source that was supposed to hand the win back to the full context — sits at +0.0064, if anything further from zero in the same direction.words drawn independentlymean +0.0038 ± 0.011ahead on 10 of 16next word set by the last lettermean +0.0064 ± 0.011ahead on 12 of 16no difference−0.0176+0.0000+0.0251bits a symbol the short context savesthe stream reported beforek = 4 · 16 streams a source · bands: ±1 standard deviationone draw, not a result
Fig. 2 Each dot is one stream: the transform’s bits a symbol minus the four-character sort’s, so positive means the short context won. The ringed dot is the stream the previous page measured, at +0.0218. The other fifteen of that source scatter either side of zero — mean +0.0038, standard deviation 0.011, ahead on ten of sixteen. The chained source, which was supposed to hand the win back to the full context, sits at +0.0064.

The per-stream spread is 0.011 bits a symbol and the mean is 0.004. The reported result is one and a half standard deviations above the centre of the distribution it was drawn from, which is an ordinary place for a draw to be. Six of the sixteen streams have the opposite sign.

Where the spread comes from is worth a sentence, because it is not measurement error in the usual sense. Nothing here is noisy: given the stream, both numbers are exact to fifteen decimal places and reproduce on any machine. The variation is in the stream — 8,192 symbols is about two thousand words, and which words happen to fall next to each other decides how many rotations share each four-character context and how the emitted characters inside those groups happen to run. On average is not a number made the same distinction for quicksort’s comparison count, where six hundred runs give a distribution and the mean is the least interesting thing in it. Here the distribution is over sources rather than over seeds inside one algorithm, and the consequence is the same: a single number from it is a sample, and it has to be reported as one.

Sixteen is not an arbitrary number here. Five streams were tried first and they leave a standard error of half the effect, which is enough to say the effect was not found and not enough to say it is not there. Sixteen leave a quarter of it. The first of the sixteen seeds is the one SOURCES.english uses, so the earlier measurement is inside the set rather than beside it — it can be pointed at rather than argued about.

This is the shape of error the seeding rule here is written against, arriving from the direction it does not cover. Every figure here is drawn from a stated seed so that the numbers in a caption are the numbers on the page, and the adversary who knows the seed has already recorded what that costs in a different setting. The cost here is subtler: a fixed seed makes a measurement reproducible without making it a measurement. That 1.780 is exactly right and anybody can reproduce it. It is a property of that stream.

What the two sources were for

The prediction had a mechanism behind it, and the mechanism is worth stating precisely because most of it survives. On text made of whole words, the four characters after a position are often the rest of a word, and the characters after those are the next word — which, in a source that draws each word independently, is chosen without reference to anything before it. Sorting a tied group by the following context is then sorting on a coin flip, and it scatters rotations that text order would have left adjacent.

If that is the whole story, the effect must weaken on a source whose next word depends on the previous one, because there the following context carries information about what precedes it.

What the chain did to the text, which is what makes the comparison a comparisonThe same vocabulary and the same word-length distribution, drawn two ways. When each word is drawn independently the transform's output costs 1.793 bits a symbol after move-to-front, with a mean run of 3.41 characters. When the next word is drawn from the third of the vocabulary that the previous word's last letter selects, it costs 1.385 with a mean run of 3.89 — a fifth less, because there is a fifth less to say. Their zeroth-order entropies are within 0.02 bits of each other and their mean word lengths within 0.21 characters, so what differs between them is the dependence between words and not the letters. That is the difference the previous page's account said would decide the tie rule, and it does not.words drawn independentlymean word 4.16 · mean run 3.411.793 bits a symbolk = 2 costs +0.303next word set by the last lettermean word 3.95 · mean run 3.891.385 bits a symbolk = 2 costs +0.433the full transform's output, after move-to-frontone vocabulary, oneword-length distribution,two ways to choose a wordthe difference between them is the order of the words,and nothing else8,192 symbols · 28 words · buckets of about thirteen23% fewer bits
Fig. 3 The same vocabulary and the same word-length distribution, drawn two ways. Independent words: the transform’s output costs 1.793 bits a symbol after move-to-front with a mean run of 3.41 characters. The next word drawn from the third of the vocabulary its predecessor’s last letter selects: 1.385 bits and a mean run of 3.89. Their zeroth-order entropies are within 0.02 bits and their mean word lengths within 0.21 characters.

The chain does a great deal to the text — a fifth off the transform’s own cost — so the two sources are genuinely different objects and the comparison is not empty. It does nothing to the tie rule. The advantage at k=4k = 4 is +0.0038 on the independent source and +0.0064 on the chained one, both inside their own spread and both, if anything, in the direction the prediction said would reverse.

Building that second source took one wrong turn worth recording. The obvious construction is to bucket the words by their last letter and draw the next word from the bucket its predecessor’s last letter names. Five of these twenty-eight words end in e and every one of those ends in e, so that chain has an absorbing class: it produces “the here the here the table figure figure” and a zeroth-order entropy of 3.37 against the independent source’s 4.05. The two sources would then have differed in their letter statistics as well as in their word order, and no comparison between them could have attributed anything to either. Round-robin buckets keep every word reachable and leave the letter distribution where it was, while still cutting the choice of the next word from twenty-eight to about thirteen — one and a half bits of dependence, which is the thing being varied.

Where the context length does decide something

The null at k=4k = 4 is not a null everywhere. Swept over kk, the curve has a decisive region and the decisive region is below four.

Where the context length actually matters, and where it stopsThe same difference at every context length, averaged over 16 streams, with bands at one standard deviation. Two and three characters are decisive and the full transform wins both, by 0.303 and 0.096 bits a symbol, on every stream of both sources. From four characters upwards every point on both curves is inside its own band: the largest is +0.0064. The context a transform needs is decided below four characters and nothing above four decides anything, on either source.-0.400-0.2000characters of context the sort reads, kbits a symbol the short context saves23456812162432words drawn independentlynext word set by the lastletterfaint: ±1 standarddeviationover 16 streams8,192 symbols a stream · move-to-front then order 0decided below four
Fig. 4 The difference at every context length, averaged over sixteen streams, with bands at one standard deviation. Two and three characters are decisive and the full transform wins both, by 0.303 and 0.096 bits a symbol, on every stream of both sources. From four characters upwards every point on both curves is inside its own band, the largest being +0.0064.

At k=2k = 2 the full context is ahead by 0.303 bits a symbol on the independent source and 0.433 on the chained one, on sixteen streams out of sixteen, both sources. At k=3k = 3 it is 0.096 and 0.146, again on every stream. At k=4k = 4 it is nothing.

So the question the previous page asked — how long a context does a transform need? — has a sharp answer, and the answer is not the one either page was looking for. It needs four characters on this source, and the fourth character is the one that matters; the fifth and everything after it change the output without changing what the output costs.

The shape of that curve is the same shape the dictionary that builds itself found when it swept LZSS’s window: a steep region where the parameter is buying something real, then a flat one, and past the flat region the sweep is measuring the source rather than the algorithm. The difference is that there the flat region eventually turned down — widening the window past 4,096 made the compressor worse, because the offsets cost more than the matches saved. Nothing here turns down, because a longer context costs the sort reads and costs the output nothing.

Why four

The tie rule arranges the rotations inside a group that shares a context. Whether that arrangement can change anything depends on whether the group holds more than one distinct emitted character, and that is decidable.

The tie rule can only matter where a context runs out of wordEvery run break the two tie rules make inside the groups they decide, on the source whose words are drawn independently, split by whether the group's own context stays inside a word or reaches a space. At two characters, 1,114 of 3,251 breaks — 34% — are inside a word. At three it is 12%. At four it is 0.014%, and above four it is nothing at all. Four characters inside a word of mean length 4.16 name the word, and naming the word names the character before it — so those groups hold one distinct emitted character and no ordering of them can break anything. Everything the tie rule decides is at a word boundary, and there the two rules differ by 3 breaks in 2,197.01e+32e+33e+3characters of context, krun breaks inside the groups the tie rule decides234568all breaks, ties in textorderall breaks, ties byfollowing contextbreaks in groups that stayinside a wordmean word 4.16 characterswords drawn independently · 16 streams, averagednothing inside a word from k = 4
Fig. 5 Every run break the two tie rules make inside the groups they decide, split by whether the group’s own context stays inside a word or reaches a space. At two characters, 1,114 of 3,251 breaks — 34% — are inside a word. At three it is 12%. At four it is 0.014%, and above four it is nothing at all. Everything the tie rule decides is at a word boundary, and there the two rules differ by three breaks in 2,197.

Four characters inside a word of mean length 4.16 name the word. Naming the word names the character before it, because in a vocabulary of twenty-eight words no two share a four-character substring at the same offset often enough to matter. A group whose context stays inside a word therefore holds one distinct emitted character, and no ordering of it can break a run. The collapse from 34% to 0.014% happens in two steps, at exactly the lengths a mean word of 4.16 predicts.

The arithmetic behind “name the word” is worth performing rather than taking on trust. Twenty-eight words with a mean length of 4.16 give about 2,000 word-starts in an 8,192-character stream and roughly 90 distinct four-character substrings that lie wholly inside a word. Those 90 contexts cover 2,241 rotations — a mean group of twenty-five — and every one of those groups emits a single distinct character. A group of twenty-five rotations that the tie rule may arrange in any of 25! ways, all of which produce the same output. That is the sense in which the reach collapses while the room does not.

What is left for the tie rule to decide is the groups whose context reaches a space. There, the characters after the context really are the next word, and there really is a choice to make. The two rules make it differently and arrive within three breaks of each other out of 2,197 — which is the measurement the whole prediction reduces to, and it is a measurement of nothing.

How much room a tie rule has, and how fast it runs outThe rotations of 8,193 positions, cut into groups sharing their first k characters. At k = 2 there are 87 groups and the largest holds 337 rotations, so the tie rule is arranging most of the text. At k = 8 there are 3,632 groups and the largest holds 68. The third curve is how many rotations are in groups whose context stays inside a word: 5,018 at k = 2, 2,241 at k = 4, and none at all from k = 12. That last curve is the one that matters: the tie rule's room and the tie rule's *reach* are different quantities, the room shrinks steadily, and the reach collapses.1011010010³characters of context, krotations, groupsgroupslargest grouprotations in groups insidea wordthe third curve reacheszeroand leaves the frame8,193 rotations · words drawn independentlythe reach collapses first
Fig. 6 The rotations of 8,193 positions, cut into groups sharing their first k characters. At k = 2 there are 87 groups and the largest holds 337 rotations, so the tie rule is arranging most of the text. At k = 8 there are 3,632 groups and the largest holds 68. The third curve is how many rotations sit in groups whose context stays inside a word: 5,018 at k = 2, 2,241 at k = 4, and none at all from k = 12.

The two curves separate two quantities that are easy to run together. The tie rule’s room — how many rotations it is arranging — falls steadily and is still substantial at k=8k = 8, where the largest group holds sixty-eight rotations. Its reach — how many of those it can actually change the cost of — collapses at k=4k = 4. A group of sixty-eight rotations all emitting the same character is a group the tie rule has complete freedom over and no effect on.

That is the general form of the result, and it is not about words. A tie rule matters exactly where the context fails to determine the character before it. On a word source that is at word boundaries; on a source with a different structure it would be somewhere else, and the length at which it stops mattering would be that structure’s own scale rather than 4.16.

And across vocabularies

One more parameter was worth moving, because an early version of this page moved it by accident. A first attempt used a thirty-eight word vocabulary instead of SOURCES.english’s twenty-eight, and on a single stream the 0.022-bit win became a 0.018-bit loss with nothing else changed — a swing larger than the effect. That is either a real dependence on the vocabulary or the same sampling noise seen twice.

Nor does the vocabulary decide itThe same difference at k = 4, against the size of the vocabulary the source is built from, each point 16 streams with a band at one standard deviation. The transform's own cost rises from 1.318 bits a symbol at eight words to 2.065 at 56, and the mean group a four-character context defines falls from 93 rotations to 6 — so the tie rule is deciding over a very different amount of text at the two ends. The difference it makes is +0.0001 to +0.0051 throughout, every point inside its own band, and the sign agrees with the mean on between 7 and 10 of 16 streams.-0.01000.01081420284056words in the vocabularybits a symbol the four-character sort savesmeasured, 16 streams apointno differencebars: ±1 standarddeviationk = 4 · vocabularies nested, each a prefix of the nextnothing anywhere
Fig. 7 The same difference at k = 4 against the size of the vocabulary, each point sixteen streams with a band at one standard deviation. The transform’s own cost rises from 1.318 bits a symbol at eight words to 2.065 at fifty-six, and the mean group a four-character context defines falls from 93 rotations to 6. The difference it makes is +0.0001 to +0.0051 throughout, every point inside its own band.

It is the noise. Across a sevenfold range of vocabulary, over which the transform’s own cost rises by 57% and the tie rule’s room falls by a factor of fifteen, the difference between the two rules stays within half a hundredth of a bit of zero and never reaches two standard deviations from it. The sign agrees with the mean on between seven and ten of sixteen streams at every size, which is what a coin does.

What the earlier page got right

It would be easy to read this as a page that overturns the one before it, and that is not what happened. The page before this one made two claims and the smaller one was wrong.

The larger claim was about the cost to undo, and it stands untouched. Sorting the rotations by their first kk characters with ties kept in text order is injective at every kk — every string of eight characters over three letters keeps its own output — so the family between the sort and the transform costs nothing to invert, and the prediction that a shorter context would leave ties for the inverse to pay for was wrong for a reason that had nothing to do with sampling. What a reordering costs to undo priced the two ends of that family exactly, and the finding that the cost lives in the tie rule rather than in the context length is a statement about all strings, established by enumeration rather than by measurement on a stream.

The smaller claim was that a four-character context also clusters better. That one was a single draw, and it is the one that does not survive.

Both claims sit inside a larger one that these pages have been building since the model is the compressor: the entropy of a text is a property of a decision about how much context to condition on, rather than a property of the text. The transform is that decision made implicitly — sorting by the whole following context is conditioning on all of it — and the family between the sort and the transform is that decision made with a dial. What this page adds is that the dial has a stop. Past four characters on these sources it moves nothing, and the reason it moves nothing is that the context has already determined the thing the transform is arranging.

The difference between those two claims is the difference between the two instruments the earlier page used, and it is worth naming. An enumeration over every string of a length is a statement about the object. A measurement on a stream is a statement about a stream, and becomes a statement about the source only with a count of streams beside it. Fitting a class to measurements made the same distinction for complexity classes, where a fit across three orders of magnitude is a claim that can fail and a single measured point is not.

What is settled and what is not

Settled, over sixteen streams of 8,192 symbols on each of two sources: at two characters of context the full transform beats the limited sort by 0.303 and 0.433 bits a symbol, and at three by 0.096 and 0.146, on every stream of both. At four characters and above the difference is +0.0038 ± 0.011 and +0.0064 ± 0.011, with the sign agreeing with the mean on ten and twelve streams of sixteen. The single stream that reported +0.0218 is inside that distribution at one and a half standard deviations.

Settled, by counting: from k=4k = 4 upwards, 0.014% and then none of the run breaks either rule makes lie inside groups whose context stays within a word, against 34% at k=2k = 2. The two rules differ by three breaks in 2,197 at k=4k = 4.

Settled, across six vocabularies from eight to fifty-six words, over which the transform’s own cost rises 57%: the difference stays between +0.0001 and +0.0051 and never reaches two standard deviations from zero.

Not settled:

Longer streams. Every measurement here is 8,192 symbols. The spread of the difference should fall as the stream lengthens, and if the mean is genuinely +0.004 rather than zero, a long enough stream would separate it. Nothing here says whether 0.004 is a small real effect or a small null; it says the reported 0.022 is neither.

Real text. These sources are word lists with a stated grammar, which is what makes the boundary argument checkable — the position of every word boundary is known. A real corpus has a word-length distribution rather than a mean, punctuation, and long-range structure, and the sharp collapse at four characters would presumably become a soft one over a range.

Other tie rules. Two rules are compared here and the earlier pages compared a third, sorting a tied group by the symbol it emits. That one is not free to undo and is priced elsewhere; whether any rule that is free to undo beats text order by more than noise is untested, and the space of such rules is not small.

The reads. The four-character sort reads 63% of the characters the full sort reads, and that number is not in question. If the two outputs cost the same, that saving is the whole of the case for the limited sort — and it is a case about construction cost, which is the axis the transform that emits nothing did not measure and this page has not either.

The coder. Every cost here is the zeroth-order entropy of the move-to-front output, which is the measure every page here has used and is a floor rather than a coder’s bill. The bits a coder emits measured the gap between that floor and what a Huffman coder and an arithmetic coder actually spend, and a difference of 0.004 bits a symbol is well inside the first of those gaps. A comparison taken at the coder rather than at the floor might not have the same sign, and nothing here says which way it would go.

Still open: the length at which a context names its own predecessor

The result that survives is a rule about when a tie rule can matter at all: it matters exactly where the context fails to determine the character before it. On these sources that length is the mean word, and the collapse is sharp because every word is drawn from a short list.

That suggests a quantity computable from a source rather than measured on it. For a given kk, the share of positions whose kk-character context is followed by more than one distinct preceding character is a property of the text — one pass to compute, no sorting, no coder — and the argument here says the tie rule’s whole reach is that share. If it is, then the context length a transform needs is readable off a text directly, and the sweep over kk that every page here has run is unnecessary.

The measurement that follows computes that share for each kk on both sources here, on the frozen corpora, and on a source with a deliberately broad word-length distribution; sets it against the run-break counts measured above; and asks whether the kk at which the share crosses a stated threshold predicts the kk at which the sweep’s curve flattens. The prediction is that it does on the word sources, where the share falls off a cliff, and that on a corpus with a broad length distribution both the share and the curve decay smoothly and the “context a transform needs” stops being a single number — which would explain why the question has an answer here and does not in general.

Named alongside this one

Essays reaching for the same objects. Nobody chose these; they are what the concept index makes visible.

The objects this essay names

Each one links to every other essay that touches it.

Bits per symbolBurrows-wheeler transformContext modelEntropyFalsificationHonest limitInvertibilityMeasurement designModel orderMove to frontPermutationPredictionSide informationVariance