Agent traces at 32K32K 下读 agent 轨迹
We pretrain the 130M recipe from scratch on our agent traces, 4959 steps of 16 sequences of 32,768 tokens. The held-out score is bits per byte on what the model wrote: the tokens of the assistant turns in 42 held-out sessions, each predicted with the whole session before it, tool outputs included. APPL on AgenticPPL trajectories is the second score. One corpus keeps every tool output as the agent saw it; the other cuts each tool output to 4000 characters.
我们用 130M 配方从零在自己的 agent 轨迹上预训练:4959 步,每步 16 条 32,768 token 的序列。留出分数是模型所写内容的 bits per byte:42 个留出会话里 assistant 回合的 token,每个 token 都以它之前的整个会话为上下文,包括工具输出。第二个分数是 AgenticPPL 轨迹上的 APPL。一份语料保留 agent 看到的完整工具输出;另一份把每个工具输出截到 4000 个字符。
On the full corpus, Qwen3 at the recipe's learning rate has the lowest BPB of the learning rates from ×0.25 to ×4; ×0.75 and a second seed land within 0.002, and ×1.5 is 0.01 lower on APPL. GAU at the same FLOPs is far behind: the best GAU-α and the original relu² GAU both end about 0.05 BPB higher. Cutting each tool output to 4,000 characters in the training data lowers the BPB a little, 0.336 against 0.347, although the held-out sessions keep their full tool outputs. Dropping the loss on tool outputs, instead of cutting them, makes it worse. A 300M model reaches 0.297.
在完整语料上,按配方学习率训练的 Qwen3 在 ×0.25 到 ×4 的学习率里 BPB 最低;×0.75 和换一个种子都相差不到 0.002,×1.5 的 APPL 低 0.01。同样 FLOPs 的 GAU 差得多:最好的 GAU-α 和原始的 relu² GAU 都高出约 0.05 BPB。训练数据里把每段工具输出截到 4,000 个字符,BPB 略低,0.336 对 0.347,尽管留出会话保留完整的工具输出。不截断、改为不算工具输出的损失,结果更差。300M 模型达到 0.297。
Training only on the model's own turns loses at the same number of steps but wins at the same number of trained tokens: 0.337 against 0.347 on the full corpus, which takes 4.6 times the steps. With tool outputs cut to 1,000 or 4,000 characters it reaches 0.328; cut to 16,000 characters it is no better than the full corpus.
只训练模型自己的回合,在步数相同时更差,但在训练 token 数相同时更好:完整语料上 0.337 对 0.347,代价是 4.6 倍的步数。工具输出截到 1,000 或 4,000 个字符时达到 0.328;截到 16,000 个字符时和不截断一样。
Natural text does not stand in for agent traces. A 130M model trained on fineweb-edu alone scores 2.26 BPB on the same turns. Mixing fineweb-edu into the batches neither helps nor hurts: with 10% or 50% of each batch from agent traces, a model lands where a run on agent traces alone lands after reading the same number of agent-trace tokens.
自然文本替代不了 agent 轨迹。只用 fineweb-edu 训练的 130M 模型,在同样的回合上是 2.26 BPB。在 batch 里混入 fineweb-edu,既没有帮助也没有损害:每个 batch 里 agent 轨迹占 10% 或 50% 时,模型的位置和只用 agent 轨迹、读了同样多 agent token 的 run 一样。
nanotb on open agent traces在开源 agent 轨迹上的 nanotb
nanotb is the benchmark these runs turned into: one 8xH100 node, 900 seconds of training, and the lowest bits per byte on the arguments of an agent's tool calls (the commands, paths and edits it writes) in held-out trajectories. Our own traces cannot be released, so the open version uses DeepSeek-V4 trajectories in the OpenHands harness. Research agents develop on DeepSeek-V4-Flash: 48,035 trajectories of 3,447 repositories, failures included and flagged. The final score runs their training script unchanged, from scratch, on DeepSeek-V4-Pro trajectories and scores a held-out split whose 136 repositories never occur in the Flash data, so a recipe has to transfer to a model and repositories it has never seen.
这些实验最后成了一个基准,叫 nanotb:一个 8xH100 节点,训练 900 秒,比的是留出轨迹里 agent 工具调用参数(它写的命令、路径和编辑)的 bits per byte,越低越好。我们自己的轨迹不能公开,所以公开版用 OpenHands 框架下的 DeepSeek-V4 轨迹。研究 agent 在 DeepSeek-V4-Flash 上开发:3,447 个仓库的 48,035 条轨迹,失败的也在内,并有标记。最终评分把它们的训练脚本原样拿到 DeepSeek-V4-Pro 的轨迹上从零训练,再在留出集上打分;留出集的 136 个仓库从不出现在 Flash 数据里,所以方法必须能迁移到没见过的模型和仓库。
On the Flash dev split the GAU starter scores 0.284 and the Qwen3 Transformer 0.206. The GAU track started on 28 November with eight agents; its milestones run from 5% below the GAU starter to beating the Transformer.
在 Flash 的 dev 集上,GAU 起点是 0.284,Qwen3 Transformer 是 0.206。GAU 赛道 11 月 28 日开始,8 个 agent;里程碑从比 GAU 起点低 5%,一直到超过 Transformer。
What the metric scores指标算的是什么文本
AgenticBPB scores the arguments of every tool call: 6.97 MB of text in the 495 Flash dev sessions and 11.27 MB in the 743 Pro held-out sessions, 10.6% of all session bytes in both. This text cannot be memorised from the training set: under 0.1% of its bytes are whole calls that also occur in a 5,000-session training sample, and no two sessions share more than half of their argument 8-grams. It is narrow in four other ways.
AgenticBPB 只算每个工具调用的参数:Flash dev 的 495 个会话里有 6.97 MB,Pro held-out 的 743 个会话里有 11.27 MB,两者都占会话总字节的 10.6%。这部分文本不能靠背训练集得到:只有不到 0.1% 的字节是在 5,000 个训练会话样本里原样出现过的完整调用,任意两个会话的参数 8-gram 重合都不到一半。但它在另外四个方面很窄。
| Flash dev | Pro held-out | |
|---|---|---|
Bytes from execute_bash / str_replace_editorexecute_bash / str_replace_editor 的字节 | 57.4% / 33.4% | 41.3% / 58.7% |
Bytes from finish messagesfinish 消息的字节 | 8.8% | 0.0% |
| Bytes inside a verbatim copy (≥ 32 bytes) of earlier session text原样复制会话前文(≥ 32 字节)的字节 | 63.3% | 73.5% |
| Repositories (effective number) / largest repository's share仓库数(有效数)/ 最大仓库的占比 | 66 (8.1) / 30.0% | 136 (23.4) / 12.0% |
| Largest single session's share最大单个会话的占比 | 1.5% | 7.7% |
First, two tools carry over 90% of the bytes, and their mix shifts from Flash to Pro. Second, most bytes copy earlier context: the edit's old_str repeats text the agent read, and new_str repeats most of old_str. Only 19.9% of dev bytes and 13.4% of held-out bytes are not part of a copy of 16 bytes or more. This is why context length matters so much here. Third, a few repositories dominate the dev split: one of 66 holds 30% of the bytes. Fourth, a few broken calls weigh a lot: one 84,887-byte repetition glitch is 1.2% of dev, and one held-out session that loops on truncated edits is 7.7% of held-out. The audit also found four pull requests that appear twice in Flash dev under two ID formats, and two repositories renamed between train and evaluation.
第一,两个工具占了 90% 以上的字节,而且两者的比例从 Flash 到 Pro 变化很大。第二,大部分字节是在复制前文:编辑的 old_str 重复 agent 读过的文件,new_str 又重复 old_str 的大部分。不属于 16 字节以上复制片段的字节,在 dev 里只有 19.9%,在 held-out 里只有 13.4%。这就是上下文长度在这里如此重要的原因。第三,dev 集被少数仓库主导:66 个仓库里有一个占了 30% 的字节。第四,少数坏调用权重很大:一个 84,887 字节的重复故障调用占 dev 的 1.2%,held-out 里一个反复提交截断编辑的会话占 7.7%。核查还发现 Flash dev 里有 4 个 PR 以两种 ID 格式各出现一次,以及 2 个仓库在训练集和评测集之间改过名。
Acknowledgements致谢
The author is pleased to acknowledge that the work reported on in this post was substantially performed using the Princeton Research Computing resources at Princeton University. Princeton Research Computing is a consortium of groups including the Princeton Institute for Computational Science and Engineering (PICSciE) and Research Computing at Princeton University.
本文报告的工作主要使用普林斯顿大学 Princeton Research Computing 的计算资源完成。Princeton Research Computing 是由普林斯顿计算科学与工程研究所(PICSciE)和普林斯顿大学 Research Computing 等团队组成的联合体。
Experiment record实验记录
Citation
@misc{chai2026nanotb,
title = {A Speedrun Benchmark on Agent Traces},
author = {Chai, Wenhao},
year = {2026},
howpublished = {Blog post},
url = {https://wenhaochai.com/exps/nanotb.html}
}