Skip to content
phookit.com
  1. Blog
  2. AI
  3. What is AI, actually? A plain-English d…

What is AI, actually? A plain-English description for programmers

"AI" is used for everything from a spam filter to a chatbot that writes your CMake files. The words underneath are precise, though, and once you know which one applies to the thing in front of you, most of the mystery goes away. This post assumes you can program but have never trained a model.

A working definition

Artificial intelligence is the field of building systems that perform tasks we would normally say require intelligence: recognising a face, translating a sentence, planning a route, playing a game. That definition is about the task, not the technique. Over 70 years the dominant technique has changed twice.

Technique one: write the rules yourself

From the 1950s to the 1980s most AI was symbolic: humans wrote the rules and the program applied them. A chess engine that searches the game tree with a hand-written evaluation function is AI in this sense; so is a medical "expert system" with thousands of if symptom and test then diagnosis rules. This works when the rules are knowable and small enough to write down. It fails at things humans do without being able to explain how, such as recognising a cat.

Technique two: learn the rules from data (machine learning)

Machine learning flips the approach. Instead of writing the function, you choose a family of functions with adjustable parameters, show it examples, and let an optimiser find parameter values that make the function's output match the examples. The learned function is the model.

# the whole idea in one loop
model = Model(parameters=random())
for x, y in training_examples:          # y is the correct answer for input x
    prediction = model(x)
    loss = distance(prediction, y)      # how wrong were we?
    model.parameters -= learning_rate * gradient(loss, model.parameters)

Three flavours cover most of what you'll meet:

  • Supervised learning: examples come with correct answers (this email is spam; this pixel patch is a cat). Classification and regression.
  • Unsupervised learning: no answers; find structure (cluster customers, compress data).
  • Reinforcement learning: an agent acts, the environment rewards or punishes, the policy improves. Game-playing systems and robot control.

The model family can be simple. Linear regression and decision trees are machine learning. What changed in the 2010s was one particular family becoming spectacularly good.

Neural networks

A neural network is a function built from layers. Each layer multiplies its input vector by a matrix of parameters (the weights), adds a bias vector and applies a simple non-linear function element-wise (ReLU: max(0, x)). Stack enough layers and the composite function can approximate almost any mapping from inputs to outputs. The name comes from a loose analogy with neurons; the maths is linear algebra.

// one layer, no library, C++
std::vector<float> layer(const std::vector<float>& in, const Matrix& W, const std::vector<float>& b) {
    std::vector<float> out(W.rows);
    for (size_t i = 0; i < W.rows; ++i) {
        float s = b[i];
        for (size_t j = 0; j < W.cols; ++j) s += W(i, j) * in[j];
        out[i] = std::max(0.0f, s);          // ReLU
    }
    return out;
}

Training uses backpropagation: the chain rule applied layer by layer to compute how much each weight contributed to the error, followed by gradient descent to nudge every weight in the direction that reduces it. Repeat over millions of examples. GPUs matter because this is all matrix multiplication, which they do in parallel very fast.

Deep learning

Deep learning just means neural networks with many layers, plus the tricks that make training them work: better initialisation, normalisation layers, residual connections, and architectures suited to the data. Convolutional networks (2012's ImageNet moment) slide small filters over images; recurrent networks processed sequences one step at a time; and in 2017 the transformer replaced recurrence with attention, a mechanism that lets every position in a sequence look at every other position and decide what's relevant. Transformers scale better, so almost everything since is a transformer.

Large language models

A large language model (LLM) is a transformer trained on a very simple supervised task: given the text so far, predict the next token (a word or word fragment). Do that over trillions of tokens of text with billions of parameters and the model ends up encoding grammar, facts, styles, code and a good deal of reasoning-like behaviour, because all of those help predict the next token. Generation is the same function run repeatedly: predict a distribution over next tokens, sample one, append it, repeat.

Two further stages turn a text predictor into an assistant. Fine-tuning on example conversations teaches the format; reinforcement learning from human feedback (RLHF) trains it toward responses people rate as helpful and safe. Terms you'll hear around this:

  • Context window: how many tokens the model can attend to at once. Everything it "knows" about your conversation has to fit here; nothing persists between calls unless you send it again.
  • Temperature: how random the sampling is. 0 is (nearly) deterministic.
  • Embeddings: vectors that represent meaning, so similar texts are close together. The basis of semantic search and retrieval-augmented generation (RAG), where you look up relevant documents and put them in the context.
  • Tools / function calling: the model emits a structured request, your code runs it and returns the result. This is how "agents" act on the world.

What these systems can't do

  • They don't know what they don't know. An LLM produces plausible text; when the training data ran thin it produces plausible wrong text with the same confidence ("hallucination"). Verify facts, run the code.
  • They don't learn from you at run time. Weights are fixed after training. Memory features are engineering around the model, not inside it.
  • They reflect their data. Biases, gaps and licences in the training set come through in the output.
  • They are expensive. Training a frontier model costs tens to hundreds of millions of pounds; even inference is orders of magnitude more compute than a database query. Pick the smallest model that does the job.
  • They are not general intelligence. Strong at pattern completion over text and images; weak at long-horizon planning, precise arithmetic without tools, and anything requiring genuine novelty.

Glossary

TermMeaning
ModelA function with learned parameters that maps inputs to outputs.
Parameters / weightsThe numbers adjusted during training. "7B" = seven billion of them.
Training vs inferenceFinding the weights vs using them. Training happens once; inference every time you call the model.
LossA number measuring how wrong the model is; training minimises it.
OverfittingMemorising the training data instead of generalising; caught with held-out test data.
TokenThe unit of text a language model reads and writes; roughly ¾ of a word in English.
PromptThe input text; "prompt engineering" is choosing it carefully.
Fine-tuningContinuing training on a smaller, specific dataset.
AgentA loop in which a model chooses actions (tool calls) toward a goal.

Further reading

  • Russell & Norvig, Artificial Intelligence: A Modern Approach, for the field's history and symbolic methods.
  • Vaswani et al., "Attention Is All You Need" (2017), the transformer paper.
  • Andrej Karpathy's "Let's build GPT" for a from-scratch implementation.

Comments 0

Log in or register to join the conversation.

No comments yet.