02.05 · Étude No. 05Study No. 05
Entraînement et inférenceTraining and inference
Un modèle apprend d’abord, puis il répond. Ce sont deux phases distinctes.A model learns first, then it answers. These are two separate phases.
L’entraînement part d’un très grand corpus de texte. À chaque étape, le modèle reçoit un début de texte et doit prédire le jeton suivant. On mesure l’écart entre sa prédiction et le jeton réel : cet écart s’appelle la perte.Training starts from a very large body of text. At each step, the model receives the beginning of a text and must predict the next token. The gap between its prediction and the real token is measured: this gap is called the loss.
Le modèle contient souvent des milliards de nombres, les poids. La rétropropagation calcule, pour chaque poids, dans quel sens il faut le modifier pour réduire la perte. La descente de gradient applique ensuite un petit changement à tous les poids à la fois. Cette boucle se répète un nombre immense de fois sur des lots de textes.The model often contains billions of numbers, the weights. Backpropagation computes, for each weight, which direction to change it in to reduce the loss. Gradient descent then applies a small change to all the weights at once. This loop repeats an immense number of times over batches of text.
Une fois l’entraînement terminé, les poids sont figés. Quand vous écrivez, le modèle ne fait que des passes avant : il calcule la probabilité de chaque jeton possible, en choisit un, l’ajoute au texte, puis recommence. Rien n’est corrigé et rien n’est écrit dans les poids. Le modèle n’apprend donc pas de votre conversation.Once training is over, the weights are frozen. When you write, the model only runs forward passes: it computes the probability of each possible token, picks one, adds it to the text, then starts again. Nothing is corrected and nothing is written into the weights. The model therefore does not learn from your conversation.
Ce qui ressemble à de la mémoire tient au texte renvoyé au modèle à chaque tour. Selon les conditions d’un service, des conversations peuvent servir à entraîner une version future, mais pas celle qui vous répond. L’entraînement coûte cher et se fait une fois, sur de nombreuses machines, en général pendant des semaines. L’inférence coûte peu par requête, mais elle recommence à chaque demande.What looks like memory is the text sent back to the model at each turn. Depending on a service’s terms, conversations may be used to train a future version, but not the one answering you. Training is costly and done once, on many machines, typically over weeks. Inference costs little per request, but it starts again with every request.
Le texte d’entraînement s’arrête à une date, que l’on appelle la date limite des connaissances. Le modèle ignore ce qui s’est produit après. Retenez ceci : un modèle sait ce qu’il a lu, et rien de plus récent.The training text stops at a date, called the knowledge cutoff. The model knows nothing of what happened after. Keep this: a model knows what it has read, and nothing more recent.
Sources
Rumelhart, Hinton, Williams, « Learning representations by back-propagating errors », 1986
Goodfellow, Bengio, Courville, Deep Learning, 2016