Why prediction needs knowledgePourquoi la prédiction exige des connaissances
TRA6008 S2 · in classS2 · en classe
Finishing one sentence
Take an unfinished sentence: The bank was closed because…
Before anything sensible can follow, one thing has to be settled: which bank this is. The financial sense and the riverside sense lead to entirely different continuations, and the sentence so far does not say which is meant. This is the ambiguity a single fixed vector per word could not resolve (see also the Contextual embeddings chapter, in the Language as numbers module) (voir aussi le chapitre Plongements contextuels, dans le module Le langage en nombres).
Settle it on the financial sense, and the continuation still depends on knowing how businesses work: a bank closes for a public holiday, for renovations, at the end of the working day, or permanently because it failed.
And even once you have settled the ambiguity and know enough about the world to suggest a plausible reason, the continuation still has to be grammatical. The bank was closed because holiday gives the right reason and is not a sentence.
What has to be learned
Predicting well across many different texts means having picked up several kinds of regularity at once:
- grammar, syntax and the conventions of a style;
- facts about the world, and the relations between the things named in it;
- patterns of reasoning, such as cause and effect or the order events happen in;
- how people actually use language, including implication and politeness.
None of this is taught separately. Guessing the next word needs all of it, so it all comes out of practising the guess.
Too much text to remember
The amount of text involved rules out the simplest explanation, that the model has the training text stored somewhere. Hoffmann et al. (2022) trained a model of 70 billion parameters on 1.4 trillion tokens. At roughly four characters a token, keeping that text would take about five terabytes, more than most laptops can store. The model that came out of it is 70 billion numbers at two bytes each, about 140 gigabytes, which fits on one laptop with room left over.
The text itself does not survive that reduction. To predict Paris after the capital of France is, a model does not need that sentence stored; it needs the association between France and Paris, which takes far less room and also works in sentences it has never seen. Karpathy calls the result a lossy compression of the training text (Karpathy, 2023).
It is a metaphor rather than a technical account, and it makes the right point: the output stays recognizably derived from text that was never kept (see also the Pretraining chapter) (voir aussi le chapitre Préentraînement).
Terminer une phrase
Prenez une phrase inachevée : The bank was closed because…
Avant que quoi que ce soit de sensé puisse suivre, une chose doit être réglée : de quelle bank il s’agit. Le sens financier et le sens de la rive mènent à des suites entièrement différentes, et la phrase telle quelle ne dit pas lequel est visé. C’est l’ambiguïté qu’un vecteur unique et fixe par mot ne pouvait pas lever (see also the Contextual embeddings chapter, in the Language as numbers module) (voir aussi le chapitre Plongements contextuels, dans le module Le langage en nombres).
Réglez-la sur le sens financier, et la suite dépend encore de ce que l’on sait du fonctionnement des entreprises : une banque ferme pour un jour férié, pour des rénovations, à la fin de la journée de travail, ou définitivement parce qu’elle a fait faillite.
Et même une fois l’ambiguïté réglée et le monde assez bien connu pour proposer une raison plausible, la suite doit encore être grammaticale. The bank was closed because holiday donne la bonne raison et n’est pas une phrase.
Ce qu’il faut avoir appris
Bien prédire à travers des textes très divers suppose d’avoir capté plusieurs sortes de régularités à la fois :
- la grammaire, la syntaxe et les conventions d’un style ;
- des faits sur le monde, et les relations entre les choses qu’on y nomme ;
- des schémas de raisonnement, comme la cause et l’effet ou l’ordre dans lequel les événements se produisent ;
- la façon dont les gens emploient réellement la langue, sous-entendus et politesse compris.
Rien de tout cela n’est enseigné à part. Prédire le mot suivant exige tout cela, si bien que tout cela sort de l’exercice répété de la prédiction.
Trop de texte pour s’en souvenir
La quantité de texte en jeu écarte l’explication la plus simple, celle où le modèle aurait le texte d’entraînement stocké quelque part. Hoffmann et al. (2022) ont entraîné un modèle de 70 milliards de paramètres sur 1 400 milliards de jetons. À environ quatre caractères par jeton, conserver ce texte prendrait quelque cinq téraoctets, plus que ne contiennent la plupart des ordinateurs portables. Le modèle qui en est sorti, c’est 70 milliards de nombres à deux octets chacun, environ 140 gigaoctets, qui tiennent sur un seul portable avec de la place en trop.
Le texte lui-même ne survit pas à cette réduction. Pour prédire Paris après the capital of France is, un modèle n’a pas besoin d’avoir cette phrase en mémoire : il a besoin de l’association entre la France et Paris, qui prend bien moins de place et vaut aussi dans des phrases qu’il n’a jamais vues. Karpathy (2023) appelle le résultat une compression avec perte du texte d’entraînement.
C’est une métaphore plutôt qu’un compte rendu technique, et elle vise juste : la sortie reste visiblement dérivée d’un texte qui n’a jamais été conservé (see also the Pretraining chapter) (voir aussi le chapitre Préentraînement).
Sources
- Hoffmann, J., Borgeaud, S., Mensch, A., Buchatskaya, E., Cai, T., Rutherford, E., et al. (2022). An empirical analysis of compute-optimal large language model training. Advances in Neural Information Processing Systems 35 (NeurIPS 2022). https://proceedings.neurips.cc/paper_files/paper/2022/hash/c1e2faff6f588870935f114ebe04a3e5-Abstract-Conference.html
- Jurafsky, D., & Martin, J. H. (2026). Speech and Language Processing: An Introduction to Natural Language Processing, Computational Linguistics, and Speech Recognition with Language Models. Online draft, 3rd edition. https://web.stanford.edu/~jurafsky/slp3/
- Karpathy, A. (2023). [1hr Talk] Intro to Large Language Models. YouTube (Andrej Karpathy channel). https://www.youtube.com/watch?v=zjkBMFhNj_g
Sources
- Hoffmann, J., Borgeaud, S., Mensch, A., Buchatskaya, E., Cai, T., Rutherford, E., et al. (2022). An empirical analysis of compute-optimal large language model training. Advances in Neural Information Processing Systems 35 (NeurIPS 2022). https://proceedings.neurips.cc/paper_files/paper/2022/hash/c1e2faff6f588870935f114ebe04a3e5-Abstract-Conference.html
- Jurafsky, D., & Martin, J. H. (2026). Speech and Language Processing: An Introduction to Natural Language Processing, Computational Linguistics, and Speech Recognition with Language Models. Online draft, 3rd edition. https://web.stanford.edu/~jurafsky/slp3/
- Karpathy, A. (2023). [1hr Talk] Intro to Large Language Models. YouTube (Andrej Karpathy channel). https://www.youtube.com/watch?v=zjkBMFhNj_g