acceptodds
Published as a conference paper at NeurIPS 2026

Effective Context in Transformers: An Analysis of Fragmentation and Tokenization

Amirmehdi Jafari Fesharaki, Mohammadamin Rami, Aslan Tchamkerten

Abstract

Transformers predict over a representation of a sequence. The same data can be written as bytes, characters, or subword tokens, and these representations may be lossless. Yet, under a fixed context window, they need not expose the same information to the model. This raises a basic question: how does the choice of representation change what a finite-context predictor can achieve? We study this question on Markov sources and uncover two complementary phenomena. First, we observe that moving to smaller representation units can hurt prediction even when the context window is enlarged to cover the relevant source history. To explain this, we introduce *fragmentation*: a lossless recoding that replaces each source symbol by several smaller units. We prove that fragmentation can strictly increase the optimal finite-context log-loss, showing that the gap is not merely an optimization or capacity issue, but can be intrinsic to the representation. Second, we study the opposite direction: greedy tokenization, which groups source symbols into larger units. We show that tokenization can make a short token window behave like a longer source-context window, and we give a loss guarantee describing when this is achievable. The guarantee depends on how reliably token windows span the needed source history, together with the compression rate of the tokenizer. This also yields a simple diagnostic for real tokenizers: measuring how much source context a fixed token window reliably contains. Together, the two directions give a finite-context view of why representation matters for Transformer prediction.

Keywords:
Paris, Main Track

Reviews

Among:
Shape:
123456this paper, Top 24%
Figure 1. Mean review rating of the reviewed papers at NeurIPS 2026. This paper averages 4.67 over 3 reviews, above 76% of the others.
Reviewer_Nri3OpenReview ↗
Rating
5
Clarity
4
Confidence
3
Originality
2
Quality
3
Significance
3
Read review
Summary

This paper analyzes the effect that token representation has on the final output loss of sequence prediction models. Their results are split into two types: (1) Fragmentation: under a lossless transformation of a vocabulary into a more fine-grained representation, say from letter-level characters {a,b,c,… }\{a,b,c, \dots\} to bits {0,1,01,… }\{0,1,01,\dots\}, the loss of an optimal sequence predictor increases; this is due to ambiguity in the fine-grained representation's phase. (2) Greedy tokenization: the authors introduce a tokenization method for a fixed vocabulary that can reduce the relative context size of a prompt but achieves optimal error comparable with the original representation. They include simulations demonstrating this phenomenon and measurements of error on real models.

Strengths and weaknesses

Correctness

I am confident in the correctness of the results in the main body, and have checked the proofs in Appendix A. I took a cursory glance over Appendix B and saw no major issues.

Strengths

  • The idea that the underlying representation, even when lossless, of the prompt can affect the optimal loss is counter-intuitive, and I found the results interesting.

  • The interweaving of results, examples, and simulations is well paced; every time I felt I was a little behind on what the results said, my intuition was supported by either a figure or an example.

  • The included simulations provide good support to the theory and illustrate the authors' points well.

  • The authors take time to weaken the assumptions of Corollary 4.2 to Theorem 4.3, which anticipates an immediate issue of a worst-case condition to a typical-case condition. Although, I think a more general condition which assumed the distribution of wsw_s could also be included and would be more interpretable. This should follow from the arguments on page 17 by just integrating over the quantiles of the ϵ\epsilon.

  • The loss metrics in this paper are well motivated from an information-theoretic standpoint.

  • I think the paper also scopes its claims quite well and does a good job of explaining the interpretation of its results.

  • As a matter of style, I think the paper is well written. I particularly liked the line ``They do not.'' in the last paragraph of page 3; it gave a nice hook to the reader.

  • The measure RZR_{\mathcal Z} seems particularly useful as a future metric of tokenization efficiency.

  • I appreciate the authors' work in Appendix B to translate previous works' assumptions to their own.

Weaknesses

  • Although it is a good first step, the method of fragmentation seems a little arbitrary to me. If I were solving an engineering problem with the model not understanding which phase of the fine-grained representation I am in, then I would also pass a position encoding to the model. Does this fix the problem in reality? Did the authors attempt any slight repair to the algorithm that may fix the loss gap?

  • I think it would be good to directly define the super and subscript notation for random sequences; it's reasonably clear from the context but became a little confusing because the authors also use power for sets.

  • For the fragmentation part of the paper, I believe that at a high level the interpretation is that even when the fine-grained representation is lossless, the models in the paper view this lossless representation for a uniform at random window on the phase of the fine grain, making it lossy due to not aligning with the boundaries of the original representation. Is this correct? If so, I think some inclusion of this in the introduction would be helpful since it signals in which part the information is lost. Just a suggestion.

  • I think it would be helpful to include the λq\lambda_q dependence of O(log⁡2(1−λq))O(\log_2(1-\lambda_q)) in Theorem 4.1. Naively, I would expect a ``good'' model qq to send the probability of irrelevant next-tokens yy given context cc to be close to zero (or possibly vanishing in the size of the vocabulary or the size of the input prompts) for which the value of λq\lambda_q may be worth tracking in the bound.

Suggested Edits

  • In the background section, maybe just quickly denote that HH is entropy and II is mutual information.

  • I believe the definition of LXfrag(q)L^{frag}_X(q) should have Xθ−Mwθ−1X_{\theta - Mw}^{\theta - 1}; is this the case? Or is the definition for any ww?

  • Space between Theorem and 4.1 on line 527.

  • It may be nice to include in the main body that the predictor for Theorem 4.3 just assigns a uniform at random guess on the event in Definition 4.1 for intuition.

  • Figure 7 is very convincing to the results of the paper; is it possible to move this to the main body?

Small Edits

  • I assume the wrapping of text on page 9 was done for space reasons, but I would prefer in the final results to have it look a little cleaner.

  • Extra ``-'' on line 775.

Questions
  • What would happen if the prefix tree is only partially known to me at some time? It would be interesting to understand how robust the results are on greedy tokenization with some error in the set of viable tokens.

  • Why is LZtok(q~)L^{tok}_Z(\tilde q) defined as E[… ]/E[… ]\mathbb E[\dots] / \mathbb E[\dots] instead of the expectation of a fraction? Is this for tractability? Personally, it seems to be more intuitive to normalize the bits inside the expectation; why exactly was this metric chosen?

  • Is it feasible to run the greedy tokenization in Figure 5 on some examples to estimate the loss, perhaps even for very simple transformer models? I am curious if the upper bound from Theorem 4.3 is tight.

  • It seems the negative results on fragmentation can be avoided by using a comma-free code, i.e., where each element of the code book is the unique element up to shifting. Would using such a code fix the issues in fragmentation? If so, is the overhead of the increase of needed context size a fair tradeoff?

Limitations

Yes, I think the limitation they bring up, that this is an achievability result instead of an optimization result, is the major counterpoint a reader would have.

Paper formatting concerns

None

Final justification

The authors answered my questions well and I retain my assessment that this paper is a solid accept. I cannot justify a 6 for this paper as the results are good but not to the level of changing the field as a whole. I would say there rebuttal raised my score from a low 5 to a medium 5.

Reviewer_r3BvOpenReview ↗
Rating
4
Clarity
2
Confidence
2
Originality
2
Quality
3
Significance
3
Read review
Summary

This work addresses the challenge of understanding how lossless sequence representations change the effective finite context available to a predictor. The paper studies stationary finite-order Markov sources and analyzes two opposing effects: fragmentation and (greedy) tokenization. The claims of the paper are technically clear: the fragmentation theorem decomposes excess loss into context-deficit and phase-ambiguity terms, and the tokenization results give deterministic and typical-span achievability bounds controlled by source span and tokenizer rate.

Strengths and weaknesses

Strengths

-The contributions are some nice and clean information-theoretic results on fragmentation and tokenization (under appropriate Markovian assumptions).

-The experimental results complement nicely the discussion of the theoretical results.

-The paper is written in a clear and coherent way (especially after the introduction, which felt dense at places)

Weaknesses

-The title and positioning of the paper is inappropriate as none of the results are about transformers and they would apply to any predictor with finite context size. This requires a major revision.

-The fragmentation discussion slightly overstates its relevance to byte- or character-level models. The formal gap relies on the predictor not observing phase. In practical settings, positional encodings, start-of-sequence special characters, etc may partially reveal phase. The paper would be stronger if it explicitly characterized when phase ambiguity remains under realistic positional information, and when it can be eliminated by providing phase or boundary features.

-I think similar observations on fragmentation have been made in prior work. For example, see [1]. Can the authors discuss how their results are new in this regard?

[1]. Exact Byte-Level Probabilities from Tokenized Language Models for FIM-Tasks and Model Ensembles. Buu Phan, Brandon Amos, Itai Gat, Marton Havasi, Matthew Muckley, Karen Ullrich. ICLR 2025

Questions

See weaknesses. Also, can you explain how tight is Theorem 4.3 in practice? Does the proposed slack term correlate quantitatively with measured language-model loss across tokenizers?

Limitations

Yes.

Paper formatting concerns

None.

Final justification

I think the authors addressed some of my concerns with their rebuttal and the promised changes. I lean towards recommending acceptance of the paper. My confidence is medium to low, though.

Reviewer_3FL7OpenReview ↗
Rating
5
Clarity
3
Confidence
3
Originality
3
Quality
3
Significance
3
Read review
Summary

The paper studies how lossless sequence representations affect finite-context prediction. It analyzes two directions: fragmentation, where source symbols are split into smaller units, and greedy tokenization, where source symbols are grouped into larger units. The main result is that fragmentation can create an intrinsic finite-context loss gap due to phase ambiguity, while tokenization can effectively extend the source history covered by a fixed token window when token spans are sufficiently large.

Strengths and weaknesses

Strengths

The theoretical framing is clean and useful. I found the fragmentation result particularly interesting: the decomposition into context deficit and phase ambiguity gives a precise explanation for why byte/character-level representations may be harder even when the nominal context span is matched. The tokenization side is also compelling; the source-span definition is simple, interpretable, and leads to a natural guarantee for finite-context predictors. The experiments are well aligned with the theory, especially the synthetic Markov experiments and the span diagnostics for real tokenizers.

Weaknesses

My main concern is scope. The formal results are about optimal finite-context predictors, not directly about what trained Transformers can realize or learn. The authors acknowledge this, but the title and motivation sometimes make the connection to Transformers sound stronger than what is proven. A second limitation is that the real-tokenizer experiments are mostly diagnostic: the WikiText span plots are suggestive, but they do not directly show that the proposed effective-context measure predicts language-modeling loss on natural text. Finally, the fragmentation setup assumes hidden phase information; it would be useful to test whether explicitly giving phase or boundary information removes the observed gap.

Questions

Does the fragmentation penalty disappear if the model is given phase or source-boundary information?

Can the source-span diagnostic be used as a tokenizer training objective, rather than only as an evaluation tool?

Limitations

yes

Paper formatting concerns

no

Final justification

The revised title more accurately reflects the scope of the theoretical results and resolves my concern about framing the contribution as Transformer-specific.

The new WikiText-103 experiments also strengthen the empirical motivation for the source-span diagnostic: larger typical source span is consistently associated with lower bits-per-character loss, both within BPE and across tokenizer families. This remains correlational evidence rather than a demonstration of directly optimizing the proposed tokenizer objective, but I consider it sufficient for the current paper.

Finally, the boundary-marker experiment and the clarification that the phase-ambiguity term vanishes whenever phase is recoverable directly answer my question about fragmentation and appropriately qualify its practical interpretation.

These additions and planned revisions address my main concerns. I have therefore increased my rating from 4 to 5.

Comments on the paper

1 comment
Meta-review

Initial Metareview

The paper is viewed positively overall, and the reviewers appreciate its conceptual contribution toward explaining how representation granularity can fundamentally affect the predictions of finite-context models. The problem is interesting and the paper is considered a good first step toward understanding this phenomenon.

At the same time, the current reviews identify several important issues that should be clarified. In addition to addressing the reviewers' questions, the discussion should primarily focus on the following points, as they would significantly strengthen the paper.

First, the reviewers noted a mismatch between the title and the scope of the technical results. Although the paper is framed around Transformers, the theoretical results apply more generally to predictors with finite context windows. The authors are encouraged to better justify this positioning or revise the framing to more accurately reflect the scope of the contributions.

Second, the reviewers would appreciate further discussion of the fragmentation model and its practical implications. In particular, they encourage the authors to clarify to what extent the observed fragmentation gap persists when simple mechanisms such as positional encodings, phase information, or boundary markers are available, and whether such information can mitigate or eliminate the effect in realistic settings. Addressing these questions successfully would further strengthen the work.

Metareview after Rebuttal

The paper is viewed positively overall, and the reviewers appreciate its conceptual contribution toward understanding how representation granularity affects the predictions of finite-context models. The rebuttal and proposed revisions satisfactorily addressed the main concerns raised in the initial reviews, including the scope and framing of the results and the practical interpretation of the fragmentation phenomenon. The additional experiments also strengthened the empirical motivation for the work.

Overall, the reviewers view the paper positively after the discussion, and the consensus is to accept the paper.

From OpenReview, CC BY 4.0. Authors as signed there; shown unedited.

Related papers

Loading the map…

Discussion (0)

Sign in to comment.