Inside AI Models
Articles
Tutorials, experiment logs, and deep-dives on how AI models work.
Working Effectively with Claude Code — Part 2: Agents, Subagents & Multi-Agent Setups
When to stop doing everything in one session and delegate: what subagents are, how to brief and build them, and how to run several Claudes in parallel without them stepping on each other.
BPE (Byte Pair Encoding): What It Is and Why It Matters for LLMs
How do models like GPT understand words they never saw during training? We start from the two extremes — word-level and character-level tokenization — and build BPE (subword tokenization) from scratch, in code.
Working Effectively with Claude Code — Part 1: Context, Skills & Prompting
A practical guide to getting real value out of Claude Code: how it sees your project, using skills, and prompting well — plus the context tricks that keep long sessions sharp.
Building GPT From Scratch: A Step-by-Step nano-gpt Walkthrough
I built a character-level, decoder-only Transformer in pure PyTorch — tokenizer, self-attention, multi-head, residual blocks, and autoregressive generation — following Karpathy's lecture and adding cosine LR, early stopping, and W&B tracking. Here is the whole build, step by step.
About This Blog
A short introduction to why I started this journal, what kind of writing you'll find here, and why writing is an inseparable part of learning.
What Is a Tensor? Linear Algebra for Deep Learning
We build the ladder from scalars to tensors, make the case that shape is the concept to track, and show why a neural network layer is really just linear algebra in disguise.
Attention, Explained from Scratch
We build the mechanism at the heart of modern language models around a single intuitive question, working from query, key, and value vectors through softmax to why attention changed everything.
How Gradient Descent Actually Works
The optimization loop behind every trained model, built from a hill-and-fog analogy through derivatives, learning rate, and backpropagation — no calculus prerequisite required.
Why Identity-Aware Negative Sampling Matters
In multimodal deepfake detection, a contrastive loss is only as good as its negatives. We examine why random batching misses the critical negatives and how identity-grouped sampling repairs it.