← Inference From First Principles

What Is Inference?

Distinguish mathematical inference, LLM forward passes, token generation, and production serving, and measure where one request actually spends its time.

I asked a 124-million-parameter model to continue a sentence by sixteen tokens. On a CPU it took about 2.7 seconds, and this is what came back:

An inference engine takes a trained model and a request, and it must turn them into a model that can be used to generate a model that can be used to generate

What can we say about that run? Three things, and each answers a different question:

Question What this run tells us
Performance: how long did it take, and at what cost? About 2.7 seconds for sixteen new tokens on the recorded CPU configuration.
Quality: was the output useful? Poor on inspection: it repeats itself. (Not formally evaluated.)
Correctness: did the program follow its rules? Partly established. Greedy selection returned the same sequence on every repeat run, which is what the rule predicts.

These three questions are independent. A run can be fast but wrong, slow but correct, or correct and still useless. Much of this book is about keeping them apart, because mixing them leads to bad engineering: tuning the sampler to fix latency, optimising a kernel to fix a prompt, or treating repeatable output as proof that an implementation is sound. (Repeatability is evidence, but proving correctness means specifying the operation and checking the code against it. Later chapters do that.)

By the end of this chapter you will be able to take one request to one model and say which stages ran, which did real work and which were simulated, where the time went, and what the measurement does not allow you to conclude.

Where this sits

This book is one volume in a series that builds a coding-agent system called Pi. Earlier volumes cover the agent loop, language, embeddings, retrieval and memory, and the series plan places optimised language-model programs (DSPy) immediately before this one. All of them call a language model, and all of them treat the cost, delay and behaviour of those calls as a given.

This volume opens that box. Its job in the series is efficient model execution and provider-level measurements: how a trained model is executed, what that execution costs, and how to measure it honestly. It gives back two things: an explanation of what a model call does, and an instrument that can tell whether a change made the system better. Later volumes rely on both. GPU computing takes the kernels apart, model serving puts local models behind provider-compatible interfaces, and evaluation and performance engineering use the measurement discipline built here.

The instrument is the Inference Lab, a small runtime built for inspection and reproducible experiments rather than production. Each chapter adds one component and records what it implemented, what it simulated and what it measured. This chapter adds a request record and stage timings. Chapters 41–43, Designing the Inference Runtime, Implementing Scheduling and Caching and Adding Multiple Model Backends, assemble the full runtime. Chapters 44 and 45, Benchmarking Against Established Engines and What We Learned: Inference From First Principles, compare it with other engines and audit what remains unproven. A comparison with an external engine counts as a result only if both systems actually ran under a matched, recorded workload; installation checks, unrun plans and provider documentation do not count.

Four meanings of one word

People use inference to mean four different things, and much confused discussion comes from sliding between them.

Four meanings of inference

  1. Statistical inference draws conclusions about unknown quantities from evidence. A language model’s token probabilities look similar, but they are not statistical conclusions about the world. A probability of 0.9 on a token does not mean the sentence is 90% likely to be true.
  2. A forward pass evaluates a neural network on one input. For a transformer, that means embedding, attention, feed-forward, normalisation and output projection, ending in a score for every possible next token.
  3. Token generation repeats forward passes, appending each chosen token to the input of the next pass. This is autoregressive generation.
  4. Production serving is the system around generation: it accepts requests, schedules them, runs generation, streams or batches results, enforces limits and reports measurements.

In this book, inference without qualification means meanings 2 to 4: the path from an already trained model to an observable result. We do not train models and we do not decide what a model ought to say.

The boundary has some give in it, though. A prompt changes how many tokens are processed and what can be reused from a cache. A tokeniser revision changes the input. Quantisation changes the arithmetic, and a decoding policy changes the output. Those belong here because they change the work done or the result observed. So does measuring task success, numerical agreement or quality, whenever a performance claim depends on it. A rule of thumb: deciding the desired behaviour is product design, and checking that the runtime preserves it is inference.

The chain that every chapter preserves

Every chapter in this book elaborates one chain:

model parameters -> request -> tokens -> computation -> generated tokens -> served response -> measured outcome

The inference chain

Each arrow can fail on its own, and success at one stage says nothing about the next. The awkward part is that a failure at one stage often looks like a failure somewhere else:

Stage What it owns A failure that looks like something else Where you first see it
Model parameters Learned weights, with their architecture, tokeniser and revision The wrong model file produces plausible but unintended text Model name recorded here; full manifest in From Training to Execution
Request Prompt, options, limits A bad stop condition looks like a slow model max_new_tokens and the stage list
Tokens Text to ids and back Non-Latin text costs several times more than English token_counts.py
Computation Tensor operations per step Redundant recomputation looks like slow hardware Per-step forward_pass timings
Generated tokens Selection rule, stop rule Greedy repetition looks like model failure The repeated output above
Served response Formatting, streaming, transport Server queueing looks like slow generation Not yet present; see From Inference Loop to API
Measured outcome Latency, throughput, cost, correctness One fast run looks like a fast system --repeat and its summary

Notice the loop in the diagram, from generated tokens back to computation. That loop is the most important dependency in the book.

The loop at the heart of generation

The question. Why does producing two hundred tokens take so much longer than reading two hundred tokens?

The intuition. A language model predicts one next token from everything before it. To predict the token after that, it needs the token it just chose. So generation is a chain of guesses, and you cannot make guess 50 until you have made guess 49.

A concrete trace. In the run that opened this chapter, the prompt was 17 tokens long and we asked for 16 more. The baseline program has no cache, so every step runs the model over the whole sequence so far:

Step Positions the model processes What happens next
1 17 (the prompt) Choose token 18, append it
2 18 Choose token 19, append it
3 19 Choose token 20, append it
… … …
16 32 Choose token 33, stop

Sixteen new tokens meant sixteen model evaluations, one after another, each a little longer than the last.

The mechanism in code. The whole loop fits in a few lines. Here, forward_last_position stands for whatever backend call returns the scores for the next token. It is pseudocode; the runnable version is examples/ch01/inference_stages.py.

ids = encode(prompt)
for _ in range(max_new_tokens):
    logits = forward_last_position(ids)  # abstract model call; not executable as written
    next_id = select(logits)             # greedy, sampled, constrained...
    ids.append(next_id)
    if stop(next_id, ids):
        break
return decode(ids)

The autoregressive loop

The formal statement. A causal language model defines the probability of the next token given everything before it:

\[ P(x_t \mid x_1, \dots, x_{t-1}) \]
By the chain rule of probability, the probability of a whole sequence of length \(n\) is the product of those conditionals:
\[ P(x_1, \dots, x_n) = \prod_{t=1}^{n} P(x_t \mid x_1, \dots, x_{t-1}) \]
The factorisation itself is just probability. The modelling choice is how to estimate each conditional. A causal transformer does it while preventing any position from looking at tokens after it.

One forward pass over a batch of \(B\) sequences, each \(L\) tokens long, with a vocabulary of \(V\) tokens, produces a score (a logit) for every vocabulary entry at every position:

\[ \text{logits} \in \mathbb{R}^{B \times L \times V} \]
Generation only needs the last position, a slice in \(\mathbb{R}^{B \times V}\). A selection rule turns that slice into one token per sequence, the token is appended, and the loop repeats until a stop condition holds.

The consequences. Two things follow, and both return many times in this book.

First, a naive call can do a lot of wasted work. A straightforward full-sequence call may project every position to vocabulary scores and then throw away all but the last. For GPT-2 that projection maps a 768-wide hidden state onto 50,257 vocabulary entries: 38,597,376 multiply-accumulates, or about 77 million floating-point operations (FLOPs) at two FLOPs per multiply-accumulate, per position. That is a calculated count, not a measured share of latency. Tokens, Embeddings and Probability looks at the matrix involved.

Second, without a cache, each step recomputes the past. At step \(t+1\) the input is the previous input plus one token, and the baseline runs the full transformer over all of it again. A key–value (KV) cache stores the attention state of earlier positions so a decode step only has to process the new one. The cache does not remove the cost of attending to the history, and it costs memory to hold.

This also separates the two phases of generation. During prefill, all prompt positions can be processed together, because the prompt is already known. During decode, each new token depends on the previous one, so steps run in sequence. Prefill and Decode and Key-Value Caching measure both.

What the loop does not mean. “Two hundred tokens means two hundred sequential steps” is true of the dependency, not of the arithmetic. Optimised runtimes reshape the work inside those steps. A KV cache reuses earlier state. Batching lets several requests share each iteration; Orca’s iteration-level scheduling is an early systems example. Speculative decoding verifies several proposed tokens in one pass. The loop is the reason those techniques exist.

Almost everything else in this book makes the model call cheaper, makes the loop less wasteful, decides which requests share the machine, or measures whether any of that worked.

The Inference Lab, stage by stage

The first implementation contains no neural network at all. It exists to expose the stages a real system has, so that each one can be timed and later replaced.

It times seven stages:

  1. request_parse validates and normalises the request.
  2. tokenize splits text into model-facing symbols.
  3. encode maps symbols to integer ids.
  4. forward_pass computes scores for the next token (once per generated token).
  5. sample selects a token (once per generated token).
  6. decode maps ids back to text.
  7. response_format assembles the response.

A production system adds scheduling, batching, cache management, memory allocation, streaming and telemetry. We add those later.

Every request produces a GenerationResult, defined in examples/ch01/inference_stages.py:

@dataclass
class GenerationResult:
    prompt: str
    tokens: List[str]
    token_ids: List[int]
    text: str
    timings: List[StageTiming]
    simulated_stages: List[str]
    metadata: dict

Two fields matter more than they first appear:

  • timings is an ordered list of (stage, seconds) pairs. A per-token stage appears once per generated token, so you can see the order in which things happened.
  • simulated_stages lists the stages that did not do real work. A result that cannot say which of its stages were simulated cannot safely be compared with one that can.

A toy that tests the plumbing

ToyGenerator implements this interface with a seeded lookup table. Its “forward pass” looks up a row of scores for the previous character and applies a numerically stable softmax:

logits = self._logits(previous_id)
maximum = max(logits)
exps = [math.exp(value - maximum) for value in logits]
total = sum(exps)
probs = [value / total for value in exps]

Subtracting the maximum before exponentiating changes nothing mathematically but prevents overflow, a pattern you will see again in attention. Selection is greedy, and ties go to the smallest token id, so the same prompt, seed and length always give the same result.

Run it from the repository root:

python examples/ch01/inference_stages.py "Hello" --max-new-tokens 8
python examples/ch01/inference_stages.py "Hello" --max-new-tokens 8 --json

With seed 7, the eight generated characters are RWPFdyxf. That is meaningless as language, and it is meant to be. The toy tests the interface and the timing harness. It tells us nothing about models, hardware or serving.

The toy’s simulated_stages field lists three things, and they are three different kinds of stand-in:

Label What kind of stand-in What actually runs
forward_pass Surrogate computation A table lookup, bias addition and softmax over 57 characters. No learned layers, no attention.
sampling_distribution Surrogate distribution Greedy selection really runs, but over artificial scores.
kv_cache Absent capability Nothing. The toy only looks at the previous character, so there is no history to cache.

The same interface, with a real model

RealModelRunner drives a real Hugging Face causal language model through the same interface. It loads the model once, decodes greedily and, deliberately, has no cache: every step runs the model over the whole sequence so far. That is the baseline later chapters improve on, and we measure it before improving it.

The two paths share a result type but not identical instrumentation:

Stage Toy path Real-model path
request_parse Timed Not timed separately
tokenize, encode Timed separately Combined as tokenize_and_encode
forward_pass, sample Timed per token Timed per token
decode Timed Timed
response_format Timed Not timed separately

So before comparing two results stage by stage, check that the stages mean the same thing.

Where one request spends its time

The question. For a small model on a CPU, with no optimisation, where does the time of one request go?

The prediction, written down before measuring (a book hypothesis): the forward pass will dominate the timed in-process stages. And because there is no cache, later steps process more positions and should tend to take longer, once warm-up and noise are accounted for.

The set-up.

Held constant Value
Model gpt2, 124,439,808 parameters, snapshot 607a30d783dfa663caf39e06633721c8d4cfcd7e
Decoding Greedy; one prompt of 17 tokens; 16 new tokens
Software PyTorch 2.6.0+cu124, Transformers 5.17.0, one PyTorch intra-op thread, offline model cache
Hardware CPU only, Windows 11, a single machine

What varied was the number of requests: one process running one request, and one process running five consecutive requests against an already loaded model. Within each request, the sequence grows by one token per step.

What would count against the prediction. A large share of time outside the forward pass would contradict the first part. The second part needs a proper study to contradict, one that varies prompt length independently of step number with enough repeats. A flat trend in one noisy run would not be enough.

python examples/ch01/inference_stages.py "An inference engine takes a trained model and a request, and it must turn them into" --max-new-tokens 16 --real --json
python examples/ch01/inference_stages.py "An inference engine takes a trained model and a request, and it must turn them into" --max-new-tokens 16 --real --repeat 5 --json

Both runs used a locally cached model, downloaded nothing and called no paid service. Results are recorded in research/ch01/results.json.

The forward pass dominates

Over five requests (80 forward passes) against one loaded model:

Stage Count Median Min Max Total
forward_pass 80 177.9 ms 124.2 ms 249.8 ms 13.93 s
sample 80 0.40 ms 0.37 ms 1.23 ms 0.034 s
tokenize_and_encode 5 0.30 ms 0.25 ms 2.94 ms 0.004 s
decode 5 0.14 ms 0.14 ms 0.27 ms 0.001 s

The forward pass took 13.93 seconds, about 99.7% of the summed instrumented stage time. A median forward pass took 177.9 ms, and a median token selection took 0.40 ms. For a 124-million-parameter model with a 50,257-token vocabulary, recomputing the whole sequence on one CPU thread, that is what you would expect.

Be clear about what that 99.7% is a share of. It covers the stages in the table. It does not include process start-up, model loading, transport, queueing or anything else a real service adds. And it describes this configuration only. A GPU kernel, a batched service or a different decoding policy could split the time very differently.

The five requests produced identical text and took 2.70, 2.67, 2.86, 2.82 and 2.92 seconds.

Each step costs more than the last

The single-request run recorded each forward pass in order. In milliseconds:

403.1  132.2  136.8  149.8  157.1  151.3  153.8  164.6
171.4  179.8  179.9  183.4  173.6  188.5  207.6  209.0

Set the first value aside for a moment. From step 2 to step 16, time per step rises from 132 ms (18 positions processed) to 209 ms (32 positions): about 1.6 times as long for about 1.8 times as many positions. That is what you would expect if each step pays for the whole prefix, and the uncached code does exactly that.

It is a single run, though, and step number and sequence length rise together, so it illustrates the trend rather than measuring it. Exercise 4 below sets up the controlled version.

The first forward pass, at 403 ms, was about three times slower than the second. A one-off penalty on the first call is common, but this run does not isolate its cause. From Training to Execution separates import time, model loading and first-call warm-up using fresh processes.

A sense of scale

A rough calculation tells us whether these times are plausible. A dense model needs about two FLOPs per parameter per token, so 124 million parameters means about 0.25 GFLOP per position. At 18 positions that is about 4.5 GFLOP, done in 0.132 s, or roughly 34 GFLOP/s.

That figure is an estimate: the timing is measured, but the operation count is a heuristic that ignores attention’s length-dependent work, tied parameters and non-arithmetic overhead. It shows the scale of the work, not a hardware profile. Memory Bandwidth and Compute Bottlenecks measures properly whether a workload is limited by arithmetic or by memory.

Why the output repeats

The repetition is consistent with an effect of the decoding rule rather than of hardware speed, though no other decoding rule was run here. Greedy decoding takes the highest-scoring token at every step. Each chosen token becomes input to the next step, so a local pattern can reinforce itself. Holtzman et al. documented this kind of degeneration under likelihood-maximising decoding.

This is the chapter’s clearest example of assigning a fault to the right layer. What we observed is narrow: greedy decoding of this checkpoint on this prompt repeats. Changing the decoding rule can change the output while leaving the weights and forward computation untouched. Making the computation faster would not change it at all.

Toy and real, side by side

The toy’s forward pass had a median of 5.7 microseconds over 80 steps; the real model’s was 177.9 ms, about 31,000 times longer. That ratio is not an optimisation figure. The toy does a table lookup and the real model does matrix multiplications over 124 million parameters. The comparison shows the boundary: the toy exercises the interface, the real model exercises the computation, and only the real model tells us anything about transformer inference.

Tokens are the unit of work

The toy treats each character as a token. Real models do not. A tokeniser maps text to integer ids drawn from a fixed vocabulary, and nearly everything that gets counted, including context limits, prices, cache size and throughput, is counted in those tokens, not in characters or words.

examples/ch01/token_counts.py counts four short samples under the GPT-2 tokeniser:

Sample Characters UTF-8 bytes Tokens Characters per token
English sentence 56 56 11 5.09
Python code 57 57 23 2.48
Digit string 31 31 12 2.58
Japanese sentence 26 78 37 0.70

The Japanese sentence has fewer characters than the English one but more than three times as many tokens. Code and digits break up in their own ways. These are four hand-picked strings with different content, so this is not a fair comparison of languages, but it shows that character count is a poor guide to token count.

So an inference engine must record which tokeniser produced the ids, because context length, billing and caching are all defined over them. Tokens, Embeddings and Probability looks at tokenisation in detail.

Inference Lab increment

This chapter adds the request record: a GenerationResult that carries the output, ordered stage timings, the list of simulated stages and free-form metadata. Anything that satisfies this protocol can be measured by the same harness:

class TokenGenerator(Protocol):
    def generate(self, prompt: str, max_new_tokens: int) -> GenerationResult: ...

run_repeated repeats a request and summarise_timings summarises the stages. The toy and the real model both satisfy the protocol. That is a first small demonstration of an idea that Adding Multiple Model Backends develops fully and the benchmark chapters depend on: swap the engine under a fixed interface, and measure both the same way.

Two limits of the record are deliberate for now. It has no notion of concurrent requests, so it cannot express queueing delay. And its metadata is a free-form dictionary, so nothing enforces that two results are comparable. The service and benchmarking parts of the book address both.

Limits of this chapter’s evidence

Everything above was measured on purpose in a narrow setting. Here is what those measurements do not tell you, collected in one place.

About the measurements

  • One machine, one session. The numbers are not portable. The environment is recorded so the experiment can be repeated, not so the numbers can be compared with anyone else’s.
  • One thread. PyTorch used one intra-op thread. Using the machine’s 24 logical CPUs would change absolute times and perhaps the split between stages.
  • One prompt and one model. The per-step trend might look different at 1,000 tokens, and a larger model would shift the balance between the forward pass and everything else.
  • Wall-clock timing. Each timing includes interpreter and library overhead. It does not separate arithmetic from memory movement; Memory Bandwidth and Compute Bottlenecks does.
  • Not measured at all: GPU execution, batching, concurrency and memory. The results file records them as not measured rather than leaving them out.

About model loading and warm-up

  • Model loading happens once per process and is not in the stage table. It took 3.20 s in the single-request run, 1.58 s in the repeat run and 2.37 s in the run recorded when the example was first written. A factor of two between three processes on one machine is a warning that load time depends on file caching and operating-system state. One load measurement is a weak basis for any claim.
  • The request totals do not show a consistent first-request slowdown after loading, yet in a separate process the first forward pass was three times slower than the second. These fit together: a one-off penalty can disappear in the sum of sixteen steps and normal variation. Neither run isolates the cause, so this chapter makes no causal claim about it.

About correctness and quality

  • Identical output across five runs is evidence of repeatability under these conditions, not proof that every kernel is correct.
  • Changing the execution engine may change latency, memory use and numerical behaviour. It is not guaranteed to preserve every token unless numerical agreement and decoding parity have been checked. Correctness, Determinism and Reproducibility and Adding Multiple Model Backends build those checks.
  • Holtzman et al. provide research context for repetitive greedy output. They do not independently validate this particular GPT-2 run, and the run does not show that GPT-2 is incapable of coherent text.
  • Output quality, semantic correctness and calibration were not evaluated.

About the record itself

  • Model identity was recorded by hand. The program stores the name gpt2 but not the snapshot revision; the revision above was read from the cache directory afterwards. Provenance that depends on someone remembering to write it down will eventually be wrong. Exercise 3 closes the gap.
  • The simulated_stages list mixes stand-ins (forward_pass, sampling_distribution) with an absent capability (kv_cache). A future schema should distinguish SIMULATED from NOT_IMPLEMENTED. Building Our First Inference Engine must not let a missing capability turn into an apparent measurement.

What you should now be able to do

  • Say which of the four meanings of inference a statement is about, and which one this book uses.
  • Explain why ordinary autoregressive decoding needs one dependent step per output token, and how KV caching, batching and speculative decoding change the work done within those steps.
  • Run one request against a real model, read the stage timings, and say which stage dominates and by how much.
  • Tell a slow result, a poor result and an incorrect result apart, and say which part of the chain each belongs to.
  • Name at least three things a given measurement does not let you conclude.

The record we built can time a request, but it cannot yet say precisely which model produced it, and our first forward pass was mysteriously slow. From Training to Execution deals with both: what a trained model actually leaves behind, how to identify it exactly, and what the first request pays before any generation begins.

Key terms

  • Inference: executing a trained model on an input to produce an output.
  • Forward pass: one evaluation of the model’s layers on a given input.
  • Autoregressive generation: producing tokens one at a time, feeding each output back as input.
  • Logits: unnormalised scores over the vocabulary before selection.
  • Token: the discrete unit a model reads and writes, defined by a specific tokeniser.
  • Greedy decoding: selecting the highest-scoring token at every step.
  • Sampling: selecting a token randomly according to a distribution derived from the logits.
  • Prefill: processing the known prompt positions, which can be done together.
  • Decode: generating new tokens one dependent step at a time.
  • KV cache: stored attention keys and values for earlier positions, reused by later decode steps.
  • Stage: a named step in the request path whose duration is recorded separately.
  • Serving: the system that manages requests, execution and responses around the model.
  • Simulated stage: a stage that returns plausible output without performing the real computation.

Reader exercises

  1. Modify ToyGenerator to sample from the softmax distribution using a fixed seed instead of greedy selection. Which stages change? Which stay identical? Does repeatability survive?
  2. Add a stop reason to GenerationResult (length reached, end-of-sequence, stop string). Decide whether the stop reason belongs to generation or to serving, and defend the choice.
  3. Extend RealModelRunner to record the snapshot revision and tokeniser name in metadata automatically, and add a test that fails if either is missing. Why is a free-form dictionary a risky place for this?
  4. Run the repeat experiment with prompts of 8, 64 and 256 tokens and the same 16 new tokens. Plot median forward time against position processed. Does the shape support the hypothesis that each step pays for the whole prefix? What would it have to look like to falsify it?
  5. Set torch.set_num_threads to 1, 4 and 12 and repeat the experiment. Does the forward-pass share of request time change? Does the step-time trend?
  6. Write one claim from this chapter that your experiments could falsify, and the measurement that would do it.

References

  • Transformer computation — primary research: Vaswani et al. (2017), Attention Is All You Need. Establishes transformer attention and decoder-side masking; it does not measure the local GPT-2 run.
  • Decoding and repetition — primary research: Holtzman et al. (2019), The Curious Case of Neural Text Degeneration. Provides evidence about degeneration under maximising decoding objectives and motivation for nucleus sampling; it does not show that sampling always improves task correctness.
  • Scheduling and serving — primary research: Yu et al. (2022), Orca: A Distributed Serving System for Transformer-Based Generative Models. Introduces iteration-level scheduling and selective batching; its reported system performance is not reproduced by this chapter.
  • Implementation documentation: Hugging Face Transformers generation strategies documents selection, stops and cache configuration; PyTorch 2.6 documentation documents the tensor and thread interfaces used in the local experiment.
  • System reference, not a local benchmark: deepseek-ai/DeepInfer at 774ce244 provides first-party code and documentation for a broader inference stack. Its public repository does not by itself establish hosted-service performance or reproduce a result here.

Evidence in this chapter

Claim Category and limit
Causal attention can compute next-token conditionals from a prefix Established background; Vaswani et al. (2017) for transformer masking, plus probability chain rule
Ordinary autoregressive generation has sequential token dependencies Established background; not a claim that every engine recomputes each prefix
Greedy decoding can produce repetitive continuations Research context: Holtzman et al. (2019); chapter shows one GPT-2 trajectory
Iteration-level scheduling addresses multi-iteration generation workloads Research context: Yu et al. (2022); not benchmarked here
Prefix length contributes to uncached decode cost Book hypothesis about measured latency; one weakly supportive single-run trend
Approximately 0.25 GFLOP per position for GPT-2 under a 2-FLOP-per-parameter heuristic Arithmetic estimate, not a profiler measurement
forward_pass was about 99.7% of the instrumented in-process stages in this configuration Book result from five requests in research/ch01/results.json; excludes loading and service overhead
Token counts of four hand-picked samples under the GPT-2 tokeniser Book result in research/ch01/results.json; not a language comparison
GPU execution, service queuing, memory, batching and real multi-request throughput Not measured in this chapter
Output quality, semantic correctness and model calibration Not evaluated in this chapter