跳到正文
arXiv cs.CL· Anxin Guo, Tianlong Huang, Chenxiao Yang, Zhiyuan Li·· 13 小时前AI 评分31

复制任务中的重复串难题:从前缀匹配到位置哈希

Copying Under Repetition: From Prefix Matching to Position Hashing

AI 导读

研究者提出用 RoPE 风格的注意力值与输出旋转(VO-rotations)配合小素数周期编码分隔符锚点距离,借助中国剩余定理区分所有所需距离,使两层 transformer 在 O(log log N) 位精度下正确复制并终止任意重复字符串。

正文 · 原文

View PDF HTML (experimental)

Abstract:Frontier LLMs can copy random text almost flawlessly, yet they often overrun or truncate long blocks of repeated characters. In repeated strings, matching local content no longer reliably identifies where copying should continue or when it should stop. Nevertheless, we show that a two-layer transformer with $O(\log\log N)$-bit precision and $O(\log N/\log\log N)$ width can copy every string up to a chosen design horizon $N$ and terminate correctly under arbitrary repetition. We use RoPE-style rotations of attention values and outputs (VO-rotations) with small prime periods to encode distances from delimiter anchors modulo those primes. By the Chinese Remainder Theorem, these periodic encodings jointly distinguish all required distances, allowing one retrieval rule to select either the next source token or the end marker. In contrast, we prove a width-independent impossibility result for copying under sequential finite-precision softmax accumulation. It applies to transformers whose only positional input is an additive attention bias that eventually becomes constant, including NoPE and a recursive implementation of ALiBi. Once an identical-token run exceeds the resulting saturation threshold, further repetitions leave the logits unchanged. If this threshold grows sublinearly with $N$, these models cannot both complete a long all-identical copy and stop correctly, a pattern resembling the termination errors of frontier LLMs. In synthetic copying experiments, baseline transformer models fail on long repeated strings even within the training range. Trained VO models, by contrast, generalize beyond the training lengths with near-perfect accuracy up to length $\approx5005$, the selected primes' period product.
Subjects: Machine Learning (cs.LG); Computation and Language (cs.CL)
Cite as: arXiv:2610.26722 [cs.LG]
  (or arXiv:2610.26722v2 [cs.LG] for this version)
  https://doi.org/10.48550/arXiv.2610.26722

arXiv-issued DOI via DataCite

Submission history

From: Anxin Guo [view email]
[v1] Mon, 19 Oct 2026 16:50:03 UTC (317 KB)
[v2] Wed, 21 Oct 2026 02:21:26 UTC (317 KB)

来源:arXiv cs.CL · arxiv.org