NeurIPS 2026QuestionsPapersAreasAboutMarkdown

Frontier Language Models Struggle to Copy: Text Can Be Better Viewed in 2D

Haodong Wen, Yiran Zhang, Yingfa Chen, Kaifeng Lyu

NeurIPS page · OpenReview · alphaXiv · Open on the map

Category: Interpretability & Model Adaptation › Transformer Models · Type: new method · Keywords: language model copying, positional encoding, 2D grid, Transformer, text processing

Areas: LLM Reasoning › Efficient Reasoning › In-Context Learning; Long Context › Long-context mechanisms › In-context learning; Model Architectures & Sequence Modeling › Language Model Architectures › Attention Interactions

Summary

The paper shows that frontier LLMs fail to copy input strings due to positional encoding limitations and introduces 2D-RoPE, a 2D grid-based positional encoding that enables perfect copying and improves performance on copy and NIAH tasks.

Explained to a 5-year-old

Big computer brain models try to copy a sentence but often mess it up. This happens because they think about words in a line, not a grid. We give them a picture where words are placed in rows and columns, making it easy to find the right word. With this new picture, the model can copy perfectly even for very long sentences. This helps the model do simple tasks better.

Explained to a 5-year-old, longer

Computers can read and write words, but sometimes they forget to copy exactly what you type. Even the smartest models get this wrong when the text is long. The reason is how they remember where each word belongs. They use a line to keep track, which works for many things but not for copying. We change the way they remember by arranging words in a grid, like a chessboard. Each word gets a row and a column, making it easy to find its spot. With this grid, copying becomes like picking the same column over and over. The model learns to look down a column instead of scanning the whole line. This makes copying simple and fast. Even short models can copy perfectly for very long texts. When we train bigger models on lots of books, they also get better at copying. The new idea helps models do basic tasks more reliably. Overall, viewing text in two dimensions makes many language tasks easier.

For a technical reader

The paper observes that state-of-the-art language models often fail to copy input strings verbatim, even when the strings fit comfortably within their context windows. This failure is traced to the inductive bias of standard 1-D positional encodings, which prioritize local context matching over precise position retrieval. The authors propose arranging tokens in a 2-D grid and using row/column identifiers as positional signals, which simplifies copying by enabling column-wise token lookup. Experiments show that shallow Transformers with this encoding achieve perfect copying on synthetic tasks at lengths far beyond training, and scaling to 1.4 B parameters on DCLM yields substantial gains on copy and NIAH benchmarks. The results suggest that rethinking positional representation can unlock improvements for basic text operations in language models.

Problem

Large language models, despite their reasoning abilities, often cannot accurately copy an input string that lies within their context window. This limitation stems from the inductive bias of standard positional encodings that prioritize local context matching over precise position retrieval.

Method

The approach arranges tokens in a two-dimensional grid, giving each token a row and column index, and uses these indices to construct positional encodings that enable column-wise token retrieval. This design is applied in both shallow Transformers for synthetic experiments and in larger models pretrained on DCLM. The models are evaluated on copy and NIAH tasks.

Results

Shallow Transformers with the proposed encoding achieve perfect copying at input lengths hundreds of times longer than training lengths, while standard encodings lag far behind. When scaled to 1.4 B parameters on DCLM, the approach yields substantial gains on copy and NIAH tasks.

Contributions

The work identifies the root cause of copying failures in Transformers and proposes a 2D grid positional encoding that enables easy column-wise token retrieval. It demonstrates perfect copying on synthetic tasks and significant improvements on standard benchmarks, highlighting the benefits of 2D positional encodings for language modeling.

Research questions this paper is counted under

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