Machine learning papers, translated into code you can break on purpose.
For engineers who ship models, not for researchers.
def attention(query, keys, values):
scores = [dot(query, k) for k in keys]
weights = softmax(scores)
return sum(w * v for w, v in zip(weights, values))
That's the beating heart of Attention Is All You Need. Three lines. Every paper here gets the same treatment: the idea as a function you could set a breakpoint in, real output from running it, and a short list of things to break so you can watch what fails.
ai-ml/
-
Attention Is All You Need
Attention is a dictionary lookup with fuzzy keys — everything else is plumbing. Runnable NumPy, four demos that prove it by breaking it.
-
KV caching and the generation loop
Why inference is affordable. A direct consequence of the causal mask that nobody explains properly.
-
LoRA: low-rank adaptation
Fine-tuning without touching the base weights.
Who writes this
Srinivasan Nagaraja Rao. AI engineer. I ship code and models for a living, and I'm learning this field in public — including the parts where the maths scares me.
I'm not a researcher. I'm a programmer. When I read a machine learning paper, I don't want the proof — I want to know what it would look like as a function I could put a breakpoint in. So that's how I write these up.
Why "for dummies"
Because most paper explainers are written by people who are comfortable with the maths, aimed at people heading toward research. That's a real audience. It just isn't mine.
Mine is the engineer who has shipped models, done the MLOps, and still feels like a fraud when someone opens a paper. I'm writing these from inside that exact confusion, while I still remember what was confusing.
The method: translate the idea into code you already understand, then deliberately break it and watch what fails. You debug for a living. Reverse-engineering from broken behaviour is faster than re-reading section 3.2 for the fifth time.