📄 科技报告 | 🤗 数据 | 💻 代码
我们推出 StateBench,这是一个用于长上下文状态追踪的基准测试——旨在评估语言模型在长文档中信息随实体演变而保持追踪的能力。
状态追踪是许多任务的基础,从阅读代码(变量被赋值和重新赋值)到跟随故事发展(角色在物理空间中移动,物品易手)。例如,如果一部悬疑小说在谋杀发生前写道“约翰把刀给了玛丽”,那么了解每个角色的状态已发生变化就至关重要。然而,并非所有的状态追踪问题都同等简单:有些只需要找到最新的更新;更难的情况则需要追踪一连串的变化,其中一步遗漏就会导致最终答案错误。例如,我们悬疑故事状态追踪的一个更复杂变体是:约翰将背包里的物品给了玛丽,而此前已知爱德华把刀放进了约翰的背包。
Transformer 在处理具有长依赖链的复杂状态追踪变体时存在有文献记载的理论极限,这促使了如 Gated DeltaNet 等携带持续记忆向前传递的循环架构和混合架构的发展。现有的状态追踪测试往往侧重于最困难的情况,但随着这些设计日益普及,研究人员需要知道每种架构能够处理哪种类型的状态追踪。我们不仅希望了解不同架构在最困难的状态追踪类型上的差异,还希望了解它们在更简单、可能更常见的状态追踪类型上的差异。
为此,我们开发了 StateBench 基准测试,以捕捉不同复杂度的状态追踪问题,并利用它来评估具有不同架构的语言模型之间的差异。我们发现,当直接在这些任务上进行训练时,循环模型和混合模型的泛化能力远超 Transformer;而包括 Gemini 3.8 Flash、Claude Opus 5.5 和 GPT-6 Sol 及 Luna 在内的前沿模型,随着输入变长,在更复杂的状态追踪形式上仍然会出现失效。
四个级别的状态追踪
StateBench 包含四个难度级别,允许进行日益复杂的状态更新操作。对于程序员来说,这些状态追踪复杂度级别可以被理解为允许不同类型的变量赋值操作:
R-trivial(平凡)问题使用不可变赋值。变量的值永远不会改变,因此模型只需要恢复其最初设置的值。在代码中,这类似于 let x = 4;在日常生活中,它就像出生日期——保持固定不变。
非周期性问题允许按值重新赋值。模型需要找到最新的值,并可以忽略之前的值。在代码中,这类似于先执行 x = 4,随后执行 x = 2;在日常生活中,它就像恒温器,最新设置决定当前温度。
可解问题增加了自引用更新。每次更新都基于当前值进行,因此模型必须将变化向前传递,而不仅仅是找到最新的赋值。在代码中,这类似于 x = x + 5;在日常生活中,它就像游戏分数,每得一分都会累加到总分中。
通用有限问题增加了按引用赋值。一个变量可以获取另一个变量的当前值,从而在更新之间创建依赖关系。在代码中,这类似于 x = y 或交换两个变量。想象一位魔术师将球藏在五个杯子中的一个下面,然后反复交换它们的位置。找到球意味着要追踪这些交换如何改变球的位置。这说明了 S₅ 状态追踪问题:追踪连续交换如何重新排列五个物体。它属于我们四个级别中最难的类别,并在先前关于状态追踪极限的研究中有所讨论。
这些层级可以通过变量赋值的概念直观地理解,但它们也代表了基于克罗恩-罗兹理论(Krohn–Rhodes theory)的理论驱动区分。该理论是代数的一个分支,描述了状态跟踪问题——可以视为有限幺半群上的词问题——如何分解为原子原语。我们层级结构中的每个层级都对应一类状态跟踪问题,这些问题可以由不同的原语集构建而成。
为了公平地比较这四个层级,我们从一般的变量赋值有限序列开始,并从中推导出三个更简单的版本,从而生成四个可比的 StateBench 问题——每个难度级别一个。所有这四个问题使用相同数量的变量和不同的值,且赋值出现在序列的相同位置;唯一改变的是赋值的类型。
我们发现
预训练模型
我们在 StateBech 的 r-平凡(r-trivial)、非周期(aperiodic)和一般有限层级上测试了一系列开源预训练模型,以观察其状态跟踪在何处失效,以及不同架构是否如理论预测的那样在特定地方失败。在标准的理论假设下,Transformer 可以稳健地处理 r-平凡问题(并在一定程度上处理可解和非周期问题),但理论上预计会在一般问题上失败。相比之下,具有更灵活内存更新机制的 Gated DeltaNet 原则上可以处理所有四个层级。
我们从开源预训练模型开始,这些模型的训练数据和上下文长度都有完整记录。其中包括两个拥有 70 亿参数的模型:Olmo 3(一种 Transformer)和 Olmo Hybrid(增加了 Gated DeltaNet 层),以及参数规模分别为 2.75 亿和 27 亿的较小模型。所有这些模型都在相同的数据上进行了预训练;在训练期间,没有任何模型见过超过 64,000 个 token 的上下文,而我们在测试中使用了远超该长度的输入。
在对每个模型进行评分时,几乎所有模型在 r-平凡问题上表现良好,随着输入增加,在非周期问题上的准确率下降,并在一般有限问题上保持在随机猜测水平。问题的格式在此处至关重要——2.75 亿参数的混合模型和 Gated DeltaNet 模型在 RULER 风格的 r-平凡问题上得分接近满分,但在以电子表格编辑形式呈现的相同问题上得分接近随机水平。这一差距是 StateBench 以多种格式测试同一底层问题的原因之一。
前沿模型
随后,我们测试了四个前沿模型——Gemini 3.8 Flash、Claude Opus 5.5 以及 GPT-6 Sol 和 Luna——要求它们读取每个变量赋值序列并生成每个变量的最终值。
所有四个模型在 r-平凡和非周期问题上表现良好。但在可解和一般有限问题上,随着输入变长,准确率急剧下降,在最长的通用有限问题上降至 13% 或更低。一个可能的因素是敏感性;在这些更难层级中,更多步骤会影响最终答案,留给模型错过更新而不导致结果错误的空间更少。
直接在任务上训练的模型
接下来,我们研究了模型在处理较难层级时的困难是反映了架构本身的限制,还是预训练仅仅没有教会模型解决这些问题。定向直接训练是一个更有利的设置,可以揭示状态跟踪问题在多大程度上源于底层架构和优化器,而非用于预训练的数据。
我们从零开始在 StateBench 上训练了几个拥有 2.75 亿参数的模型:两种 Transformer 变体、两种混合模型以及两种具有不同内存更新约束的 Gated DeltaNet 变体。这些模型在长达 256 个赋值的序列上进行训练,并在长达 64,000 个赋值的序列上进行测试,即最大训练长度的 250 倍。
随着序列长度的增加,这些架构开始分化。Gated DeltaNet 和混合模型在 r-平凡、非周期以及可解问题上几乎实现了完美的泛化,其测试范围延伸至我们测试过的最长序列,即数万条赋值。Transformer 学会了较简单的层级,但在更长序列上性能下降,且从未学会泛化有限问题。在最难的层级上,具有更灵活记忆更新机制的 Gated DeltaNet 变体实现了最远的泛化,在长度约为训练期间所见最长序列的十倍范围内,其表现仍接近完美。
对于 Gated DeltaNet 和混合模型而言,这一差距指向的是训练而非架构;直接进行训练时,它们学会了处理其预训练对应模型无法应对的状态追踪层级。Transformer 则不同——即使直接进行训练,它们也永远无法学会最难的那一层。
未决问题与发布
一些问题仍然悬而未决。我们的新证明表明,在论文规定的固定精度算术及舍入条件下,具有更有限记忆更新机制(非负特征值)的 Gated DeltaNet 能够解决所有非周期任务以及某些周期任务,例如追踪重复输入出现的次数是偶数还是奇数。它在层级结构中的确切位置仍然不明,包括它是否能解决所有可解任务,以及数值精度或将其与注意力层结合会如何影响其能力。StateBench 还假设变量数量固定,而真实任务通常会随时间引入新实体。例如,在长对话中,随着对话展开,会出现新的人物和物体,模型也必须开始追踪它们。当前的框架尚未涵盖这种场景。
随着新型循环架构和混合架构的不断涌现,了解每种架构能够处理何种类型的状态追踪,将有助于指导未来系统的开发与训练。我们希望 StateBench 能为研究人员提供一种更细粒度的方法,以发现模型失效之处——并为那些仍显不足的能力构建训练和评估数据。从更根本的意义上说,我们希望它能作为研究人员的“北极星”,引导他们开发出比当前模型具有更强健状态追踪能力的新架构。
📄 Tech Report | 🤗 Data | 💻 Code
We’re introducing StateBench , a benchmark for long-context state tracking —how well language models keep track of information about entities in long documents as they evolve.
State tracking underlies tasks from reading code, where variables are assigned and reassigned, to following a story as characters physically move around and objects change hands. For example, if a mystery novel states that “John gave Mary the knife” right before a murder occurs, it’s important to know that the state of each character has changed. However, not all state-tracking problems are created equal: some require only finding the latest update; harder ones require following a chain of changes, where one missed step can throw off the final answer. For example, a harder variant of our mystery state tracking would be if John gave Mary the item in his backpack, with it previously known that Edward put a knife in John’s backpack.
Transformers have well-documented theoretical limits on hard variants of state tracking with long dependency chains, helping motivate recurrent and hybrid architectures such as Gated DeltaNet that carry a running memory forward. Existing state-tracking tests tend to focus on the hardest cases, but as these designs become more common, researchers need to know which kinds of state tracking each architecture can handle. We would like to understand the differences between architectures not just on the hardest kinds of state tracking, but also on the simpler, potentially more common kinds.
To this end, we developed the StateBench benchmark to capture state-tracking problems of different complexity, which we used to evaluate the differences between language models with different architectures. We find that recurrent and hybrid models can generalize much farther than transformers when trained directly on these tasks, while frontier models including Gemini 3.8 Flash, Claude Opus 5.5, and GPT-6 Sol and Luna still break down on harder forms of state tracking as inputs grow longer.
Four levels of state tracking
StateBench consists of four difficulty levels that permit increasingly complex state update operations. For programmers, these levels of state tracking complexity can be understood as allowing different types of variable assignment operations:
R-trivial problems use immutable assignment. A variable’s value never changes, so the model only needs to recover what it was first set to. In code, this looks like let x = 4; in everyday life, it’s like a birth date—it stays fixed.
Aperiodic problems allow reassignment by value. The model needs to find the most recent value and can ignore earlier ones. In code, this looks like x = 4 followed later by x = 2; in everyday life, it’s like a thermostat, where the latest setting determines the current temperature.
Soluble problems add self-referential updates. Each update builds on the current value, so the model has to carry changes forward rather than simply find the latest assignment. In code, this looks like x = x + 5; in everyday life, it’s like a game score, where each point adds to the running total.
General finite problems add assignment by reference. One variable can take on another variable’s current value, creating dependencies across updates. In code, this looks like x = y or swapping two variables. Imagine a magician hiding a ball under one of five cups, then repeatedly swapping their positions. Finding the ball means keeping track of how those swaps change its location. This illustrates the S₅ state-tracking problem: following how successive swaps rearrange five objects. It belongs to the hardest of our four levels and is discussed in previous work on the limits of state tracking .
These levels can be intuitively understood in terms of variable assignments, but they also represent theoretically motivated distinctions in state tracking rooted in Krohn–Rhodes theory, a branch of algebra that describes how state-tracking problems – which can be viewed as word problems over finite monoids – can be decomposed into atomic primitives. Each level in our hierarchy corresponds to a class of state-tracking problems that can be built out of a different set of primitives.
To compare the four levels fairly, we start with a general finite sequence of variable assignments and derive three easier versions from it, producing four comparable StateBench problems—one at each difficulty level. All four use the same number of variables and distinct values, with assignments appearing at the same points in the sequence; only the type of assignment changes.
What we found
Pretrained models
We tested a range of open pretrained models on the r-trivial, aperiodic, and general finite levels of StateBench to see where their state tracking breaks down, and whether different architectures fail where theory predicts. Under standard theoretical assumptions, transformers can handle r-trivial robustly (and soluble and aperiodic to some degree) but are predicted to fail on general problems. In contrast, Gated DeltaNet with a more flexible memory update can, in principle, handle all four levels.
We started with open pretrained models, where the training data and context lengths are fully documented. These included two 7-billion-parameter models, Olmo 3 (a transformer) and Olmo Hybrid (which adds Gated DeltaNet layers), along with smaller models with 275 million and 2.7 billion parameters. All of these models were pretrained on the same data; none had seen contexts longer than 64,000 tokens during training, and we tested most of them on inputs well beyond that length.
When we scored each model, almost all performed well on r-trivial problems, lost accuracy on aperiodic ones as inputs grew, and stayed at chance on general finite problems. Problem format mattered here—the 275-million-parameter hybrid and Gated DeltaNet models scored near the ceiling on RULER-style r-trivial problems but were near chance on the same problems framed as spreadsheet edits. That gap is one reason StateBench tests the same underlying problem in several formats.
Frontier models
We then tested four frontier models – Gemini 3.8 Flash, Claude Opus 5.5, and GPT-6 Sol and Luna – asking them to read each sequence of variable assignments and generate the final value of every variable.
All four performed well on r-trivial and aperiodic problems. But on soluble and general finite problems, accuracy fell sharply as inputs grew longer, dropping to 13% or lower on the longest general finite problems. One likely factor is sensitivity ; at these harder levels, many more steps can affect the final answer, leaving less room for a model to miss an update without getting the result wrong.
Models trained directly on the task
Next, we investigated whether models’ difficulty with the harder levels reflects limits of the architectures themselves, or whether pretraining simply doesn’t teach models to solve them. Targeted direct training is a more favorable setting that reveals to what degree state-tracking issues come from the underlying architecture and optimizer rather than the data used to pretrain a model.
We trained several 275-million-parameter models from scratch on StateBench: two transformer variants, two hybrids, and two Gated DeltaNet variants with different memory-update constraints. The models trained on sequences of up to 256 assignments and were tested on sequences as long as 64,000 assignments, or 250 times the maximum training length.
The architectures began to diverge as sequences grew longer. Gated DeltaNet and hybrid models generalized almost perfectly on r-trivial, aperiodic, and soluble problems out to the longest sequences we tested, tens of thousands of assignments. Transformers learned the easier levels but degraded on longer sequences, and they never learned general finite problems. On the hardest level, the Gated DeltaNet variant with a more flexible memory update generalized the farthest, staying near perfect out to roughly 10 times the length of the longest sequences it saw during training.
For Gated DeltaNet and hybrid models, the gap points to training rather than architecture; trained directly, they learned to handle state-tracking levels their pretrained counterparts couldn’t. Transformers were different—even trained directly, they could never learn the hardest level.
Open questions and the release
Some questions remain open. Our new proof shows that Gated DeltaNet with a more limited memory update (non-negative eigenvalues) can solve all aperiodic tasks and certain periodic tasks, such as tracking whether a repeated input has occurred an even or odd number of times, under the paper’s fixed-precision arithmetic with rounding. Its exact placement in the hierarchy remains open, including whether it can solve all soluble tasks and how numerical precision or combining it with attention layers affects its capabilities. StateBench also assumes a fixed number of variables, while real tasks often introduce new entities over time. In a long conversation, for example, new people and objects can appear as it unfolds, and the model has to begin tracking them too. The current framework doesn’t yet cover that setting.
As new flavors of recurrent and hybrid architectures emerge, understanding which kinds of state tracking each can handle could help guide how future systems are developed and trained. We hope StateBench gives researchers a finer-grained way to find where models break down—and to build training and evaluation data for the capabilities that still fall short. More fundamentally, we hope it serves as a North Star for researchers to develop new architectures with more robust state-tracking abilities compared to current models.
首次收录 · 2026-11-04 · 10.71 分