This website uses cookies

Read our Privacy policy and Terms of use for more information.

❝

For business inquiries, reach out to me at [email protected]

THEWHITEBOX
How Agents Are Shaping AI, Part 2, Hardware

Welcome to the second part of how agents are shaping AI, which is now a three-part series because I’ve realized there’s much to say here.

In this issue, we’ll focus on the hardware side, explaining how agents’ computational requirements push us to rethink not only accelerator design, but the data center as a whole.

We’ll do this by:

  • Reviewing how agents work and how they actually run in hardware. You'll visualize exactly what happens, giving you unique intuition for why elements like memory are so necessary. In other words, you probably know memory is a bottleneck, but you’ll see how true that is today.

  • Using that to explain the key remaining feature in the most innovative architecture ever released: DeepSeek v4.1 Flash

  • A detailed explanation of sandboxed agents like Muse, and why they are the first non-coding agent product I’m actually using.

So without further ado, let’s dive in.

How inference is ‘felt’ by hardware

Last week, I explained how agents change the computational workload considerably, moving AIs away from a decode-heavy workload to a prefill one, which are the two phases of inference.

Recall that prefill measures the time to obtain the first token, a computationally heavy workload because the agent has to process the entire input all at once. After that first token is produced, we cache much of the computation and use it to generate the following tokens more quickly, known as decode.

As explained last week, if with standard chatbots the average sequence had a smaller amount of input tokens and very long output responses, with agents the tide reverses; agents have to process enormous amounts of input tokens received not only from the user but from tools, databases, and the virtual machine and simply reason about what to ask for next.

In this paradigm, output tokens are much smaller by comparison, which means agents are mostly prefill-heavy.

And this has a profound impact on hardware. But to see why, we need to dive a little deeper into what is really going on.

AIs are databases… sort of.

Years ago, detractors of large language models (LLMs) defined them as ‘databases’ to argue they weren’t really intelligent, but simply algorithms that had compressed the world’s information into a smaller package. They couldn’t reason; it was just a ‘bag of words’.

Sadly for those people, the reinforcement learning age that started in September 2024 quickly eradicated that belief. However, the database analogy is still useful for understanding how the models are used for inference.

In a way, it’s still true and LLMs do behave like databases; general-purpose ones.

At heart, an LLM is a sequence-to-sequence model. It’s literally a huge mathematical function that takes in a sequence and produces the next part of the sequence. That’s all they are. You give them context and, in the case of agents, a state (i.e., the environment and progress of what they are doing), and they produce the ‘next thing’.

Thus, an agent is simply an LLM that can not only talk to you and reason in natural language, but can also output actions like calling Google’s search system or its external database to enrich its context, and call ‘action tools’ to actually take action, like modifying the state of a customer support ticket in ServiceNow. Agents are really not hard to understand. They are LLMs that can take action.

But the real magic here occurs around the LLM: the harness. A harness is a system we build on top of these ‘next thing’ predictors, using their ‘next thing’ ability when needed.

The harness defines the environment (virtual machine, database, or even the physical world for humanoids) where the agent will be and also defines the context (what previous relevant context might be useful) the AI will receive in every interaction.

The AI doesn’t decide any of that; it’s a black box you can embed in any system and make predictions about, and it has no control over the context it is provided, which depends on the harness’ effectiveness. Even when the AI decides to enrich its context with a database query, it’s still up to the harness to take that query, execute it, retrieve the result, parse it into text, and feed it to the LLM.

❝

Nonetheless, this newsletter is called TheWhiteBox because my job is to try to disentangle what that black box is for you. At least that’s the idea.

Therefore, when we are inferencing an AI model, the hardware layer is essentially doing two things:

  1. Building the sequence of input + context + state we’ll feed to the AI to produce the next step

  2. Query the model with it. In other words, an AI is just a part of the system that you can ask: ‘dear model, what comes next?’

I want to pause on this second point and insist on this ‘query’ framing. As mentioned, an LLM is a black box that receives a sequence of tokens and chooses the next one. Thus, in a way, one can view LLMs as “‘next thing’ databases”; databases that, whatever sequence you give them, know what the next part of the sequence is.

I insist on this framing because it helps explain what goes under the hood, especially how data moves, which is fundamental to understanding the direction AI hardware is taking, the entire point of today’s newsletter.

The first point is almost entirely on the CPU side. The CPU receives the user’s input and builds the context for that round, while the GPU creates the cache and the first token (prefill phase). But say the AI is already generating tokens and, for example, say that in the previous round, the LLM decided to call an SQL database.

The CPU takes the model’s SQL query, executes it, receives a response from the database, transforms it into text, identifies all the tokens in that text, and sends the new sequence back to the GPU where the AI resides, which can be understood as something like:

  • “here’s what the user said previously +

  • here’s some context you need about the task and previous calls +

  • here’s the cache, +

  • here’s the response to the query you requested.”

Essentially, you send the sequence’s last state (including the last predicted token) + the new context (the response to the query), and the AI has to decide what to do next.

Then, the entire process repeats, everything described above. Of course, the CPU's next work depends on what the AI decides to do next. If the AI simply outputs text, the CPU can immediately resend the context with the last predicted token again for the next round, as it happens with a chatbot.

But if the model predicts a new tool call, the CPU has to execute that tool before we can send the response back to the model, which takes time. The visualization below simulates the interaction between the CPU and the GPU during agent reasoning and a database call.

Here, you’re probably starting to see why CPUs matter for agents. The CPUs can definitely become the bottleneck, as we can’t continue asking ‘next thing’ queries to the AI black box if the CPU is handling the actions the AI asks for. Especially with tool-heavy traces, like most agentic traces are, CPUs are doing a lot of work. This will become important later.

However, CPU-GPU communication isn't the only bottleneck here. In fact, most of the latency in this interaction is just the GPU waiting for the CPU to finish. But the famous memory bottleneck is also present, inside the GPU, where most data is stored and moved.

Getting the GPU naked

As explained, you need to ask the model for every single next token. Every single time. You send ‘n’ tokens to the LLM; it produces the (n+1)th token. You send (n+1) tokens to the model; it produces the (n+2)th token. It’s like a token database that gives you the next one.

❝

Having to send the ‘n’ previously processed tokens again and again is precisely why you cache that work to avoid unnecessary recomputation.

So, what is going on inside the GPU during this process?

Like a CPU, a GPU has two parts: compute and memory. Compute does the calculations; memory provides what needs to be calculated and stores any results that need to be saved. In other words, the GPU’s memory stores the model and the cache and feeds them to the compute to generate the next token.

As mentioned, the AI needs to be ‘queried’ for every next-token prediction, which helps explain what's happening: a continuous back-and-forth between memory and compute.

  1. The weights and cache are sent in layers for computation.

  2. When all layers and cache are processed, the final result is the next token.

  3. The token gets immediately appended—by the CPU; recall that AIs don’t do anything but make predictions; they are bodiless, if that makes sense.

  4. And the process repeats

This back-and-forth continues until the nth token is either an <EOS> (End of Sequence) or a tool call, which initiates the loop we visualized earlier with the CPU doing more work than just appending the new token to the previous sequence.

Internally, at a high level, what is going on is something along the lines of what you see below:

And why is it important to understand this?

For a simple reason:

❝

If the previous CPU-GPU example showed us the importance of a powerful CPU that could keep up with the GPU, here we’re seeing what the GPU needs most: memory bandwidth.

The big bottleneck

❝

The calculations below include a simplification. Models don’t fit in the compute chips’ SRAM. Thus, they are broken down into layers and streamed progressively. So, in reality, we have a loop inside a loop. The process is already sufficiently confusing with one loop, so we assume the model fits entirely, without being broken down.

Importantly, the numbers you’re about to see are still accurate; we’re just simplifying some steps.

Because we have to query the box at every step, we continuously send billions upon billions of bytes that must move quickly for every next-token prediction.

But Nacho, we already know that; you’ve been telling us for years. But many bytes are we actually talking about? Let’s actually compute this.

For example, say we’re looking at Kimi K3 inferencing a one-million-token sequence. Let’s focus on decoding (the part where you see word after word appear on your ChatGPT screen), where more data must move per second.

Kimi K3 is a 2.8-trillion-parameter model. However, as a mixture-of-experts model, “only” 104 billion of them are activated for any given prediction.

  1. After prefill, we have a 27 GB cache, according to this KV cache calculator. For each subsequent decoding step, the model activates approximately 104 billion parameters, since Kimi is a mixture-of-experts model that needs only a fraction of it to run for any given prediction. At four bits per weight, that represents roughly 52 GB of weight data.

  2. Therefore, when decoding the next token, since it uses the cache, we have to send 79 GB (52 + 27) to the compute chips for every new predicted token. Thus, if the response from the model was 200 tokens, and the model takes 4 seconds to do that (a response of 50 tokens/second), that means we have moved 15.8 Terabytes of data, or almost 16 trillion bytes (128 trillion bits), to do that work, at a rate of 3.95 Terabytes/second.

That is a lot of data!

At this point, we can already visualize why HBM (High Bandwidth Memory) has become essential to AI progress; it’s the only technology that can move data at this scale while having enough capacity (enough GB) to hold the model and the cache.

A single HBM4 stack (a pile of memory chips mounted on top of each other connected to the compute chip, the product that Samsung, Hynix, and Micron build) has around 3 Terabytes/second of memory bandwidth, so with one stack we’re barely keeping up. We actually need at least two stacks.

Here’s the mind-breaking part: the numbers you’re seeing are for one sequence!

Now let’s assume the batch is 10 users, all of whom happen to require sequences with one million tokens each. That grows Kimi's global KV cache to 270 GB. Importantly, as we are now generating ten new tokens in parallel (the next token for each of the ten sequences), we no longer need just 52 GB; we need much more.

Even if all ten users selected exactly the same experts, allowing perfect reuse of the 52 GB of weights, their separate caches would still total 270 GB. That's about 322 GB per round now.

If we want to keep the same interactivity, 50 tokens/second, which is a bare minimum, that is 50 rounds per second, so you need to move 50 × 322 = 16.1 Terabytes/second. That means you need roughly 6 very expensive HBM stacks (we’ll later see how we can reduce HBM requirements thanks to DeepSeek).

❝

Different expert selections would increase the weight traffic further, which is very likely, but we’ll simplify to avoid complexity.

Have you ever wondered why new GPU generations like Rubin, TPUv8, or AMD’s MI450 stack so many HBM stacks per package? Have you ever wondered why NVIDIA puts 72 tightly connected GPUs in every rack?

Well, that’s the math that explains it.

❝

To be clear, the reason I’m not even discussing compute throughput (operations/second a chip can do) is that inference is memory-bound; the bottleneck is the bandwidth, and AI accelerators have tremendously powerful compute cores, more than capable of doing whatever the bandwidth allows them to.

In a simple back-of-the-envelope exercise, we’ve seen both the need for high memory bandwidth per GPU and the need for many of them for these types of tasks. And we haven’t even discussed memory capacity, which in this case is in the trillions of bytes (TB) and thus guarantees the need for multiple GPUs.

And how do agents change this? The dawn of the sandboxed agent will bring huge changes to the hardware you're ready to understand.

❝

Behind the paywall, using DeepSeek’s most complex innovations, we cover the main hardware changes we’ll see over the next few years. Then, we’ll dissect Muse Agent-type architectures so you understand what you’re dealing with and how this product will reframe how data centers around the world are built over the next five years.

logo

Subscribe to Full Premium package to read the rest.

Become a paying subscriber of Full Premium package to get access to this post and other subscriber-only content.

Upgrade

A subscription gets you:

  • NO ADS
  • An additional insights email on Tuesdays
  • Gain access to TheWhiteBox's knowledge base to access four times more content than the free version on markets, cutting-edge research, company deep dives, AI engineering tips, & more