Administrator
This teaching view is for the instructor. Enter the administrator password.
Wrong password · Mot de passe incorrect
Cette vue enseignement n'existe qu'en anglais.
The systems behind much of today’s language technology, including almost all machine translation systems and chatbots with which you will interact, are neural networks. The name suggests something brain-like, and the inspiration is real, but loose: there are some similarities between artificial neural networks and natural neural networks like our brain, but this does not go beyond the very basics.
Each unit, called a neuron, is a small mathematical function. It receives numbers from the units connected to it, combines them, and passes a number on. Every connection has a strength, called a weight weightpoids machine learningapprentissage automatique A real number attached to one input of a computing unit, learned during training, that sets how much that input counts towards the unit's output.Nombre réel attaché à une entrée d'une unité de calcul, appris pendant l'entraînement, qui détermine l'importance de cette entrée dans la sortie de l'unité. , and those weights, the network’s parameters parameterparamètre de modèle machine learningapprentissage automatique A numerical value learned during a model's training and used in its computations.Valeur numérique apprise pendant l'entraînement d'un modèle et utilisée dans ses calculs. , are what training adjusts: a stronger connection means one unit’s output matters more to the next.
The units are organized in layers. An input layer takes in the raw data as numbers; one or more hidden layers transform it, step by step; an output layer produces the answer, for example one value per possible category. When there are many hidden layers, the network is called deep, which is all that the “deep” in deep learning means (LeCun et al., 2015).
Depth is what lets a network build complex patterns out of simple ones. Early layers pick up simple regularities in the raw input; later layers combine those into larger ones. In image recognition, the classic illustration, first edges, then shapes, then faces. For text the same principle applies, with one catch: a network’s input layer takes numbers, so using one for language requires a way to encode language as numbers (see also the Language as numbers module) (voir aussi le module Le langage en nombres).
Worth saying aloud and not projecting: the brain inspiration is real and loose, and each unit is a small mathematical function. Depth is what lets a network build complex patterns out of simple ones: edges, then shapes, then faces for images.
A toy example
Suppose we want a network that tells diamonds, squares and circles apart.Shapes are a toy task, chosen for its simplicity and easy visualization. A real network chooses among far more classes, and its input is rarely anything as tidy as a drawn shape. The loop is the same either way, which is what lets the example be this small. That already fixes the shape of its output layer: one unit per category, one for square, one for circle, one for diamond. Their scores are turned into percentages that add up to 100, so the three answers compete, and raising one lowers the others.
A network answers in probabilities from the start. Untrained, they are essentially random. Given a picture of a diamond and asked what shape it is, the answer might be something like: square 40%, circle 35%, diamond 25%. Early in training they can be confidently wrong instead: square 80%, circle 10%, diamond 10%. The network is then told the right answer, and the predict-compare-adjust loop of supervised learning reappears in its neural form (see also the From rules to machine learning chapter) (voir aussi le chapitre Des règles à l'apprentissage automatique): the error flows backward through the network, and the connections that pushed toward square are weakened, the ones that pushed toward diamond strengthened.
Millions of small adjustments
Adjustment is not reserved for mistakes. A network nudges its connections on every example, including the ones it already gets right; the nudge simply gets smaller as the prediction moves closer to the label. One example changes little. Millions of examples, each nudging millions of parameters parameterparamètre de modèle machine learningapprentissage automatique A numerical value learned during a model's training and used in its computations.Valeur numérique apprise pendant l'entraînement d'un modèle et utilisée dans ses calculs. , add up to a system whose predictions are sharp. Nothing else in the network changes during training: the architecture, the layers and the connections stay as designed. Learning is entirely a matter of adjusting the strengths.
The difference from a feature-based model
The decisive difference from a feature-based model is what the network learns from. A feature-based model needed a human to decide that suffixes and capitalization matter. A neural network takes raw data (e.g., pixels of an image, or numerical representations of words), and finds its own regularities in it, including ones no human would have thought to specify. The features are learned, and feature engineering disappears. The human work does not disappear with it: choosing and encoding features used to be most of the effort of building a system, and the effort now goes into collecting the data, defining the task and designing the network.
Why it took until the 2010s
Nothing about the idea is new: the underlying design goes back to the perceptron of the 1950s (Rosenblatt, 1958), the first model that could learn its own weights weightpoids machine learningapprentissage automatique A real number attached to one input of a computing unit, learned during training, that sets how much that input counts towards the unit's output.Nombre réel attaché à une entrée d'une unité de calcul, appris pendant l'entraînement, qui détermine l'importance de cette entrée dans la sortie de l'unité. from labelled examples (Goodfellow et al., 2016). In the 2010s, its two main requirements could finally be fulfilled. Learning features from raw data takes far more examples than learning weights for a few hand-picked features, and processing them takes enormous computation. Large collections of digital text and images supplied the first; graphics processors, built to render games, turned out to suit the calculations and supplied the second. With both in place, deep networks moved the state of the art in speech recognition, image recognition and object detection, and in fields as far from language as drug discovery (LeCun et al., 2015).
The second line is the one that connects back to the features chapter: no human decides that suffixes and capitalization matter. The third is the answer to “why now”: two appetites, data and computation, fed at the same time in the 2010s. LeCun et al. (2015) name speech, images and object detection as where it showed first.
With a rule-based system rule-based systemsystème à base de règles AIIA A system whose behaviour is fixed by rules that people wrote, most often of the form "if this condition, then this action", so that every output can be traced to the rule that produced it.Système dont le comportement est fixé par des règles écrites par des personnes, le plus souvent de la forme « si cette condition, alors cette action », de sorte que chaque résultat peut être rapporté à la règle qui l'a produit. you can always find out why an output came out as it did: some rule was triggered, and that rule can be read, disagreed with and changed. In a trained neural network there is nothing to read. Its behaviour is stored as millions of numerical connection weights weightpoids machine learningapprentissage automatique A real number attached to one input of a computing unit, learned during training, that sets how much that input counts towards the unit's output.Nombre réel attaché à une entrée d'une unité de calcul, appris pendant l'entraînement, qui détermine l'importance de cette entrée dans la sortie de l'unité. , learnt from data, and no single one of them means anything on its own. The mathematics of every step is known exactly; what the steps collectively do is not stated anywhere in a form a person can check.
Statistical systems are a sort of middle ground: their rules are learnt from data rather than written by hand, but stay more or less readable (see also the Four paradigms page) (voir aussi la page Quatre paradigmes). How readable depends on the algorithm: a decision tree can be printed and followed, while the weights of a support vector machine with a non-linear kernel cannot be read that way.
This is what people mean when they call neural networks black boxes, and it is a property of the approach rather than a defect to be patched later. The power of the method comes from letting the system find regularities too numerous and too diffuse for anyone to write down; a representation humans could read would be a representation humans could have written.
Four consequences follow for anyone who works with these systems:
- Errors cannot be fixed the way a rule is fixed. There is no line to correct. Improving a network means changing its training data training setjeu de données d'entraînement machine learningapprentissage automatique The portion of a dataset used to train a machine-learning model.Portion d'un jeu de données servant à entraîner un modèle d'apprentissage automatique. , training it further, or changing its architecture and training again, and any of these can shift its behaviour elsewhere in ways nobody chose.
- Behaviour is discovered by testing, not by inspection. The only way to know how a system handles legal text, or Québécois French, is to try it on legal text and Québécois French, which is why evaluation is a professional skill in its own right (see also the Evaluating language technology module) (voir aussi le module L'évaluation des technologies langagières).
- The same input need not give the same output. A classifier is deterministic deterministicdéterministe computinginformatique Describes a process, algorithm, or system that, under the same initial conditions and with the same input, always produces the same output.Se dit d'un processus, d'un algorithme ou d'un système qui, dans les mêmes conditions initiales et avec la même entrée, produit toujours la même sortie. : the same email gives the same verdict every time. A system that generates text often is not, because choosing each next word can involve randomness, and one run then differs from the next. A single trial is evidence about that run, not about the system.
- Confidence is not self-knowledge. A network reports probabilities, and they measure how its training data looked, never how much it “knows” (see also the Critical issues with LLMs module) (voir aussi le module Enjeux critiques des GML).
Put it to the room: how would you find out whether a system handles Québécois French? The only answer is to try it on Québécois French, which is why evaluation is a professional skill and a whole module here.
One model, many tasks
Every system of the first three paradigms was built for one task: a spam filter sorts email, a tagger labels words with their grammatical class, and the next system means starting again, with new rules, new features or new labelled data. A large language model is a neural network neural network (NN)réseau de neurones (RNA) machine learningapprentissage automatique A machine-learning model composed of interconnected layers of small computational units.Modèle d'apprentissage automatique composé de couches interconnectées de petites unités de calcul. of the kind this chapter describes, trained from examples like the second and third paradigms, except that the examples are plain text and the task is to predict the next word (Jurafsky & Martin, 2026). Nothing in that training names a task, and once trained, the same model translates, summarizes, lists the terms in a text or labels its words, when the request is written to it in a prompt (Brown et al., 2020). Figure 6figure 6 sets the two arrangements side by side.
Decreasing human influence
Each shift took one thing out of the developer’s hands, as the table below sets out, and the last took the largest: the task itself, which passes to the person using the model.
| Shift | No longer specified by the developer | Still specified by people |
|---|---|---|
| Rules to machine learning | the patterns | the task and the features, by the developer, before training |
| Machine learning to deep learning | the features featureattribut machine learningapprentissage automatique A property or representation of an observation that a machine-learning model uses as input when making a prediction.Propriété ou représentation d'une observation qu'un modèle d'apprentissage automatique utilise en entrée pour produire une prédiction. | the task and its data, by the developer, before training |
| Deep learning to large language models | the task | the task, by the person using the model, in a prompt |
A large language model is, technically, deep learning. Four things make it a paradigm of its own all the same, rather than a step inside the third:
- One general system instead of a system per task. The line is not absolute, since a model can be fine-tuned fine-tuningaffinage machine learningapprentissage automatique Further training of a pretrained model on new data to adapt it for a particular task, domain, or intended behaviour.Poursuite de l'entraînement d'un modèle préentraîné sur un jeu de données généralement plus restreint et spécialisé, afin de l'adapter à une tâche ou à un domaine particulier. for one task or one context (see also the Fine-tuning chapter, in the LLM lifecycle module) (voir aussi le chapitre Affinage, dans le module Cycle de vie des GML) and dedicated systems are built on top of models, but its capabilities are far broader than those of any earlier system, and a prompt alone reaches most of them.
- A far simpler interface, so far less specialized users. A prompt is ordinary text rather than a program, so the person who describes the job is often the person who used to be a user of someone else’s system. The line between building a system and using one has moved.
- An even larger appetite for data and computation, in place of explicit knowledge. Each earlier shift already traded knowledge written by people for data; this one trades the task description itself for more text and more computation.
- A blurrier line between natural language processing natural language processing (NLP)traitement automatique de la langue (TAL) NLPTAL An interdisciplinary field that develops and studies computational methods for analyzing, processing, and generating human language.Domaine interdisciplinaire qui développe et étudie des méthodes computationnelles pour analyser, traiter et générer le langage humain. and the rest of AI. The model that labels words or extracts terms is the same one that writes code, describes images and acts on your behalf, and language has become the interface to all of it.
A prompt steers a model without changing it, and within limits (see also the In-context learning chapter, in the LLM lifecycle module) (voir aussi le chapitre Apprentissage en contexte, dans le module Cycle de vie des GML).
Still deep learning
Everything that was true of the third paradigm is still true of the fourth:
- the patterns it learned are spread over billions of numbers nobody can read (see also the black box page) (voir aussi la page La boîte noire);
- everything it does comes from its training text, with that text’s gaps and leanings (see also the Critical issues with LLMs module) (voir aussi le module Enjeux critiques des GML);
- the tasks it does well and badly do not follow what a person finds hard, so its abilities have to be tested;
- the dedicated systems have not disappeared: for a task run on whole corpora, fast and the same way every time, a trained tagger or a term extractor is still the usual tool (see also the Comparing term extraction methods page, in the Classical NLP module) (voir aussi la page Comparer les méthodes d'extraction de termes, dans le module TAL classique).