Guiding black-box large language model agents with the Pitfall-Anticipating World Model (PAWM)Steering Black-Box Large Language Model Agents with Pitfall Anticipation World Model
The authors propose PAWM: a world model that intervenes to guide a black-box LLM agent only when it anticipates a trap, raising Claude Sonnet 4.5's Acc on ScienceWorld from 54.6% to 78.9%.
- Black-box LLM agents lack knowledge of how a specific task environment responds to actions, while existing world models mostly predict the next observation step by step, which the authors consider both expensive and insufficiently informative; what a world model should output and when it should intervene remain unsettled.
- First conduct a pilot study to determine two design principles, then propose PAWM: the world model normally outputs <pass> to stay silent, and gives forward-looking guidance only when it anticipates a pitfall; training has two stages, SFT (on a synthetic pitfall dataset) and GRPO co-training with the black-box agent.
- On ScienceWorld and WebArena-Lite, PAWM+GRPO guiding Claude Sonnet 4.5 achieves Acc of 78.9% and 80.4%, respectively, higher than the 54.6% and 72.7% without guidance and higher than each baseline; the authors state that the trap knowledge can transfer to other backbone models.
- The authors note: the experiments mainly use Claude Sonnet 4.5 as the black-box agent, without separate co-training for each backbone; they are limited to two benchmarks; the world model is task-specific; and pitfall annotations come from LLM hindsight annotation, which may contain noise or teacher-model bias.
- Evaluated models
- Claude Sonnet 4.5Haiku 4.5Opus 4.5GLM 5Kimi K2.5
- Benchmarks
- ScienceWorldWebArena-Lite
- Metrics
- AccPass@3ACRIR#Calls
PAWM guides black-box large language model agents through selective anticipation of multi-step traps, improving Claude Sonnet 4.5's performance by 24.3% on ScienceWorld and by 7.7% on WebArena-Lite. The method intervenes when potential traps appear and predicts imminent failures; it first performs SFT on synthetic data with annotated traps, then co-trains with a black-box LLM via GRPO, outperforming a series of baselines.
Paper analysis
What problem does this paper attempt to solve?
How to use a world model to supply environment knowledge to black-box LLM agents: what it should output and when it should intervene.
Core question: what a world model should output and when it should intervene to effectively guide black-box LLM agents that cannot be fine-tuned.
- Scenario and motivation: frontier LLMs such as GPT-5 and Claude are deployed in various agent applications and have strong general capabilities, but the authors believe what they lack is reliability in specific task environments—knowledge of how the environment will respond to actions; because the models are black boxes, this knowledge cannot be injected by fine-tuning weights.
- Shortcomings of existing methods: the authors state that existing black-box guidance methods mainly assist planning (decomposing subgoals, giving high-level action sequences), reinforcing capabilities the model already has; existing world models mostly act as simulators predicting the next observation step by step, which the authors consider both expensive and often uninformative, and Qian et al. (2026) found that generative world models give no consistent benefit to agents and are sometimes worse than not using them.
- Core observation: the authors' pilot study on ScienceWorld and WebArena-Lite proposes two design principles—guidance is most useful when predicting "multi-step futures bounded by meaningful milestones," and its value is concentrated at potential pitfalls.
- Method proposed in the paper: Pitfall Anticipation World Model (PAWM), which intervenes only when it anticipates a pitfall and gives forward-looking guidance, obtained through two stages: SFT (on a synthetic pitfall dataset) plus GRPO co-training with the black-box LLM.
- Setting: the agent is a frozen black-box policy π that can only be queried, not updated; the world model ωθ is an externally trained module that injects guidance into π's context at inference time, without selecting actions for π or performing search; experiments use Claude Sonnet 4.5 as the black-box agent and Qwen3.5-27B as the world-model backbone.
What related research exists?
Related work falls into two categories, steering black-box LLMs and world models; the authors position this paper as world-model-in-the-loop steering and systematically study output and timing.
Steering Black-box LLMs
- Shin et al. (2020), Fernando et al. (2024)—automatic prompt optimization, searching for one fixed prompt for all inputs; the paper notes that such static prompts cannot adapt to individual tasks.
- Li et al. (2023)—trains a smaller model to generate per-task guidance, with the target LLM unchanged.
- Li et al. (2024), Asawa et al. (2025), Lingam et al. (2026), Liu et al. (2026a)—train lightweight advisor models to give high-level pre-task guidance in agent tasks; the paper notes that these advisors mainly do planning or task decomposition and still build on the black-box model's existing general reasoning ability rather than injecting knowledge it lacks.
World Models
- Ha and Schmidhuber (2018), Hafner et al. (2019b,a)—latent dynamics models for the visual control domain, used for planning or policy learning.
- Three uses of world models for LLM agents: generating synthetic experience (Gao et al., 2025; Chen et al., 2025; Ding et al., 2026), internalizing environment dynamics into the agent (Zhang et al., 2025; Yu et al., 2025, 2026b), and assisting action selection through simulation and search (Zhao et al., 2023; Gu et al., 2024; Chae et al., 2025; Zheng et al., 2026; Guan et al., 2026).
- Qian et al. (2026), Zhang et al. (2026)—explore interaction modes in which a world model continuously assists within the agent loop; the paper notes that they do not systematically study how a world model should help an agent.
Baselines and benchmarks: the baselines compared in the main experiments are N/A (no guidance), RAG (retrieving successful trajectories of similar tasks and injecting them into context), Pre-Task Guidance (Qwen3.5-27B generating pre-task guidance), and three world-model variants, Next-Obv/Full-Traj/SubGoal-Traj; the evaluation benchmarks are ScienceWorld and WebArena-Lite.
Positioning: the authors state that unlike candidate ranking or tree-search-style uses, this paper keeps the world model directly in the agent loop, providing guidance at execution time, and systematically answers the two questions of "what information to output and when guidance is most useful."
How does the paper address this problem?
PAWM normally outputs <pass> silence and only gives guidance when it anticipates a trap, trained through two stages: SFT and GRPO.
Overall approach: first, through a pilot study, determine two design principles—what the world model outputs and when it intervenes—and then build Pitfall Anticipation World Model (PAWM) on that basis: a trainable world model that monitors a frozen black-box LLM agent and, only when it foresees an imminent failure, describes the pitfall and gives forward-looking guidance.
Problem setting
- The task is formalized as a POMDP M = (S, A, O, T, R); the agent acts based on the interaction history ht and is a frozen black-box policy π that can only be queried, not updated.
- At each step, the agent first proposes a tentative action ãt, the world model generates guidance gt ∼ ωθ(·|ht, ãt) based on it, and the agent then re-proposes action at incorporating the guidance; only at is executed.
- Both the agent and the world model work in rounds: at each step they query with a history ht rebuilt from scratch to compress long observations (e.g., WebArena's HTML pages), and the reconstruction omits previous world-model guidance to prevent it from carrying over into subsequent decisions.
PAWM's output mechanism
- When the tentative action does not anticipate a pitfall, PAWM outputs the special format <pass>, injects no guidance, and the agent directly executes ãt.
- Otherwise it outputs guidance gt: describing the imminent failure and how to avoid it, and the agent re-proposes an action accordingly. The gating corresponds to "when to intervene," and the guidance content corresponds to "what to output"—multi-step forward-looking guidance concentrated at pitfalls.
Stage 1: SFT on a synthetic pitfall dataset
- Trajectory collection: run the black-box agent three times repeatedly on the training set at sampling temperature 1.0, keeping successful and failed trajectories; failures are located at the error position, and successes provide the correct continuation as a contrast.
- Pitfall annotation: use a separate LLM (Claude Sonnet 4.5) as annotator, comparing successful and failed trajectories of the same task to locate key pitfall steps and describe the failure risk; the remaining steps are labeled <pass>. Tasks with only successful trajectories are annotated for residual pitfalls (e.g., non-fatal suboptimal detours); tasks with only failed trajectories are rerun with ground-truth guidance injected to obtain successful trajectories, which are then compared.
- Leakage prevention: the annotator is required to describe pitfalls based only on information observable by the agent before that step, in abstract wording, to avoid hindsight knowledge leakage.
- Training objective: minimize the negative log-likelihood loss on dataset D, LSFT(θ) = −𝔼(ht, ãt, gt)∼ D log ωθ(gt|ht, ãt); since most steps are <pass>, <pass> steps need to be downsampled to an empirically chosen <pass>-to-anticipation ratio.
Stage 2: GRPO co-training with the black-box agent
- Motivation: the authors believe SFT optimizes agreement with the annotator, not whether the guidance actually helps the agent succeed.
- Sample K trajectories for task q as a group, with PAWM interacting with the agent in the loop, compute group-relative advantages from outcome rewards, and optimize ωθ according to the GRPO objective (including clip ratio ϵ and KL penalty coefficient β to the reference model).
Evaluation method
- Benchmarks: ScienceWorld (30 task types, 708 training and 271 test variants) and WebArena-Lite (165 validated tasks out of 812 for evaluation, 647 for training).
- Metrics: task success rate Acc (averaged over three runs, with standard deviation reported) and Pass@3 (at least one success in three runs); the pilot study also reports ACR (proportion of guidance that led to action modification), IR (actual intervention rate), and #Calls (number of black-box queries per task).
What experiments did the paper conduct?
PAWM+GRPO has the highest Acc on both benchmarks (78.9%/80.4%), and the authors state that pitfall knowledge can transfer to other backbones.
Experimental setup
- Agents tested: the main experiments use Claude Sonnet 4.5 (accessed via the Amazon Bedrock API); transfer experiments additionally test Claude Haiku 4.5, Claude Opus 4.5, GLM 5, and Kimi K2.5.
- World model: all use Qwen3.5-27B as the backbone; the pilot study collected 2,124 ScienceWorld trajectories and 1,941 WebArena trajectories to build SFT data.
- Benchmarks: ScienceWorld (708 training and 271 test task variants) and WebArena-Lite (165 evaluation tasks, 647 training tasks); the WebArena RL environment uses WebServ's Incus containers to isolate per-task state.
- Baselines: N/A, RAG (Qwen3-Embedding-0.6B retrieval), Pre-Task Guidance, and three world-model variants: Next-Obv/Full-Traj/SubGoal-Traj.
- Metrics and judging: Acc (average of three runs, with standard deviation), Pass@3, ACR, IR, #Calls; WebArena evaluation replaces the rule-based evaluator with an LLM judge giving binary rewards (the paper says the rule-based evaluator has many false positives); the judge model is not stated in the paper.
- Evaluation details: at evaluation time, both agent and world model temperatures are set to 0, and each evaluation is run three times and averaged; GRPO hyperparameters are in Table 7 (5 epochs, 8 agents per group, learning rate 2e-6, etc.).
Main results
According to Table 4 (Acc%, average of three runs ± standard deviation; Pass@3%):
Swipe horizontally to read the table
Guidance method ScienceWorld Acc ScienceWorld Pass@3 WebArena-Lite Acc WebArena-Lite Pass@3 N/A 54.6±1.9 66.8 72.7±0.6 80.0 RAG 70.2±1.4 78.6 73.3±2.1 81.8 Pre-Task Guidance 69.2±1.9 79.3 74.3±1.3 81.8 Next-Obv WM 58.5±1.7 71.6 73.1±0.9 81.2 Full-Traj WM 65.6±1.1 80.1 71.1±2.1 80.6 SubGoal-Traj WM 67.6±1.6 79.0 74.3±2.1 81.8 PAWM (Ours) 71.4±1.7 84.5 75.0±1.8 85.5 PAWM + GRPO 78.9±0.9 87.5 80.4±1.3 86.1 - The authors state that PAWM (+GRPO) is best on both benchmarks and both metrics, improving Acc over the unguided agent by 24.3% (ScienceWorld) and 7.7% (WebArena-Lite), respectively.
- The authors observe that GRPO improves Acc far more than Pass@3, and consider the two stages complementary: SFT provides the environment knowledge that determines the Pass@3 ceiling, and GRPO lets the agent realize it more consistently.
- Exception: Full-Traj WM has an Acc of 71.1% on WebArena-Lite, lower than the unguided baseline's 72.7%; in the pilot study the authors attribute this to long-horizon prediction accumulating errors and interfering with agents already on track.
Pilot study: output content and intervention timing
- Output content (Table 1, intervening at every step): SubGoal-Traj has the highest Acc on both benchmarks (ScienceWorld 66.7%, WebArena-Lite 74.1%); Next-Obv gives limited improvement, and Full-Traj on WebArena-Lite (71.1%) is lower than the baseline; the authors conclude that the value of the world model lies in multi-step foresight bounded by meaningful milestones.
- Semantic analysis: using Claude Sonnet 4.5 to binary-classify 400 guidance instances per group, 76.8% in the CHANGED group are pitfall anticipation, versus only 29.0% in the UNCHANGED group (χ² = 181.1, df = 1, p < 0.001);词法分析(Table 2)中区分度最高的词与失败或停滞相关。
- 门控消融(Table 3,SubGoal-Traj 世界模型加 LLM 分类器门控):ScienceWorld 上 Pitfall-only 的 Acc 65.2% 接近 All 的 66.7%,#Calls 从 36.5 降到 26.7;Non-pitfall-only 为 58.4%;WebArena-Lite 上 Pitfall-only 72.9% 对 All 74.1%,#Calls 从 20.0 降到 12.8。作者称陷阱预判以低得多的成本保留了大部分收益。
GRPO 应用于基线与迁移实验
- 基线加 GRPO(Figure 2,ScienceWorld):对 Pre-Task Guidance 和各世界模型变体从 SFT 检查点施加 GRPO;作者称 GRPO 后 PAWM 的 Acc 与 Pass@3 仍为所有方法中最好(图中具体数值在文本中不可读)。WebArena-Lite 因在线交互成本高、速度慢,只对 PAWM 跑了 GRPO。
- 迁移性(Figure 3):把与 Claude Sonnet 4.5 协同训练的 PAWM (+GRPO) 直接接到 Haiku 4.5、Opus 4.5、GLM 5、Kimi K2.5 上;作者称所有受测骨干的准确率均有提升,认为学到的陷阱知识不绑定于协同训练时的智能体(图中具体数值在文本中不可读)。
其他消融与分析
- <pass>-to-anticipation ratio (Table 5): the larger the ratio, the lower the IR at evaluation; the best Acc is at ratio 1.0 on ScienceWorld (72.3%) and 0.75 on WebArena-Lite (75.0%), while at the original ratio orig, IR is only 3.2%/14.6% and Acc is lowest (67.2%/69.9%).
- Qualitative examples: Figures 5–7 in Appendix H give examples of PAWM guiding agents to avoid pitfalls (two ScienceWorld tasks, one WebArena-Lite task).
What are some points that can be further explored?
The authors list four types of limitations: agent scope, number of benchmarks, task specificity, and annotation noise.
Limitations and future directions noted by the authors
- Agent scope (Limitations): due to access and query costs of proprietary models, the experiments mainly use Claude Sonnet 4.5 as the black-box agent for trajectory collection and GRPO co-training; although the resulting PAWM can transfer to other backbones at evaluation time, the authors did not co-train separately with each backbone, and differences in optimal pitfall anticipation across agents remain unexplored.
- Benchmark scope (Limitations): the study is limited to ScienceWorld and WebArena-Lite, and the high cost of online interaction (especially WebArena-Lite) limits the scale of reinforcement learning experiments.
- Task specificity (Limitations): the world model studied is task-specific, trained on trajectories from specific environments rather than a large-scale general world model; the authors state that conclusions should be interpreted within this setting and may not directly generalize to world models trained across multiple environments.
- Annotation quality (Limitations): PAWM relies on synthetic pitfall supervision generated by LLM hindsight annotation; although annotation is constrained to use only information before the current step, it may still contain noise or teacher-model bias, and the pitfall definition may not cover all forms of suboptimal behavior.
Experimental coverage
- 5 agents were tested: the main experiments and co-training use only Claude Sonnet 4.5, and transfer evaluation covers Claude Haiku 4.5, Claude Opus 4.5, GLM 5, and Kimi K2.5 (Figure 3).
- The benchmarks are ScienceWorld (271 test task variants) and WebArena-Lite (165 evaluation tasks); GRPO on WebArena-Lite was run only for PAWM, and baseline methods did not undergo GRPO on that benchmark.
- Each evaluation run was repeated three times and averaged, with standard deviation reported; the semantic analysis sample is 400 guidance instances per group.
- The paper does not report specific numerical values for each method in Figure 2 and Figure 3 (the main text gives only trend conclusions).
- WebArena evaluation replaces the rule-based evaluator with an LLM judge to give binary rewards; the paper does not state which model the judge uses, nor does it report agreement between the judge and human judgments.
Summarize the main content of the paper
PAWM makes a trainable world model intervene only when it anticipates a pitfall, guiding a black-box agent, with the highest Acc on two benchmarks.
A methods paper on guiding black-box LLM agents with a world model, answering two design questions: what the world model should output and when it should intervene.
- Problem: black-box LLM agents lack knowledge of how a specific environment responds to actions, which cannot be injected by fine-tuning; the authors state that existing world models' step-by-step next-observation prediction is expensive and uninformative.
- Pilot study: on ScienceWorld and WebArena-Lite, with Claude Sonnet 4.5 as the agent and Qwen3.5-27B as the world-model backbone, they find that multi-step foresight bounded by the next subgoal (SubGoal-Traj) works best; 76.8% of guidance in the CHANGED group is pitfall anticipation (29.0% in the UNCHANGED group, p < 0.001);只放行陷阱类引导的门控以更少黑盒调用接近每步引导的表现。
- 方法:PAWM 在无陷阱时输出 <pass> stays silent and gives forward-looking guidance when it foresees failure; first SFT on a synthetic pitfall dataset annotated by Claude Sonnet 4.5, then GRPO co-training with the frozen black-box agent in the loop.
- Main results (Table 4): PAWM+GRPO achieves Acc 78.9% and Pass@3 87.5% on ScienceWorld, and Acc 80.4% and Pass@3 86.1% on WebArena-Lite, all higher than unguided (54.6%/72.7%) and baselines such as RAG, Pre-Task Guidance, and the three world-model variants.
- Other findings: the authors state that PAWM remains best after applying GRPO to the baselines as well (Figure 2); PAWM co-trained with Sonnet 4.5, when directly attached to Haiku 4.5, Opus 4.5, GLM 5, and Kimi K2.5, improves accuracy on all (Figure 3).
- Authors' conclusion: anticipating pitfalls is an effective way for a world model to assist black-box LLM agents; the authors also note that the experiments are limited to a single main agent, two benchmarks, a task-specific world model, and reliance on LLM hindsight annotation that may contain noise.