← Latest papers
💻 computer science

One Vector Is All You Need for O(1) Self-Attention: The Ocean State

This paper introduces the "Ocean State," a method that replaces standard self-attention with a single persistent vector to achieve O(1) computation and memory complexity while demonstrating superior training stability and no signs of forgetting even at 10 million steps of context.

Original authors: SHUYUAN YU

Published 2026-09-04
📖 5 min read🧠 Deep dive

Original authors: SHUYUAN YU

Original paper licensed under CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Modern artificial intelligence often relies on a specific type of computer program called a Transformer, which has become the standard for tasks like writing text, translating languages, and answering questions. These programs work by looking at a sequence of words and deciding what word comes next. To do this accurately, the program must remember the words it has already seen. In the current design, as the program reads a longer sentence or a whole book, it keeps a growing list of every word it has processed so far. This list acts like a memory bank that expands with every new word. While this works well for short texts, it becomes a heavy burden for very long ones. The computer must constantly scan this ever-growing list to find relevant information, which requires a massive amount of processing power and memory. As the text gets longer, the time and energy needed to read it grow much faster than the text itself, eventually making it impossible to process very long documents efficiently.

A researcher named Yu Shuyuan has proposed a different way to handle this memory problem. Instead of keeping a growing list of every word, the new method suggests keeping just one single summary vector, which the author calls the "ocean state." Imagine this state as a single, dense container that holds the essence of everything the program has read so far. As the program reads a new word, it updates this single container to include the new information, replacing the old summary with a fresh one. The program then uses this single container to help predict the next word. This approach changes the fundamental math of the problem: instead of the effort growing with the length of the text, the effort stays the same no matter how long the text becomes. The program can read a million words with the same amount of work per word, and it uses a fixed, tiny amount of memory regardless of the length.

The core idea behind this work is a simple question: what if we did not throw away the final summary of a sentence after using it to predict the next word? In standard programs, this summary is calculated and then discarded. The new method keeps it, treating it as a persistent memory that flows from one step to the next. The program reads the current word and this single summary vector, combines them, and produces a new summary. This process repeats for every word in the text. Crucially, the program learns how to read and update this single vector entirely on its own. No one told it how to compress information into one spot; it simply learned to do so during training because the design allowed it to happen. The researchers found that this single vector is surprisingly capable. It can hold information from a sequence of ten million steps without losing any of it. In tests, the program could recall specific words from the beginning of a ten-million-step sequence just as accurately as it could from the first few steps, showing no sign of forgetting.

The researchers tested this idea against the standard method using a large set of text data. They trained both versions to predict the next word in a sentence. The results showed that the new method, which uses only one vector, consistently performed better than the standard method that keeps a growing list. This advantage was not a fluke; it appeared across many different settings, including different sizes of models and different lengths of text. In fact, the new method was so stable that it could process a sequence of ten million steps without any increase in error, whereas the standard method would have run out of memory or taken an impossible amount of time to process even a fraction of that length. The researchers also tested a specific task where the program had to repeat a word after a long delay. The new method reproduced the word with a loss of 0.0006, while the standard method failed completely.

One concern with such a compressed memory is that it might become unreadable or "foggy" over time, losing the details needed to make good predictions. However, the experiments showed the opposite. The single vector remained sharp and clear, capable of retrieving specific information even after millions of steps. The researchers also explored how to make this method faster on real computers. Because the new method processes words one after another in a strict sequence, it can be slower to train on a single machine compared to the standard method, which can process many words at once. To solve this, the researchers developed a way to split the work across different layers of the program, allowing multiple steps to be processed simultaneously. This engineering change significantly reduced the time needed to train the model while keeping the same high performance.

The study demonstrates that it is possible to build a system that remembers a vast amount of information using a fixed amount of memory and processing power. The researchers showed that the program learns to organize this information efficiently without any special instructions. While the current experiments were conducted on a specific dataset and with relatively small models, and behavior at real-world sizes remains untested, the results suggest that the underlying principle is robust. The method works by repositioning how the program handles its own internal state, turning a discarded summary into a persistent memory. This change eliminates the structural cost that has limited the length of text AI systems can handle. The findings indicate that with this approach, the limitations of context length may no longer be a barrier, allowing for systems that can read and understand documents of any size with consistent speed and accuracy.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →