Text-to-image systems get spatial instructions wrong: objects swap sides, depth order inverts, things merge or vanish. The most effective current fixes put a planner in front of the image model. A language model turns the prompt into a layout, and the diffusion model (an image generator that turns random noise into a picture step by step) is guided to follow it. These planners treat a layout as a one-shot artifact. Real use is iterative. A user says "a plant in front of a window," then "add a lamp to its left," then "actually, put the plant behind the sofa." At each turn the planner rewrites its spatial description, and nothing checks that the rewrite still means what the old one meant. Spatial language is also full of defaults: a plant "by the window" is assumed near it and in front unless told otherwise. A later instruction should be able to override such a default, not contradict it.
We propose to represent layouts as small logic programs with retractable defaults, written in answer set programming (a rule language whose "not" means "cannot be derived," so conclusions can be withdrawn when new rules arrive). Every rewrite the planner makes is then checked for strong equivalence: the old and new programs must agree no matter what rules a future edit adds. A failed check produces a concrete counterexample, meaning a specific future edit under which the rewrite would behave differently. That counterexample goes back to the language model as a correction. The claim is that this check, rather than any single-turn spatial accuracy gain, is what keeps multi-turn layouts consistent. It also asks a question nobody has posed: whether a natural restriction on how negation appears in spatial rules lets us verify the related notion of uniform equivalence, which is undecidable in general.
Core Claim
Strong equivalence is the right correctness notion for planner rewrites in iterative editing, because an edit is literally "add rules to the program." Two layout programs can produce identical scenes today and still diverge after the next instruction whenever defaults are involved. A planner that only checks whether the current scene is preserved will therefore accumulate silent errors that surface turns later. Checking strong equivalence of non-ground programs is decidable even over unbounded sets of objects. Strong and Uniform Equivalence in Answer-Set Programming shows it is co-NEXPTIME-complete and has a finite-countermodel property, which makes a practical counterexample search feasible. The same paper and Complexity Results for Checking Equivalence of Stratified Logic Programs show the limit of this approach. Uniform equivalence asks whether two programs agree on every set of input facts, which in our setting means every new object inventory with the rules held fixed. It becomes undecidable once negation enters, even with a single negative constraint. We treat that undecidability as a design constraint on the spatial rule language, not as a dead end.
Research Program
Layout language. The first component is a non-ground spatial rule language. Variables range over scene objects. Built-in qualitative relations cover left/right, above/below, front/behind, inside, near and occludes, so we avoid continuous coordinates and the open problem of logic over real-valued geometry. Defaults are written with negation-as-failure, for example "X is in front of Y if X is near Y and not explicitly behind Y." Hard requirements are written as constraints. A final solver step maps each answer set (one consistent scene the rules allow) to boxes and depth layers by solving linear inequalities. The boxes then condition an off-the-shelf layout-to-image pipeline.
Planner loop. The second component is the planner. A language model translates each user turn into rule additions and is allowed to compress or rewrite the accumulated program. Before any rewrite is accepted, the verifier searches for a pair of interpretations that is a "strong-equivalence model" (SE-model) of one program and not the other. An SE-model is a here-and-there pair of atom sets, following the characterization through the logic of here-and-there analyzed in The Modal Logic S4F, the Default Logic, and the Logic Here-and-There and the propositional reduction in Discovering Classes of Strongly Equivalent Logic Programs.
We implement this search as a bounded-domain encoding run on the conflict-driven solver clasp from Conflict-Driven Answer Set Solving. The bound grows iteratively. Scenes rarely exceed a dozen objects, and the finite-countermodel property tells us how large the bound must be for a "no counterexample" answer to be complete. Any witness found is turned into a natural-language counter-edit, such as "if the user later says the plant is behind the sofa, your rewrite still puts it in front." The language model gets up to three correction rounds. This mirrors the solver-feedback loop of Logical-SAGE, which repairs first-order translations of word puzzles using solver error messages. Our feedback differs in kind: it is a semantic counterexample about future contexts, not a syntax or satisfiability error.
Guarded fragment (theory). The third component is theoretical. Guarded Negation shows that classical first-order logic stays decidable when every negated subformula is accompanied by an atom covering its free variables. Spatial defaults naturally have this shape, because "not behind(X,Y)" almost always appears alongside "near(X,Y)." We will define guarded-negation spatial programs and try to prove one of two outcomes. Either uniform equivalence becomes decidable for this fragment, or the reductions of Eiter et al. still go through, in which case we will identify which feature they exploit. Either result is new, since ten Cate's work is monotonic and Eiter et al. study only unrestricted negation. The practical system does not depend on this outcome. It needs only bounded strong-equivalence checks.
Benchmark. The fourth component is an evaluation set, EditChain. We build it by extending T2I-CompBench spatial prompts (T2I-CompBench++) and SpatialGenEval scenes (Everything in Its Place) into five-turn edit sequences. A deliberate share of the turns override an implicit default. The instruction style is informed by MultiEdit. Every turn carries gold constraints for the objects it touches and for the objects that should stay where they are.
Baselines
Naive reference. The base layout-conditioned diffusion model receives the concatenated edit history as a single prompt at each turn, with no planner. This sets the floor for both spatial accuracy and drift.
Strongest planner competitor. MCCD (MCCD) uses language-model agents to plan boxes and an evaluator agent to criticize them in natural language. It reports up to a 41.49% gain in spatial-relationship accuracy on T2I-CompBench and a 9.04% overall gain on SDXL. This is the closest system to ours: a planner plus a feedback loop, with the feedback unverified. We run it with the same language model, the same image backend, and a matched number of language-model calls per turn. Its evaluator gets the same edit history. To isolate planning from rendering, all planners share one layout-to-image renderer, RealCompo-style dual-branch guidance (RealCompo).
Single-turn rendering reference. STORM (Spatial Transport Optimization by Repositioning Attention Map) improves VISOR spatial accuracy from 62.98% to 94.39% on Stable Diffusion 1.4. We use it to confirm that our renderer is competitive on first turns, so that any multi-turn gain cannot be blamed on a weak renderer.
Ablations. Two ablations isolate the key ingredient. The first, classical-check, replaces strong-equivalence checking with a check that the current answer sets are unchanged. The second, monotonic, removes defaults and encodes every implicit relation as a hard constraint. Beating MCCD means at least 10 points lower cumulative drift by turn five, with first-turn spatial accuracy no worse than 2 points below it. Beating classical-check means significantly fewer delayed failures on default-override turns. No published multi-turn result exists for any of these systems; we found no reported result on Lacuna for multi-turn spatial edit consistency.
Why not just…?
Why not just regenerate the layout from scratch each turn with a strong language model? This avoids rewrites altogether, and it is a real threat. Its expected failure is drift: objects the user never mentioned move between turns, because nothing ties turn t to turn t−1. SpatialGenEval reports that even top systems sit near 20–30% on occlusion and size-comparison reasoning, which suggests fresh re-planning will not reliably re-derive the earlier scene. We include this regenerate-from-history baseline explicitly and measure untouched-object drift (box IoU across turns). If its drift matches ours, the equivalence machinery is not earning its keep, and we will report that.
Why not just check that the current scene is preserved, with a SAT or geometry solver? For one turn this is enough. Over many turns it misses exactly the rewrites that agree now and diverge after a default is overridden. The classical-check ablation is built to expose this. The prediction is that its errors concentrate on override turns that come after a rewrite, which is a precise and falsifiable signature.
Why not just drop defaults and use monotonic constraints, where classical and strong equivalence coincide? Then the hard semantics disappear. The cost is that implicit relations must be either asserted as hard constraints, which makes later overrides contradictory and unsatisfiable, or left out, which loses the "plant in front of the window" reading that SpatialGenEval's dense prompts depend on. The monotonic ablation measures both effects: the unsatisfiable-turn rate and first-turn accuracy.
Why not just fine-tune the image model on spatial data? Fine-tuning on SpatialT2I yields +4.2% to +5.7% (Everything in Its Place). Mitigating Noise-Induced Layout Priors shows the initial noise largely fixes the layout early, regardless of the weights. More fundamentally, fine-tuning addresses rendering. It does not address whether the plan stays coherent across edits, so it is complementary to this work.
Proposed Experiments
The decisive experiment runs EditChain with all planners on SDXL and SD3 backends. We report three metrics: per-turn spatial accuracy, measured with T2I-CompBench's detector-and-depth scoring; cumulative drift of untouched objects; and the rate of delayed failures, meaning an error at turn t traceable to a rewrite accepted earlier. The headline prediction is that the strong-equivalence planner and classical-check are tied on turn one and separate by turn three, with the gap concentrated on default overrides.
A second check measures paraphrase invariance. Prompts that compile to strongly equivalent programs should produce layouts within a small IoU tolerance. We report how often the language model's raw translations of paraphrases fail the check before correction and after correction.
A third check is cost: verifier latency against scene size, compared with the 2–4× overhead reported for test-time optimization in Gu et al.
On the theory side, the result is either a decision procedure for uniform equivalence of guarded-negation spatial programs, or an undecidability reduction that respects the guard. Either one settles where Eiter et al.'s cliff sits for the rule shapes spatial language actually uses.
References
- Strong and Uniform Equivalence in Answer-Set Programming: Characterizations and Complexity Results for the Non-Ground Case
- Complexity Results for Checking Equivalence of Stratified Logic Programs
- The Modal Logic S4F, the Default Logic, and the Logic Here-and-There
- Discovering Classes of Strongly Equivalent Logic Programs
- Conflict-Driven Answer Set Solving
- Logical-SAGE: A Logical Socratic Architecture for Guided Evolution in Neuro-Symbolic Reasoning
- Guarded Negation
- T2I-CompBench++: An Enhanced and Comprehensive Benchmark for Compositional Text-to-Image Generation
- Everything in Its Place: Benchmarking Spatial Intelligence of Text-to-Image Models
- MCCD: Multi-Agent Collaboration-based Compositional Diffusion for Complex Text-to-Image Generation
- RealCompo: Balancing Realism and Compositionality Improves Text-to-Image Diffusion Models
- Spatial Transport Optimization by Repositioning Attention Map for Training-Free Text-to-Image Synthesis
- Mitigating Noise-Induced Layout Priors for Object Counting in Diffusion Models