Ask a vision-language model for the Blender code that rebuilds a photo. In one shot it gets the gist and misses the details. VIGA closes the loop: write code, render it, look at the difference, edit, and remember what you tried.
Learn why one-shot code is blind, how a render turns code back into evidence, why memory turns guessing into bisection, and what the paper's 35%, 117% and 125% gains really average.
Press Run. The agent edits a program, renders it, and marks where its picture differs from the target. Then switch Inspect or Memory off and run again. Watch the loop stall.
You need a rough idea of what a vision-language model and an agent loop are. We build the rest from zero.
The scene, the program and the agent's edit rule are a toy written for this page, so its losses and iteration counts are illustrative. The paper's real effect, on BlenderBench Task 2 with GPT-4o (best-of-1): photometric loss falls from 7.36 (one-shot) to 5.11 (VIGA), and the VLM score rises from 2.75 to 3.58 Table 2.
Chapter 0
Try to rebuild a picture by hand, find out why looking at the difference matters, and meet the paper's plan
Someone hands you a photo of a living room. They want the room in Blender, a 3D program, so they can move the sofa, change the light, or train a robot in it. Not a picture of the room. The room itself, as objects with positions, sizes, materials and lights.
In Blender, a scene can be written as a program: a short Python script that creates each object and sets its numbers. Run the script and Blender draws, or renders, an image. So your job is to write the script whose render looks like the photo.
Try a tiny version. The target below has a table, a box, a ball and a lamp. Your scene matches it except for the ball. Move the ball until the two pictures agree.
Drag the two sliders to place the ball. Then turn on the difference map and finish the job.
A toy scene drawn in this page. The loss is the mean absolute difference between the two images, times 100, the same kind of photometric loss the paper reports §4.2. The values themselves are illustrative.
By eye, you get close fast and then slow down. The difference map changes that. It shows two blobs: where the ball should be and where it is. Now each move has a direction. This is the paper's whole idea in miniature: turn the code into a picture, compare the picture with the goal, and let the difference guide the next edit.
To compare two pictures, add up how far apart they are, pixel by pixel. This is the photometric loss:
Worked example with a 4-pixel image. Target: 0.2, 0.2, 0.9, 0.2. Render: 0.2, 0.9, 0.2, 0.2. The differences are 0, 0.7, 0.7 and 0. The loss is 1.4 / 4 = 0.35. Move the bright pixel to the right place and the loss is 0.
VIGA, the Vision-as-Inverse-Graphics Agent, does what you just did, but with a vision-language model in charge. The model writes the program, a graphics engine renders it, and the model inspects the render against the target. It repeats this code-render-inspect loop, with a set of high-level tools and a memory of recent rounds abstract. It needs no training. It works for slides, 3D scenes, multi-step 3D edits and 4D physics §1.
Chapter 1
Run graphics forwards and backwards, and see why one picture can come from many scenes
Computer graphics goes one way: from a description of a scene to a picture. Give the engine objects, materials, lights and a camera, and it computes every pixel. This direction is exact and well understood.
Vision, seen this way, is the reverse. Given the picture, recover the description. Researchers call this vision as inverse graphics. The paper traces the idea to Larry Roberts' 1963 MIT thesis on the "blocks world", which recovered simple 3D blocks from photos §1. VIGA asks for the strict version: recover an executable program, one you can run, read and edit §2.
The paper states the goal in words. Start from a target s*g and an empty state s0. Write a final program pT whose render sT is "visually consistent" with the target §3.1.
A camera flattens three dimensions into two. Depth is lost. A small box near the camera and a big box far away can make exactly the same picture. Try it.
Move the box's distance and size. The left panel is what the camera sees; the right is the room from above. Press the button to find another scene with the same picture. Then add a second camera.
A pinhole camera with a focal length of 500 pixels. A teaching toy, not from the paper.
A pinhole camera draws an object of size s at distance z with an on-screen height of:
Worked example with f = 500. A 1 m box at 4 m: h = 500 × 1 / 4 = 125 px. A 2 m box at 8 m: h = 500 × 2 / 8 = 125 px. Same picture. Only the ratio s/z is visible. A second camera at a different place breaks the tie, because the two scenes now look different from there.
Chapter 2
Compare gradient descent on pixels with one-shot code from a VLM, then combine them
The paper sees two existing ways to solve inverse graphics, each with the other's missing half §1.
Road one: differentiable inverse graphics. Make the renderer differentiable: able to report how each pixel would change if a scene number changed a little. Then use gradient descent: nudge every number in the direction that lowers the loss, and repeat. This gives fine, pixel-level grounding. But it relies on "local gradients", so it is "vulnerable to local minima, especially when the discrepancy is large" §1.
Worked example. A dark ball sits at x = 0.20; the target ball sits at x = 0.72. They do not overlap. Move the ball a little to 0.21: it still covers the same number of wrong pixels, and still misses the same target pixels. The loss does not change, so the gradient is 0. Gradient descent takes a step of size η × 0 = 0. It is stuck on a flat plain, far from the answer.
Road two: one-shot code from a VLM. A vision-language model knows what rooms look like. It can write the whole scene program in a single pass, which jumps past the flat plains. But this is open-loop: it never looks at what its code draws. Without fine visual grounding, it struggles with camera position, object poses and lighting §1.
The curve is the real photometric loss of a one-dimensional scene as the ball moves. Pick a method and a starting point, then press Go.
The loss is computed exactly for a one-row image: a bright ball of width 0.12 on a dark row. The one-shot guess lands 0.09 off on purpose: an illustrative stand-in for a VLM's coarse spatial grounding. The loop's edit rule is the bisection of Chapter 6.
Start near the target, and gradient descent works well. Start far away, and it never moves. The one-shot VLM lands near from anywhere, but stops off target. The loop does both: a semantic jump, then grounded corrections. VIGA's proposal is exactly this pairing: use the VLM for "holistic semantic reasoning" and visual feedback for "fine-grained visual refinement" §3.
Chapter 3
Step through Algorithm 1 one phase at a time, and follow what goes in and out of each
VIGA's loop has four phases per iteration Algorithm 1. The same model, called the agent A, does the thinking in each. The graphics engine does the drawing.
The task, from the paper's Figure 2: move the basketball to the goal state. Press Next phase. The panel shows what each phase reads and writes, and its type.
The ball heights (0.8, 0.7, 0.75) and the feedback sentences follow the paper's Figure 2. The tool names are from its skill library Table 1, Appendix D. The image sizes are illustrative.
Two lines of the algorithm carry the idea. The program depends on the target, the memory and the plan:
And the feedback depends on the target, the new render, the agent's observations of it and the memory:
Worked example from the paper's Figure 2. Round 1: p1 sets ball = (0, 0, 0.8). The render shows the ball floating; f1 = "it should be lower". Round 2: p2 sets the height to 0.7; f2 = "lower but stuck in the table, it should be higher". Round 3: with both rounds in memory, p3 sets 0.75. Then the ball moves to (0.2, 0.12, 0.75), and the agent ends.
Here is the whole loop from scratch, in Python. The model calls are left abstract; everything else is the algorithm.
pythondef viga(target, agent, engine, T=10, L=12): memory = [] # list of (program, feedback, render) rounds program = "" for t in range(T): # the paper caps rounds at 10 on benchmarks plan = agent.plan(target, memory) # text: what to build or fix next if plan.end_process: break # the agent decides it is done program = agent.write_code(target, memory, plan) # FULL script, not a diff ok, state = engine.execute(program) # renders (images) or an error log (text) if not ok: feedback = "execution error: " + state # the log itself becomes feedback else: views = agent.observe(target, state, memory) # read-only: set_camera, investigate feedback = agent.compare(target, state, views, memory) memory = (memory + [(program, feedback, state)])[-L:] # Tail_L: last L rounds return program
Chapter 4
Use read-only camera tools to find a discrepancy that the default view hides, without changing the scene
Recent multimodal models can "think with images": they crop or zoom a picture while they reason. The paper argues VIGA does something richer. Its action space is a whole graphics engine: camera poses, geometry, materials, lights, visibility and time. "In a nutshell, this agent thinks with a graphics engine" §1.
The key design choice is a split. Some tools only look. They move a viewing camera, zoom, focus on an object, hide an object, or jump to a frame. They are read-only: they never change the scene. Other tools act: they run code that changes the scene §1, Table 1. Because looking is free of side effects, the agent can look as much as it needs before it acts.
The target photo shows a character beside a sofa. In the current scene, the default camera sees only the sofa. Use the read-only tools until the inspector can compare the character. Then send the edit.
A toy after the paper's Figure 3, where the agent cannot find a character, calls Focus and Zoom, and then sees a larger belly than in the target. The scene, depths and camera steps are illustrative.
When a camera moves sideways, near things shift on screen more than far things. This is parallax. The screen position of a point at sideways position x and depth z, seen by a camera at xc, is:
Worked example with f = 400. Move the camera 1 m to the right. The sofa at 2 m shifts 400 × 1 / 2 = 200 px left on screen. The character at 5 m shifts only 400 × 1 / 5 = 80 px. The sofa slides out of the way faster than the character, so a character hidden behind it comes into view.
The paper's observation tools are set_camera and investigate (zoom, move, focus) for space, set_keyframe for time, get_scene_info and set_visibility for structure, and initialize_viewpoint, which renders four views from the corners of chosen objects' bounding box Table 1, Appendix D. The inspector's final answer covers camera, objects, layout, environment and, for 4D, animation Appendix D.
Chapter 5
See why a few high-level tools beat raw graphics code, and how error logs let the loop recover
A naive agent writes raw Blender Python: dozens of low-level calls per object. The paper calls that action space "high-dimensional and brittle". It bloats the context and invites hallucinated, non-runnable code §3.3. So VIGA wraps fragile steps into a few reliable skills, high-level tools with clear inputs.
| Skill | Tools | What it does |
|---|---|---|
| Spatial navigation (look) | set_camera, investigate | Move viewpoints to inspect regions and see past occlusions |
| Temporal inspection (look) | set_keyframe | Move along the 4D timeline to check motion |
| Structural query (look) | get_scene_info, set_visibility | Read object attributes; show or hide objects |
| Diagnostic rendering (look) | initialize_view | Render standard views and target bounding boxes |
| Asset instantiation (act) | init_scene, get_better_assets | Fetch or generate detailed 3D assets with outside modules |
| State execution (act) | execute_code | Run the program and update the scene |
| Trajectory control (act) | undo_action, end_process | Undo a bad edit, or stop the loop |
Rows from the paper's Table 1. The planning tool make_plan, which "you must call first", is in Appendix D.
A toy model shows why fewer, bigger actions help. Say each line of generated code has a small chance ε of being wrong, independently. A program of n lines runs cleanly with probability:
Worked example with ε = 0.02. Raw code, n = 60: q = 0.9860 ≈ 0.30. Skills, n = 8: q = 0.988 ≈ 0.85. A one-shot method gets one try. A loop with R = 10 rounds, even with raw code, reaches 1 − 0.7010 ≈ 0.97.
Pick raw code or skills, then slide the error rate per line and the rounds allowed. The curve shows the chance of at least one clean run.
The independence model and the call counts are illustrative. The real effect the paper reports is on SlideBench execution success: Qwen3-8B rises from 0.10 one-shot to 0.54 with VIGA, and Gemini-2.5 from 0.61 to 0.69 Table 4.
The paper credits the loop with exactly this recovery. One-shot methods "frequently halt upon encountering a single syntax or rendering error", while VIGA parses the execution log and fixes the code §4.3. The execute_code tool returns either detailed error information or a clean render plus suggestions from a separate verifier Appendix D.
Chapter 6
Replay the paper's basketball example with and without memory, and see oscillation turn into bisection
Feedback from one render tells you a direction ("too high"), rarely an exact amount. An agent that sees only the current render must guess a step size. If the step is too big, it overshoots. Then the next render says "too low", it steps back, and it lands where it started.
The paper's Figure 2 shows how memory breaks this. The ball at height 0.8 floats: "lower". At 0.7 it is stuck in the table: "higher". With both attempts in memory, the agent "contrasts prior height parameters (0.8 vs. 0.7) to deduce" 0.75 §3.2. Without memory, the paper says, the agent is limited to single-step edits, "oscillating between incorrect states rather than converging" §3.2.
The ball must rest on the table. Each iteration the inspector says "lower" or "higher". Step it with Memory on, then off. Move the table to change the answer.
Start height 0.8, a first step of 0.1, and a ball radius of 0.05 follow the paper's Figure 2 (0.8, then 0.7, then 0.75). The edit rules are our model of "with" and "without" memory; the inspector sees errors above 0.002.
Once two attempts sit on opposite sides of the answer, the answer is between them. Try the midpoint. Its feedback tells you which half holds the answer. Each step halves the interval. This is bisection, and its error shrinks geometrically:
Worked example. The bracket is 0.7 to 0.8, so Δ = 0.1. One midpoint (0.75) leaves an error of at most 0.05; in the paper's case it is exactly right. If the table were at 0.66, the target would be 0.71: after 4 midpoints the error is at most 0.1 / 16 ≈ 0.006. Without memory, a fixed step of 0.1 never gets closer than its own size allows.
pythondef next_value(value, sign, history, step=0.1): """sign = +1 if the inspector says 'higher', -1 if 'lower'. history = [(value, sign), ...] from memory; empty without memory.""" other_side = [v for v, s in history if s == -sign] if other_side: # a bracket exists: go to its middle nearest = min(other_side, key=lambda v: abs(v - value)) return (value + nearest) / 2 return value + sign * step # no bracket yet: take a guessed step next_value(0.7, +1, [(0.8, -1)]) # 0.75, as in Figure 2 next_value(0.7, +1, []) # 0.8: no memory, back where it started
Chapter 7
Keep only the last L rounds, see the context stop growing, and find the one design choice that makes forgetting safe
If memory helps, why not keep everything? Because every round adds a program, images and feedback. Over a long run the context grows without limit. The paper calls this context bloat: more compute per call, and distracting noise. As the context lengthens, models reason worse, which is known as context rot §3.2.
VIGA's fix is a sliding window: keep only the most recent L iterations §3.2.
Worked example with illustrative sizes: C0 = 2,000 tokens and a = 3,000 per round. The paper's long qualitative runs use a window of 12 and up to 100 rounds Appendix A.2. At round 100, the windowed context holds 2,000 + 12 × 3,000 = 38,000 tokens. Keeping everything would hold 2,000 + 100 × 3,000 = 302,000.
Slide the window L and the rounds. Then switch how each round stores its program: the full script, as VIGA does, or only the lines it changed.
Token sizes are illustrative. The window of 12 and the cap of 100 rounds are the paper's qualitative settings Appendix A.2. The rule that every execute_code call carries the complete updated script is in its tool schema Appendix D.
The paper calls the truncation "inherently lossless" §3.2. The reason is one design choice. Every program the agent writes is a complete script that builds the whole scene, with all earlier successful edits already inside. So the newest program carries everything; older rounds are only the reasoning that led there. Switch the device to "changed lines only" and the claim breaks: edits older than the window vanish, and objects disappear from the scene.
That failure is what the paper's Figure 5 shows for an unwindowed memory: the agent loses objects it made earlier, such as a tree, as the context fills Fig. 5. The paper reports this ablation only as pictures, not as a number.
Chapter 8
Swap the engine under the same loop: lay out a slide in 2D, then aim a throw in 4D physics
Nothing in the loop is specific to 3D. It needs only an engine that turns code into something visible. The paper says the loop "naturally generalizes to any visual domain governed by a programmatic interface" §4.1. It shows four: 2D documents, 3D reconstruction, multi-step 3D editing, and 4D physical interaction, where the fourth dimension is time.
2D slides. Swap Blender for a slide engine and VIGA builds PowerPoint slides from text instructions §4.1, Fig. 7. The paper's Figure 4 shows its edits: "The content is obscured by the image; adjust the layout", then text.bbox.x2 -= 1 and Image.bbox.y1 -= 1.
4D physics. Given one image and a prompt like "throw a ball to knock over objects", VIGA sets physical parameters such as mass and collision shapes. Then Blender's physics engine runs §4.1, Fig. 8. To check motion, it jumps between frames with set_keyframe.
Pick an engine and press One iteration. On the slide, the inspector checks for overlap. On the throw, it checks the final frame and adjusts the ball's speed. Drag the keyframe slider to inspect any moment.
The slide edits copy the paper's Figure 4 (shrink the text box, move the image). The throw uses g = 9.8 m/s², a 3 m distance and a 1 m launch height, all illustrative; the paper's examples are a ball scattering fruit, a shattering mirror and an earthquake Fig. 8.
The physics toy shows why time needs its own tool. The ball flies for a fraction of a second. Is it short, over, or on target? Only frames near impact can tell. The motion follows:
Worked example. At v = 7 m/s, thit = 3 / 7 = 0.43 s. Then y = 1 − 4.9 × 0.432 = 1 − 0.90 = 0.10 m. That is between 0 and 0.3, so the ball hits the tower. At v = 12, y = 0.69 m: it flies over. At v = 4, y would be negative: it lands short.
Chapter 9
Meet the paper's new benchmark, its three tasks and three scores, and explore its results table
Older benchmarks such as BlenderGym mostly test one edit and score only the final picture §4.2. The paper adds BlenderBench, 27 tasks built to test multi-step agent behaviour §1. It has three tracks §4.2, Fig. 9:
Targets often differ in style from the scene, for example a style-transferred image or one with guiding arrows Appendix A.1. So the paper uses three scores. Photometric loss (PL), lower is better. Negative-CLIP (N-CLIP), a semantic distance from the CLIP model, lower is better. And a VLM score: GPT-4o rates the result from 0 to 5 on task completion, spatial accuracy, detail accuracy and visual quality, ignoring style; higher is better Appendix A.1, C.
The baselines are a one-shot VLM and BlenderAlchemy, an iterative method without memory. Both iterative methods run under best-of-N: each step proposes N candidate edits and keeps the best by CLIP score §4.2, Appendix A.1.
Worked example from the paper: on Task 1 with GPT-4o, going from N = 1 to N = 4 raises VIGA's VLM score from 1.44 to 3.25 §4.2. More candidates per step help escape bad viewpoints.
Pick a model, a search budget and a score. Each group is one task; the bars are one-shot, BlenderAlchemy and VIGA.
Every number is from the paper's Table 2. The one-shot row has no best-of-N setting, so its bars are the same in both budgets.
Three findings stand out. Against a one-shot VLM, the loop helps almost everywhere. Against BlenderAlchemy, the gain is largest on Task 3. There BlenderAlchemy "frequently overwrit[es] earlier edits", and VIGA's state tracking keeps them: +187.50% VLM score for GPT-4o at best-of-4 §4.2. With the small open model Qwen3-VL-8B, VIGA's average gain over BlenderAlchemy at best-of-1 is +312.20%. The paper reads this as the loop closing part of the gap between small open models and large closed ones §4.2.
Chapter 10
Rebuild the headline gains from the tables, and see which rows drive each average
The abstract says VIGA "substantially improves accuracy compared with one-shot baselines in BlenderGym (35.32%), SlideBench (117.17%) and our proposed BlenderBench (124.70%)" abstract. These are not accuracies, and not "twice as accurate". Each is an average of relative improvements over the one-shot baseline, built in two layers.
Layer one: one row. For one model and setting, take each score and compute its relative change against one-shot. For lower-is-better scores, the gain is (one-shot − VIGA) / one-shot. For higher-is-better, it is (VIGA − one-shot) / one-shot. Average over the row's scores. That is the "Impr." column Tables 2, 3.
Worked example: GPT-4o, best-of-1, BlenderBench. Task 1 PL goes 48.16 → 8.56, a gain of 82%. Task 3 VLM score goes 0.25 → 1.53, a gain of 512%. The nine gains are 82, 72, 148, 31, 39, 30, 52, 54 and 512 percent. Their mean is about 113%; the table reports 113.96. One small baseline score (0.25 out of 5) dominates the row.
Layer two: the headline. Average the rows. BlenderBench: (113.96 + 159.19 + 112.79 + 112.87) / 4 = 124.70. BlenderGym: (26.88 + 48.86 + 22.64 + 42.88) / 4 = 35.32. Both match the paper exactly.
Pick a benchmark. Each bar is one row of the paper's table; the line is their mean. Then leave out the largest row and see how much the headline depends on it.
Row values from Tables 2, 3 and 4. SlideBench rows are the Overall-score gains per model. The four average to about 118%; the paper reports 117.17%, a small gap we could not trace. Table 4 labels one model "Claude-3.5"; the text names Claude-Sonnet-4.
SlideBench is the clearest case. Overall scores rose by 4.5% for GPT-4o, 2.5% for Claude and 18.1% for Gemini-2.5. For Qwen3-8B they rose from 6.0 to 32.8, or 446.7%, because one-shot Qwen produced runnable code only 10% of the time Table 4. The 117% headline is mostly that one model. Without it, the mean is about 8%.
Chapter 11
Honest limits, where VIGA sits next to Thinking in Blender, and how a slow loop can feed a fast model
| Idea | In one line |
|---|---|
| Inverse graphics | Find the program p whose render exec(p) matches the target; one view leaves depth ambiguous. |
| Two old roads | Gradients are precise but stall far away; one-shot VLM code jumps close but is blind. |
| The loop | Plan, write code, render, inspect, write feedback, update memory; training-free. |
| Read-only tools | Move the camera, zoom, hide, jump in time, without changing the scene. |
| Skills | Few high-level calls instead of raw API code: q = (1 − ε)n stays high. |
| Memory | Attempts on both sides of the answer form a bracket; bisection halves the error each step. |
| Sliding window | Keep the last L rounds; safe because each program is a full script. |
| Headline numbers | Means of relative gains over one-shot: 35.32%, 117.17%, 124.70%; small baselines dominate. |
That last limit is the starting point of Guangzhao He's post A New Era for Agentic Vision and Robotics, which cites VIGA as its reference 2. The post calls demos of agents redoing old tasks "party tricks" if they stop there. Its proposal: treat the agent as a one-time data engine. A VIGA run leaves behind something valuable: a target image paired with a verified, editable scene program, plus every intermediate (program, render) pair. Those pairs can train a fast model that maps an image to a scene program in one pass.
Choose how many scenes to run and how many rounds each takes. Turn on the verifier to keep only scenes whose final render matches the target.
Illustrative. Two model calls per round (a generator and a separate verifier, as the execute_code schema describes Appendix D), one render per round, and a 70% pass rate for the verifier are our assumptions, not the paper's. The paper does not train a student; this is the hub post's proposal applied to VIGA.
Each verified scene costs R rounds of model calls but leaves one clean (image, program) pair and R intermediate ones. The cost per training pair is:
Worked example with illustrative prices: R = 10, cround = $0.05, ρ = 0.7 gives 10 × 0.05 / 0.7 ≈ $0.71 per verified scene program. Pay that once per training example, and the student answers later scenes in one forward pass.
Thinking in Blender, by He, Luo, Ma and Averbuch-Elor, is reference 1 of the same post and the closest relative. Both write Blender code and look at renders. The difference is in the harness. Thinking in Blender uses a staged workflow: several rollouts, a selector, then separate refine-and-verify stages for geometry, material, composition and lighting. VIGA uses one generic loop for every stage and domain, held together by skills and memory, and adds 2D and 4D. In the post's terms, both are strong harnesses that later models may need less of. Both are good teachers for a fast model.
Now press Present or Teach and explain, out loud and from memory, why a one-shot VLM gets the gist of a scene but not its numbers, and what each part of VIGA's loop adds. Then go back to the hero, switch Memory off, and predict the loss curve before you press Run.