Shahzad Ali · Learning notes

The AI machinery room.

How the different approaches fit together.

My visual notes on the machinery behind AI: how a system learns, how it is built and what it produces.

SHAHZAD ALI / MY NOTES / 02AI, in pictures

Find your way
around AI.

Three questions help me place any model on the map.

Artificial intelligenceThe broad field
Machine learningSystems that learn from data or experience
Deep learningNeural networks with many layersTransformer
01 / Learning

How does it learn?

From examples, patterns, prediction targets or rewards.

SupervisedSelf-supervisedUnsupervisedReinforcement
02 / Architecture

How is it built?

The arrangement of its calculations.

TransformerCNNRNNGNN
03 / Task

What does it do?

The job we ask it to perform.

ClassifyPredictGenerateChoose an action
Put it together / A GPT-style model

Predict text to learn+Transformer architecture+Generate text when used

Learning method, architecture and task describe different parts of the same system.
  1. Supervised learning

    Learning from examples

    Give a model examples with answers: emails labelled “spam” or “inbox”, for instance. Training adjusts the model to improve its predictions on those examples.

    The useful question is how well it handles new examples. Labels, data quality and the problem being solved all matter.

    Neural networks
  2. Unsupervised learning

    Finding structure

    Give a model data without an answer label for each example. It may group similar items or find a simpler way to represent them.

    For example, a shop could group customers by purchasing patterns. A cluster shows similarity under the chosen method; explaining its cause needs further investigation.

    Patterns and representations
  3. Self-supervised learning

    The data supplies the target

    Text can supply its own training questions. Hide a token and predict it, or use earlier text to predict the following token. That creates many examples without someone labelling every answer.

    BERT learns from masked text. A GPT-style model learns next-token prediction. Both can learn useful representations before additional training for specific uses.

    Pretraining
  4. Reinforcement learning

    Actions have consequences

    An agent takes actions, receives rewards and learns a policy: a way to choose what to do. The aim is a higher total reward over time.

    In the DQN work, a deep neural network learned to play Atari games from screen pixels and rewards. This connects reinforcement learning directly with deep learning. The reward defines what success means to the system.

    Reinforcement learning
  5. Deep learning

    Layers build representations

    A deep neural network transforms its input through many layers. Each stage creates numerical representations that later stages can use.

    The learned parameters are numerical values. Networks vary in depth and structure, and individual layers rarely have one neat human label.

    Inside a neural network
  6. Network architectures

    Different arrangements for different data

    CNNs reuse filters across local regions, such as parts of an image. RNNs carry a state through a sequence. Transformers use attention to combine information. GNNs pass information along the links in a graph.

    An image, a sentence and a molecule have different structures. These designs offer ways to use that structure. Many systems combine several components.

    The transformer
  7. Generative models

    Creating a new example

    An autoregressive language model builds text token by token. A GAN trains a generator alongside a discriminator. A standard diffusion model learns to reverse added noise, then uses repeated denoising to generate a sample.

    These approaches learn from training examples and can produce new text, images or other data. A generated result still needs checking for the task you want it to perform.

    Generating with a model
  8. From data to a useful system

    Training and using are different stages

    Training changes the model’s parameters. Inference uses the trained model on an input. A typical chat supplies fresh context while the parameters remain fixed.

    The application adds its own decisions: which data to use, what success means and how to check results. Fluent language and attractive images alone cannot establish accuracy.

    Training and inference

Sources behind the technical details

Sources for these notes.

Reviewed . Technical details are linked to their sources. My perspective on how I use AI is personal.

  1. Authors’ textbook · Published 2016

    Deep Learning · Chapters 1, 9 and 10 ↗

    Goodfellow, Bengio and Courville. The introduction maps AI and deep learning. Chapters 9 and 10 explain convolutional filters and recurrent networks.

  2. Primary research · First released

    BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding ↗

    Devlin and colleagues. Masked-language training supplies targets from the text itself. BERT uses bidirectional context, showing how transformer designs can serve different tasks.

  3. Primary research · First released

    Human-level control through deep reinforcement learning ↗

    Mnih and colleagues. The DQN system combines a deep neural network with reinforcement learning on Atari games.

  4. Primary research · First released

    Attention Is All You Need ↗

    Vaswani and colleagues. Introduces the transformer. Sections 3.1–3.5 describe attention, masking, feed-forward networks, residual connections, normalisation, embeddings and position.

  5. Primary research · First released

    Neural Message Passing for Quantum Chemistry ↗

    Gilmer and colleagues. Describes learning on molecular graphs by passing and aggregating information between connected nodes.

  6. Primary research · First released

    Language Models are Few-Shot Learners ↗

    Brown and colleagues. Describes autoregressive language modelling, whole-model parameter counts and learning from context with fixed trained weights. Its results also document limitations.

  7. Primary research · First released

    Generative Adversarial Networks ↗

    Goodfellow and colleagues. Introduces joint training of a generator and a discriminator.

  8. Primary research · First released

    Denoising Diffusion Probabilistic Models ↗

    Ho and colleagues. Defines a noise-adding process and a learned reverse process for generating samples.

← Back to my computing notes