Works on My GPU

ML & AI

LLMs, NLP, computer vision, and general ML research.

Deep DiveArchitecture

Grouped-Query Attention: Shrinking the KV Cache Itself

PagedAttention changed how the KV cache gets allocated. Prefix caching changed whether it has to be recomputed at all. Neither touches how big it is per token in the first place. Grouped-query attention is the lever that does.

Read more →·Beyzanur Zeybek
Deep DiveArchitecture

Mixture of Experts: How Sparse Models Save Compute

Every post in this section's Foundations series described one dense feed-forward network every token has to pass through. Mixture of Experts replaces that one FFN with dozens, and routes each token through only a couple of them — decoupling how much a model knows from how much compute each token actually costs.

Read more →·Beyzanur Zeybek
FoundationsAttention

RoPE: How Rotary Position Embeddings Actually Work

How the Transformer Actually Works left one sentence unexplained: most modern LLMs moved on from sinusoidal position encoding to something called RoPE. The trick behind it is almost mechanical — rotate the query and key vectors by an angle proportional to position, and relative position falls out of the dot product for free.

Read more →·Beyzanur Zeybek
FoundationsMultimodal

CLIP: Connecting Text and Images in One Embedding Space

The last three posts built a text encoder and an image encoder separately. CLIP's entire contribution is refusing to keep them separate: train both at once so a caption and its matching image land at the same point in a shared embedding space, and classification falls out for free.

Read more →·Beyzanur Zeybek
FoundationsVision

Vision Transformers: Attention for Images

Split an image into patches, treat each patch as a token, and feed the sequence into the exact same Transformer encoder from the NLP posts on this blog. No convolutions, no vision-specific architecture — just enough data to make up for what CNNs get for free.

Read more →·Beyzanur Zeybek
FoundationsNLP

Tokenization: How Text Becomes Numbers

The previous post started from 'token embeddings' without saying where tokens come from. Byte-Pair Encoding builds a vocabulary by repeatedly merging the most frequent adjacent pair — a small, mechanical rule that ends up deciding how expensive every prompt is.

Read more →·Beyzanur Zeybek
FoundationsAttention

How the Transformer Actually Works

Self-attention, in one formula: softmax(QKᵀ/√d_k)V. Everything else in the Transformer — multi-head splitting, positional encoding, the residual stack — exists to make that one computation usable at scale.

Read more →·Beyzanur Zeybek