From data to an answer
How artificial intelligence works
Follow an AI system from the data it is built from to the answer it gives, and see where it can go wrong.
Educational. Not medical, security or legal advice, and no claim about any product’s performance.
From data to an answer
Each step is built from the one before
Scroll to descend through 10 layers. Select a layer to read it in full, with its sources.
- 01 / 10 What the word means A system defined by what it does Read this layer
- 02 / 10 Data The examples a system is built from Read this layer
- 03 / 10 Text into numbers Words become pieces, pieces become vectors Read this layer
- 04 / 10 The model A network of adjustable numbers Read this layer
- 05 / 10 Attention Each position weighs the others Read this layer
- 06 / 10 Training Adjust the weights to shrink the error Read this layer
- 07 / 10 Testing Judged on data kept apart Read this layer
- 08 / 10 Producing an answer One token at a time Read this layer
- 09 / 10 Limits: confabulation and bias Fluent is not the same as true Read this layer
- 10 / 10 Who governs it Rules and frameworks scaled to risk Read this layer
10 layers, each with its sources
The layers in full
-
01 / 10
What the word means
A system defined by what it does
European law defines an AI system as a machine-based system that infers, from the input it receives, how to generate outputs such as predictions, content, recommendations or decisions.[1] The OECD defines an AI system in nearly the same words, and adds that AI systems vary in their levels of autonomy and in how far they adapt after deployment.[2] An international standard, ISO/IEC 22989, establishes terminology for AI and describes concepts in the field.[3]
Illustration
A drawing of the definition: an input goes in, and one of four kinds of output comes out. Sources
- Regulation (EU) 2024/1689 (Artificial Intelligence Act), Article 3 (definitions) and recital 26
- OECD, AI Principles overview: the definition of an AI system in the OECD Recommendation on Artificial Intelligence (OECD/LEGAL/0449)
- ISO/IEC 22989:2022, Artificial intelligence concepts and terminology (abstract)
-
02 / 10
Data
The examples a system is built from
European law defines training data as data used for training an AI system through fitting its learnable parameters.[1] NIST warns that the data used for building an AI system may not be a true or appropriate representation of the context it is meant for.[2] It adds that datasets used to train AI systems may become stale or outdated relative to where the system is deployed.[2]
Illustration
A drawing, not a data set: examples sorted into two groups, and a few that fit neither. -
03 / 10
Text into numbers
Words become pieces, pieces become vectors
Sennrich, Haddow and Birch describe encoding rare and unknown words as sequences of subword units.[1] Their method adapts byte pair encoding, a compression algorithm, to the task of splitting words into segments.[1] It represents an open vocabulary through a fixed-size vocabulary of variable-length character sequences.[1] In the transformer, learned embeddings convert the input tokens and output tokens to vectors.[2]
Illustrative, not measured
The split and the numbers are made up to show the idea. -
04 / 10
The model
A network of adjustable numbers
Rumelhart, Hinton and Williams describe networks of neurone-like units, joined by connections that carry weights.[1] European law calls the numbers that training fits the learnable parameters of an AI system.[2] The transformer is built from stacked self-attention layers and fully connected layers.[3]
Illustration
A drawing of a very small network. Each line stands for one adjustable weight. Sources
- Rumelhart, Hinton and Williams, “Learning representations by back-propagating errors”, Nature 323, 533–536 (1986), doi:10.1038/323533a0 (abstract)
- Regulation (EU) 2024/1689 (Artificial Intelligence Act), Article 3 (definitions) and recital 26
- Vaswani et al., “Attention Is All You Need”, 2017, arXiv:1706.03762
-
05 / 10
Attention
Each position weighs the others
The transformer is a network architecture based solely on attention mechanisms.[1] Self-attention relates different positions of a single sequence in order to compute a representation of the sequence.[1] The output of an attention function is a weighted sum of values. Each weight is computed from how compatible a query is with the corresponding key.[1]
Illustrative, not measured
The thicknesses are made up. A thicker arc stands for a larger weight given to that word. -
06 / 10
Training
Adjust the weights to shrink the error
Back-propagation repeatedly adjusts the weights of the connections in a network so as to minimise a measure of the difference between the network’s actual output and the desired output.[1] As a result, hidden units that are part of neither the input nor the output come to represent important features of the task.[1] European law notes that an AI model can be trained with a large amount of data using self-supervision at scale.[2]
Illustrative, not measured
A made-up curve: the ball stands for the weights, stepping down toward a lower error. -
07 / 10
Testing
Judged on data kept apart
European law defines testing data as data used for providing an independent evaluation of the AI system, to confirm its expected performance before it is placed on the market or put into service.[1] It defines validation data as data used to evaluate the trained system and to tune its learning process in order, among other things, to prevent underfitting or overfitting.[1] A validation data set is a separate data set or a part of the training data set.[1]
Illustrative, not measured
Made-up curves: the error on training data keeps falling, and the error on data kept apart turns upward. -
08 / 10
Producing an answer
One token at a time
The transformer generates its output one element at a time.[1] At each step the model is auto-regressive: it consumes the symbols generated so far as additional input when generating the next.[1] A softmax function converts the decoder’s output to predicted next-token probabilities.[1]
Illustrative, not measured
The words and heights are made up to show a set of next-token probabilities. -
09 / 10
Limits: confabulation and bias
Fluent is not the same as true
NIST’s Generative AI Profile centres on a list of 12 risks. One of them is generative AI systems confabulating, or “hallucinating”, output.[1] NIST has identified three major categories of AI bias: systemic, computational and statistical, and human-cognitive.[2] Each of these can occur in the absence of prejudice, partiality or discriminatory intent.[2] NIST also writes that biases remain endemic across technology processes and can lead to harmful impacts regardless of intent.[3]
Illustration
A drawing: an answer with no line back to a source. Sources
- NIST, “Department of Commerce Announces New Guidance, Tools 270 Days Following President Biden’s Executive Order on AI”, 26 July 2024 (announcing NIST AI 600-1, the Generative AI Profile)
- NIST AI 100-1, AI RMF 1.0, section 3: AI Risks and Trustworthiness
- NIST Special Publication 1270, Towards a Standard for Identifying and Managing Bias in Artificial Intelligence, March 2022 (abstract)
-
10 / 10
Who governs it
Rules and frameworks scaled to risk
NIST’s AI Risk Management Framework is intended for voluntary use.[1] Its core is composed of four functions: Govern, Map, Measure and Manage.[2] The recitals of the European Union’s AI Act say that a clearly defined risk-based approach should be followed.[3] Under that approach the Act prohibits certain AI practices it calls unacceptable, lays down requirements for high-risk AI systems, and lays down transparency obligations for certain AI systems.[3]
Illustration
The four functions named in NIST’s framework, drawn as a cycle.
Where this shows up
Not on this site
No project to show
No project on this site is presented as an AI system. This section stands on its own.
Nothing to open
Ways into the extraordinary