Rúben GalvãoThe Rabbit Hole
Follow your curiosity

The Rabbit Hole

Visual explanations and interactive experiments. Start with one idea, try it for yourself, then follow the next question.

53 articles · 14 subjects

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.

Neural networks

Build an intuition for learning, layers and recognising patterns.

Language models

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

6 articles

Inside a language model

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

Explore this subject →
4 articles

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.

Explore this subject →
4 articles

Keeping values in range

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

Explore this subject →
2 articles

The residual stream

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

Explore this subject →
2 articles

Inside attention

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

Explore this subject →
1 article

Tokens and embeddings

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

Explore this subject →
11 articles

Remembering context efficiently

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

Explore this subject →
3 articles

Working with longer context

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

Explore this subject →
3 articles

Choosing and combining experts

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

Explore this subject →
3 articles

Generating text

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

Explore this subject →
2 articles

Running models efficiently

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

Explore this subject →
5 articles

Alternative language-model architectures

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

Explore this subject →
2 articles

Understanding images and sound

Discover how language models represent visual and audio inputs.

Explore this subject →
Browse all ai and machine learning articles →
Coming soon

More articles are on the way.