Learning Where to Repair: Revision-Distance Search for Long Scene-Aware Human Motion

Systems that animate a 3D human through a room for many seconds, following instructions like "walk around the sofa, sit at the desk, then pick up the cup", fail in a characteristic way. Somewhere in the middle of a long rollout the character clips through a table, skips the "sit" stage, or drifts into a corner. The usual remedy is to check the result and regenerate it. Regeneration has two forms: resampling the whole sequence until one passes, or running a critique-and-revise loop with a vision-language model. Both are slow. The cost grows with sequence length and with the number of rounds, and a pass/fail check gives no hint about which part of the motion to change. We propose to train a small model that reads a draft motion together with the scene and the instruction. It predicts two things: how much of the draft must be regenerated to make it valid, and where that regeneration must begin. A search procedure then resamples only that window and keeps edits that shrink the predicted remaining distance to a valid sequence.

The central bet concerns blame assignment over time. A collision at second 9 is often caused by a path decision at second 6. Repairing from the frame where the violation is visible therefore usually fails, and restarting from scratch wastes compute. If a learned predictor can name the right edit window, the cost of making a long motion valid should scale with the size of the error rather than the length of the sequence. That would turn iterative refinement from a latency multiplier into a bounded, interruptible repair. Throughout, the critic works on discrete, checkable facts about the motion, such as contact events, penetration and stage completion. It does not depend on free-form multimodal reasoning, because the multimodal-reasoning literature shows that free-form reasoning is exactly where current models break.

Core Claim

A learned "revision distance" model, borrowed in spirit from code repair and adapted to motion, can do two things. It can tell a token-based motion generator how far a long draft is from satisfying the scene and the instruction, and it can tell it which temporal window to regenerate. Local search guided by this model should reach valid long-horizon motions with fewer regenerated frames and less wall-clock time than whole-sequence resampling, violation-frame inpainting, or critique loops, at equal or better motion quality.

Where the Pieces Come From

The method is a transfer of Let's Revise Step-by-Step (ReLoc). ReLoc trains a reward model to predict the number of edits separating a buggy program from a correct one, and uses that dense signal for hill-climbing search instead of sparse test outcomes. It reports LiveCodeBench Pass@1 of 38.4% against 33.8% for the strongest baseline, and 37% fewer tokens than tree search. ReLoc assumes discrete code edits and has no notion of time or physical geometry. Our contributions are to redefine distance over contiguous windows of motion tokens, and to make the predictor output an edit start location, not just a scalar score.

The application regime is long scene-aware synthesis on token-based generators. SceMoS plans global paths from a bird's-eye image of the room and decodes discrete motion tokens conditioned on local heightmaps. It reaches FID 0.31 and Contact Score 0.98 on TRUMANS. Its autoregressive planner has no way to detect and undo a bad decision mid-rollout. Scaling Up Dynamic Human-Scene Interaction Modeling chains diffusion episodes into arbitrarily long motion (1.6 s of motion in 0.7 s on an A800). Its authors note that the model is limited to behaviours present in its training data and drifts semantically without a high-level planner. HUMANISE grounds language in point-cloud scenes but is restricted to short single actions. These papers motivate the need for mid-rollout correction. The discrete motion token, a finite codebook entry produced by a vector-quantized autoencoder that compresses a short chunk of poses, is what makes window-level resampling cheap. A token span can be regenerated by conditioning on its prefix and suffix.

Two lines of work constrain the design. On the reasoning side, MATH-Vision finds that 42.2% of GPT-4V errors are reasoning errors on correctly perceived inputs, and that chain-of-thought sometimes lowers accuracy. GeoSQA shows that failures persist even when diagrams are replaced by text, and Plot Twist shows that models answer through linguistic shortcuts. A vision-language critic asked "what went wrong in this 20-second clip and when?" is therefore an unreliable judge. Following the symbolic-translation route of Synthesize Step-by-Step, we instead convert each draft into discrete predicates. These are computed exactly where possible: penetration from a signed distance field, foot contact and sliding from kinematics, and goal distance. Stage completion comes from an action recognizer applied per window.

On the latency side, Volcano reports that critique-revise-decide loops cost 2× to 3× a single pass. Meta-Reflection shows that reflection can be folded into one forward pass: 246 ms against 951 ms first-token latency on ECID, and MBPP 63.4% against 58.8%. It does so without any external check, and the file flags over-correction without verifiers as a known failure. We keep external exact checks and spend learning only on localization.

Our proposal differs from Motion-R1. Motion-R1 adds verbal reasoning and sub-action plans before emitting motion tokens and improves BABEL FID to 0.53 from 1.14. It plans in language before generation and uses no scene geometry. We correct after generation, against the scene, and spend compute only where a draft is wrong. The two are complementary, and a Motion-R1-style planner could serve as our base generator.

Research Program

The base generator is a scene-conditioned token model in the style of SceMoS. We use the released model if available. Otherwise we reimplement it: a bird's-eye planner plus a heightmap-conditioned tokenizer, trained on TRUMANS and checked against the reported FID and Contact Score before any further work. To support stage-wise conditioning, its text condition is extended to accept an ordered list of action stages.

Revision distance is defined as follows. A draft is a sequence of $K$ token windows $w_1,\dots,w_K$ of fixed length, together with a predicate set $P$ that it must satisfy. The distance is

$$\gamma(w) = \min_{s,e}\; (e-s+1) \;\text{ such that resampling } w_s,\dots,w_e \text{ yields a draft satisfying } P,$$

where $s$ and $e$ are the first and last regenerated windows. The predictor $R_\theta$ takes the scene encoding, the stage list and the draft. It outputs an estimate of $\gamma$ and a distribution over the start window $s$.

Training labels are produced offline, in the way ReLoc built its 872k pairs. We take ground-truth TRUMANS sequences that we concatenate into multi-stage episodes. We corrupt a chosen window, for example by perturbing a path token or swapping a stage, and roll the generator forward from that point to obtain realistic downstream failures. Labels are the corrupted window index and the smallest successful repair span, found by exhaustive resampling over spans on a capped budget. Real failures of the base generator are also labelled by the same brute-force search. This keeps the predictor from learning only the artifacts of synthetic corruption.

At inference, the generator produces a full draft and the exact predicates are evaluated. If any predicate fails, $R_\theta$ proposes a start window. The generator resamples a span from that start, conditioned on the frozen prefix and with suffix inpainting. An edit is accepted if no exact predicate gets worse and the predicted $\gamma$ decreases. Search is hill climbing with a few parallel candidates per step, and it stops when all predicates pass or a wall-clock budget is exhausted. Every intermediate state is a complete motion, so the procedure can be interrupted at any time.

Baselines

The do-nothing reference is the single-pass base generator. It fixes the floor for stage completion and penetration and the ceiling for speed. For orientation, SceMoS reports generating 80 frames in roughly 8 seconds, and the TRUMANS diffusion model samples 1.6 s of motion in 0.7 s. All methods are timed on the same GPU with the same generator, so these published figures serve only as context.

The strongest simple competitor is best-of-N resampling of the whole sequence against the same exact predicate checker. It needs no learned component, parallelizes trivially, and is the obvious answer to "why learn anything?" It is run with N chosen to match our method's wall-clock budget on the same hardware. Our method beats it if it reaches a higher fraction of fully valid long episodes at equal time, or the same fraction in clearly less time.

The strongest existing scene-aware method is SceMoS, with reported results on TRUMANS of FID 0.31 and Contact Score 0.98 SceMoS. These numbers come from its standard-length setting, not from our multi-stage long episodes, so we rerun it on our episodes. Our requirement is that repair must not degrade FID or Contact Score relative to SceMoS's own single-pass output, while it raises stage completion and lowers penetration on long, multi-stage episodes.

The multi-turn critique baseline is a Volcano-style loop. A vision-language model views rendered clips plus the instruction, states what to fix, and the generator regenerates. It receives the same wall-clock budget. On the physics side we include PROX-style post-hoc gradient optimization of poses against the scene's signed distance field Resolving 3D Human Pose Ambiguities With 3D Scene Constraints. That paper reports mean joint error falling from 220.27 mm to 167.08 mm in its pose-estimation setting, which is a different task, so we use it only as a repair operator.

The key ablation is violation-frame inpainting: resample a fixed-size span starting at the first window where a predicate fails, with no learned predictor. This isolates the claim that learned blame assignment matters. A second ablation keeps the predicted start but drops the $\gamma$ acceptance test, which isolates the value of the distance signal during search.

Why not just…?

Why not just do best-of-N with an exact checker? For short clips this may well be competitive, and we expect it to be. The argument against it is about scaling. The chance that an entire long multi-stage episode is valid falls roughly multiplicatively with the number of stages, while localized repair pays only for the failing span. The experiment settles this directly by plotting valid-episode rate against wall-clock time for episodes of 2, 4 and 8 stages. If best-of-N matches us at 8 stages, the idea is wrong for this regime and we will say so.

Why not just inpaint at the frame where the violation appears? This is the most serious threat, because exact checks already localize physical violations. Our hypothesis is that many failures are caused upstream, by a path committed seconds before the collision or a stage silently skipped. Under that hypothesis, violation-frame inpainting will repeatedly fail and then need larger spans. We measure the gap between the violation frame and the start of the minimal successful repair in the brute-force labels. If that gap is near zero for most failures, the learned predictor is unnecessary, and we would reduce the contribution to the distance-guided acceptance rule alone.

Why not just ask a vision-language model to critique and revise? The evidence from MATH-Vision and GeoSQA is that such models perceive correctly yet fail at multi-step deduction. Deciding when, in a long clip, the plan went wrong is a multi-step deduction. Separately, Volcano puts the latency cost of such loops at 2× to 3× per pass. The critique baseline at matched budget will show whether this matters in practice.

Why not just internalize correction into one pass, Meta-Reflection style, or plan better upfront, Motion-R1 style? Both reduce errors before they happen. Neither can respond to a collision that only appears after rollout in a specific scene. Meta-Reflection also has no external check, which risks over-correction. We test complementarity by using a stage-planned generator as the base model and measuring how much repair still adds.

Proposed Experiments

The main benchmark is TRUMANS with long multi-stage episodes built by chaining its action labels across its 100 scenes. Splits hold out both scenes and stage orderings. Cross-dataset transfer is tested on HUMANISE scenes, where the reported "lie down" goal distance of 0.196 m HUMANISE gives a reference for goal accuracy on short tasks. BABEL tests stage completion on long, densely labelled sequences without scenes, against Motion-R1's reported FID of 0.53.

Metrics are as follows. Validity is measured by the fraction of episodes passing all predicates and by per-stage completion. Physics is measured by penetration volume, contact and foot sliding. Realism is measured by FID and diversity. Cost is measured by wall-clock time to the first valid episode, the fraction of frames regenerated, and the number of generator calls.

Four checks are decisive. The first is that predicted $\gamma$ should rank-correlate with true brute-force repair cost on held-out failures. If it does not, the search signal is noise. The second is that the learned start window should beat violation-frame inpainting on failures whose true cause lies upstream. The third is that at matched wall-clock, valid-episode rate should beat best-of-N, with the margin widening as episode length grows. The fourth is that repaired motions should not lose FID or contact quality relative to single-pass SceMoS output, since repair that trades realism for validity would not be useful.