{"id":"N-Q-SYSTEMS-NEXT-TOKEN","url":"https://chrishayuk.com/notebook/can-a-language-from-1969-predict-the-next-token","currentVersion":"1.1","publication":"published","scientificStatus":"OPEN","versions":[{"version":"1.0","title":"Can a language from 1969 predict the next token?","abstract":"A third note on the Q-systems, Alain Colmerauer’s rule language of 1969, reconstructed with a coding agent from his report of 1970. The graphs the reconstructed machine makes hold every sentence they allow. Read as a language model, which is a modern experiment and not anything Colmerauer did, a graph gives the probability of each next word as the share of its complete paths that continue the prefix with that word. Counted by dynamic programming, without listing any sentence, the counts equal those of listing at all 13,510 prefixes of a graph of 1,458 sentences, and the 9,565,938 paraphrases of one sentence of the report’s grammar decode from 2,760 arrows. Against a trigram model trained on all 131,424 sentences of the grammar with at most one level of embedding, the graph of those sentences samples only grammatical French, where the trigram’s samples are grammatical 91 times in 300. But the graph is closed: it gives zero to every sentence with deeper embedding, and the trigram gives a probability to 16 of 300 and invents 29 grammatical sentences it never saw. Read instead as a grammar, by hand, and checked against the machine on 8,414 trees, then given a probability for each choice with the tree drawn only as the prefix needs it, the report’s sixteen rules predict with no tree given and no bound on depth: every sample grammatical, every deeper sentence given a probability. Merging equal partial derivations saved nothing there: no two of them ever left the same work.","authors":["Chris Hay"],"url":"https://chrishayuk.com/records/N-Q-SYSTEMS-NEXT-TOKEN/1.0","published":"2026-11-26","publication":"published","scientificStatus":"OPEN","supersededBy":[],"hash":"115b37eca5115a731054df845e052f4c8fb683225fc1646886232c6722491c3b","algorithm":"sha256","revision":{"kind":"initial","summary":"First publication, after an independent fact-check against the repository and the report's page scans"},"display":{"kind":"initial","summary":"First publication, after an independent fact-check against the repository and the report's page scans"},"next":"https://chrishayuk.com/records/N-Q-SYSTEMS-NEXT-TOKEN/1.1","sources":[{"title":"A. Colmerauer, Les systèmes-Q ou un formalisme pour analyser et synthétiser des phrases sur ordinateur, publication interne no 43, Département d’informatique, Université de Montréal, September 1970","url":"http://alain.colmerauer.free.fr/alcol/ArchivesPublications/SystemesQ/SystemesQ.pdf","note":"The grammar of section 11, pp. 35–37, whose synthesis makes the graphs and whose analysis judges grammar. Read from the page scans for the first note."},{"title":"chrishayuk/q-systems, docs/research.md, QSYS-E16 and E17","url":"https://github.com/chrishayuk/q-systems/blob/main/docs/research.md","note":"Every count in this note, with the test in tests/research.rs that asserts it."},{"title":"chrishayuk/q-systems","url":"https://github.com/chrishayuk/q-systems","note":"The historical machine, src/machine.rs; the counting, src/lm.rs, and the open model, src/open.rs, neither historical."},{"title":"Coding-agent session, 26 November 2026","note":"The experiments were designed, run and written up with a coding agent. Every result can be rerun with cargo test --release --test research in the repository."}],"manuscript":"https://chrishayuk.com/api/record/N-Q-SYSTEMS-NEXT-TOKEN?version=1.0","citations":"https://chrishayuk.com/api/citations/N-Q-SYSTEMS-NEXT-TOKEN?version=1.0"},{"version":"1.1","title":"Can a language from 1969 predict the next token?","abstract":"A third note on the Q-systems, Alain Colmerauer’s rule language of 1969, reconstructed from his report of 1970. The graphs the reconstructed machine makes hold every sentence they allow. Read as a language model, which is a modern experiment and not anything Colmerauer did, a graph gives the probability of each next word as the share of its complete paths that continue the prefix with that word. Counted by dynamic programming, without listing any sentence, the counts equal those of listing at all 13,510 prefixes of a graph of 1,458 sentences, and the 9,565,938 paraphrases of one sentence of the report’s grammar decode from 2,760 arrows. Against a trigram model trained on all 131,424 sentences of the grammar with at most one level of embedding, the graph of those sentences samples only grammatical French, where the trigram’s samples are grammatical 91 times in 300. But the graph is closed: it gives zero to every sentence with deeper embedding, and the trigram gives a probability to 16 of 300 and invents 29 grammatical sentences it never saw. Read instead as a grammar, by hand, and checked against the machine on 8,414 trees, then given a probability for each choice with the tree drawn only as the prefix needs it, the report’s sixteen rules predict with no tree given and no bound on depth: every sample grammatical, every deeper sentence given a probability. Merging equal partial derivations saved nothing there: no two of them ever left the same work.","authors":["Chris Hay"],"url":"https://chrishayuk.com/records/N-Q-SYSTEMS-NEXT-TOKEN/1.1","published":"2026-11-26","revised":"2026-11-27","publication":"published","scientificStatus":"OPEN","supersededBy":[],"hash":"803250633f18b139c2c6af1cf18e0a2387fa840042b86fbd40404bd94da510ae","algorithm":"sha256","revision":{"kind":"clarification","summary":"Removed the statements about how the work was done; nothing about the results changed","previous":"1.0"},"display":{"kind":"clarification","summary":"Removed the statements about how the work was done; nothing about the results changed"},"previous":"https://chrishayuk.com/records/N-Q-SYSTEMS-NEXT-TOKEN/1.0","sources":[{"title":"A. Colmerauer, Les systèmes-Q ou un formalisme pour analyser et synthétiser des phrases sur ordinateur, publication interne no 43, Département d’informatique, Université de Montréal, September 1970","url":"http://alain.colmerauer.free.fr/alcol/ArchivesPublications/SystemesQ/SystemesQ.pdf","note":"The grammar of section 11, pp. 35–37, whose synthesis makes the graphs and whose analysis judges grammar. Read from the page scans for the first note."},{"title":"chrishayuk/q-systems, docs/research.md, QSYS-E16 and E17","url":"https://github.com/chrishayuk/q-systems/blob/main/docs/research.md","note":"Every count in this note, with the test in tests/research.rs that asserts it."},{"title":"chrishayuk/q-systems","url":"https://github.com/chrishayuk/q-systems","note":"The historical machine, src/machine.rs; the counting, src/lm.rs, and the open model, src/open.rs, neither historical."},{"title":"Experiments, 26 November 2026","note":"Every result can be rerun with cargo test --release --test research in the repository."}],"manuscript":"https://chrishayuk.com/api/record/N-Q-SYSTEMS-NEXT-TOKEN?version=1.1","citations":"https://chrishayuk.com/api/citations/N-Q-SYSTEMS-NEXT-TOKEN?version=1.1"}]}