Skip to the document
Madhuopen lab
Outcome School · Transformers and architecture13 min read

by Amit Shekhar · 29 May 2026

Self Attention in Transformers

Self Attention in Transformers. We will understand what it is, how it works step by step, and why it is the heart of modern Large Language Models like BERT and GPT.

2,449 words#llm#ai#machine-learning3 recall cards

Self Attention in Transformers
Read on Outcome School ↗then come back to lock it in
Before you read, guess

How should one approach mastering KV cache compression techniques?

Ten seconds, a guess, then read — a wrong guess still makes the answer stick.

What this article covers

  1. What is Self Attention?
  2. Why do we need Self Attention?
  3. Query, Key, and Value vectors
  4. Step-by-step working of Self Attention
  5. A simple example walk-through
  6. Why Self Attention works so well
  7. Multi-Head Self Attention
  8. Where Self Attention is used

The article lives on outcomeschool.com. Read it there, then come back: the tutor in the margin has read it and will answer questions, and the questions below check what stayed.

Before you go

In one sentence, what was this chapter about?

From memory, without scrolling up. Writing it is what makes it yours; the grade is only to show you what you had.

How sure?