Self-Verification with DeepSeek V4 Flash Beats Claude Fable 5 on Terminal-Bench LLM-as-a-Verifier, a framework for fine-grained agent feedback, reports that self-verification with DeepSeek V4 Flash outperforms Claude Fable 5 on Terminal-Bench 2.1, achieving 86.5% ± 1.1% Pass@1 for Best-of-3 and 88.0% ± 0.6% for Best-of-5, compared to Pass@1 baselines of 79.4% and 78.7%, respectively, with oracle scores of 92.1% and 96.6%. The framework, available via pip install llm-verifier, also introduces version 0.2.0 with prefix-cache optimization reducing uncached input tokens by ~3.4× on trajectory-heavy benchmarks. | Documentation https://llm-as-a-verifier.com/docs/ | | https://llm-as-a-verifier.com Website | https://arxiv.org/abs/2607.05391 Paper | https://github.com/llm-as-a-verifier/TurboAgent Claude Code Plugin | https://x.com/jackyk02/status/2042347578139033628 Twitter/X | https://join.slack.com/t/llm-as-a-verifier/shared invite/zt-3utx6oe8m-86ACBqtPGfsOnpOoMJQwng Slack 🔥 LLM-as-a-Verifier achieves SOTA performance across agentic benchmarks, including Terminal-Bench, SWE-Bench Verified, MedAgentBench, RoboRewardBench and more. We invite the community to contribute more use cases pip install llm-verifier To install the latest from a clone: pip install -e . What's new in 0.2.0 full notes in CHANGELOG.md /llm-as-a-verifier/llm-as-a-verifier/blob/main/CHANGELOG.md : - Prefix-cache optimization: ~3.4× fewer uncached input tokens on trajectory-heavy benchmarks - Terminal-Bench 2.1 self-verification benchmark self-verification-terminal-bench-21 deepseek-v4-flash verifier backend- Token accounting llm verifier.token usage LLM-as-a-Verifier is a general-purpose framework that provides fine-grained feedback for any agent. The key idea is simple: 1 use fine-grained scoring granularity, 2 take the expectation over the full logprob distribution of LLM score tokens, and 3 scale repeated evaluation and criteria decomposition. The resulting fine-grained feedback can be used for test-time scaling, progress tracking, and reinforcement learning. Run a first end-to-end selection requires DEEPSEEK API KEY or VERTEX API KEY in .env , or an OpenAI-compatible server that returns logprobs — e.g. vllm serve Qwen/Qwen3.5-9B with OPENAI BASE URL=http://localhost:8000/v1 : python import llm verifier problem = "Write a function that reverses a string." candidates = "def rev s : return s ::-1 ", "def rev s : return s", "def rev s : return ''.join sorted s ", result = llm verifier.select problem=problem, candidates=candidates, criteria={"Correctness": "Does the code actually reverse the string?"}, print result.index index of the best candidate: 0 print result.scores candidate scores: 0.73104, 0.38446, 0.38449 select is built on a pairwise reward model. For the raw fine-grained rewards of a single comparison, call compare : reward a, reward b = llm verifier.compare problem, candidates 0 , candidates 1 , criteria={"Overall": "Does the code solve the problem?"}, print reward a, reward b fine-grained rewards in 0, 1 : 0.99994 0 The same fine-grained reward can also score an agent's progress after each step with track : python steps = 'Read the problem statement', 'Wrote def rev s : return s ', 'Tested: rev "abc" returned "abc"', 'Changed to def rev s : return s ::-1 ', 'Tested: rev "abc" returned "cba"', result = llm verifier.track problem=problem, steps=steps, checkpoint steps= 1, 2, 3, 4, 5 , n evaluations=4 print result.scores progress after each step: 0.00106, 0.02417, 0.03143, 0.62004, 0.99978 Can a model verify its own rollouts? On Terminal-Bench 2.1 we generate 5 mini-swe-agent trajectories per task with deepseek-v4-flash and use the same model as the verifier. Selection lands well above Pass@1 even though the verifier is judging its own model's work: | Config | Pass@1 | LLM-as-a-Verifier | Oracle | |---|---|---|---| | Best-of-3 | 79.4% | 86.5% ± 1.1% | 92.1% | | Best-of-5 | 78.7% | 88.0% ± 0.6% | 96.6% | The trajectories ship in data/terminal bench 2.1 trajs/ ; scoring only needs DEEPSEEK API KEY in .env . Each configuration has its own reproduction script: python scripts/run bo3.py best-of-3 python scripts/run bo5.py best-of-5 Each benchmark ships with its agent trajectories data/ . We use Gemini 2.5 Flash gemini-2.5-flash as the verifier for all benchmarks below. Expected results: | Benchmark | Base Model | Harness | Pass@1 | LLM-as-a-Verifier | Oracle | |---|---|---|---|---|---| | Terminal-Bench V2 | GPT-5.5 Best-of-5 | Capy | 83.1% | 86.5% | 92.1% | | SWE-Bench Verified | Opus 4.5 / Opus 4.6 / Gemini 3 Flash Best-of-3 | mini-swe-agent | 76.1% | 78.2% | 84.4% | | MedAgentBench | Claude Opus 4.8 Best-of-5 | AgentBench | 70.2% | 73.3% | 75.0% | Run a benchmark by name python scripts/run.py with no argument lists them : python scripts/run.py terminal bench python scripts/run.py swe bench python scripts/run.py medagentbench The tournament defaults can be overridden on the command line: python scripts/run.py swe bench --pivots 2 --n-evaluations 8 --seed 0 --max-workers 50 Benchmarks are defined in llm verifier/benchmarks.py — add or tweak one there. Given a task and a pool of agent trajectories, pick the best one in a few lines of code. python import llm verifier problem = "Fix the failing test in utils.py." candidates = traj 1, traj 2, traj 3, traj 4, traj 5 result = llm verifier.select problem=problem, candidates=candidates, criteria={"Root cause": "Did the agent fix the real cause?", "Verification": "Did the agent confirm the fix?"}, model="gemini-2.5-flash", verifier model n evaluations=4, repeated evaluations per criterion pivots=2, pivots < N; reduced verification cost print "Best candidate:", result.index print "Ranking:", result.ranking Under the hood, select runs the Probabilistic Pivot Tournament probabilistic-pivot-tournament to rank all N trajectories using O Nk pairwise verifications instead of a full O N² round-robin. pivots trades cost for accuracy: more pivots = more comparisons = higher accuracy. Use the verifier for your own task in three steps — Claude Code does the rest generates the criteria, writes a runner, and selects the best-of-N for you : Add your data. Copy your agent trajectories into data/task name trajs/ . Update naming. Replace every task name inwith the name of your task. add new benchmark.md Spin up Claude Code in this repo or Codex, or whatever you like — with permissions disabled and paste the contents of add new benchmark.md to let it run. The same fine-grained reward can score a trajectory at every step see track in the Quickstart fine-grained-progress-tracking . Below, we track two Terminus-2 runs of the Terminal-Bench task pytorch-model-cli . The successful trajectory exhibits consistently increasing verifier scores, whereas the failed trajectory is characterized by erroneous behaviors, resulting in lower scores throughout the execution. Reproduce it with: python scripts/terminal bench progress.py scores both runs then plots track scores a finished trajectory. To monitor an agent while it runs , use ProgressTracker : feed it each step as it happens and get a live progress score back — e.g. to stop a hopeless rollout early or decide when to resample. Since the verifier only ever sees the steps so far, it cannot peek at the future. tracker = llm verifier.ProgressTracker problem, n evaluations=4 score = tracker.update 'Read the problem statement' 0.00002 score = tracker.update 'Wrote def rev s : return s' 0.00013 score = tracker.update 'Changed to def rev s : return s ::-1 ' 0.73938 score = tracker.update 'Tested: rev "abc" returned "cba"' 0.98604 if score < 0.05: after any step: abandon a hopeless rollout early ... Replay the two Terminal-Bench trajectories step-by-step through ProgressTracker — printing a live score bar after every step, as an agent harness would see it: python scripts/terminal bench progress.py --online With a multimodal verifier model e.g. Gemini 2.5 Flash or vllm serve Qwen/Qwen3.5-9B , every entry point accepts images — a single image images="frame.png" or a list of images, each a local file path, an http s URL, or raw bytes: result = llm verifier.select problem, candidates, criteria=criteria, images= "before.png", "after.png" tracker = llm verifier.ProgressTracker problem score = tracker.update step, images="camera frame.png" per-step frame Per-step frames stay part of the trajectory for all later updates, so the verifier always sees the full visual history — e.g. camera frames while tracking a robot rollout. See the multimodal documentation https://llm-as-a-verifier.com/docs/multimodal/image inputs.html for accepted input forms, backend notes, and verified examples. TurboAgent https://github.com/llm-as-a-verifier/TurboAgent brings LLM-as-a-Verifier to Claude Code https://claude.com/claude-code as a drop-in LLM API proxy. It sits between your client and the model provider, generating multiple candidate responses in parallel and selecting the best one with a Probabilistic Pivot Tournament probabilistic-pivot-tournament . pip install git+https://github.com/llm-as-a-verifier/TurboAgent Point Claude Code at the proxy and run as usual: turbo-agent starts on port 8888 ANTHROPIC BASE URL=http://localhost:8888 claude It ships a built-in visualizer at http://localhost:8888/visualizer that shows the pipeline DAG, progress scores, candidate responses, and the final selection. See the TurboAgent repository https://github.com/llm-as-a-verifier/TurboAgent for configuration and setup details. . ├── scripts/ command-line entry points │ ├── run.py registry-driven benchmark launcher │ ├── run bo3.py reproduce the best-of-3 self-verification run │ ├── run bo5.py reproduce the best-of-5 self-verification run │ └── terminal bench progress.py re-score + plot the progress-tracking example ├── criteria/ verifier criteria + ground-truth notes │ ├── TEMPLATE.md copy this to write your own │ ├── terminal bench.md │ ├── swe bench.md │ └── medagentbench.md ├── llm verifier/ the reusable framework import llm verifier │ ├── init .py llm verifier.select ... / .compare ... │ ├── main .py python -m llm verifier