Wenhao Chai, a computer science PhD student at Princeton, has published AgenticPPL, a method that ranks command-line AI agents by scoring their logs instead of running them. In a blog post dated November 25, Chai reported a rank correlation of +0.788 with Terminal-Bench 2.1 results on 15 held-out open-weight models, against -0.495 for plain perplexity.
Perplexity measures how surprised a language model is by text, so a lower number means the model predicted it better. The correlation Chai reports, Spearman's, compares two rankings: +1 means they match exactly and -1 means one is the reverse of the other.
Why plain perplexity fails on agent logs
According to its authors, Terminal-Bench 2.1 scores agents on hard, realistic tasks in a command-line environment. Running every model through it takes sandboxes and hours of rollouts, so a score computed from fixed logs, called trajectories, would be a far cheaper stand-in.
Chai found that the obvious version of that stand-in points the wrong way. Across 40 open-weight models, plain perplexity on full trajectories ranked them backwards, according to the post.
The trouble sits in terminal output, which made up 35.7% of the bytes and on its own ranked models at -0.37. On those spans, Chai wrote, "weak agents predict text that already appeared earlier, while strong agents predict their own next step." Commands alone ranked models forwards at +0.67.
How the metric works
AgenticPPL keeps only the command tokens that depend on what the shell just printed, according to the post. A token is a small chunk of text, often part of a word. An evaluator model the post calls Flint scores each trajectory twice, once with the terminal output and once with it swapped for "[output hidden]," and tokens whose perplexity drops by more than 0.5 bits when the output is visible are kept.
That leaves about 0.30% of the bytes, the post says. In one example from the post, after the ls command prints a filename, the rule picks that filename when it appears in the next cat command.
Each model's perplexity on the kept tokens is then capped at 2 bits and averaged. One confident bet on a different valid flag "costs 10 to 40 bits and erases dozens of small wins," Chai wrote, and capping lifted the development correlation from +0.679 to +0.888.
AI agents found the rule. Chai's setup ran Claude Code on Gemini 4 Carbon as both an outer agent that rewrote trajectories and an inner agent that wrote the scoring rule, and "nobody steers them," the post says. Three parallel searches each leveled off between +0.84 and +0.90 within about two and a half hours.
Limits and how to try it
According to the post, the development set used 1,401 trajectories from the open Terminal-Lego and terminal-wrench projects, with another 960 held out. The 15 held-out models, between 21 billion and 37 billion parameters, were scored once at the end under a test fixed in advance.
Chai reported that the +0.788 result is the best of three searched rules on those models. The other two reached +0.695 and +0.683, and Chai doesn't name the held-out models.
All trajectories use the Terminus-2 agent format, the post says. Chai lists whether the approach carries over to other domains as an open question, and the work is a blog post that hasn't been peer reviewed.
A second evaluator model, Inkling 2 Mini, found a rule of the same shape when searched alone, reaching +0.889 on development models and +0.763 on held-out ones. Chai wrote that the two evaluators "point at the same kind of token," text read off earlier output.
Chai released the toolkit on GitHub under the Apache 2.0 license and the dataset on Hugging Face. Scoring a model takes one forward pass over the stored trajectories, with no sandbox and no judge model, and the post says the study ran on Princeton Research Computing's Della cluster.
Source: Wenhao Chai's blog, Wenhao Chai, PhD student, Princeton computer science (independent research), “AgenticPPL: Perplexity (on what?) is intelligence”
Additional sources: GitHub, Wenhao Chai, “AgenticPPL toolkit”; Hugging Face, Wenhao Chai, “AgenticPPL dataset”
