potentialpaper

Sampling from Your Language Model One Byte at a Time

Jonathan Hayase, Alisa Liu, Noah A. Smith, Sewoong Oh

ICML 2026

Edit this page

Or clone it with git

Run in a terminal:

Needs Git LFS. To push, use an API key from your profile as the password.

Or let your agent set it up

It checks and sets up everything: signing in, git, the clone, credentials and an SSH key.

Abstract. Tokenization is used almost universally by modern language models, enabling efficient text representation using multi-byte or multi-character tokens. These models are typically invoked to autoregressively complete a text prompt by tokenizing the prompt, sampling more tokens to continue the tokenized prompt, and detokenizing the result. However, prior work has shown that this process can introduce distortion into the model's sampling distribution, leading to unexpected or undesirable generations. For example, users are often advised not to end their prompts with a space because it prevents the model from including the space as part of the next token. While this heuristic is effective in English, the underlying problem continues to affect languages such as Chinese as well as code generation, settings where word and syntactic boundaries may not line up with token boundaries. We present an optimal method to solve this "Prompt Boundary Problem," which is based on an efficient online algorithm for Byte-Pair Encoding (BPE). This allows one to compute the next byte distribution conditioned on an arbitrary byte prefix, given only logit access to the original tokenizer-based model. This procedure can be applied iteratively to convert any autoregressive LM with a BPE tokenizer into a character-level or byte-level LM, without changing the generative distribution at the text level. We show that this significantly improves next-character prediction accuracy when computed on arbitrary prefixes. Moreover, our method is able to unify the vocabularies of language models with different tokenizers, allowing one to ensemble LMs with different tokenizers at inference time as well as transfer the post-training from one model to another using proxy-tuning. We demonstrate in experiments that the ensemble and proxy-tuned models outperform their constituents on downstream evals.

Are you an author? Claim this paper to see who's reading it, with views and other statistics, and to write about it here.

Claim this paper
How does this paper connect to your work? Write how you built on it, compared with it or reproduced it, or add a summary, a critique or errata.
Or make it interactive:
Start writing

edit · history

FromAToBDateVersionSubmitted toPDFEvidence
30 May 2025TokShop @ ICML 2025submittedTokShop @ ICML 2025Accepted—[1]
18 Sep 2025ICLR 2026submittedICLR 2026Rejected—[1]
24 Jan 2026ICML 2026submittedICML 2026Accepted—[1]
Their titles, abstracts and, where both have a PDF, the text.Missing a version?

We don't know of a submission of this paper to a venue with open reviews. Missing a submission?

Loading the discussion…