Skip to content
coden

Map of artificial intelligence: what is what and how it all fits together

Artificial intelligence, machine learning, deep learning, language models and AI agents — how they relate to each other, on a single page. The opening part of the AI basics series.

6 minutes Matěj Žalmánek 2026-10-15

Series AI basics Part 1 of 52
  1. Map of artificial intelligence: what is what and how it all fits together
  2. A brief history of artificial intelligence: from Turing to language models
  3. Data, model, training, inference: the basic terms on a single example
  4. How to read mathematical notation: symbols, indices, sums and quantifiers
  5. Sets and relations: the building blocks of definitions in AI
  6. Functions and mappings: why every AI model is a function
  7. Logic and proofs: the rules AI reasons by
  8. Graphs and trees: the structure that both search and neural networks stand on
  9. Linear algebra for machine learning: vectors, matrices and why AI mostly multiplies
  10. Derivatives, the gradient and the chain rule: how a model finds out which way to learn
  11. Gradient descent: how a model learns
  12. What probability is: from rolling dice to the Kolmogorov axioms
  13. Conditional probability and Bayes’ theorem: how to update your estimate when you learn something new
  14. Random variables and the cumulative distribution function: one function that tells you everything about a distribution
  15. Probability density and probability mass functions: why a continuous variable has zero probability at a point
  16. Expected value, variance and covariance: where a distribution lies, how wide it is and what goes with what
  17. Overview of probability distributions: Bernoulli, binomial, Poisson, uniform, normal and exponential
  18. Law of large numbers and central limit theorem: why averages behave so predictably
  19. Statistics and parameter estimation: maximum likelihood, MAP and confidence intervals
  20. Information theory: entropy, cross-entropy and KL divergence — where loss functions come from
  21. State-space search: BFS, DFS, UCS and A* with animations
  22. Games and adversaries: minimax, alpha-beta pruning and Monte Carlo tree search
  23. Constraint satisfaction: backtracking, constraint propagation and AC-3 on sudoku and a map of Czech regions
  24. Logic and knowledge systems: forward and backward chaining, resolution and expert systems
  25. Planning: STRIPS, the blocks world, heuristics from relaxation and planning in AI agents
  26. Local search and simulated annealing: a travelling salesman through the Czech regional capitals
  27. Genetic algorithms: population, crossover, mutation and selection on a backpack for a hike
  28. Evolution strategies and genetic programming: from the one-fifth rule to Kepler’s law
  29. Ant colony optimization: how a pheromone trail finds a short path
  30. Particle swarm optimisation: inertia, personal experience and the swarm’s experience
  31. Neuroevolution: evolving the weights and shape of neural networks, and the NEAT algorithm
  32. Fuzzy sets and membership functions: how to write down “somewhat warm”
  33. Fuzzy logic and probability: why “somewhat warm” does not mean “probably warm”
  34. Fuzzy logic: t-norms, implications and IF–THEN rules
  35. Fuzzy control: Mamdani and Sugeno from a fan to a pole on a cart
  36. Fuzzy clustering: the fuzzy c-means algorithm and points between clusters
  37. Neuro-fuzzy systems (ANFIS): fuzzy rules that learn from data
  38. Markov chains: the transition matrix, the stationary distribution and PageRank
  39. Hidden Markov models: the Viterbi algorithm and the dishonest casino
  40. Bayesian networks: why the grass is wet and what it means for the sprinkler
  41. The Kalman filter: how to estimate where a car is and how fast it goes from imprecise measurements
  42. Types of machine learning: supervised, unsupervised, semi-supervised and more
  43. Prompts, context and RAG: how to give a model the right information
  44. Variational autoencoders (VAE): new images from a continuous latent space
  45. Generative adversarial networks (GAN): the forger versus the detective
  46. Diffusion models: how pure noise becomes an image
  47. Markov decision processes: states, actions, rewards and the Bellman equations
  48. Q-learning and DQN: learning the value of actions, from a table to a neural network
  49. Policy gradient and PPO: learning the policy directly
  50. How an AI agent works: a language model in a loop with tools
  51. Programming with AI agents: the task, tests and review
  52. Evaluating and securing AI systems: how to measure and how to keep watch

Full series syllabus 52 of 83 topics published

What you will take away
  • How artificial intelligence, machine learning, deep learning and language models fit together.
  • The two big families of AI: systems that search and systems that learn.
  • What an AI agent is and why you will meet everything else in it.

Artificial intelligence, machine learning, neural networks, language models, agents. Words that are used today almost as synonyms — and yet each of them means something different. This part is a map: it shows what is what and how it all fits together. The other parts of the series go into depth; each of them can also be read on its own.

1. What artificial intelligence is

Definition — rational agent (Russell and Norvig)

An agent is anything that perceives its environment through sensors and acts upon it through actions. Its behaviour is described as follows.

Let P be a non-empty set of possible percepts and A a non-empty set of actions available to the agent. Denote by P* the set of all finite percept sequences (p1, …, pt), where t ∈ ℕ and pi ∈ P for i = 1, …, t. The agent function is the function

f : P* → A,   (p1, …, pt) ↦ f(p1, …, pt),

which assigns to every percept history so far the action the agent takes.

Further, let U be the performance measure — a number that rates how well the agent has done in its environment — and for a history (p1, …, pt) ∈ P* and an action a ∈ A let E[U | p1, …, pt, a] be the expected value of U given that the agent takes action a after this history (computed from what the agent knows about the environment). Assume that the maximum below exists (e.g. if A is finite). The agent f is rational if and only if

∀ (p1, …, pt) ∈ P* :   f(p1, …, pt) ∈ argmaxa ∈ A E[U | p1, …, pt, a].

So after every percept history a rational agent chooses one of the actions with the highest expected performance measure (if there are several, it does not matter which).

Artificial intelligence, as Russell and Norvig see it, is the field that designs and builds rational agents. That is a description of a field, not a mathematical notion — there is no formal definition of artificial intelligence.

In plain words

Artificial intelligence is the field that tries to build programs that make sensible decisions: they look at what is going on around them and choose what is most likely to lead to the goal. A chess program, a navigation app and a chatbot are all artificial intelligence — each just solves a different task by different means.

Rationality can be written as a single formula — the agent chooses the action with the best expected outcome:

a* = argmaxa ∈ A E[ U | p1, …, pt, a ]

a*
the action the agent takes — the output of the whole function f
argmaxa ∈ A
try out all available actions in your head and take the best one; this is where the decision happens
E
the expected (average) value — the world is uncertain, the same action can turn out differently, so the outcomes are weighted by probabilities
U
the performance measure (utility) — what “good” means; without it there would be nothing to choose by
p1, …, pt
everything the agent has perceived so far — it decides only by what it knows, not by the true state of the world
Example — a navigation app chooses a route

The utility U is the negated driving time in minutes. On the motorway it takes 20 minutes, but with probability 0.3 there will be a traffic jam and 50 minutes; on the country road it is always 30 minutes. The colours match the terms of the formula above.

Motorway: E[U | …, motorway] = 0.7 · (−20) + 0.3 · (−50) = −14 − 15 = −29. Country road: E[U | …, country road] = −30 = −30.

a* = argmaxa ∈ {motorway, country road} E[U | …, a] = motorway, because −29 > −30. The rational agent picks the motorway — on average it is a minute faster, even though in roughly a third of cases it turns out worse.

The whole field can be drawn as nested sets. Deep learning is a kind of machine learning, machine learning is one of the paths to artificial intelligence — and an AI agent today often combines both, search and learning:

Artificial intelligence Search and planning chess, navigation, schedules Machine learning a model learns from data Deep learning neural networks Generative AI language models, images AI agent — searches, plans and learns
Map of artificial intelligence

2. AI that searches

The oldest family of AI learns nothing. It gets an exact description of the task — where I start, what I can do, where I want to get — and searches through the possibilities until it finds a solution. That is how a navigation app looking for the shortest route works, a chess program calculating moves ahead, or a timetable planner.

The upside: when the task is well described, the result is reliable and you can prove it is the best possible one. The downside: someone has to describe the task exactly — and the world can almost never be described exactly.

Definition — search problem

A search problem is a six-tuple (S, s0, A, T, G, c), where

  1. S is a non-empty set of states;
  2. s0 ∈ S is the initial state;
  3. A is a function that assigns to every state s ∈ S the set A(s) of actions applicable in state s;
  4. T is the transition function: for every s ∈ S and a ∈ A(s), T(s, a) ∈ S is the state that action a leads to from state s;
  5. G ⊆ S is the set of goal states;
  6. c is the step cost: for every s ∈ S and a ∈ A(s), c(s, a) ∈ ℝ, c(s, a) ≥ 0.

A solution of the problem is a sequence of actions (a1, …, ak), k ∈ ℕ, together with states s1, …, sk ∈ S such that

  1. ai ∈ A(si−1) and si = T(si−1, ai) for every i = 1, …, k;
  2. sk ∈ G.

The cost of a solution is

C(a1, …, ak) = ∑i=1k c(si−1, ai).

A solution is optimal if and only if its cost is less than or equal to the cost of every other solution. So a solution is a path from the initial state to a goal along allowed steps; the optimal one is the cheapest.

In plain words

For a navigation app the states are junctions, the actions are “drive down this street”, the goal is an address and the step cost is the length of the street. Anyone who can describe a task like this can run a general algorithm on it — one that does not need to know anything about maps.

search(s₀):
    frontier ← [s₀]                      # states we can reach but have not expanded yet
    visited ← {s₀}
    while frontier is not empty:
        s ← remove a state from frontier  # WHICH state determines the kind of search
        if s ∈ G: return path to s
        for each action a ∈ A(s):
            s′ ← T(s, a)
            if s′ ∉ visited:
                add s′ to visited and to frontier
    return “no solution exists”

The catch is the number of possibilities: if every state has b continuations, then after d steps there are up to bd paths. In chess typically b ≈ 35, and calculating just five moves for each side (d = 10) means 3510 ≈ 2.8 · 1015 positions. That is why chess programs do not search blindly but prune cleverly.

In depth: Part 2 — State-space search.

3. AI that learns

Definition — machine learning (T. Mitchell)

The definition works with three objects:

  1. T — the task: a class of problems the program is to solve (e.g. “decide whether an e-mail is spam”);
  2. P — the performance measure: a rule that assigns a number to a program solving T, the higher the better (e.g. the share of correctly classified e-mails);
  3. E — the experience: the data the program receives (e.g. e-mails labelled “spam” / “not spam”).

A program learns from experience E with respect to a task T and a performance measure P if and only if its performance on T, as measured by P, improves with experience E.

Mitchell’s definition is verbal and deliberately general — “improves” is not formalized any further. For supervised learning it has a precise form, worked through below: T is predicting the answer y from the input x, E are the training pairs (xi, yi) and the performance is the better, the smaller the average loss.

In plain words

Instead of rules, the program gets examples and works out the rules from them on its own. Nobody writes down for it what spam looks like — it is shown a thousand e-mails and notices what makes spam different.

Machine learning is divided by what kind of signal the model gets while learning: correct answers (supervised learning), just data without answers (unsupervised), a bit of both (semi-supervised), answers produced from the data itself (self-supervised), or rewards for actions (reinforcement learning).

For supervised learning, Mitchell’s “performance measure” can be written down concretely. Let (x1, y1), …, (xn, yn), n ≥ 1, be the training examples (input xi ∈ X and correct answer yi ∈ Y), fθ : X → Y a model with parameters θ ∈ Θ and L : Y × Y → [0, ∞) a loss function. The model learns by looking for the parameters with the smallest average loss on the data:

θ* = argminθ 1/n ∑i=1n L(fθ(xi), yi)

θ*
the learned parameters — the result of the whole training; the model then runs with them in production
argminθ
we look for the numbers θ for which the error is smallest — “learning” here is literally a search for a minimum
1/n ∑
the average over all n examples — the model should be good on all of them, not on one; dividing by n makes the error comparable across data sets of different sizes
L
the loss function — turns “how wrong the model was” into a number, and so says which errors are worse
fθ(xi)
the model’s answer to the i-th input — the only place where the parameters θ enter the formula
yi
the correct answer from the teacher — without it there would be nothing to compare against
Supervised machine learning = minimizing the average loss on the training data.
Example — a line through three points

Data (x, y): (1, 2), (2, 4), (3, 5), so n = 3. The model fw(x) = w · x has a single parameter w ∈ ℝ; the loss is the squared error L(ŷ, y) = (ŷ − y)². The colours match the terms of the formula above.

  • w = 1: answers 1, 2, 3, errors −1, −2, −2, losses 1, 4, 4, average loss 1/3 · (1 + 4 + 4) = 3.
  • w = 2: answers 2, 4, 6, errors 0, 0, 1, losses 0, 0, 1, average loss 1/3 · (0 + 0 + 1) = 1/3 ≈ 0.333.
  • Minimum: the derivative with respect to w is zero for w* = ∑xiyi/∑xi² = 2 + 8 + 15/1 + 4 + 9 = 25/14 ≈ 1.786, with average loss 5/42 ≈ 0.119.

For large models the minimum cannot be computed by a formula, and it is searched for step by step with gradient descent.

In depth: Part 3 — Types of machine learning.

4. Deep learning and neural networks

Deep learning is machine learning with one particular kind of model: a neural network with many layers. Each layer transforms its input a little differently — in a network for images the first layers recognize edges, the next ones shapes, the last ones whole objects. Nobody tells them what to look for; they learn it from the data.

Definition — layered neural network

Let L ∈ ℕ, L ≥ 1, be the number of layers and n0, n1, …, nL ≥ 1 their widths (n0 is the input dimension, nL the output dimension). For l = 1, …, L let

  1. Wl ∈ ℝnl×nl−1 be the weight matrix,
  2. bl ∈ ℝnl be the bias vector,

and let φ : ℝ → ℝ be a non-linear activation function; for a vector z, φ(z) denotes the vector obtained by applying φ to each component separately. Layer l is the function

fl : ℝnl−1 → ℝnl,   fl(h) = φ(Wlh + bl).

A neural network with L layers is the composite function

f = fL ∘ … ∘ f2 ∘ f1 : ℝn0 → ℝnL,   i.e. f(x) = fL(… f2(f1(x))).

(In the last layer φ is often left out or replaced by another function, e.g. softmax.) The parameters of the network are θ = (W1, b1, …, WL, bL). Layers 1, …, L − 1 are called hidden. A network is deep when it has several hidden layers (usually L − 1 ≥ 2 is meant; there is no settled sharp boundary).

hl = φ(Wl hl−1 + bl)

hl
the output of layer l — a new description of the input that the next layer works with
φ
the non-linearity (e.g. ReLU(z) = max(0, z)) — without it the layers would collapse into a single linear function and depth would bring nothing
Wl
the weights — what the network learns: how much each input contributes to each neuron
hl−1
the output of the previous layer (for the first one it is the input x) — this is where the layers are chained
bl
the bias — lets a neuron “switch on” even when the inputs are zero, and shifts the threshold
Example — a single neuron with ReLU

Weights w = (0.5, −1), bias b = 0.2, activation φ = ReLU (the colours match the terms of the formula above).

For the input x = (2, 1): z = 0.5 · 2 + (−1) · 1 + 0.2 = 0.2 and the output is ReLU(0.2) = 0.2.

For x = (1, 3): z = 0.5 · 1 + (−1) · 3 + 0.2 = −2.3 and ReLU(−2.3) = 0 — the neuron stays silent. A network is thousands of such neurons side by side and dozens of layers one after another.

Why “deep”? Because of the number of layers. And why only now, when neural networks have existed since the 1950s? Because only today do we have enough data and enough computing power (graphics cards) to train large networks.

In depth: coming soon — the parts “Gradient descent: how a model learns” and “A neural network from scratch”.

5. Generative AI and language models

Most models answer the question “what is this?” — spam or not? Generative models create new data: text, images, sound, code. A large language model is a neural network that has learned one single thing from an enormous amount of text: to guess the next word. When it does that well enough, along the way it can also answer questions, translate and write code.

Language models learn in three steps, and each one is a different kind of learning: self-supervised learning on texts from the internet, supervised fine-tuning on example answers, and reinforcement learning based on which answers people rate higher.

“Guessing the next word” has a precise form — the probability of the whole text is broken down into a product of word-by-word predictions:

P(w1, …, wT) = ∏t=1T Pθ(wt | w1, …, wt−1)

P(w1, …, wT)
how probable the whole text is — what a language model actually describes
∏
a product over positions — the chain rule of probability; thanks to it, it is enough to be able to do one thing: predict the next word
Pθ
a neural network with parameters θ that returns a probability distribution over the whole vocabulary
wt
the word (token) being predicted right now
w1, …, wt−1
everything before it — the context; that is why while writing the model sees only what it has already written
Text is generated by drawing a word from Pθ, appending it to the context and repeating.
Example — what is measured during learning

The context is “The capital of Czechia is”. The model gives the word “Prague” probability 0.8 and the word “Brno” 0.1. The loss is the negative logarithm of the probability of the correct word: −ln 0.8 ≈ 0.223. Had it given the correct word only 0.1, the loss would be −ln 0.1 ≈ 2.303 — roughly ten times more. Training (minimizing the loss from the chapter on learning) pushes the probability of the correct words up.

Two words in a row: if after “Prague” the model gives the full stop probability 0.9, the probability of the continuation “Prague.” by the formula above (the colours match its terms) is

P(Prague, . | context) = Pθ(Prague | … Czechia is) · Pθ(. | … is Prague) = 0.8 · 0.9 = 0.72.

In depth: coming soon — the part “Transformers and large language models”.

6. AI agents: where it all comes together

An AI agent is a language model that does not just answer but acts: it reads files, runs commands, searches the web and decides what to do next based on the results. This is where the two families of AI meet again — the model has learned language and judgement, but it solves the task as a search: it tries a step, looks at the result, and if it does not lead to the goal, it tries another.

The core of every such agent is a short loop — exactly the agent from the first chapter, which perceives and acts:

agent(task):
    context ← [task]
    repeat:
        response ← language_model(context)       # decide: text, or a tool call?
        if response is a finished result:
            return response
        result ← run_tool(response)              # act: read a file, run a command, search
        append response and result to context    # perceive: what came of it
    until the step budget runs out

Agents today write and fix code, and coden was built precisely for working with them: the agent works on your computer and you direct it from your phone.

In depth: coming soon — the part “How an AI agent works”.

7. How to read this series

  • Every part can be read on its own. At the top you will find what you will take away and what is useful to know first.
  • The plain explanation is enough. The precise mathematical definitions are tucked away under a fold — for those who want them.
  • The pictures are real. The animations in the parts are the output of actual runs of the algorithms, not illustrations.

The list of all parts, including the ones that are coming soon, is in the series box at the top and in the overview of articles.

Do you see it differently? Write to support@coden-app.com.

An Agent on your computer, driven from your phone