MENU

Understanding AI Chips | Learn Semiconductors, Introduction 1-3 Supplement

Home > Learn Semiconductors > Introduction 1-3 Supplement
BeginnerLearn Semiconductors · Part 1 Introduction · 1-3 Supplement · Back to all lessons

SEMICONDUCTOR FRONT-END · INTRO 1-3 SUPPLEMENT

Understanding AI Chips
From the maths of training
to the hardware of inference

Why does AI need so much computing power, and why can memory matter more than arithmetic? The answer starts with a few simple operations. A language model represents its input as lists of numbers, transforms those lists using learned weights, and calculates probabilities for the next token. Training adjusts the weights; inference uses them. This supplement follows that calculation step by step, then connects it to parallel compute circuits, memory capacity, memory bandwidth and links between chips.

Semiconductor Front-End Series · Intro 1-3 Supplement · Level ★★☆
Suggested background: Intro 1-3 · Updated 8 November 2026

How to read this lesson

Reported identifies information stated in the cited source, including attributed company estimates; Calculation identifies an estimate worked out in this lesson; Outlook marks forecasts and roadmap requirements; Interpretation marks an illustrative judgement. Standard physical explanations are generally untagged. Figures are schematic and not to scale. Numbered links lead to the supporting sources.

What you will learn
  • Explain a language model's main calculations using vectors, dot products and matrices.
  • Distinguish training from inference, and prefill from decoding.
  • Connect those differences to compute throughput, memory capacity, memory bandwidth and communication between chips.

1. Three ideas to keep in mind

  • A language model transforms numbers to predict a continuation. Tokens become vectors. Learned matrices transform those vectors, while attention mixes information from the context. The final result is a probability distribution over the next token.
  • Training changes the numerical rules. It calculates predictions, evaluates a loss, works out gradients and updates the parameters. Training needs substantial arithmetic, space for more than just weights, and communication when work is spread across chips.
  • Inference uses the rules, but its workload changes along the way. Prefill processes the available input together. Standard decoding then extends each request token by token. For a dense model with a small batch, repeatedly reading weights can make memory bandwidth more important than peak arithmetic throughput.
Keep three roles separate
  • Vectors represent information being processed. Contextual representations change with the input and as they move through the model.
  • Weights are learned numerical rules for transforming that information. They are normally fixed during inference. The initial embedding table is itself part of the learned parameters.
  • Memory and compute circuits store the data and perform the arithmetic. Capacity is how much can fit; bandwidth is how much can move each second.

You do not need to master every equation before continuing. Follow the worked examples and ask what can be reused, and what must be moved again. A token is the model's processing unit. It can be a word, part of a word, punctuation or another text fragment; one token does not necessarily equal one word.

2. What do “parameters” and “vectors” mean?

A common explanation says that an LLM turns words into parameters and compares their meanings. That combines several different ideas. Separating them makes the hardware implications much easier to see.

Familiar shorthandA more useful explanation
Words become parametersTokens are mapped to vectors. Parameters are the learned numbers used by the model, including its embedding table and transformation matrices. GPT-3 has about 175 billion parameters [3].
The model compares word meaningsDot products help calculate attention scores and output scores, but these are learned numerical relationships, not simply dictionary similarity.
Comparing similarity is the goalIn next-token generation, the goal is to assign probabilities to possible continuations. Similarity-like calculations are components of that process.

A large part of the work is multiplying values by weights and adding the results. Each operation is simple. The difficulty is doing it at enormous scale and delivering the required data to the circuits quickly enough.

3. Vectors and dot products: a concrete starting point

Representing a token with numbers

An embedding maps a token to a vector: a list of numbers. Real language-model representations can have hundreds, thousands or more components. To see the idea, begin with three invented components.

Suppose, purely for this example, that they describe “living thing”, “pet” and “machine”. These are labels chosen to make the arithmetic understandable. Real embedding components do not come with such human-assigned meanings.

Example wordInvented vector
Dog(0.9, 0.8, 0.1)
Cat(0.8, 0.9, 0.2)
Car(0.1, 0.2, 0.9)

Multiply matching entries, then add

The dot product takes two vectors, multiplies corresponding entries and adds the products:

Dog · Cat = 0.9×0.8 + 0.8×0.9 + 0.1×0.2 = 1.46 Dog · Car = 0.9×0.1 + 0.8×0.2 + 0.1×0.9 = 0.34

Dog and cat score higher in this example because both have large values in the first two components. Calculation If a learned representation places related items in similar directions, dot products can help compare their relationships.

A dot product depends on both direction and magnitude. If vectors have equal magnitudes, more closely aligned directions give larger dot products. To compare direction independently of magnitude, cosine similarity divides the dot product by the product of the two vector magnitudes. Here, magnitude means geometric length, not the number of entries in the list.

Mikolov and colleagues' 2013 word2vec paper discusses useful relationships in learned word vectors, including the well-known king − man + woman ≈ queen example, which it cites from earlier work [1]. Reported This illustrates a property that representations can learn; it is not a claim that every linguistic relationship is a simple vector equation.

From words to vectors and dot products
Figure 1 From words to vectors and dot products (schematic)
Reading the figure

The feature names and values are invented. The arrows illustrate similar and different directions; they do not plot the three coordinates to scale. The two calculations show exactly which numbers are multiplied. Cosine similarity removes the effect of the vectors' magnitudes when comparing direction.

4. A matrix multiplication is a collection of dot products

One row gives one output

A matrix is a rectangular table of numbers. Multiplying a matrix W by a column vector x gives another vector y. Each output is the dot product of one row of W with the whole input vector.

In Figure 2, x = (2, 1, 3). The three rows of W produce:

  • Row 1: 1×2 + 2×1 + 0×3 = 4.
  • Row 2: 0×2 + 1×1 + 1×3 = 4.
  • Row 3: 2×2 + 0×1 + 1×3 = 7.

Thus y = (4, 4, 7). Calculation Many model parameters are entries in matrices like W. As a representation passes through layers, those learned transformations change the information it carries.

Small operations, very large counts

The basic operation is a multiply-accumulate: multiply two numbers and add the result into a running total. A conventional operation count treats that as two operations.

The largest GPT-3 model has a representation width of 12,288 and 96 layers [3]. Reported Multiplying just one 12,288-by-12,288 matrix by a vector involves:

12,288 × 12,288 = 150,994,944 multiply-accumulates

That is about 150 million, before repeating transformations within a layer and across many layers. Calculation

Kaplan and colleagues approximate the main forward-pass work as 2N operations per token, with N representing the relevant parameter count [4]. Reported Substituting GPT-3's total 175 billion parameters for a scale estimate gives about 350 billion operations per token. Calculation

What the 2N and 6N estimates leave out

The cited estimate uses non-embedding parameters and omits context-dependent attention work when it is relatively small [4]. We use total parameter counts here for an approximate sense of scale. Long contexts, mixture-of-experts models that activate only part of their weights, recomputation and implementation overheads can change the actual work. These are useful estimates, not universal operation counts.

Why matrices suit parallel hardware

Different rows can be evaluated independently. One row does not need another row's answer before starting. Hardware can therefore provide many multiply-accumulate units and run them in parallel, provided it can feed them with data.

The original Google TPU included 65,536 eight-bit multiply-accumulate units in its matrix unit [14]. Reported GPUs and other accelerators also exploit parallel arithmetic. The design problem is both how much arithmetic to provide and how to keep the arithmetic units supplied.

Three independent rows, three outputs
Figure 2 Three independent rows, three outputs (schematic)
Reading the figure

Follow one colour at a time. Each row uses the same input vector and produces one output entry. The notation is W × x = y. The values are invented, while the 12,288-width example uses GPT-3's published model width to illustrate the scale.

5. From input text to the next token

Follow one generation step

Many LLMs build on the Transformer architecture introduced in 2017 [2]. A simplified decoder-style generation step works as follows:

  1. Embed the input. Map tokens to numerical representations.
  2. Mix contextual information. Attention calculates which earlier information contributes to a representation.
  3. Transform the result. Learned matrices and other operations process that information.
  4. Repeat across layers. GPT-3's largest model uses 96 layers [3].
  5. Score the vocabulary. The final representation is projected to a score, or logit, for each possible next token.
  6. Convert scores to probabilities. Softmax produces a distribution; a decoding rule selects a continuation.
  7. Append and continue. Use the selected token when calculating the next one. This is autoregressive generation [2][3].

The original Transformer shares weights between its input embedding and its output projection [2]. Reported Weight tying depends on the model. In either case, output scores are learned predictors of continuations, not simply a search for a word with the closest dictionary meaning.

Attention: compare, weight and mix

Consider: “He read the book he bought yesterday. It was interesting.” A representation at “It” may need information from earlier positions, such as “book”. Attention provides a numerical mechanism for mixing contextual information. It does not apply a handwritten rule that pronouns must refer to books.

The original scaled dot-product attention is [2]:

Attention(Q, K, V) = softmax(QKT / √dk) V

Read it as a sequence rather than as one intimidating formula:

  • Q, the query, is a learned projection of the representation at the position seeking information.
  • K, the keys, are learned projections used for matching against that query.
  • Q·K scores, after scaling and masking, are converted by softmax into mixing weights.
  • V, the values, supply the information that is mixed using those weights.

Dividing by √dk helps keep large dot products from pushing softmax into an unhelpfully extreme regime. The paper also notes the efficiency of implementing dot-product attention with optimised matrix multiplication [2]. Reported

Producing one token, then continuing
Figure 3 Producing one token, then continuing (schematic)
Reading the figure

The probabilities and token boundaries are invented. The example word “interesting” is a readable label, not a claim about a particular tokenizer. Real layers also include normalisation, residual connections and nonlinear operations. The highest-probability candidate is not always selected: decoding settings matter. The 96-layer label refers to GPT-3, not every LLM.

Inside attention: matching is followed by mixing
Figure 4 Inside attention: matching is followed by mixing (schematic)
Reading the figure

The 10%, 10% and 80% weights are invented. They are not the raw dot products, and they are not next-token probabilities. These input-dependent attention weights are also different from stored model parameters. Learned matrices generate Q, K and V; multiple attention heads can capture different relationships. A causal mask prevents a position from using future tokens.

6. Training changes the weights

Learn from a continuation, rather than writing every rule

During autoregressive pretraining, a model sees part of a training text and predicts what comes next. Its prediction is compared with the token that actually follows in that text. A common loss is the negative logarithm of the probability assigned to that target: a low target probability gives a high loss.

Imagine the prompt “The sky is”, with “blue” as the training-text continuation. If the model assigns “blue” only 20%, the loss signals that this prediction needs improvement. It does not mean “blue” is the only possible continuation in every context.

Training aims to reduce this loss over many examples. Viewed mathematically, loss is a function of the parameters, and the task is to find better parameter values. A gradient describes how loss changes as a parameter changes. Moving against the gradient is like taking a downhill step, although a real optimisation landscape has many dimensions and offers no guarantee of reaching a global minimum.

Backpropagation finds the gradients efficiently

Rumelhart, Hinton and Williams' 1986 paper describes adjusting connection weights to reduce differences between actual and desired outputs [5]. Reported Backpropagation applies the chain rule through the network, working from the output towards earlier layers to calculate parameter gradients efficiently.

A typical training step has four parts:

  1. Forward pass: calculate predictions using the current weights.
  2. Loss: compare those predictions with the training targets.
  3. Backward pass: calculate gradients through the layers.
  4. Update: use an optimiser to adjust the parameters.

Kaplan and colleagues estimate the backward pass at roughly twice the forward-pass work. The main arithmetic is therefore about 2N + 4N = 6N operations per training token, roughly three times the forward-only estimate [4]. Reported The optimiser update and other work are not being counted as a separate large term in that approximation.

For GPT-3, using 175 billion parameters and 300 billion training tokens [3]:

6 × 175 billion × 300 billion ≈ 3.15 × 1023 operations

This agrees closely with the paper's reported 3.14 × 1023 FLOPs [3]. Calculation Even at one trillion operations per second, that represents roughly 10,000 years of arithmetic. Calculation

Meta reports 405 billion parameters, 15.6 trillion training tokens and 3.8 × 1025 FLOPs for its largest Llama 3 model [8]. Reported That reported compute is more than 100 times GPT-3's. Calculation

Forward pass, loss, backward pass and update
Figure 5 Forward pass, loss, backward pass and update (schematic)
Reading the figure

The target comes from the training text. The backward pass calculates gradients; it does not generate a second response. The displayed probabilities are invented, and 2N, 4N and 6N are approximate counts of the main matrix work. An update aims to improve the loss, but a single step need not find the correct prediction or a minimum.

7. What training requires from hardware

Parallel compute and reuse

Training usually processes many token positions and examples together. A weight fetched from memory can contribute to many calculations. This raises arithmetic intensity, the amount of arithmetic performed per unit of data transferred. It makes a large supply of parallel compute units valuable, although memory and communication can still constrain the workload.

Space for more than weights

Training stores gradients and optimiser state as well as the weights themselves. The ZeRO paper gives a mixed-precision Adam example requiring 16 bytes per parameter: two bytes for a 16-bit weight, two for a gradient, four for a 32-bit master copy and eight for two 32-bit Adam states [6]. Reported Activations and other working memory are additional.

For a 1.5-billion-parameter GPT-2 model, the paper describes at least 24 GB of model state and explains why the complete training workload does not fit directly into a 32 GB GPU in its example [6]. Reported Multiplying the same state layout by GPT-3's parameter count gives:

16 bytes × 175 billion = 2.8 TB

That excludes activations and workspace. Calculation It is roughly ten times the 288 GB capacity of the Rubin GPU used as a comparison here [13]. Calculation Sharding, state reduction and other techniques are therefore essential at this scale.

Communication across many chips

When parameters or computation are split across accelerators, the devices must exchange intermediate results or gradients. Meta reports using up to 16,000 H100 GPUs, each with 80 GB of HBM3, to train the largest Llama 3 model [8]. Reported

Its reported BF16 model FLOPs utilisation (MFU) was 38-43% [8]. Reported MFU compares useful model arithmetic with the hardware's theoretical peak over time. A gap from 100% can reflect communication, memory traffic, recomputation and other work; it cannot all be labelled idle waiting from this figure alone. Fast interconnects matter because distributing the model also creates communication.

Precision and reliability

Lower-precision values reduce storage and traffic and can enable more efficient arithmetic. Micikevicius and colleagues describe mixed-precision training using 16-bit values together with a 32-bit master copy, reporting memory reductions approaching half in their examples [7]. Reported The saving depends on what is stored and how; it does not mean every optimiser-state layout is automatically halved. Llama 3 used BF16 training [8].

Large-scale training also has to recover from failures. Over a 54-day period, Meta reports 466 interruptions, including 419 unexpected interruptions. About 78% of the unexpected interruptions were attributed to confirmed or suspected hardware problems; GPU issues accounted for 58.7% of that unexpected-interruption total [8]. Reported Reliable hardware and recovery procedures are part of useful performance.

What occupies memory during training and inference?
Figure 6 What occupies memory during training and inference? (schematic)
Reading the figure

The 16-byte layout is one mixed-precision Adam example, not a universal requirement. Activations and workspace are outside that total. The inference KV cache stores past keys and values, not newly learned model weights. Its size depends on sequence length, concurrent requests, KV-head configuration and numerical precision. Capacity and bandwidth measure different things.

8. Inference has two different phases

Forward computation with fixed weights

During ordinary inference, the model uses learned weights without running a training loss, backward pass or parameter update. Its main arithmetic is approximated by the forward-only 2N per token, rather than training's 6N [4]. The smaller operation count does not mean inference is straightforward: serving must also meet latency, throughput and memory requirements.

Prefill: process the input that is already available

The prompt is present at the start. Its token positions can be processed together while retaining a causal mask. This prefill phase makes substantial use of matrix-matrix operations and weight reuse [9][12]. Reported It can keep compute units busy more effectively than small-batch decoding, but is not guaranteed to achieve peak utilisation.

Decode: extend each request in sequence

In standard autoregressive decoding, the next step for a request depends on the token selected at the previous step. Each request therefore advances sequentially. Serving systems can batch different requests; methods such as speculative decoding provide further optimisations beyond this simple picture.

For a dense model and small batch, the main matrix weights are used repeatedly with little reuse per fetched weight. A single request may obtain only one multiply-accumulate, or two operations, from a weight read at that step. Data delivery can then take longer than the arithmetic it enables [9][11][12]. Reported Mixture-of-experts models, where only selected weights are active, require a different traffic estimate.

A timing estimate with matching assumptions

NVIDIA's inference article gives about 14 GB of 16-bit weights for Llama 2 7B [12]. Reported Suppose a single-request decode step reads all 14 GB from HBM, without a cache saving that traffic. Use the Rubin GPU's published 19.2 TB/s bandwidth [13], assuming it is fully achieved. Ignore KV reads and other work. GB and TB use decimal units here.

14 GB / 19.2 TB/s ≈ 0.73 ms

That is the time to move the weights under these ideal assumptions. Its reciprocal is approximately 1,400 tokens/s. Calculation This is a bandwidth-only upper-bound estimate for this scenario, not measured generation speed. Ten times the weight traffic would lower the estimate to about 140 tokens/s. Calculation

Now compare like numerical formats. The main arithmetic estimate is 2N ≈ 14 billion operations. Dividing by the published 4 PFLOPS FP16/BF16 dense peak [13] gives about 0.0035 ms. Calculation A small matrix-vector workload need not reach that peak. The point is the gap between two ideal lower bounds: more arithmetic units alone cannot remove a data-delivery bottleneck. The separate 50 PFLOPS NVFP4 sparse specification is not used as the compute rate for this 16-bit dense example.

KV caches save recomputation, but occupy space

Attention uses keys and values from earlier positions. Recomputing them for every new token would be wasteful, so inference retains them in a KV cache [9]. Reported For a fixed architecture and cache precision, the cache grows with sequence length and concurrent requests.

  • NVIDIA's Llama 2 7B example requires about 2 GB of KV cache for one 4,096-token sequence at 16-bit precision [12].
  • The PagedAttention paper gives about 800 KB per token for OPT-13B, or up to 1.6 GB for a 2,048-token sequence. It identifies memory capacity as a limit on the number of simultaneous requests [10].
  • Pope and colleagues give a 500-billion-parameter-scale example with 512 sequences of length 2,048, requiring 3 TB of KV cache, three times the weight storage in that example [9].

For the Llama 2 7B example, 100 concurrent sequences of 4,096 tokens would use roughly 200 GB of KV cache, in addition to about 14 GB of weights and other allocations. Calculation That is a substantial part of the comparison GPU's 288 GB capacity [13]. It is not a generic cache size for all 7B models.

Batching improves reuse and changes the trade-off

Processing multiple requests together lets one weight read serve more calculations. NVIDIA describes batching as a simple way to improve GPU utilisation [12]. Reported But more concurrent sequences also need more cache capacity. Pope and colleagues distinguish small-batch weight-read bottlenecks from cases where large batches and long sequences make KV-cache traffic dominant [9]. Reported Capacity determines what can fit; bandwidth determines how quickly the data can be delivered.

Prefill and decoding reuse the same weights differently
Figure 7 Prefill and decoding reuse the same weights differently (schematic)
Reading the figure

The small-batch decode example is a common bandwidth-limited case, not a rule for every inference workload. Batching can increase weight reuse during decoding too. HBM is part of the GPU package; arrows represent transfers from memory towards compute circuits. The KV cache contains tensors for past positions, rather than raw output text.

9. What inference requires from hardware

  1. Memory bandwidth. Repeated weight and KV reads make data delivery important. HBM places high-bandwidth stacked DRAM close to the compute chip.
  2. Memory capacity. The model, cache and working data must fit. In the PagedAttention paper's OPT-13B example on a 40 GB GPU, roughly 65% of memory holds weights and around 30% holds per-request state [10]. Reported
  3. Efficient numerical formats. Moving from 16 bits to 8 or 4 reduces raw weight storage and transfer volume to one half or one quarter, before format overheads. Actual speed and output quality depend on quantisation and implementation; traffic reduction does not guarantee a matching speed-up.
  4. Energy efficiency. Horowitz's 2014 examples show that DRAM accesses can cost much more energy than arithmetic [15]. Reported Ratios depend on bit width, operation and technology, rather than being fixed for every chip. Reducing distance and traffic can reduce energy demand.
  5. Response time. Users care how long the first output takes and how quickly later tokens arrive. The inference literature emphasises the difficulty of meeting latency targets for sequential generation [9]. Reported

10. From workload to hardware

AspectTrainingInference: prefillInference: small-batch decode
Main taskForward pass, loss, backward pass and updateProcess available prompt positionsExtend each request sequentially
Approximate main operations per token6N [4]2N2N
Typical matrix workMatrix-matrixMatrix-matrixMatrix-vector, or small-batch matrix work
Common constraintsArithmetic, memory and communicationArithmetic and data deliveryWeight/KV traffic and memory capacity
Hardware prioritiesParallel compute, model-state capacity, fast links and reliabilityParallel compute and reuseBandwidth, capacity and efficient formats

These are representative cases, not fixed classifications. Batch size, context length, architecture and implementation can change the bottleneck.

Workload, bottleneck and hardware response
Figure 8 Workload, bottleneck and hardware response (schematic)
Reading the figure

Follow each column downwards. The middle row explains why a workload becomes difficult before the bottom row identifies a hardware response. More capacity does not automatically mean more bandwidth, and more arithmetic throughput does not automatically solve either problem. Electrical and optical links serve different distances and integration needs.

11. What the maths tells us about AI chips

IdeaHardware implication
Representations are vectors; learned parameters include matrices and embeddingsMany simple numerical operations, applied at scale
Matrix rows and batches expose independent workParallel arithmetic can be valuable when data arrives fast enough
Training calculates gradients and updates parametersMore computation and more stored state than inference
Distributed training exchanges resultsInterconnects and reliability affect useful performance
Small-batch decoding repeatedly reads weightsBandwidth can matter more than peak arithmetic throughput
Longer contexts and more requests enlarge the KV cacheServing needs both capacity and bandwidth
Fewer bits can reduce storage and trafficNumerical efficiency must be checked against quality and implementation

The core arithmetic is familiar: multiplication and addition. What makes AI demanding is the scale, the state that must be retained and the movement of data between storage and computation. The “memory wall”, HBM and chip-to-chip links introduced in Intro 1-3 follow from these workload properties.

12. Check your understanding

  1. What is a model parameter, and how does it differ from a representation of the current input?

    Show answer

    A parameter is a learned numerical value, including matrix weights and embedding-table entries. Contextual representations are intermediate values produced while processing a particular input. The embedding table is a parameter even though a vector selected from it represents an input token.

  2. How does matrix-vector multiplication relate to a dot product, and why can hardware parallelise it?

    Show answer

    Each output entry is the dot product of a matrix row with the input vector. Different rows can be evaluated independently, so separate arithmetic lanes can work on them at the same time if supplied with data.

  3. What does a dot product do inside attention?

    Show answer

    It compares a query with keys. After scaling, masking and softmax, the scores determine mixing weights for the values. Those weights are not the final next-token probabilities or the stored model parameters.

  4. Why is the main training compute often estimated at three times a forward pass?

    Show answer

    The approximation gives about 2N operations per token for the forward pass and about 4N for backpropagation, totalling 6N. It omits some terms and is not a universal count for every architecture or context length.

  5. Why can small-batch decoding be bandwidth-limited?

    Show answer

    A dense model repeatedly reads its main weights but obtains little reuse from each read. The arithmetic enabled by a weight can take much less time than delivering it. Larger batches and different architectures can change this balance.

  6. Why do longer sequences or more concurrent requests increase memory requirements?

    Show answer

    They enlarge the KV cache, in addition to weights and workspace. The exact size also depends on the architecture, KV-head count and numerical precision.

13. Glossary

Token
A unit of text handled by a model; not necessarily a whole word.
Vector
An ordered list of numerical components, with a geometric direction and magnitude.
Embedding
A mapping from a token to a numerical vector, commonly through a learned table.
Dot product
The sum of products of corresponding vector entries; it depends on direction and magnitude.
Cosine similarity
A dot product divided by the product of vector magnitudes, used to compare directions.
Matrix
A rectangular array of numbers that can transform one vector or group of vectors into another.
Parameter or weight
A learned numerical value; parameters include matrix entries, embedding tables and other learned quantities.
Multiply-accumulate
Multiplying two numbers and adding the product to a running total; conventionally counted as two operations.
Transformer
An architecture introduced in 2017 that uses attention and other transformations to process representations.
Attention
A mechanism that calculates matching scores and uses them to mix information from values.
Softmax
A function converting scores into positive proportions that sum to one.
Autoregression
Generating a continuation using earlier input and previously generated tokens.
Loss
A numerical objective describing prediction error; training aims to reduce it over examples.
Gradient
The derivatives describing how the loss changes with model parameters.
Backpropagation
Efficient calculation of gradients by applying the chain rule backwards through the computation.
Mixed-precision training
Training that combines numerical formats, such as 16-bit computation with selected 32-bit state.
Prefill
Processing the available prompt tokens together at the beginning of inference.
Decode
Extending a request through successive generation steps.
KV cache
Stored keys and values for past positions, avoiding their repeated computation during decoding.
Batching
Processing several tokens or requests together to improve reuse and hardware utilisation.
Memory-bound
Constrained by memory behaviour rather than arithmetic; bandwidth and capacity are distinct constraints.
MFU
Model FLOPs utilisation; useful model arithmetic as a fraction of theoretical peak arithmetic over the elapsed time.

14. Primary sources and further reading

  1. T. Mikolov and colleagues, Google — Efficient Estimation of Word Representations in Vector Space (2013) — Read source
  2. A. Vaswani and colleagues — Attention Is All You Need (2017) — Read source
  3. T. Brown and colleagues, OpenAI — Language Models are Few-Shot Learners: GPT-3 (2020) — Read source
  4. J. Kaplan and colleagues — Scaling Laws for Neural Language Models (2020) — Read source
  5. D. E. Rumelhart, G. E. Hinton and R. J. Williams — Learning representations by back-propagating errors, Nature 323, 533-536 (1986) — Read source
  6. S. Rajbhandari and colleagues, Microsoft — ZeRO: Memory Optimizations Toward Training Trillion Parameter Models — Read source
  7. P. Micikevicius and colleagues, NVIDIA and Baidu — Mixed Precision Training, ICLR 2018 — Read source
  8. Llama Team, AI @ Meta — The Llama 3 Herd of Models (2024) — Read source
  9. R. Pope and colleagues, Google — Efficiently Scaling Transformer Inference (2022) — Read source
  10. W. Kwon and colleagues — Efficient Memory Management for Large Language Model Serving with PagedAttention, SOSP 2023 — Read source
  11. N. Shazeer — Fast Transformer Decoding: One Write-Head is All You Need (2019) — Read source
  12. NVIDIA Technical Blog — Mastering LLM Techniques: Inference Optimization (November 2023) — Read source
  13. NVIDIA — Vera Rubin NVL72: Rubin GPU specifications — Read source
  14. N. P. Jouppi and colleagues — In-Datacenter Performance Analysis of a Tensor Processing Unit, ISCA 2017 — Read source
  15. M. Horowitz — Computing's Energy Problem (and what we can do about it), ISSCC 2014; paper copy — Read source

15. Claims and supporting sources

TopicEvidence and scopeType
Word-vector relationships and cosine comparisonsMikolov [1]; examples and the cited earlier analogy resultReported
Scaled dot-product attention, multiple heads, output projection and autoregressionVaswani [2]; original architecture, not a claim that every LLM uses identical detailsReported
GPT-3: 175B parameters, width 12,288, 96 layers, 300B tokens and 3.14×1023 training FLOPsBrown [3]Reported
Main forward estimate 2N, backward about twice forward, training estimate 6NKaplan [4]; non-embedding approximation with context-dependent terms omitted under stated conditionsReported
Adjusting weights to reduce output errorRumelhart and colleagues [5]Reported
Mixed-precision Adam example: 16 bytes per parameter plus additional allocationsZeRO [6]; storage layout and model example, not a universal memory requirementReported
Mixed precision with a master copy and reported memory savingsMicikevicius [7]; method- and workload-dependentReported
Llama 3: 405B, 15.6T tokens, 3.8×1025 FLOPs; up to 16K H100s, 80 GB HBM3; BF16 MFU and interruption statisticsLlama 3 report [8]; reported training run and denominators retainedReported
Prefill, decoding, caching, batch-dependent weight/KV bottlenecks and 3 TB examplePope [9]; stated architecture and serving conditionsReported
OPT-13B cache estimates and memory-allocation examplePagedAttention [10]; 800 KB/token, 1.6 GB maximum sequence cache and cited 40 GB GPU caseReported
Repeated reads as a decoding constraintShazeer [11]; hardware balance and workload matterReported
Llama 2 7B: about 14 GB weights, 2 GB cache example and batchingNVIDIA technical article [12]; sequence and precision assumptions retainedReported
Rubin GPU: 288 GB, 19.2 TB/s, FP16/BF16 dense 4 PFLOPS; NVFP4 sparse 50 PFLOPS distinguishedNVIDIA [13]; different precision and sparsity specifications are not interchangeableReported
Original TPU: 65,536 eight-bit multiply-accumulate unitsJouppi [14]Reported
Data-movement energy relative to arithmeticHorowitz [15]; technology-, bit-width- and operation-dependent examplesReported
Dot products 1.46 / 0.34; W×x = (4,4,7); 12,288²; compute totals; 2.8 TB; 0.73 ms / 0.0035 ms; about 200 GB cacheArithmetic in this lesson from explicit source values and assumptions; timing bounds are not benchmarksCalculation
Vector sketches, learning loop, memory analogies and workload-to-hardware mapTeaching schematics; invented probabilities and representations are labelledExplanation
Interpreting MFU and distinguishing capacity, bandwidth and computeGeneral explanation; the unused fraction of peak is not all measured idle timeExplanation

Updated 8 November 2026. The technical discussion draws on the cited research papers and official equipment specifications. All eight ImageGEN diagrams are teaching schematics. Invented examples, estimates based on explicit assumptions and company-reported figures are distinguished. This lesson explains the principles; its ideal timing calculations are not measured model-serving performance.

© 2026 Troy Technical. Original text and illustrations: all rights reserved, subject to applicable legal exceptions. The credited photographs retain their stated licences. Links to this article are welcome.

🌐 Japanese