ML Blog

Welcome to my research blog โ€” structured like a library of books. Each book covers a major AI topic; every chapter is a short, self-contained post you can read in 3โ€“5 minutes. Start with the Start Here overview of any book, then dive into whichever chapters interest you most.

โ˜… My papers Gold cards mark posts directly tied to my own research papers and companion explainers.
๐Ÿค–

Book I โ€” Transformers

From the attention mechanism to GPT, BERT, ViT, and beyond

Start Here ยท Overview

Transformers: The Architecture That Changed AI

A self-contained guide to the Transformer โ€” the engine behind GPT, BERT, and modern AI. Learn how attention replaces recurrence and why every major AI system uses it.

๐Ÿ“– 5 min read The complete picture in one post
๐Ÿงฉ Core Components
๐Ÿงฉ

The Transformer Block: Putting It All Together

A single Transformer block combines attention, residuals, layer norm, and an FFN into one reusable uni...

โฑ 5 min transformer-blockarchitecture
๐Ÿง 

Feed-Forward Networks: The Forgotten Half of Transformers

The FFN block holds two-thirds of a Transformer's parameters and does most of its factual recall. Yet ...

โฑ 5 min FFNMLP
โž•

Residual Connections: Why Transformers Can Be Deep

Without residual connections, training a 96-layer Transformer would be practically impossible. The ski...

โฑ 4 min residualskip-connections
๐Ÿ“Š

Layer Normalization in Transformers

Layer norm is not optional plumbing. It determines training stability, gradient flow, and whether deep...

โฑ 4 min layer-normbatch-norm
๐Ÿ›๏ธ

Encoder vs Decoder vs Encoder-Decoder Transformers

BERT, GPT, and T5 are all Transformers โ€” but their architectures are fundamentally different. One comp...

โฑ 5 min BERTGPT
๐Ÿ”—

Cross-Attention: How Models Attend to Another Sequence

Cross-attention lets one sequence query information from a completely different sequence. It is the br...

โฑ 4 min attentioncross-attention
๐ŸŽญ

Attention Masks: Causal, Padding, and Bidirectional

The difference between GPT, BERT, and T5 is largely a masking decision. Learn how causal, padding, and...

โฑ 5 min attentionmasking
๐Ÿ”

Query, Key, Value: The Intuition Behind QKV

Q, K, and V are not arbitrary labels. They map precisely onto search queries, database labels, and ret...

โฑ 4 min attentionQKV
โš–๏ธ

Scaled Dot-Product Attention: Why the โˆšd Matters

Dividing by โˆšd_k is not just a trick โ€” it prevents softmax from saturating and dying in high-dimension...

โฑ 4 min attentionscaling
๐Ÿ‘๏ธ

Multi-Head Attention: Many Eyes on the Data

One attention head sees one relationship. Multiple heads running in parallel let the model capture syn...

โฑ 4 min attentionmulti-head
๐Ÿ”

Self-Attention: Teaching Machines to Focus

Self-attention is the core of every Transformer. Learn how Query, Key, and Value vectors let every tok...

โฑ 4 min attentionmechanism
๐Ÿ“ Positional Encodings
๐Ÿ”‘

GAPE: Remember to Forget โ€” Gated Adaptive Positional Encoding

GAPE is a drop-in RoPE augmentation that adds content-aware attention logit biases: a query-gate suppr...

โฑ 8 min positional-encodingrope
๐Ÿ”ญ

LongRoPE: Extending Context to 2 Million Tokens

LongRoPE (Microsoft, 2024) pushes RoPE-based context to 2M tokens by searching for optimal per-dimensi...

โฑ 5 min RoPELongRoPE
๐Ÿงถ

YaRN: Yet Another RoPE Extensionn Method

YaRN combines NTK scaling for high-frequency dimensions with linear interpolation for low-frequency on...

โฑ 5 min RoPEYaRN
๐Ÿ“ก

NTK-Aware Scaling: Extending Context Without Fine-Tuning

NTK-Aware Scaling extends the context window of RoPE-based models by rescaling frequencies using Neura...

โฑ 5 min RoPENTK
๐Ÿ“

ALiBi: Attention with Linear Biases

ALiBi skips traditional positional embeddings entirely and just subtracts a distance penalty from atte...

โฑ 3 min positional-encodingalibi
๐Ÿ”„

RoPE: Rotary Position Embeddings

RoPE encodes position by rotating query and key vectors by an angle proportional to position. The clev...

โฑ 5 min positional-encodingrope
โ†”๏ธ

Relative Positional Encodings: It's All About Distance

Instead of asking 'where am I?', relative PEs ask 'how far are these two tokens apart?' Shaw et al. an...

โฑ 4 min positional-encodingrelative
๐ŸŽ“

Learned Positional Encodings: Data-Driven Position

Instead of a fixed formula, why not just train position embeddings from scratch โ€” like word embeddings...

โฑ 3 min positional-encodinglearned
ใ€ฐ๏ธ

Sinusoidal Positional Encodings: The Original Solution

The PE method from the 2017 'Attention Is All You Need' paper uses sine and cosine waves at different ...

โฑ 4 min positional-encodingsinusoidal
๐Ÿ“

Positional Encodings: Why Position Matters

Transformers see all tokens at once โ€” which means without help they'd treat 'cat ate mouse' and 'mouse...

โฑ 4 min positional-encodingoverview
๐ŸŒŠ

FoPE: Fourier Position Embedding for Length Generalization

FoPE rethinks long-context positional encoding from a frequency-domain perspective. Instead of only st...

โฑ 5 min FoPEpositional-encoding
๐Ÿชœ

Position Interpolation: Extending RoPE with Minimal Fine-Tuning

Position Interpolation rescales positions before applying RoPE so a model trained on short contexts ca...

โฑ 5 min RoPEposition-interpolation
๐Ÿงญ

XPos: Length-Extrapolatable Rotary Embeddings

XPos modifies RoPE with a multiplicative decay that keeps relative rotations while stabilising magnitu...

โฑ 4 min XPosRoPE
๐ŸŒ€

p-RoPE: What Makes Rotary Positional Encodings Useful?

This paper does two things at once: it explains what RoPE is really doing inside a trained LLM, and it...

โฑ 5 min p-RoPERoPE
๐Ÿ•ธ๏ธ

Book II โ€” Graph Neural Networks

Graphs, spectral theory, and learning architectures for relational data

Start Here ยท Overview

Graph Neural Networks: Learning on Graphs

Graphs are everywhere โ€” molecules, social networks, road maps, knowledge bases. Graph Neural Networks learn from this relational structure by propagating information between connected nodes. Here's the compl...

๐Ÿ“– 5 min read The complete picture in one post
๐Ÿ“Š Graph Fundamentals
๐Ÿ—๏ธ Architectures
๐Ÿ“จ

Message Passing: The Universal GNN Framework

Every GNN โ€” GCN, GAT, GraphSAGE, GIN โ€” is a special case of message passing. Learn the three-step loop...

โฑ 4 min message-passingmpnn
๐Ÿ”ต

GCN: Graph Convolutional Networks

GCN (Kipf & Welling, 2016) is the 'hello world' of GNNs. It simplifies spectral graph convolution into...

โฑ 4 min gcnspectral
๐ŸŽฏ

GAT: Graph Attention Networks

GCN assigns the same (degree-based) weight to every neighbour. GAT learns which neighbours actually ma...

โฑ 4 min gatattention
๐ŸŒ

GraphSAGE: Inductive Learning on Large Graphs

GCN and GAT learn embeddings for fixed graphs โ€” add a new node and you're stuck. GraphSAGE (Hamilton e...

โฑ 4 min graphsageinductive
โšก

GIN: Graph Isomorphism Network โ€” The Most Expressive GNN

How powerful can a GNN be? Xu et al. (2019) answered with a theoretical bound โ€” and GIN is the archite...

โฑ 5 min ginexpressiveness
๐Ÿ“

ChebNet: Spectral Graph Convolutions via Chebyshev Polynomials

ChebNet avoids the expensive full eigendecomposition by approximating spectral filters with Chebyshev ...

โฑ 5 min ChebNetspectral
โšก

SGC: Simple Graph Convolution

SGC removes all nonlinearities between GCN layers and collapses the entire propagation into a single p...

โฑ 4 min SGCsimple
๐Ÿ“Š

APPNP: Personalized PageRank Meets Graph Neural Networks

APPNP decouples feature transformation from propagation. A neural network transforms features first; t...

โฑ 4 min APPNPPageRank
๐ŸŒ

Graph Transformers: Bringing Attention to Graphs

Graph Transformers replace or augment local message passing with full pairwise attention โ€” every node ...

โฑ 5 min graph-transformerattention
๐Ÿ†

Graphormer: Transformers with Structural Biases for Graphs

Graphormer encodes graph structure directly into Transformer attention via three biases: node centrali...

โฑ 5 min Graphormergraph-transformer
๐Ÿ“ฌ

MPNN: The General Message Passing Neural Network Framework

The MPNN framework (Gilmer et al., 2017) unifies GCN, GAT, GIN, GraphSAGE, and almost all spatial GNNs...

โฑ 5 min MPNNmessage-passing
๐Ÿ”ฌ Expressivity & Limitations
๐Ÿ“ Graph Positional & Structural Encodings
๐Ÿงบ Pooling & Graph-Level Learning
๐ŸŽจ Heterogeneous & Relational Graphs
๐ŸŒŠ Dynamic & Temporal Graphs
๐Ÿ”ฎ Geometric & Equivariant GNNs
๐Ÿš€ Applications
๐Ÿ”บ

Book IV โ€” Topological Deep Learning

From simplicial complexes and homology groups to barcodes, stability theorems, and TDA for machine learning

๐ŸŽฎ

Book V โ€” Reinforcement Learning

From MDPs and Bellman equations through deep RL, policy gradients, model-based methods, MARL, and RLHF

๐Ÿค–

Book VI โ€” Learning-Based Robotics

From kinematics and sensors through SLAM, imitation learning, sim-to-real, diffusion policy, and foundation models

๐ŸŽจ

Generative AI & Style Transfer

Diffusion models, latent manipulation, style alignment, and controllable generation.