Chapter 3 noted that cost can grow faster than the number of steps, and Chapter 8 measured accuracy against the number of thinking steps.
the companion book noted that cost can grow faster than the number of steps, and the companion book measured accuracy against the number of thinking steps. this article prices those steps from the server’s side.
A transformer language model (Vaswani et al., 2017) serves a request in two phases. In prefill it processes the whole prompt at once and stores, for every token and every layer, the keys and values that later tokens will attend to. In decode it generates one token at a time, and each new token attends to everything stored so far. The stored keys and values form the KV cache. Every thinking token is a decode step, and every thinking token adds to the cache the server must hold until the request ends.
Thinking therefore consumes three resources at once: time (one decode step per token, steps that cannot be parallelised within a sequence), memory (the cache grows with each token), and arithmetic (attending over an ever longer history). When reasoning traces run to thousands of tokens, the second is often the binding constraint on how many requests a machine can serve together.
Continue with the book
Explore the full treatment, worked examples, and exercises in Next-Generation AI, Explained and Evaluated.
Companion article for Next-Generation AI, Explained and Evaluated, published by Choral Software. Article text and original examples © 2026 Choral Software. All rights reserved.
