The floors

The repeats a context cannot see past

Sorting rotations by their first k characters stops losing to the full Burrows–Wheeler transform at four or five characters on four sources and at about ten on a corpus of technical writing. The count proposed to explain the exception — how much a context spanning a word boundary says about the letter before it — cannot be read off its own estimate, which falls on words drawn independently where there is nothing to find. Measured against each text's own shuffled twin, the information the word order carries is real, but it has all arrived by four or five characters, and at eight, twelve and sixteen the two corpora are indistinguishable. What does separate them is repetition. Stream by stream, the share of positions inside a repeated sixteen-character string predicts the technical corpus's loss with a correlation of 0.98.

Where a context stops naming the letter before sorted the rotations of a text by their first kk characters and compared the result with the full Burrows–Wheeler transform, which sorts by all of them. A short sort loses only where a context of kk characters fails to decide the character before it. The share of such positions, counted in one pass inside words that go on past the context, predicted within a step the kk at which the sort stops losing, on four sources of five. The two word sources flattened at four characters, the corpus of essays at five, a source drawing words from a whole vocabulary at four. The corpus of technical writing flattened at about ten, where the share said six.

The page could not explain the exception. Its closing section proposed the quantity it had left out: information rather than ambiguity. For each kk, the conditional entropy of the preceding character given the context can be estimated from the same single pass that counts the contexts. Its fall over contexts that cross a word boundary is what the next word says about the previous one, which might be what the technical corpus has more of. The section predicted that adding that fall to the share would move the technical corpus’s predicted crossing towards ten without moving the others. It named how the idea could fail: by bias, since an estimate of a conditional entropy from counts falls towards zero as contexts become unique.

It failed exactly that way. The repair for the bias works, and it shows that the information across a boundary is not what the technical corpus has. What it has is repetition.

An estimate that finds information where there is none

The loss being explained is measured as the earlier page measured it: bits a symbol after move-to-front and an order-zero entropy, the cost the bits a coder emits showed a real coder approaches to within a few hundredths. Three estimates are computed for each kk, over the same five sources and eight streams of 8,192 characters as before, and each is split into the positions whose context stays inside a word and those whose context spans a space. The plug-in estimate is the entropy of the predecessors actually seen after each context. The corrected estimate adds Miller and Madow’s allowance for the downward bias of an entropy counted from few observations. The adaptive estimate is the cost of predicting each predecessor, in text order, from the counts of that context seen so far: a coder that could actually be run, so its estimate can never be lower than the information there is.

On words drawn independently — no word says anything about the next — the plug-in estimate of what boundary-spanning contexts leave unknown about the letter before them falls from 0.849 bits a symbol at four characters to 0.466 at eight and to nothing by twenty-four, while the sweep has been flat since four; the adaptive coder's estimate climbs instead, to 4.458Bits a symbol, averaged over eight streams of 8,192 characters of words drawn independently, against the context length k: the conditional entropy of the preceding character given the next k characters, over contexts that span a space, estimated three ways, and the context sort's excess over the full transform. Adaptive coder: 1 0.640, 2 1.010, 3 1.436, 4 1.958, 5 2.467, 6 2.910, 8 3.555, 10 3.990, 12 4.227, 16 4.419, 24 4.458. Plug-in, corrected: 1 0.630, 2 0.873, 3 0.910, 4 0.898, 5 0.852, 6 0.768, 8 0.546, 10 0.350, 12 0.195, 16 0.049, 24 0.001. Plug-in: 1 0.629, 2 0.858, 3 0.875, 4 0.849, 5 0.790, 6 0.696, 8 0.466, 10 0.290, 12 0.154, 16 0.038, 24 0.001. The sweep's excess: 1 1.135, 2 0.305, 3 0.098, 4 0.000, 5 0.000, 6 0.000, 8 0.000, 10 0.001, 12 0.002, 16 0.000, 24 0.000. The horizontal axis is logarithmic.123456810121624context length k, charactersbits a symbol012345adaptive coderplug-in, correctedplug-inthe sweep's excesswords drawn independentlyeight streams, 8,192 characters
Fig. 1 On words drawn independently, over contexts spanning a word boundary: the plug-in estimate falls from 0.849 bits a symbol at four characters to 0.466 at eight and 0.001 at twenty-four; corrected, from 0.898 to 0.546; the adaptive coder rises from 1.958 to 3.555 and on to 4.458. The sweep’s excess is zero from four characters on.

The plate is drawn on the source where the answer is known in advance. Its words are drawn independently of one another, so the next word says nothing about the previous one. Past the length of a word, a longer context cannot tell a sort anything more about the letter before it, and the sweep agrees: it is flat from four characters. Over those same boundary-spanning contexts, the plug-in estimate falls from 0.849 bits a symbol at four characters to 0.466 at eight, as if the extra characters had told it a third of a bit, and to nothing by twenty-four. None of that fall is information. It is contexts becoming unique: a context seen once has one predecessor, and the plug-in entropy of one observation is zero. At twelve characters most contexts on this source are seen once, and the estimate reads that as certainty.

The correction for unseen predecessors barely moves it, because the correction is for contexts seen a few times and these are seen once. The adaptive coder goes the other way: a context seen once costs its whole alphabet to predict, so the coder’s estimate climbs past four bits as contexts become unique. The truth lies between the two, and neither curve shows where. The fall the proposal asked for cannot be read off any of them, because on the one source where it is known to be zero, all three report it as large.

A text’s own twin as the control

The bias comes from contexts becoming unique, and that depends on how much the text repeats, not on what its word order means. So a control that repeats in the same way but has no word order is a way to cancel it. Every stream has one: the same words, shuffled into a random order. The shuffled twin keeps every word, every letter inside a word, and so nearly the same unique contexts. It loses whatever one word says about the next. The plug-in estimate of the twin less that of the text is what the order of the words adds, with the bias shared by both.

What the order of the words says about the letter before a context, measured against each text's own shuffled twin: nothing on words drawn independently (within 0.002 bits a symbol at every length); at its peak 0.241 bits on the chained source, 0.110 on the technical corpus and 0.071 on the essays, all by four or five characters — and below zero past a word on the two corpora, where the twin's long contexts become unique soonerThe plug-in conditional entropy of the preceding character given the next k characters, for each stream's twin with its words shuffled less for the stream itself, averaged over eight streams, against k. Words drawn independently: 1 0.001, 2 0.001, 3 0.001, 4 −0.000, 5 −0.001, 6 −0.000, 8 0.002, 10 0.002, 12 −0.000, 16 −0.002, 24 0.000. Next word set by the last letter: 1 0.000, 2 0.177, 3 0.219, 4 0.241, 5 0.200, 6 0.137, 8 −0.022, 10 −0.109, 12 −0.123, 16 −0.069, 24 −0.006. Words from the whole vocabulary: 1 0.000, 2 −0.001, 3 −0.000, 4 0.002, 5 −0.001, 6 −0.000, 8 −0.001, 10 0.000, 12 0.000, 16 0.000, 24 0.000. The corpus of essays: 1 0.001, 2 0.024, 3 0.059, 4 0.071, 5 0.047, 6 0.019, 8 −0.020, 10 −0.031, 12 −0.022, 16 −0.010, 24 −0.001. The corpus of technical writing: 1 0.001, 2 0.034, 3 0.103, 4 0.110, 5 0.066, 6 0.036, 8 −0.012, 10 −0.028, 12 −0.028, 16 −0.017, 24 −0.004. Both estimates are biased downward alike where contexts are unique in both texts, so the difference keeps what the word order adds. The horizontal axis is logarithmic.123456810121624context length k, charactersbits a symbol the order adds−0.10.00.10.2words drawn independentlynext word set by the lastletterwords from the whole vocabularythe corpus of essaysthe corpus of technical writingeight streams a sourcelabels at four characters
Fig. 2 The plug-in estimate for each stream’s shuffled twin less the stream’s own, eight streams a source. Words drawn independently: within 0.002 bits a symbol of zero at every length. Words from the whole vocabulary: within 0.002. Next word set by the last letter: 0.241 at four characters. Technical corpus: 0.110 at four. Essays: 0.071 at four. On the two corpora it turns negative past eight characters.

On both independent-word sources the twin difference is zero to within 0.002 bits a symbol at every length; the bias has cancelled. On the three sources whose word order means something, it measures that meaning. On the chained source, where each word is chosen by the last letter of the one before, the order is worth 0.241 bits a symbol at four characters. On the technical corpus it is worth 0.110, and on the essays 0.071.

Every one of those peaks is at four characters, and on every source most of the information has arrived by five. That is the prediction’s main claim failing. The chained source carries the most word-order information of all, more than twice the technical corpus’s, and its sort flattens at four characters, because the information arrives inside the first few characters of the next word — which is where a context of four already reaches. Information that arrives early cannot delay the crossing. The technical corpus’s order information peaks at the same length as the essays’ and has the same shape, a third larger. Nothing in it says ten.

Where the twin turns negative

Past eight characters the difference changes sign on the two corpora, and the reason is the clue to everything else.

Written against shuffled: at four characters the order of the words leaves less unknown about the letter before a context (0.758 against 0.829 bits on the essays), and past eight characters more (0.037 against 0.015 at twelve), because repeated phrases keep long contexts from becoming unique; at eight, twelve and sixteen characters the two corpora are within 0.008 bits of each otherThe plug-in conditional entropy of the preceding character given the next k characters, bits a symbol, eight streams a source, for the corpus of essays and the corpus of technical writing, each as written and with its words shuffled. Essays, as written: 1 3.166, 2 2.171, 3 1.272, 4 0.758, 5 0.500, 6 0.346, 8 0.145, 10 0.077, 12 0.037, 16 0.010, 24 0.001. Essays, words shuffled: 1 3.167, 2 2.195, 3 1.331, 4 0.829, 5 0.547, 6 0.365, 8 0.125, 10 0.046, 12 0.015, 16 0.001, 24 0.000. Technical, as written: 1 3.253, 2 2.165, 3 1.207, 4 0.667, 5 0.437, 6 0.310, 8 0.145, 10 0.071, 12 0.042, 16 0.018, 24 0.004. Technical, words shuffled: 1 3.254, 2 2.199, 3 1.310, 4 0.777, 5 0.503, 6 0.346, 8 0.134, 10 0.043, 12 0.015, 16 0.001, 24 0.000. Both axes are logarithmic.1234568101216240.0010.010.11context length k, charactersbits a symbolessays, as writtenessays, words shuffledtechnical, as writtentechnical, words shuffledplug-in estimatedashed: words shuffled
Fig. 3 The plug-in estimate for the two corpora, as written and with words shuffled. Essays: 0.758 against 0.829 at four characters, 0.037 against 0.015 at twelve. Technical corpus: 0.667 against 0.777 at four, 0.042 against 0.015 at twelve. At eight, twelve and sixteen characters the two corpora as written are within 0.008 bits of each other.

At four characters the word order leaves less unknown about the letter before a context than a shuffle does. Past eight it leaves more. On the essays the written text’s estimate is 0.037 bits a symbol at twelve characters, against the twin’s 0.015. The written text repeats itself in ways a shuffle destroys — a phrase, a name, a construction — so its long contexts recur, each time after different letters, and stay ambiguous. The twin’s long contexts are new combinations of words that each occur once, and they become unique sooner. So the twin difference past a word does not measure prediction. It measures repetition, with the opposite sign. The transform that emits nothing found that the Burrows–Wheeler transform changes no count of characters, only their order, and that everything it gains comes from what the order lets the next stage see. A repeat is order at its most extreme, and a count of predecessors cannot see it.

On this plate the two corpora are all but the same curve past a word. At eight, twelve and sixteen characters their estimates as written differ by at most 0.008 bits a symbol, and their twins agree more closely still. Whatever makes the technical corpus’s sort lose until ten characters, the conditional entropy of the letter before a context does not see it — not through the plug-in count, not through the correction, not through the twin. The model is the compressor found five correct entropies for one stream at five model orders. This is the same caution from the other side: the order-kk entropy of the predecessor is a property of the text, and here it is the same for two texts whose transforms behave differently.

Repetition longer than any word

What the technical corpus has that the essays do not: 18.8% of its positions begin a twelve-character string that occurs again in the stream against 10.6% of the essays', and 6.5% a twenty-four-character one against 0.8% — repetition far longer than any word, which a context of k characters cannot see pastThe share of positions whose next k characters occur at least twice in the same cyclic stream, eight streams of 8,192 characters a source, against k. Words drawn independently: 4 98.9%, 6 92.8%, 8 75.7%, 10 51.2%, 12 30.3%, 16 7.1%, 24 0.3%, 32 0.0%. Next word set by the last letter: 4 99.9%, 6 98.6%, 8 92.5%, 10 79.6%, 12 61.4%, 16 25.7%, 24 1.9%, 32 0.1%. Words from the whole vocabulary: 4 71.6%, 6 32.1%, 8 14.0%, 10 5.8%, 12 2.0%, 16 0.3%, 24 0.1%, 32 0.1%. The corpus of essays: 4 81.8%, 6 52.8%, 8 31.4%, 10 18.3%, 12 10.6%, 16 4.0%, 24 0.8%, 32 0.3%. The corpus of technical writing: 4 82.1%, 6 54.9%, 8 36.8%, 10 25.4%, 12 18.8%, 16 11.5%, 24 6.5%, 32 4.6%. Both axes are logarithmic.46810121624320.0010.010.11string length k, characterspositions in a repeated stringwords drawn independentlynext word set by the lastletterwords from the whole vocabularythe corpus of essaysthe corpus of technical writingeight streams a sourcetick labels: 0.1% to 100%
Fig. 4 The share of positions whose next k characters occur again in the same stream. At twelve characters: technical corpus 18.8%, essays 10.6%, whole vocabulary 2.0%. At twenty-four: 6.5%, 0.8%, 0.1%. At thirty-two: 4.6%, 0.3%, 0.1%. The word sources repeat heavily at short lengths, from a small word list, and not at all past sixteen characters.

Of the technical corpus’s positions, 6.5% begin a twenty-four-character string that occurs again in the same stream of 8,192 characters, against 0.8% of the essays’. At thirty-two characters it is 4.6% against 0.3%. The earlier page found that the essays repeat word pairs more than the technical corpus does. That still holds — at twelve characters and below the two are within a factor of two. Past two words the difference opens to a factor of eight and then fifteen. The technical corpus is writing about programs, and it quotes them: identifiers, calls, error messages and whole lines recur, word for word, far longer than any phrase an essay repeats.

A repeat share alone cannot be the whole story, and the word sources say why. The chained source repeats a quarter of its sixteen-character strings, more than the technical corpus, because its words come from a short list and follow one another by rule; its sort does not lose anything past four characters. A repeat costs a short sort only if the letter before it is left ambiguous by the short context and named by the long one — only if the repeat is a copy of something longer. That can be counted too, in the same pass. Of the technical corpus’s positions, 0.87% have a context ambiguous at eight characters that a repeated twenty-four-character context resolves to a single predecessor. On the chained source it is 0.26%, on the essays 0.06%, on independent words 0.02%, and on the broad vocabulary none. That count separates the technical corpus from all four others by a factor of three or more, where the plain repeat share did not.

A long repeat that is a copy is exactly what a sort by kk characters cannot use. Take a twenty-four-character string that occurs twice. Its rotations share their first kk characters with every other occurrence of the same kk characters. The full transform sorts by all twenty-four and puts the two copies’ predecessors side by side, where move-to-front codes the second almost for nothing. A sort by kk breaks the tie by position and scatters them among the other occurrences of their first kk characters. The order inside a tie found that the order of rotations within a tied context can matter as much as the sort itself; for a copied string it is the whole difference. The loss is paid at every kk shorter than the repeat, and it stops only when kk is long enough to separate the repeat from everything else. The dictionary that builds itself measured a coder whose whole model is that the next stretch of text appeared before, and that is the model the technical corpus rewards.

Stream by stream

A share averaged over eight streams could hide a coincidence, so the claim is tested where it would fail: each stream on its own.

Stream by stream, the technical corpus's loss is its long repeats: across its eight streams the share of positions in a repeated sixteen-character string and the context sort's excess at 8 characters correlate at 0.98; its most repetitive stream, 28.0% of positions, loses 0.043 bits a symbol, and streams near 5% lose nothing — while the essays' streams, none above 6.6%, show no clear relation (−0.37)Each point one stream of 8,192 characters: the share of its positions whose next sixteen characters occur again in the stream, against the context sort's excess over the full transform at 8 characters after move-to-front. The corpus of technical writing (correlation 0.98): 7.8% 0.0003, 28.0% 0.0434, 17.1% 0.0180, 10.2% 0.0105, 10.0% 0.0040, 8.3% 0.0074, 5.1% 0.0008, 5.8% −0.0017. The corpus of essays (correlation −0.37): 3.8% 0.0044, 4.3% 0.0026, 4.4% 0.0004, 6.6% −0.0056, 1.6% −0.0010, 3.4% −0.0005, 4.3% 0.0008, 3.3% −0.0007.00.0200.04000.1000.200positions in a repeated 16-character stringexcess at 8 characters, bits a symbolthe corpus of technicalwriting, r = 0.98the corpus of essays, r = −0.37one point a streamcontext of 8 characters
Fig. 5 One point a stream: the share of positions in a repeated sixteen-character string, against the context sort’s excess at eight characters. Technical corpus, correlation 0.98: its most repetitive stream, 28.0% of positions, loses 0.043 bits a symbol; its two least, 5.1% and 5.8%, lose nothing. Essays, none above 6.6%: correlation −0.37.

Across the technical corpus’s eight streams, the share of positions in a repeated sixteen-character string and the sort’s loss at eight characters correlate at 0.98. The stream where 28% of positions repeat loses 0.043 bits a symbol. The one at 17% loses 0.018, the two near 10% lose 0.010 and 0.004, and the two near 5% lose nothing. The corpus’s loss at eight characters is not a property of technical writing spread evenly through it. It is concentrated in the streams that quote code, in proportion to how much they quote. The earlier page reported the technical corpus’s spread between streams as larger than its mean. This is what the spread was.

The essays’ streams all sit between 1.6% and 6.6% and show no clear relation; at those shares nothing is lost to relate to. A result the size of its own noise found that a difference between two orderings of rotations could be smaller than the spread between streams of the same source. Here the spread between streams was itself the signal. It just needed the right quantity measured beside it.

So the prediction fails, and the failure is informative. The information across a word boundary is real, and the twin measures it cleanly, but it arrives too early to move any crossing. The one-pass quantity that does track the technical corpus’s late crossing is not an entropy at all. It is a count of long repeats that are copies — a context that recurs at twenty-four characters, always after the same letter, where eight characters left that letter open. The same pass that counts contexts can make it, by keeping for each long context how often it occurs and whether its predecessors agree. Whether that count predicts the crossing on other texts, rather than separating one corpus from four, is a claim for a text with planted copies to test.

What was and was not established

One corpus of technical writing. The repeats are the technical corpus’s own: text about programs, with code quoted in it and all punctuation removed. A technical corpus without quoted code would have fewer of them, and nothing here says the result is about technical writing rather than about quotation.

Correlation across eight streams. The per-stream relation is strong, and it is a correlation across eight streams of one corpus, not a controlled experiment. The controlled version would plant repeats of a stated length into a stream of the essays and measure the sort’s loss as the planted share grows.

The twin cancels the bias only where the two texts repeat alike. Shuffling words preserves the words and destroys phrases, so past a word the twin repeats less than the text, and its difference measures that. At four and five characters, where the word-order information is, a context lies within one or two words, and a text and its twin repeat such short strings far more alike than they repeat whole phrases; the difference there is mostly information, and the independent sources, where it is zero, show the residue of the bias is small.

Eight streams of 8,192 characters. Every estimate, share and excess is at the earlier page’s size. What a reordering costs to undo priced the information a sorted order hides, and a stream long enough to hold a whole program’s text would hold more of it. A longer stream has fewer unique contexts at every kk, so the plug-in bias moves to longer contexts, and more repeats fall inside a stream, so the repeat share grows. Both move the curves; neither is measured here.

Still open: a sort that finds the repeats before it sorts

The sort by kk characters loses where a string longer than kk recurs, and the full transform wins there by sorting as deep as each repeat requires. There is a structure between them: sort by kk characters, and deepen the sort only inside the ranges where a long repeat has been detected. Detection is the one-pass count this page ends on. A context whose count exceeds one at length 2k2k marks a range worth deepening, and everything else stays at kk.

The measurement that follows builds that sort. It deepens a range only when its contexts repeat at twice the current length, and continues until no range does. It compares the bits a symbol and the characters compared against the sort by kk and against the full transform, on the technical streams sorted by their share of long repeats. The prediction is that it matches the full transform’s bits on every stream while comparing far fewer characters. On streams with few long repeats it should be almost the sort by kk, and on the most repetitive it should pay for the repeats and nothing else. It could fail if deepening one range reorders its neighbours — two repeats sharing a prefix but differing further on — so that the ranges cannot be deepened independently. That would make the cost of a repeat depend on what else repeats beside it, which is the structure a suffix array is built to handle and a context sort was built to avoid.

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 modelCorpusEntropyEstimator biasHonest limitMeasurement designModel orderMove to front