Rúben GalvãoThe Rabbit Hole

The Rabbit Hole / AI and machine learning

AI and machine learning

Explore how models learn, process language and work with images and sound. Visual explanations and experiments, from the first neuron to the latest architectures.

New here?

Start with a neuron

Try a small network, watch it learn, and build up from there.

Take the first step →
See the ideas in action

Explore model architectures

Open a real model’s diagram and follow the parts you want to understand.

Browse 137 architecture maps →
Compare performance

Model benchmarks

See where open and closed models sit. Explore capability, coding, reasoning and memory results, then compare performance against model size.

Explore the benchmark charts →

Neural networks

Build an intuition for learning, layers and recognising patterns.

How neural networks learn

Start with one neuron, then explore layers, learning and recognising patterns.

Back to subjects ↑

Language models

Start with the complete path from text to prediction, then explore how models extend it.

Inside a language model

A reading path from tokens and embeddings to attention, one transformer layer and the whole model.

Read in order · 6 articles

Back to subjects ↑

Giving tokens a sense of position

Start with RoPE, then stretch it to longer texts and explore other ways to bring token order into attention.

Back to subjects ↑

Keeping values in range

Normalise vectors, place the norm, and stop attention scores and activations from growing too large.

Back to subjects ↑

The residual stream

Change how layers read from and write to the stream: wider streams, scaled skips and extra paths.

Back to subjects ↑

Inside attention

Small changes inside attention: gates, bias terms and the tokens that collect spare attention.

Back to subjects ↑

Tokens and embeddings

Other ways to turn text into vectors: extra lookups per layer, n-gram tables and bytes instead of tokens.

Back to subjects ↑

Remembering context efficiently

Understand the KV cache and how sharing, compression and quantisation make it smaller.

Back to subjects ↑

Working with longer context

Keep a local window, mix local and global layers, or learn which entries or blocks attention should read.

Back to subjects ↑

Choosing and combining experts

Learn how mixture-of-experts models route work and balance their specialists.

Back to subjects ↑

Generating text

Explore predicting several tokens, speculative decoding and text generation through diffusion.

Back to subjects ↑

Running models efficiently

Store weights in fewer bits, read prompts faster, overlap expert communication and grow trained models.

Back to subjects ↑

Alternative language-model architectures

Explore recurrent models, state-space models and architectures that combine approaches.

Back to subjects ↑

Understanding images and sound

Discover how language models represent visual and audio inputs.

Back to subjects ↑
Coming soon

More articles are on the way, from here towards how large language models work.