{"id":"N-Q-LM","url":"https://chrishayuk.com/notebook/from-q-systems-to-q-lm","currentVersion":"1.0","publication":"published","scientificStatus":"OPEN","versions":[{"version":"1.0","title":"From Q-systems to Q-LM.","abstract":"The third Q-systems note asked whether the rules could be learned from the sentences. Q-LM, a modern experiment that leaves the reconstructed machine unchanged, uses it to make a corpus of 131,424 sentences, every sentence of every tree with at most one level of embedding, and to judge what learners produce. A learner given only 105,138 training sentences and the vocabulary groups substrings that share a context into categories. From 1,000 sentences one category holds both a name and an embedded clause, and every one of 300 deeper sentences of known words can be derived. From 10,000 sentences on, the grammar is the same 192 categories and 1,772 rules. Its first write-up, QLM-003, put it far ahead of a transformer at depth. Two corrections followed, and a test. Its five rounds of inside–outside were early stopping: run to convergence, it gives deeper sentences 2.37 bits per token at full size, not 1.59, though its structure still derives all of them. The transformer it beat was one custom model: a Llama-shaped model of about the same size comes within 0.02 to 0.6 bits of the grammar at full size, and is about 1% better on the corpus. The test showed that the custom model’s failure was not sentence length, and an ablation finds that rotary positions alone carry the difference between the two transformers. On three generated languages, the grammar still leads Llama at depth by 0.2 to 1.5 bits.","authors":["Chris Hay"],"url":"https://chrishayuk.com/records/N-Q-LM/1.0","published":"2026-11-27","publication":"published","scientificStatus":"OPEN","supersededBy":[],"hash":"7ed7505accf6ed1bf61bfd34402579c97c5bb02cebdf62de40857eb641060593","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","url":"https://github.com/chrishayuk/q-lm","note":"The corpus, the learners (src/subst.rs, src/prefix.rs), the transformers (transformer/train.py), and the commands that reproduce every table."},{"title":"chrishayuk/q-lm, docs/results.md, QLM-002 and QLM-003","url":"https://github.com/chrishayuk/q-lm/blob/main/docs/results.md","note":"The learned grammar and its exact next-token prediction, with the correction for early stopping. The first run is kept as docs/results-run1.md."},{"title":"chrishayuk/q-lm, docs/results-qlm004.md","url":"https://github.com/chrishayuk/q-lm/blob/main/docs/results-qlm004.md","note":"Inside–outside run to convergence, pruning by expected rule count, and inference cost against the transformer."},{"title":"chrishayuk/q-lm, docs/results-architectures.md","url":"https://github.com/chrishayuk/q-lm/blob/main/docs/results-architectures.md","note":"The Llama arm, and the test that rules out sentence length."},{"title":"chrishayuk/q-lm, docs/results-qlm-arch-001.md","url":"https://github.com/chrishayuk/q-lm/blob/main/docs/results-qlm-arch-001.md","note":"Which of Llama’s four changes carries depth."},{"title":"chrishayuk/q-lm, docs/results-qlm005.md","url":"https://github.com/chrishayuk/q-lm/blob/main/docs/results-qlm005.md","note":"Three generated languages, against the plan written before they were generated."},{"title":"chrishayuk/q-systems","url":"https://github.com/chrishayuk/q-systems","note":"The reconstruction of Colmerauer’s Q-systems, whose machine makes the corpus and judges grammar."}],"manuscript":"https://chrishayuk.com/api/record/N-Q-LM?version=1.0","citations":"https://chrishayuk.com/api/citations/N-Q-LM?version=1.0"}]}