Rules written by people
Lawyers have used software for decades, and most of it follows rules that a programmer wrote down. A program that works out interest on a debt multiplies the sum by a fixed rate and a number of days, and a document assembly system inserts a clause whenever a box is ticked. A person spelled out every step of both programs in advance, so each gives the same answer to the same input every time, and its makers can explain any answer by pointing to the rule that produced it.
Rules written in advance work well for tasks a person can describe step by step, such as working out interest or assembling a standard document. Many everyday tasks resist a step-by-step description: reading handwriting, recognising a voice on a recording, or telling a threatening email from a joke all depend on judgement that people exercise without being able to list the steps. Programmers who tried to write such judgement down as rules found that the list of rules kept growing, and the list of exceptions grew faster.
Patterns learned from examples
Machine learning tackles tasks that depend on judgement by starting from examples paired with their right answers, such as thousands of emails each marked as spam or as legitimate. A program built this way judges an email by arithmetic, so software first turns the email into numbers, for instance by counting how often each word appears in it. The program then multiplies each count by a number it holds for that word and adds up the results, and a total above a set mark labels the email as spam. In a step called training, the program adjusts its large set of numbers, a little at a time, until its answers match the right answers for the examples as closely as it can.
The purpose of training lies in emails the program has not yet seen, which it tends to label correctly when they resemble the examples it learned from. The rule that results exists only as those adjusted numbers, which is why a system built by machine learning can be hard to explain: its makers do not have a written rule to point to.
A child learns to tell a dog from a cat in a similar way, by seeing many of each and being corrected, without ever being told a rule about ears or whiskers. A machine needs far more examples than a child does, and it learns only the patterns its examples contain, a point taken further in How a machine learns from examples, a Beginner module.
Artificial intelligence, or AI, is a loose label for computer systems that do tasks people associate with thinking, such as recognising speech, translating, answering questions or writing. Almost every system called AI today is built by machine learning, from the spam filter in an email account to the chatbot on a lawyer’s screen. Generative AI is the branch of AI that produces new text, images or sound, and the chatbots lawyers now meet belong to that branch.
What a model is
The result of training is called a model, made up of two parts that only work together: a fixed recipe of arithmetic, written once as program code, and the very large set of numbers that training has adjusted. The adjusted numbers are often called weights, since in the spam filter each one sets how much weight a word’s count gets in the total.
A spreadsheet built to sort emails shows how the two parts fit together. The word counts for an email go into a column of input cells, a second column holds the weights, and a fixed formula multiplies each count by its weight and adds up the results in a total cell. Training changes only the weights column, feeding the marked examples through the sheet one at a time and nudging each weight until the total cell gives the right answer for as many examples as it can. The same formula with different weights would give different answers, so the weights hold everything the model learned.
A model on its own sits idle until some other program runs it on an input. Chatbots are programs of this sort, each a product built around a model, with a web page to type into and filters that screen what goes in and out. The business that runs a chatbot also writes instructions that the user does not see, and the product sends them to the model along with each question without changing any of the model’s numbers. Two products can use the same model and still behave quite differently, because their instructions, filters and other parts differ while the model inside stays the same.
The model inside a chatbot is a large language model, trained on a very large amount of text to predict the next word, or part of a word, in a passage of text. The text supplies its own right answers, since the word that actually comes next at each point in a passage is the answer the model should have given. To predict, the model works out a score for every word and part of a word in its vocabulary, as the spam filter works out its one total. The chatbot then picks a word, often by a weighted draw that favours the higher scores, adds it to the passage and predicts again, a process explained in How a chatbot writes an answer, a Beginner module.
Neural networks are the form that the models behind chatbots and most other AI products take today, with the recipe of arithmetic arranged in layers of simple units that each weigh their inputs. The units and weights of a neural network are pictured as dials in Neural networks without the mathematics, a Beginner module. The arithmetic itself is written out step by step in a separate module with the same title as this section, What a model is, an Intermediate module.
Where AI already sits in legal work
Machine learning was already at work in legal practice well before chatbots arrived on lawyers’ desks. In disclosure, a review platform can learn from the documents a lawyer has marked as relevant and rank the rest by how closely they resemble them, so the review team reads the likeliest documents first. The Divisional Court in R (Ayinde) v London Borough of Haringey noted, at paragraph 4, that AI “is used for example to assist in the management of large disclosure exercises in the Business and Property Courts”.
Other uses of machine learning are less visible: legal research databases rank search results with learned models, transcription services turn recorded hearings into text, translation tools render foreign documents, and contract review tools flag clauses that depart from a standard form. Drafting and research assistants built on large language models have joined these tools since 2023.
Every tool in legal work can fail, and the error to expect depends on how the tool was built and what it produces. A program that follows written rules fails where a rule is wrong, for instance when an interest calculator applies the wrong rate, and the same mistake then appears in every answer that uses the rule. A tool built by machine learning tends to fail where its examples did not prepare it, so a relevant document unlike those the lawyer marked may sit near the bottom of a ranking tool’s list, where the review team may miss it. A tool that generates text adds a further risk, since a chatbot asked for authorities may produce a case that does not exist. Knowing how a tool was built, and whether it ranks what exists or writes something new, therefore helps a lawyer judge which kind of error to look for. How a chatbot comes to produce a case that does not exist is the subject of Does AI reason?, a Beginner module.
Check your understanding
Question 1 How did a program that applies a fixed interest rate to a sum and a number of days come by its rule?
Show the answer
Answer: A person wrote the rule down in advance. Each step of a rule-based program is spelled out in advance by a person, which is why it gives the same answer every time and each answer can be traced to the rule.
Question 2 What does training produce when a system is built by machine learning from examples?
Show the answer
Answer: A large set of adjusted numbers that a fixed recipe of arithmetic uses. Training adjusts a large set of numbers until the system’s answers match its examples, and a fixed recipe of arithmetic then uses those numbers to produce each answer. The rule the system has learned exists only as those numbers, which is why a system built by machine learning can be hard to explain.
Question 3 Which explanation fits best when two chatbots run the same model and give different answers to the same question?
Show the answer
Answer: The products around the model differ, for instance in the instructions their makers added. A chatbot is a product built around a model, and the instructions, filters and other parts a business adds can change its answers while the model itself stays the same.
Question 4 According to recital 12 of the EU AI Act, which systems should the definition of an AI system leave out?
Show the answer
Answer: Systems based on rules defined solely by natural persons to execute operations automatically. Recital 12 of the AI Act leaves out systems based on rules defined solely by natural persons, and it counts both machine learning and some approaches that infer from encoded knowledge as techniques that enable inference.
Sources
- Regulation (EU) 2024/1689 (the AI Act), Article 3(1), as consolidated on 27 July 2026
- Regulation (EU) 2024/1689 (the AI Act), recital 12
- R (Ayinde) v London Borough of Haringey, heard with Al-Haroun v Qatar National Bank, [2025] EWHC 1383 (Admin), paragraph 4
- Department for Science, Innovation and Technology, A pro-innovation approach to AI regulation: government response
Your progress
Switched on, it keeps a short record of the modules you open and the quizzes you finish in this browser’s own storage, and the record stays on this device.
This module is general information, checked against the sources above on 28 October 2026. It is not legal advice, and the law it describes may have changed since then. Read the disclaimer.