arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2602.07672cs.SEcs.AIcs.LGcs.PLcs.SC
收藏

调试代码世界模型

Debugging code world models

Tübingen AI Center, University of Tübingen, Microsoft Research(图宾根人工智能中心、图宾根大学、微软研究院)

Babak Rahmani

AI总结:

代码世界模型通过模拟程序执行来预测运行时状态,研究发现其在长周期状态跟踪中存在token预算耗尽和字符串状态处理的局限性,提出改进监督和状态表示的方向。

摘要:

代码世界模型(CWMs)是通过预测每个执行命令后显式的运行时状态来模拟程序执行的语言模型。这种基于执行的世界建模方法使模型内部能够进行验证,提供了一种替代自然语言推理的途径。然而,错误的来源以及CWMs的局限性仍然不为人知。我们从两个互补的角度研究CWMs:局部语义执行和长周期状态跟踪。在真实的代码基准测试中,我们识别出两种主导的失败模式。首先,密集的运行时状态揭示产生大量token的执行轨迹,导致具有长执行历史的程序在token预算上耗尽。其次,失败集中在字符串值的状态中,我们将其归因于子词token化限制,而不是程序结构。为了研究长周期行为,我们使用了一个受控的排列跟踪基准测试,该测试在动作执行下隔离状态传播。我们证明,长周期退化主要由错误的动作生成驱动:当动作被替换为真实命令时,基于Transformer的CWM在长周期内准确传播状态,尽管已知Transformer在长周期状态跟踪中有局限性。这些发现表明了更高效的监督和状态表示在CWMs中的方向,这些方向更符合程序执行和数据类型。

英文摘要:

Code World Models (CWMs) are language models trained to simulate program execution by predicting explicit runtime state after every executed command. This execution-based world modeling enables internal verification within the model, offering an alternative to natural language chain-of-thought reasoning. However, the sources of errors and the nature of CWMs' limitations remain poorly understood. We study CWMs from two complementary perspectives: local semantic execution and long-horizon state tracking. On real-code benchmarks, we identify two dominant failure regimes. First, dense runtime state reveals produce token-intensive execution traces, leading to token-budget exhaustion on programs with long execution histories. Second, failures disproportionately concentrate in string-valued state, which we attribute to limitations of subword tokenization rather than program structure. To study long-horizon behavior, we use a controlled permutation-tracking benchmark that isolates state propagation under action execution. We show that long-horizon degradation is driven primarily by incorrect action generation: when actions are replaced with ground-truth commands, a Transformer-based CWM propagates state accurately over long horizons, despite known limitations of Transformers in long-horizon state tracking. These findings suggest directions for more efficient supervision and state representations in CWMs that are better aligned with program execution and data types.

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

↑