Learning path

LLM Inference Systems

Understand the memory, scheduling, decoding, and hardware tradeoffs that make LLM serving fast or painfully expensive.

Intermediate23 lessons135 min
Start first article
Path outcome

What this path gives you

You can reason about long context cost, KV cache pressure, PagedAttention, speculative decoding, and model-specific silicon.

1
What Problem Did Language Models Try to Solve?

Before transformers, KV cache, and GPU serving, language models had a smaller job: look at context and predict what text should come next.

AI Engineering / 5 min read
2
What Came Before Transformers?

Transformers were not the first attempt to model language. They arrived after rules, n-grams, recurrent networks, LSTMs, seq2seq models, and attention exposed the same bottleneck: sequence processing was too slow and too forgetful.

AI Engineering / 6 min read
3
Why N-Gram Models Hit a Wall

N-gram models were useful because they turned language into counts. They failed because a fixed local window cannot remember distant context, understand meaning, or generalize well to unseen phrases.

AI Engineering / 6 min read
4
Why RNNs Process Text Sequentially

RNNs improved on local n-gram counting by carrying a hidden state through the text. The tradeoff was dependency: token 10 cannot be processed until token 9 has updated the state.

AI Engineering / 6 min read
5
Why LSTMs Were Better Than Plain RNNs

Plain RNNs rewrote one hidden state at every step. LSTMs added gates and a cell state, giving the model a cleaner path for preserving useful information over longer spans.

AI Engineering / 6 min read
6
Why Sequence Models Struggled With Long Context

RNNs and LSTMs gave language models memory, but that memory still had to pass through one step after another. Long context made useful clues fade, compete, and arrive too slowly.

AI Engineering / 6 min read
7
What Problem Did Attention Solve?

Attention changed the sequence-model bottleneck. Instead of forcing every old clue through one running state, it let the model look back and score which earlier tokens mattered now.

AI Engineering / 6 min read
8
What Is Self-Attention?

Self-attention is attention applied inside one sequence. Each token builds a better representation by comparing itself with the other tokens in the same input.

AI Engineering / 6 min read
9
Why Self-Attention Can Look at Every Token

Self-attention changed the shape of sequence processing. Instead of moving one state through the text step by step, it builds token-to-token scores for the whole sequence with matrix operations.

Article / 6 min read
10
What Is a Transformer?

A transformer is a stack of repeated blocks that use self-attention, small neural networks, residual paths, and normalization to turn token vectors into context-aware predictions.

Article / 6 min read
11
Why Transformers Replaced RNNs for Language Modeling

Transformers replaced RNNs because they gave tokens shorter paths to context and gave training hardware a more parallel shape. The tradeoff was higher attention cost.

Article / 6 min read
12
What Are Embeddings?

Embeddings turn tokens into learned vectors. The vector is not a dictionary definition; it is a set of numbers the model can use as the starting point for computation.

Article / 6 min read
13
Why Transformers Need Positional Information

Self-attention can compare tokens, but attention alone does not know their order. Transformers need positional information so the same tokens in different positions can mean different things.

Article / 6 min read
14
What Are Query, Key, and Value Vectors?

Query, key, and value vectors are three learned views of the same token representation. Attention uses queries and keys to decide what matches, then mixes values to carry information forward.

Article / 6 min read
15
Why Attention Uses Q, K, and V

Attention separates matching from information flow. Queries and keys decide which tokens are relevant, while values carry the information that gets mixed into the updated token representation.

Article / 6 min read
16
What Is Multi-Head Attention?

Multi-head attention runs several learned attention views in parallel. Each head uses its own projections, then the model combines the results into one updated token representation.

Article / 6 min read
17
Why Multiple Attention Heads Help

Multiple attention heads help because one token may need several kinds of context at the same time. Heads give the layer several learned ways to score and mix tokens before the results are combined.

Article / 6 min read
18
What Is a Feed-Forward Network in a Transformer?

After attention lets tokens exchange context, the feed-forward network works on each token separately. It is the per-token thinking step inside a transformer block.

Article / 6 min read
19
Why Transformers Use Residual Connections

Residual connections let a transformer layer add a transformation without forcing the original representation through a narrow gate. They preserve a route around attention and feed-forward steps.

Article / 6 min read
20
The Hidden VRAM Bill Behind Long Context

VRAM planning for LLMs is not just about model weights. Long context windows can make the KV cache as expensive as the model itself.

AI Engineering / 5 min read
21
The Memory Trick Behind Fast LLM Serving

Bigger GPUs help, but fast LLM serving is mostly a scheduling and KV cache problem. PagedAttention, block allocation, batching, and prefix caching decide how much useful work fits in memory.

AI Engineering / 6 min read
22
How Speculative Decoding Makes LLMs Feel Faster

Speculative decoding speeds up LLM inference by letting a cheap draft model guess several tokens, then asking the expensive target model to verify those guesses in one parallel pass.

AI Engineering / 6 min read
23
17,000 Tokens per Second, Burned Into Silicon

If language models can be compiled directly into silicon, inference stops looking like software running on a GPU and starts looking like the computer itself.

AI Engineering / 5 min read
Menu
LLM Inference Systems | Decipher Engineering