Can an AI model skip work it has already done?
Yes. Ask a model “What is the zebra eating?” and then “What is the giraffe eating?”. Today it works through both questions from scratch, even though most of the words and much of the picture are the same. MLP Cache gives the model a memory. What it has worked out before, it looks up. Only what is new, it computes. The model is not retrained, and on a laptop chip it writes its answers 1.20× to 1.38× faster.
First question
Everything is computed.
Q: “What is the zebra eating? Concise answer only.”
A: “Grass.”
Later questions
Most of it has been seen before.
Q: “What is the animal eating? Concise answer only.”
A: “Grass.”
Q: “What is the giraffe eating? Concise answer only.”
A: “Leaves.”
Seen before: look it up New: compute it Picture content that comes back
- RememberRun the model on past questions and note which calculations keep coming back.
- RecognizeFor each new piece of input, check whether it is close to one of them.
- ReuseClose enough? Look the result up. If not, compute it as usual.
- A lot of the work repeats. On Qwen3.5-9B, a model that answers questions about pictures, our larger cache looks up about one in four of the calculations it covers, on pictures it has never seen.
- The repeats are the predictable parts: fixed question wording such as “Is there … in the image?” and picture backgrounds.
- Looking up is faster where computing is slow. On an Apple M5 Pro laptop chip, that cache makes the model write its answer 1.38× faster for about 3 points of accuracy. A smaller cache gives 1.20× for about half a point.
Why would a model repeat itself?
Because it works in small steps, and the same steps keep coming back.
A model cuts a question and a picture into small pieces called tokens: bits of words and patches of the image. Each token passes through a stack of layers, 32 in this model. In every layer a block called the MLP runs a large calculation on the token. That is the MLP in MLP Cache.
The MLP has no memory. It runs in full on every token, even when it did almost the same calculation a moment ago. Look at the example again:
- In the picture: grass looks like grass. One zebra photo and the next share most of their patches.
- In the words: “What is the … eating? Concise answer only.” comes back in every question. One word changes.
You do not work out 7 × 8 every time. You remember 56. A model could do the same, with one catch: its inputs are almost never exactly the same twice. “Zebra” becomes “giraffe”, the grass is a slightly different green, and a memory that only knows exact repeats is almost never used.
So the real question is: can a model reuse its work on inputs that are only similar, and still get the answer right?
In shortModels keep redoing almost the same small calculations. Almost, and never exactly.
How do you look up something you have never seen exactly?
You store a small shortcut that covers a whole neighborhood of similar inputs.
Over all possible inputs the MLP is complicated. Up close it is simple, the way a winding road looks straight under your feet. So wherever inputs keep landing, we store a stand-in: a tiny formula that gives nearly the same result as the MLP in that neighborhood, for a fraction of the work.
Looked up: a stored stand-in Computed: the original MLP
A lookup is called a hit. Everything else is a miss and goes to the original MLP, which is left untouched. A stand-in is stored only if it stays within a set error limit on recorded data. The stand-ins sit in ordinary computer memory, which is cheap, and they replace work on the graphics chip, which is not.
The hard part: how big should a neighborhood be?
- Too big (roughly, “anything about animals”): it comes up often, but one tiny formula can no longer match the MLP across all of it. Errors grow.
- Too small (roughly, “this exact zebra”): it is easy to match, but it rarely comes up again, and the memory fills with entries nobody uses.
We let the data decide. Past inputs are sorted into a tree, with broad groups at the top and narrow ones below. A search over the whole tree then chooses, branch by branch, between a broad group and its narrower parts, so that as many inputs as possible are covered within the error limit and the memory budget.
Photos
Video
Text
For experts: the tree comes from graph-spectral partitioning (ncut-pytorch), the search is dynamic programming over the tree, and a small network, the Router, finds a token's group at run time.
See stand-ins pass or fail the error check on a toy example
See the overview diagram from the paper
In shortStore small stand-ins where inputs pile up. Send everything else to the original MLP.
What ends up in the cache?
The predictable parts. With our larger cache, that is about one in four of the MLP's calculations.
We built caches for Qwen3.5-9B from one collection of picture questions, and tested them on two others, MME and MMStar. None of the test pictures were used to build the cache. In the 28 layers that have a cache (of 32), this is how much of the MLP's work was answered from memory:
Looked up Computed as usual
Which calculations? The ones you would guess:
In the zebra example, that would be “What is the … eating? Concise answer only.” and the grass. The cache takes over the routine parts, and the model still computes whatever is specific to this question.
See where in the model the hits happen
Deep inside the model, the question stays easy to look up, while a long written answer does not. The model spends its real effort on writing the answer, and far less on re-reading the question.
See how memory and the error limit change the result
In shortFixed wording and backgrounds get looked up. Whatever is new still gets computed.
Does looking up actually save time?
On a laptop chip, clearly. On a data-center GPU, a little.
A lookup is not free. Every token has to be checked against the cache first, whether it hits or misses. If checking costs more than the hits save, the cache makes the model slower.
A cached layer pays off when how often it hits × the time one hit saves is larger than the fixed cost of checking.
That is why the hardware matters. The slower the MLP is on a machine, the more each hit saves:
Run one MLP layer (a hit skips this) Check the cache (every token pays this)
Measured on the whole model while it writes its answer:
Each compared with the same model without a cache, one request at a time. Accuracy is the share of those MME questions answered correctly, in percent. On the M5 Pro the smaller cache keeps about 1.2 GiB in memory and the larger one about 8 GiB.
The gain is largest when requests arrive one at a time. When many are processed together it fades, because the MLP has to run as soon as one of them misses.
See when a cache stops paying off
- Under 10% hits: checking costs more than the hits save. No gain.
- 20 to 40% hits: the saving clearly beats the cost.
- Over 50% hits: on a fast GPU the lookups themselves become the bottleneck. Bigger MLPs and slower chips keep gaining.
One cost remains on the A100: reading the question, before the first word is written, takes 41 to 55 ms longer with the cache. The numbers above are for writing the answer.
In shortLookups win when hits are frequent and the calculation they replace is slow. Today that means a laptop-class chip answering one request at a time.
What's next?
- Workloads that repeat a lot. Places where many near-identical questions arrive are the natural fit.
- Even hits across layers. Today some layers hit 10% of the time and others 70%. We want every layer between 20% and 40%.
- Cheaper lookups. A better memory layout, lookups that run in parallel, and popular entries kept ready.
BibTeX
@article{yang2026mlpcache,
title = {MLP Cache: A Post-Hoc Memory--Compute Trade-off
for Transformer Inference},
author = {Yang, Huzheng and Huang, Yiqiao and Hu, Qingqiao and
Zhao, Dongdi and Zhang, Jiaxing and Fu, Di},
journal = {arXiv preprint},
year = {2026}
}

