Transformer Circuits 2: The Transformer, Redrawn

Reading the Framework paper, part 2. Redrawing the residual stream as a communication channel and attention heads as independent information movers, through virtual weights and the QK/OV split.

May 31, 2025 · 9 min · rick

Transformer Circuits 1: Summary of Results

Reading the Framework paper, part 1. Treating tiny attention-only models as model organisms for fully reverse engineering transformers, and a map of the key results.

May 17, 2025 · 3 min · rick

Mechanistic Interpretability: Free Materials to Start

Reverse-engineering neural networks, circuit by circuit. Anthropic’s Transformer Circuits thread and a few companion resources are all free. Where to start, to open this series.

May 10, 2025 · 1 min · rick

Steering GPT-2's Emotions with Sparse Autoencoders

Finding emotion-related features in GPT-2 using OpenAI’s pretrained SAE, then training one from scratch. Feature patching turns ‘good person’ into ‘shit’.

February 16, 2025 · 6 min · rick

K-means, GMM, EM: Three Nested Russian Dolls of Clustering

K-means is actually an extreme case of GMM, and GMM is the canonical application of the EM algorithm. How these three connect within a single framework, and how information geometry explains the relationship.

December 10, 2023 · 7 min · rick

Reinforcement Learning Lecture 10: RL in Games

David Silver’s Lecture 10. A case study. Best response and Nash equilibrium seen through game theory, minimax search with a binary-linear value function, self-play reinforcement learning, combining minimax with RL, and imperfect-information games like poker. One recipe running through Chinook, Deep Blue, Logistello, TD-Gammon, and Maven.

June 19, 2021 · 16 min · rick

Reinforcement Learning Lecture 9: Exploration and Exploitation

David Silver’s Lecture 9. Use what you know now (exploitation), or find out more (exploration)? This note ties that dilemma into five principles, then follows the multi-armed bandit through regret and lower bounds, UCB, Thompson sampling, and information-state search, and on to contextual bandits and the extension to MDPs.

May 15, 2021 · 19 min · rick

Reinforcement Learning Lecture 8: Integrating Learning and Planning

David Silver’s Lecture 8. Learn a model of the environment from experience, then plan with that model. Model learning as supervised learning, the AB example, Dyna and Dyna-Q+, Monte-Carlo Tree Search and Go, TD search and Dyna-2.

April 17, 2021 · 5 min · rick

Reinforcement Learning Lecture 7: Policy Gradient

David Silver’s Lecture 7. Optimize the policy directly, without going through value. The likelihood-ratio trick and the score function, REINFORCE, baselines and advantage, actor-critic, natural policy gradient, and a summary that ties six faces into one.

March 13, 2021 · 6 min · rick

Reinforcement Learning Lecture 6: Value Function Approximation

David Silver’s Lecture 6. When states are too many to write down in a table, approximate the value with a handful of parameters. The incremental methods that learn features by gradient descent, mountain car and the bootstrapping debate, Baird’s counterexample where off-policy diverges, and the batch methods and DQN that pool experience.

February 13, 2021 · 13 min · rick