{"id":"N-Q-LM-SCALE","url":"https://chrishayuk.com/notebook/the-language-model-that-gets-smaller-as-it-learns","currentVersion":"1.0","publication":"published","scientificStatus":"OPEN","versions":[{"version":"1.0","title":"The language model that gets smaller as it learns.","abstract":"A second note on Q-LM, a modern experiment that learns a grammar from sentences alone by grouping substrings that share a context. QLM-SCALE-001 measures how its cost grows. On more sentences of the same language, the grammar is largest with little data: at 300 of Colmerauer’s sentences it has 85,969 rules, uses 23,948 of them per sentence, and takes 613 milliseconds per next token. From 10,000 sentences to 105,138 it is the same 192 categories and 1,772 rules, at about a millisecond per next token, some 584 times less. A generated language does the same sooner. What keeps growing is the learner’s bookkeeping: every substring of every sentence, over a million at full size. On sentences from TinyStories it breaks. The learner takes the context of a substring to be the whole rest of its sentence, and in natural text such contexts almost never recur, so almost nothing merges: 5.4 million categories from 6.6 million substrings at 100,000 sentences, with the rules growing about linearly. Q-LM v2 starts again from contexts of a few words. Its first stages are a known technique, distributional word classes mixed with a 5-gram in the line of Brown et al. (1992). They beat the 5-gram, and with little data a small Llama-shaped transformer, but at 100,000 sentences the transformer is ahead by about 0.3 bits, and building classes on classes added almost nothing beyond an ensemble of independent class models.","authors":["Chris Hay"],"url":"https://chrishayuk.com/records/N-Q-LM-SCALE/1.0","published":"2026-11-27","publication":"published","scientificStatus":"OPEN","supersededBy":[],"hash":"b1cdf27f8123d6c104e103a89477292890fc9703ee32c7628806eb33cc1c916c","algorithm":"sha256","revision":{"kind":"initial","summary":"First publication, after an independent fact-check against the repository's results documents and plans"},"display":{"kind":"initial","summary":"First publication, after an independent fact-check against the repository's results documents and plans"},"sources":[{"title":"chrishayuk/q-lm, docs/results-qlm-scale-001-kind1.md","url":"https://github.com/chrishayuk/q-lm/blob/main/docs/results-qlm-scale-001-kind1.md","note":"Kind 1 of QLM-SCALE-001: nested subsets of Colmerauer’s language and the right family, against the plan as revised before measurement."},{"title":"chrishayuk/q-lm, docs/results-qlm-scale-001-tinystories.md","url":"https://github.com/chrishayuk/q-lm/blob/main/docs/results-qlm-scale-001-tinystories.md","note":"The same learner on TinyStories sentences, a feasibility run."},{"title":"chrishayuk/q-lm, docs/results-qlm-v2-e1-e3.md","url":"https://github.com/chrishayuk/q-lm/blob/main/docs/results-qlm-v2-e1-e3.md","note":"Bounded-context word classes mixed with a 5-gram, and the Llama-shaped transformer on the same sentences."},{"title":"chrishayuk/q-lm, docs/results-qlm-v2-e4.md","url":"https://github.com/chrishayuk/q-lm/blob/main/docs/results-qlm-v2-e4.md","note":"Abstractions as contexts, with the seeds and flat controls and a confirmation split."},{"title":"chrishayuk/q-lm, docs/results-qlm-key-001-b.md","url":"https://github.com/chrishayuk/q-lm/blob/main/docs/results-qlm-key-001-b.md","note":"A transformer limited to the 5-gram’s window, which splits v2’s gap to the full transformer."},{"title":"chrishayuk/q-lm","url":"https://github.com/chrishayuk/q-lm","note":"The learners, v2/classes.py and v2/hier.py, and the commands that reproduce every table."}],"manuscript":"https://chrishayuk.com/api/record/N-Q-LM-SCALE?version=1.0","citations":"https://chrishayuk.com/api/citations/N-Q-LM-SCALE?version=1.0"}]}