arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2605.13485cs.LGcs.CLcs.ITmath.IT
收藏

Transformer中的有效上下文:碎片化与分词分析

Effective Context in Transformers: An Analysis of Fragmentation and Tokenization

Department of Communications and Electronics(通讯与电子系);Institut Polytechnique de Paris(巴黎高等理工学院)

Amirmehdi Jafari Fesharaki, Mohammadamin Rami, Aslan Tchamkerten

AI总结:

本文研究了不同表示方式对Transformer有限上下文预测的影响,发现碎片化会增加信息损失,而分词方法能扩展上下文范围,揭示了表示选择的信息论框架。

摘要:

Transformers预测序列的表示。相同数据可以表示为字节、字符或子词标记,这些表示可能无损。但在固定上下文窗口下,它们不一定向模型暴露相同的信息。本文在马尔可夫源上研究这一问题,发现碎片化会增加最优有限上下文对数损失,而分词方法能扩展上下文范围,揭示了表示选择的信息论框架。

英文摘要:

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. This gives a theoretical account of the finite-context gap observed in byte- and character-level models such as ByT5 and CANINE relative to subword-tokenized models. Second, we study the opposite direction: greedy tokenization -- BPE, WordPiece, and related methods -- 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 establish a finite-context information-theoretic framework for reasoning about representation choices in Transformers.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑