PinnedSrivatsa Narasimha·Jun 5, 2025Why is Attention divided by √dₖ: The Secret Behind Scaled Attention in TransformersDiscover why attention is scaled by √dₖ in Transformers. Dive into the math, intuition, and role of softmax in self-attention.A response icon1A response icon1
Srivatsa Narasimha·Nov 8AI Agents from Scratch, Part 5: Short-Term MemoryIf you have spent a long afternoon with a coding assistant, you have probably met this moment. Early on you told it that it must never…
Srivatsa Narasimha·Nov 4AI Agents from Scratch, Part 4: PlanningIf you have used a coding assistant this year, you have probably met plan mode. You ask for a feature and, before a single file changes…
Srivatsa Narasimha·Nov 3AI Agents from Scratch, Part 3: ReActIf you have watched an AI agent write code, you have seen the little lines it prints between tool calls: "The test imports a helper I have…
Srivatsa Narasimha·Nov 1AI Agents from Scratch, Part 2: Tool CallingHow do AI agents call tools? Build LLM tool calling from scratch in Python, with JSON schemas, validation and errors the model can fix.A response icon2A response icon2
Srivatsa Narasimha·Oct 29AI Agents from Scratch, Part 1: An Agent Is a LoopEverything has the word "agent" stapled to it this year. Your code editor has an agent, your browser has an agent, and I am fairly sure my…
Srivatsa Narasimha·Oct 24Attention Is Not All You Need: How FNet Swapped It for a Fourier TransformWhat if attention is mostly mixing? FNet replaces it with a Fourier transform, keeps 92% of BERT, and trains 80% faster on GPUs.A response icon1A response icon1
Srivatsa Narasimha·Oct 23Part 3: Attention with Linear Biases (ALiBi) - A Deep, Intuitive, and Mathematical ExplanationBLOOM, the 176-billion-parameter open multilingual model, has no positional embeddings at all. Neither does MPT-7B, whose StoryWriter…A response icon1A response icon1
Srivatsa Narasimha·Oct 23Part 2: Rotary Positional Embeddings (RoPE) - A Deep, Intuitive, and Mathematical ExplanationIf you have used LLaMA, Qwen, Mistral or almost any open-weight language model released recently, every attention layer you ran was…A response icon1A response icon1
Srivatsa Narasimha·Oct 23Part 1: Positional Embeddings in Transformers - A Deep, Intuitive, and Mathematical ExplanationTransformers power almost every modern NLP model, yet one of their most critical components is often glossed over, positional embeddings!A response icon1A response icon1