Apply to my task
arXiv:2512.02002 ★ 76 Dec 4, 2025

Static Simulation with LLMs: Check Your Instructions Before You Run Them

Key result

An LLM can "execute" code without running it — it reads the instruction text and predicts the outcome in words. Accuracy is 97.5-100% compared to real robot simulators. The method lets you check plans, code and multi-step processes BEFORE the real run — finding errors without spending money and time on fixing them later. The trick: three agents in a loop. The Generator creates instructions → the Simulator statically simulates them (describes in words what will happen at each step) → the Evaluator compares with the goal and gives specific feedback for the fix. The loop repeats until it matches or hits the iteration limit.

01

TL;DR

Static simulation with LLMs is a three-agent checking technique: one model generates instructions or code, a second one "executes" them statically (describes in words what will happen), and a third finds the errors and gives feedback for the fix. The loop repeats until the result is right. The research demonstrated it on robots: an LLM generates drone-control code → another LLM "reads" the code and describes the flight paths → a third compares that with the task and points out the mismatches.

The main finding: an LLM can statically simulate execution — not by actually running the code, but by analyzing its text and predicting the outcome. The accuracy of this simulation is 97.5-100% compared to real robot simulators. It works because LLMs are good at reasoning about cause and effect: "if the drone turns 90° and flies 5 meters along the Y axis, it ends up further east, not further north." A semantic description ("flew east") catches errors better than numbers ("X=0, Y=5, Z=2").

How the method works: Three agents run in a loop. The Generator creates the instructions. The Simulator "executes" them statically — reads the text and describes, step by step, what will happen. The Evaluator compares that description with the goal, finds the mismatches and writes feedback. The Generator fixes things based on the feedback. Repeat until it matches or you hit the iteration limit.

Want this for your own case? Apply this study to your task: AI adapts its method to what you are working on and writes the prompt.

02

Method Blueprint

ITERATION LOOP (until it matches or max iterations):

STEP 1 — Generator: 
Task → Code/instructions (first version or a version fixed per feedback)

STEP 2 — Simulator:
Code/instructions → Static simulation → Semantic description of the outcome

STEP 3 — Evaluator:
Description + Task → Find mismatches → Feedback (if there are errors)

→ If there is feedback: go back to STEP 1 to correct
→ If there are no mismatches: the final result is ready

All three steps need separate LLM calls. Each agent is its own prompt with its own role.

03

Example

Task: Sanity-check a launch plan for a new product on Amazon before actually going live. Lots of steps (photos, listing copy, price, inventory shipment, ads), and a mistake at any stage means lost money and time.

Prompt for the Generator:

Create a step-by-step launch plan for the product "Self-Heating Travel Mug" on Amazon.
Launch budget: $2,000.
Goal: break into the top 100 of the category within a month.

Prompt for the Simulator:

You are a business-process simulator. Read this Amazon launch plan:

[paste the plan from the Generator]

Describe in words what will happen at each step:
- What resources get spent
- What results we get
- What state we end up in after each action

Format: a step-by-step description of the trajectory from start to finish.

Prompt for the Evaluator:

Compare this plan and its simulation against the goal "break into the top 100 on Amazon within a month on a $2K budget".

Plan: [paste the plan]
Simulation: [paste the description from the Simulator]

Find the mismatches:
- Where will the actions fail to reach the goal?
- Where does the budget not cover the costs?
- What was forgotten or done wrong?

Give specific feedback for the fix.

Result:

The three agents run in a loop (in separate chats or one after another in the same one). The Generator writes the plan → the Simulator describes what will happen ("after $1K on ads the product sits at rank 150, not in the top 100") → the Evaluator spots the mismatch ("the budget is split wrong: too much on photos, too little on promotion"). The Generator fixes it. After 2-3 iterations you have a vetted plan without paying real money for the mistakes.

04

Why It Works

The LLM's weakness: A model often generates plausible but wrong instructions. Ask for a plan and you get a nicely written text full of logical holes. The LLM doesn't see the consequences of its own advice unless you explicitly ask it to.

The LLM's strength: A model reasons about cause and effect really well once you give it context and a role. "Read this code and describe what will happen" — and the LLM traces the execution logic step by step. A semantic description ("the drone will fly east instead of north") is easier to grasp than numbers ("Y=5 instead of X=5"), which makes errors easier to find.

How the method uses that strength: It splits the roles — the Generator creates without the pressure of checking, the Simulator thinks only about consequences, the Evaluator compares with the goal without generating anything new. Each agent does one job well. Static simulation is faster and cheaper than real execution (no robot, simulator or running code needed), yet it delivers the same level of insight through a text description.

Control knobs:

  • Number of iterations — lower it for simple tasks (2-3 is enough), raise it for complex ones (5-7 for multi-step processes)
  • Simulation detail — ask the Simulator to "describe every step in detail" or "only the key transitions" (saves tokens)
  • Evaluator strictness — say "find any deviation" or "only critical errors"
  • Feedback format — "specific edits" vs "general recommendations"
05

Prompt Template

For the Generator:

Create a {instruction type: plan/algorithm/code} for the task: {task description}.

Requirements:
{specific constraints: budget/time/resources}

Goal:
{desired outcome}

Format: step-by-step instructions with explanations.

For the Simulator:

You are a process simulator. Read these instructions:

{paste the instructions from the Generator}

Describe in words what will happen at each step:
- What the state is before the step
- What the step does
- What the state is after the step
- What resources are spent

Format: a semantic description of the trajectory from start to finish. No execution — only analysis of the text and prediction.

For the Evaluator:

Compare the instructions and their simulation with the goal of the task.

Task: {task description}
Goal: {desired outcome}

Instructions: {paste from the Generator}
Simulation: {paste from the Simulator}

Find the mismatches between the simulation and the goal:
- Where will the actions fail to produce the result?
- What was forgotten or done wrong?
- Which steps violate the constraints?

Give specific feedback for the fix. If there are no mismatches, write "Ready to execute".

Placeholders: - {instruction type} — a launch plan, a data-processing algorithm, a script - {task description} — what needs to be done - {specific constraints} — budget, time, resources, technical requirements - {desired outcome} — the success criterion


🚀 Quick start — paste this into the chat:

Here is a template for static simulation with three agents (Generator → Simulator → Evaluator). 
Adapt it to my task: [your task]. 

Ask me questions so you can fill in the agents' roles for my context.

[paste the three templates above]

The LLM will ask about your task, constraints and success criteria — because every agent needs to know the context. It will take the three-agent pattern and build prompts specific to your situation. You end up with three ready-to-go prompts to run the checking loop.

06

Limitations

⚠️ Simulation accuracy: The LLM simulator reaches 97.5-100% accuracy, but it isn't perfect. On complex multi-step processes involving arithmetic or scientific knowledge it can get predictions wrong. Double-check the critical steps.

⚠️ Cost of iterations: Three agents x several iterations = lots of tokens. For simple tasks it can be overkill — use it when the cost of a mistake is high (money, time, safety).

⚠️ Multi-call workflow: You have to copy outputs between agents by hand or use separate chats. It's not one message — it's a full process.

⚠️ Not for expert domains: If the task needs deep expertise (medicine, law, engineering), the simulation can miss non-obvious errors — an LLM won't replace a specialist.

07

How They Tested It

Researchers from the University of Massachusetts and California State University tested the idea on drone control — tasks where a mistake is expensive (a crashed drone). They took 20 hard tasks like "fly a 5x5 meter square, turning perpendicular on each side" (6-19 actions per task).

They compared four approaches: 1. Direct — the LLM analyzes the code directly and gives feedback (no simulation) 2. Numerical — a real drone simulator outputs coordinate numbers (X=5, Y=0, Z=2) 3. Semantic (SOTA) — a real simulator + translating the numbers into text ("flew 5 meters north") 4. Their method — an LLM simulator outputs a text description with no real execution

The surprise: the LLM simulator, without actually running the code, showed the same accuracy as a real simulator with semantic translation (Success Rate 85-93%, Completeness 97-98%). The Direct method flopped (33-55% SR) — proof that an LLM can't reliably check code by eyeballing it; it needs the simulation.

The key practical insight: semantics ("flew the wrong way") exposes errors better than numbers ("Y=5 instead of X=5") — even an experienced human finds "flew east instead of north" easier to grasp. With such descriptions the LLM finds 90-93% of errors vs ~70% with direct analysis and no simulation.

Why they reached these conclusions: LLMs are good at reasoning about consequences ("if you turn 90° and fly along Y, you'll end up further east") but bad at directly checking logic ("is this code written correctly?"). Splitting the roles (create → simulate → evaluate) plays to the strengths and sidesteps the weaknesses.

They tested on two different systems (a simple AirSim controller + the more advanced PX4) and two models (o3-mini, o4-mini) — the results held steady, so the principle works across the board.

08

Adaptations and Extrapolations

🔧 Technique: One agent instead of three → a lightweight check

For simple tasks (5-10 steps) you can merge all the agents into one prompt:

Create a plan for: {task}

Then:
1. Simulate the execution (describe what will happen at each step)
2. Compare the simulation with the goal
3. Find the errors and fix the plan

Give me the final version with an explanation of what you fixed.

Effect: Faster (one call instead of a loop), but less reliable — without explicit role separation the LLM can miss non-obvious errors. Good enough when the cost of a mistake is low.


🔧 Technique: Add a "pessimist" simulator → sharper criticism

Run two simulators in parallel — an optimist and a pessimist:

Optimist simulator: Describe what will happen if everything goes according to plan.
Pessimist simulator: Describe what will go wrong — which risks and failures are possible at each step.

The Evaluator gets both versions and gives deeper feedback.

Effect: Uncovers non-obvious risks that a single simulator would miss. Useful for high-stakes tasks (money, safety, reputation).


🔧 Technique: Numeric checkpoints in the simulation → debugging complex processes

Ask the Simulator to add concrete metrics to the semantic description:

At each step, state:
- Semantics: what is happening, in words
- Metrics: budget remaining, time spent, progress toward the goal (%)

Sample output: "Step 3: Launched ads (semantics: impressions started in Amazon search). Spent $600 of $2K, $1.4K left. Progress toward the top 100: we expect 20% within a week."

Effect: You see not only WHAT is happening but also HOW CLOSE you are to the goal. Makes it easier to spot bottlenecks in long processes.

09

Resources

LLM-Driven Corrective Robot Operation Code Generation with Static Text-Based Simulation

Authors: Wenhao Wang, Yi Rong, Yanyan Li, Long Jiao, Jiawei Yuan
Affiliations: University of Massachusetts Dartmouth, California State University San Marcos

Submitted to IEEE (2025)

Research digest

Key result

An LLM can "execute" code without running it — it reads the instruction text and predicts the outcome in words. Accuracy is 97.5-100% compared to real robot simulators. The method lets you check plans, code and multi-step processes BEFORE the real run — finding errors without spending money and time on fixing them later. The trick: three agents in a loop. The Generator creates instructions → the Simulator statically simulates them (describes in words what will happen at each step) → the Evaluator compares with the goal and gives specific feedback for the fix. The loop repeats until it matches or hits the iteration limit.

Principle

Split the roles instead of single-shot generation. The Generator creates without the pressure of checking. The Simulator thinks only about consequences — it reads the instructions and traces what will happen step by step. The Evaluator compares the description with the task's goal and finds the mismatches. Each agent does one job well — none of them tries to generate AND check at the same time. A semantic description ("the drone will fly east instead of north") makes errors easier to spot than numbers ("Y=5 instead of X=5"). The Simulator doesn't actually execute anything — it reasons about cause and effect through text.

Why it works

LLMs are strong at reasoning about consequences but weak at checking themselves while generating. Ask for a plan and you get a nicely written text full of logical holes. The model doesn't see the consequences of its advice until you explicitly ask "so what happens next?". Static simulation is faster and cheaper than real execution (no robot or code run needed), yet it gives the same level of insight. Splitting the roles lets each model focus: the Generator creates without fear of mistakes, the Simulator analyzes without generating anything new, the Evaluator judges without producing alternatives. Semantics works because words about actions ("will turn right and go 5 meters") are closer to human logic than coordinates — it's easier to notice "wait, that's the wrong way."

When to apply

Checking multi-step processes before launch → specifically plans where mistakes are costly (money, time, reputation), especially when real-world testing is expensive or slow. Launching a product on a marketplace, building a data-processing algorithm, planning a business process, designing an automation scenario. NOT suitable for expert domains (medicine, law, engineering calculations) without a final check by a specialist — the LLM will miss non-obvious errors that only a pro can see.

Mini recipe

1. Generator (creation): State the task clearly: `Create a {plan/algorithm/code} for {task}. Constraints: {budget/time/resources}. Goal: {success criterion}`. Get the first version of the instructions. 2. Simulator (prediction): Give it a role: `You are a process simulator. Read these instructions: [paste from the Generator]. Describe in words what will happen at each step: what the state is before the step, what the step does, what the state is after, what resources are spent`. Get a semantic description of the trajectory. 3. Evaluator (checking): Feed it everything: `Task: {description}. Goal: {outcome}. Instructions: [from the Generator]. Simulation: [from the Simulator]. Find the mismatches: where will the actions fail to reach the goal? what was forgotten? which steps violate the constraints? Give specific feedback`. If there are mismatches, go back to step 1 and add the feedback to the Generator's context. If it says "Ready to execute", you're done. 4. Iterations: Repeat the loop 2-5 times. For simple tasks 2-3 is enough; for complex multi-step ones go up to 5-7 iterations.

Examples

[BAD]: `Create a launch plan for a travel mug on Amazon with a $2K budget, goal — top 100 within a month` (A single-shot request. You'll get a pretty plan full of logical holes — the LLM won't check whether the budget fits, won't sanity-check the timeline, won't notice that the actions won't reach the goal) [GOOD]: Three agents in a loop: Generator: `Create a step-by-step launch plan for the product "Self-Heating Travel Mug" on Amazon. Budget $2K. Goal: top 100 of the category within a month` Simulator: `You are a business-process simulator. Here is the plan: [paste]. Describe what will happen at each step: what resources get spent (specific amounts), what results we get (search rank, traffic), what state we end up in after each action` Evaluator: `Compare the plan and the simulation with the goal "top 100 within a month on a $2K budget". Plan: [paste]. Simulation: [paste]. Find the mismatches: where will the actions fail to reach the goal? where does the budget not cover the costs? what was forgotten?` (After 2-3 iterations you get a vetted plan without paying real money for mistakes. The Simulator says "after $1K on ads the product is at rank 150, not in the top 100" → the Evaluator finds "the budget is split wrong" → the Generator fixes it)

In plain words

In Plain Words: 2512.02002

In Plain Words

LLM-Driven Corrective Robot Operation Code Generation with Static Text-Based Simulation

Here's the gist: an LLM is a pathological optimist that believes in its code even when that code is steering the robot straight into a wall. The problem is the lack of feedback: the model spits out an instruction and calls it a day, with no grasp of the physical consequences of its words. To fix that, the researchers brought in static simulation: the code isn't run on real hardware — instead, another model has to "play it out" in its head and describe the outcome in words. That creates a control loop where one agent proposes, a second critiques and a third judges, turning hallucinations into working logic.

It's like asking a friend who's all theory to plan a route through an unfamiliar city, then reading that plan to a cab driver who lives there. The driver immediately says: "That's a one-way street, that's a dead end, and here you'd drive straight into the river." Instead of actually slamming a drone into a pole, the system runs a virtual scenario in text form. That lets you catch screwups in the trajectory or the logic before the robot so much as twitches a motor — saving a ton of time and not wrecking expensive equipment.

There are three roles in this setup: the Generator, the Simulator and the Corrector. The first writes the control code, say, for a drone. The second takes that code and literally narrates: "The drone will rise two meters, turn right and crash into the cabinet." The third agent compares that verbal report with the original task and rubs the first one's nose in the mistakes: the trajectory doesn't match, fix it. The loop keeps spinning until the text description of the "flight" fully satisfies the system — and only then does the code go out for execution.

Even though it was tested on robots, the three-agent check principle is universal and fits any complex process, from launching an online store on a marketplace to writing software. If you have a chain of actions where a mistake at the start multiplies losses at the end, you need this kind of buffer layer. Instead of blindly trusting the model's plan, you make the model itself play the role of a strict auditor that visualizes the consequences of every step. That turns an ordinary chatbot into a system with the beginnings of self-criticism.

Bottom line: stop asking AI to just "make a plan" — make it simulate the outcome and check itself through a separate agent. The static simulation method shows that LLMs get much smarter when you make them argue with each other instead of nodding along. Whoever builds this checking loop into their processes will stop getting pretty nonsense and start getting instructions that actually work. Everyone else will keep wondering why their "perfect" plans keep crashing into reality.

ArXiv ID: 2512.02002 | Generated: 2026-01-02 17:03 | Nova Research

AI lab assistant

Apply this study to your task

Describe what you're working on. AI takes the method and the measured results from this paper and adapts them to your case, or writes a ready prompt built on them.

Based on Static Simulation with LLMs: Check Your Instructions Before You Run Them arXiv:2512.02002

Sign in to apply this study New accounts get 50 free credits.