Last updated 27 November 2026
Annoying new industry terms that people assume you know. A really good video: https://www.youtube.com/watch?v=hBzUokVYQkI
TTFT: Time to first token. This is typically a round trip, so includes network and processing latency, but the interesting thing here is that it’s time to the first token output from the llm. That then includes loading the user’s prompt into memory so it can be submitted to the GPU to run against the model (“Prefill”).
Prefill: The time taken between the prompt being submitted to the engine (vLLM or whatever) and the engine spitting out the first token. A prompt typically starts with a ‘wait’ and then starts spitting out tokens quite quickly. This wait is the pause and it’s the time it takes the system to load everything into memory and start to iterate. Imagine the prompt is like ‘read this 100 page document’, that takes a long time to load.
The work the model does is to tokenise the input and then generate QKV vectors for the tokens. This first one takes long because it needs to do that for allll input tokens. After the prefill, each pass only generates a single new token, and QKV vector for that single new token are calculated so the math is much simpler. If you don’t know what a QKV vector is, it’s a long story, go look it up. The point of each LLM ‘pass’ is in part to calculate QKV vector of a new token. But it’s more than that, don’t get tooooo hung up on those values, QKV is a took not an end goal. The end goal is to use that info to predict the next token. Only God and the authors of the transformer paper know how it does that.
Decode (sometimes “generation”): Everything after the Prefill, this is when the generation loop is running. An LLM produces a single token at a time, so the model technically has to be loaded in to the GPU memory and the entire prompt (which is every single token up until now) injected again for every single token. So, the output speed bottleneck is typically the time it takes to load the model from mem.
QKV Vectors: The result of running Attention on input tokens in a Transformer architecture. Query/Key/Value are each vectors that essentially place a token into a kind of search space and help the model to mathematically understand which tokens are semantically similar or related to each other. For example, the ‘Value’ vectors for King and Queen (and probably the Query and Key vectors) are very likely closely aligned. We can do dot products between vectors to see how ‘similar’ they are. Weird shit yo. Conceptually what each vector contains:
it, then the query vector might be ‘what does it refer to in this context?’cat might be “thing, noun”, and the query for it might be “looking for noun”. Then cat matches the ‘query’ of it.cat may be ‘a cute cat’ (note, cute was learned from the token before cat. I don’t think the value of cat can contain black because that token comes after cat)KV Store: A place to keep work already done. Every token is processed individually, and all the tokens processed so far are stored in a ‘KV Store’ (this stores the QKV vectors, not to be confused with the ‘serverless’ KV store that just allows tenants to store arb data). This is so that the engine only has to recalculate for the newest single token on each ‘round’. What this means, conveniently, is that KV stores are prefix-matchable. If two queries come in:
Activation function:
(or: sigmoid function, softmax, …) This is a function that is used to ‘squish’ another number x into the range [0,1]. The point of this is to take a solution space of (-∞, ∞) and map it into the range that is required by our neural network input.
It’s an ‘actvation’ function because once it is applied it kind of shows ‘how activated’ a value makes a given neuron. 1 being fully activated and 0 being dormant.
The biological equivalent is a little unclear to me but 3b1b explains it that a neuron can only encode values between 0 and 1 (on or off) and the sigmoid function (just one example but it’s commonly used as a placeholder for any of these ‘activation’ functions) squashes the output of a neuron to somewhere in this range.
ReLU is also an example of an activation function, but does not map onto the range [0,1], but rather [0,∞].
ReLU:
A nonlinear function that’s commonly used to normalise an input. If the input x <= 0, the output is zero. If the input x > 0 the output is x. This is useful for reasons.
Temperature: An arbitrary constant that is added to the softmax activation function which has the effect of increasing randomness (I think). Basically, softmax’s point is to map a vector of integers onto a vector of 0..1 values, and it does it in such a way that makes higher values significantly more likely to be very close to 1. And does it so that all the normalised numbers add up to exactly 1 (because it’s converting the vector into a probability set). Effectively, when Temperature is larger, you give more weight to the ‘lower’ values and increases the chance they are chosen. Distribution is a bit more uniform. Low temperature = pretty predictable model, high temperature = very stochastic model.
Embedding matrix: These are the (pre-trained) vectors that represent the entire input set of tokens. When generating text, the input tokens are initially ‘looked up’ in this embedding matrix, and the token -> vector transformation is made.
Unembedding matrix: Basically the opposite. Once the vector for the next predicted token is calculated, the unembedding matrix is used to convert it from vector -> token. I believe this is basically the inverse of the embedding matrix.
For some reason I started using the word ‘phrase’ here to refer to an input set of tokens. It’s kind of a nice word so I’m keeping it but it bears explaining.
Attention: Attention is the process by which we update the ‘meaning vector’ of a given token embedding based on the ‘meaning vectors’ of the tokens around any given token in a phrase. 3b1b describes this process as different tokens having a ‘direction’ in space and the attention step essentially trying to refine the direction to one that is more appropriate given the context of this token within the phrase.
Transformer: Attention is a single ‘step’ where tokens in a phrase share meaning with each other. The transformer describes a set of steps (including an attention step) which is the basis of our big ol LLM models today. For example a transformer describes (WARNING: MASSIVE OVERSIMPLIFICATION):
Feed forward: The step whereby input is fed through a ‘normal’ neural network to produce some output. So called feed forward because it isn’t recurrent or anything fancy, we just pass through once. This is used as a step in the transformer architecture after the attention heads have run. Every Layer has its own pretrained feed-forward neural net. The neural net is sometimes caled Multilayer Perceptrons (MLP).
Attention Head (specifically, a “Self” Attention Head): A single trained model contains many of these. A head refers to a QKV matrices, and a model trains up a number of these. You can think of each head as kind of a ‘question’ that is asked of the token set. Like:
Layer: In the ‘loop step’ of the transformer, each iteration is called a Layer. A Layer just contains the Attention step (running all the heads), followed by the feed-forward step. The output of one layer is fed into the next layer. Conceptually, we do many ‘layers’ because each single layer updates a token vector based on more and more refined information (refined by the previous layer!). So the heads ask a bunch of questions to uncover better understanding, and we do that multiple times based on the updated information. Typically however the attention heads and feed-forward networks are not shared between layers. However there is research on whether shared attention heads (and I assume neural nets) are usable, it seems like they are slightly worse generally speaking than individually trained heads/nets per layer. I guess in a sense, the questions you want to ask at each layer are different, the first layer may have a head that asks “what noun do I refer to” and the last layer should probably ask “what is the next word?”. Doing it this layered looped way allows the transformer to ask gradually more high level questions in later layers, and the early ones should ask very low-level/low-context questions. So different ones kinda makes sense? Idk, it’s hard.