NeurIPS 2026QuestionsPapersAreasAboutMarkdown

Scratchpad Patching: Decoupling Compute from Patch Size in Byte-Level Language Models

Lin Zheng, Vasilisa Bashlovkina, Timothy Dozat, Dan Garrette, Laura Rimell, Joshua Maynez

NeurIPS page · Open on the map

Category: Efficient LLM Inference & Training › Sparse Long-Context Attention · Type: new method · Keywords: byte-level language models, patch size, compute efficiency, scratchpad buffers, entropy-based compute allocation, KV cache reduction

Summary

Scratchpad Patching (SP) adds transient scratchpads inside each patch to refresh context and allocate compute based on prediction entropy, enabling byte-level language models to keep quality while using far less KV cache and inference compute.

Explained to a 5-year-old

Some computer programs read text by looking at groups of letters called patches. Bigger groups save time but make the program less accurate because it uses old information. The new idea adds small memory spots inside each group to keep track of what has been seen. This helps the program be faster without losing accuracy. It also decides where to use more time when the program is unsure what comes next.

Explained to a 5-year-old, longer

Computers sometimes read text by breaking it into chunks, and they call these chunks patches. When the chunks are big, the computer can work faster because it has less to remember. However, if a chunk is big, the computer might have to guess some letters using information from earlier chunks, which can make mistakes. The researchers noticed that this guessing problem gets worse the larger the chunks become. To solve this, they added tiny temporary storage areas inside each chunk, called scratchpads. These scratchpads keep a fresh record of the letters seen so far inside the current chunk. By having up-to-date information, the computer can make better guesses even when the chunks are large. The system also looks at how uncertain the computer is about the next letter and uses more time where it is unsure. This means the computer can be efficient when things are easy and careful when things are tricky. The new method works well on both normal text and programming code. It lets the computer keep the same quality as before while using much less memory and less processing power. In practice, this could help phones, laptops, and other devices run language models smoother and faster.

For a technical reader

Scratchpad Patching (SP) addresses the quality-compute trade-off in byte-level language models by inserting lightweight scratchpad buffers inside each patch to maintain up-to-date context. These buffers aggregate bytes seen so far and refresh the model’s representation, mitigating the stale-context problem that grows with larger patches. SP dynamically triggers scratchpad usage based on next-byte prediction entropy, allowing the system to allocate extra compute only where predictions are uncertain. Experiments on natural language and code show that SP retains baseline quality while reducing KV-cache size by 16× and inference compute by 3-4×.

Problem

Choosing a patch size for byte-level language models creates a trade-off between computational efficiency and modeling quality because predictions within a patch must rely on stale context from previous patches.

Method

The approach inserts transient scratchpads inside each patch to accumulate bytes seen so far and refresh patch-level context, using prediction entropy to decide where to allocate compute.

Results

The approach achieves comparable quality to baseline while using a 16× smaller KV cache and 3-4× less inference compute at 16-byte patches.

Contributions

It decouples compute from patch size by introducing transient scratchpads that refresh context within patches and allocate compute based on prediction entropy, enabling efficient inference without sacrificing quality.

Practical relevance

The method lets practitioners run byte-level language models more efficiently on limited hardware while maintaining performance.

This page was written by language models from the title and abstract of each paper, and the answers were checked by two other models. It can be wrong: check the paper itself. Suggest a correction