Vision-language models fail at long embodied tasks for two separate reasons, and current fixes address only one at a time. The first is spatial: they cannot reliably say where things are, especially after the camera turns or similar-looking objects repeat. The second is about long inputs: there is almost no training data, and almost no checkable feedback, for questions whose evidence is spread across thousands of video frames. We propose to train a model to keep an explicit written map as it watches a long trajectory. The map is a small table of objects with their positions in a fixed room frame, rewritten after every chunk of video. Because training happens in a simulator, every map entry can be checked exactly against the simulator's true object state. That gives a dense reward at every step, with no human annotation and no teacher model that could inject its own errors.
The second payoff concerns compute. The model only ever reads one chunk of frames plus its own previous map, so reinforcement learning (RL) rollouts stay short even when the trajectory is very long. The core bet is that a model trained this way on chunks of at most about 16k tokens will beat models that read 128k to 1M raw tokens on long-horizon spatial memory, because it has learned to commit to an intermediate world state instead of hoping attention finds the right frame at question time.
Core Claim
Long-horizon spatial failures such as losing track of objects, miscounting, and confusing duplicates after rotations come mainly from the absence of a verified intermediate state, and not mainly from short context windows. REM is an evaluation-only benchmark of multi-frame egocentric trajectories. On it, GPT-4o reaches 80.0% overall but fails 86–90% of the time under 180° rotations with duplicated objects, and drops to 35.7% on counts above 2. Beyond Needle(s) in the Embodied Haystack builds ∞-THOR and the NiEH benchmark and scales context to over 1M tokens with YaRN and ring attention. Its best model still reaches only 11.5% success on long-horizon tasks, and it trains on raw trajectories with no intermediate reward. We claim that a recurrent written map, rewarded against simulator ground truth at every chunk, closes much of this gap. We also claim it generalizes far beyond the trajectory lengths seen in training.
What Is New Relative to the Closest Work
Four lines of prior work supply pieces of the method, and none combines them into this design.
LongRLVR shows that answer-only RL rewards vanish over long text, because the chance of landing on the right evidence by luck is near zero. It fixes this with a reward on cited evidence chunks. We reuse that diagnosis and the citation-style reward. Their verifier, however, is a large teacher model labeling text chunks; ours is the simulator's true state, and ours applies to spatial content.
SpatialThinker, SATORI-R1 and 3D-RFT train with GRPO, a group-relative policy-gradient method for RL. They use dense geometric rewards such as box overlap or 3D IoU, along with structured scratchpads. 3D-RFT in particular shows that cross-entropy fine-tuning on coordinate tokens piles errors at zero IoU, while metric rewards smooth them out. All three work on single images or clips of about four frames. We carry their metric-reward idea into a recurrent, long-horizon setting.
SPELL contributes a curriculum rule: target questions the model solves about half the time. We borrow that rule to grow trajectory length. We drop SPELL's self-verifier role, because the simulator makes it unnecessary.
3ViewSense motivates the choice of a structured intermediate form. Asking the model to write canonical orthographic views raised block counting from 6.2% to 95.0% and cut responses from over 10,000 tokens to about 375. Its linear-probe result (55.8% from frozen features against 6.2% end-to-end) suggests the spatial information is present but has no good interface. Our map is that interface, extended over time.
Extending LLM Context via Associative Recurrent Memory also carries memory across segments. Its memory is latent and unsupervised, whereas ours is human-readable and checked against the simulator at every step.
Research Program
We generate long trajectories in ∞-THOR (AI2-THOR), logging at every step the true pose of the agent and of every object. Positions are expressed in a frame fixed at the trajectory's start, along with each object's container and room. A trajectory is cut into chunks of $K$ frames. At chunk $t$ the model reads the chunk plus its previous map $M_{t-1}$. It then writes a new map $M_t$, where each row gives an object id, category, room, $(x, z)$ position, container, and the frame index of its last change. It also writes the frame indices within the chunk where any object's state changed. After the final chunk it answers questions using only its last map and the final chunk.
The per-chunk reward follows a lexicographic gate as in SpatialThinker, so malformed maps get zero reward:
$$R_t = \lambda_1\,\mathrm{F1}(\hat{O}_t, O_t) + \lambda_2\,\frac{1}{|\mathcal{P}_t|}\sum_{(i,j)\in\mathcal{P}_t} e^{-\lVert \hat{p}_i - p_j \rVert/\sigma} + \lambda_3\,\mathrm{F1}(\hat{C}_t, C_t)$$
The symbols are defined as follows. $\hat{O}_t$ and $O_t$ are the predicted and true object sets. $\mathcal{P}_t$ is the Hungarian matching between them, which handles duplicate categories. $\hat{p}_i$ and $p_j$ are predicted and true positions. $\sigma$ is a distance scale of roughly half a meter. $\hat{C}_t$ and $C_t$ are the predicted and true sets of change frames, and $\lambda_1, \lambda_2, \lambda_3$ are weights. The exponential term gives partial credit for near misses, which is the property 3D-RFT found essential. A terminal answer reward is added on the last chunk.
Training proceeds in two stages. A short supervised warm-up teaches the map format from simulator-rendered maps. GRPO then runs with on-policy map chaining: the model's own, possibly wrong, map is fed forward, so it learns to recover from its own errors. The number of chunks per episode grows under SPELL's 50%-success targeting. The base model is Qwen2.5-VL-7B, the same family as the NiEH best result, with rollouts capped at 16k tokens. Two analyses run alongside training. We track map error as a function of chunk index to see whether errors compound. We also probe whether accuracy on REM's duplicate-object rotations tracks the map's matching accuracy.
Baselines
The naive reference point is the base Qwen2.5-VL-7B reading the full interleaved trajectory with YaRN context extension and no further training. This tells us how much any training adds at all.
The strongest existing method on the target benchmark is the NiEH recipe of Beyond Needle(s) in the Embodied Haystack. It fine-tunes Qwen2.5-VL on long interleaved ∞-THOR trajectories at 128k context with YaRN, and its paper reports an 11.5% success rate on long-horizon tasks. It is the strongest competitor because it uses the same simulator, the same model family, and far more context per example, and that paper also found that raw interleaved histories beat both retrieval and summaries. We will retrain it on exactly our trajectories, with the same number of training tokens and GPU-hours and the same tuning budget for learning rate and schedule. Beating it means a statistically clear margin on NiEH long-horizon and multi-clue questions at 128k and above, while our model never sees more than 16k tokens at once.
A third baseline is the same raw-context model trained with outcome-only GRPO on the final answers. Following LongRLVR, we expect it to plateau.
For broader spatial skill, we will compare on VSI-Bench against 3D-RFT, which reports an average of 62.8 with a 4B model. On REM, the comparison point is GPT-4o's 80.0% overall and 35.7% on counts above 2. Beating REM means exceeding 35.7% on large counts and cutting the duplicate-rotation failure rate well below 86%.
Three ablations isolate the key ingredient. The first trains on maps with supervised learning only, using no RL. The second uses RL with a coarse map that records rooms and containers but no coordinates, which removes the metric term. The third uses RL with teacher-forced true previous maps instead of on-policy chaining.
Why not just…?
Why not just extend the context window and fine-tune on simulator QA? This is essentially what NiEH did: training on its synthetic data improved VSI-Bench by 11.2%, yet long-horizon success topped out at 11.5%, and Gemini 2.0 Flash degraded at 256k. Long-context RL at 64k tokens is already expensive, and at 1M it is impractical. Our main comparison runs this alternative at matched compute. If it matches us, the claim that intermediate state matters is refuted.
Why not just supervise the maps with ordinary fine-tuning, since the simulator gives them for free? This is the real threat, and we take it seriously. It is cheaper, and it may capture most of the gain. Two pieces of evidence argue for RL. 3D-RFT found that coordinate cross-entropy produces all-or-nothing errors. More importantly, teacher-forced maps never show the model its own mistakes, so errors may compound over hundreds of chunks. The supervised-map ablation settles the question by plotting map error against chunk index. If supervised learning matches RL at long horizons, we will report the written map itself as the contribution and RL as unnecessary.
Why not just retrieve relevant frames or run an external object tracker? NiEH found that visual retrieval lost to raw interleaved history because it misses small state changes. Encoders like CLIP are trained on captions that say what is present rather than where, as shown by What's "up" with vision-language models?. A hand-built tracker is a fair pipeline baseline inside the simulator, but it does not transfer to REM's Blender scenes or to photorealistic VSI-Bench without per-domain engineering. We will include an oracle-detection tracker as an upper-bound reference rather than as a competitor.
Why not just let the model think longer in free form? SATORI-R1 shows that long free-form reasoning pulls attention away from the image. 3ViewSense shows that structured outputs are both shorter and far more accurate. Our outcome-only GRPO baseline tests this alternative directly.
Decisive Checks
The first check is length generalization. We train with episodes of at most 16k tokens, then evaluate NiEH at 32k, 128k, 256k and 1M against the matched NiEH baseline. Success means our accuracy curve stays flat where the baseline's falls.
The second check is transfer without fine-tuning. On REM's Full Rotation split and on counts above 2, the map model must beat GPT-4o's 35.7% and reduce the duplicate-object failure rate. This would show the map tracks object identity rather than memorizing AI2-THOR layouts. VSI-Bench serves as a check that photorealistic spatial skill is not lost, measured against 3D-RFT's 62.8.
The third check is causal. At test time we corrupt one map entry, for example by moving an object. If downstream answers change accordingly, the model is actually using the map. If answers do not change, the gains come from somewhere else, and the core claim fails.
References
- REM: Evaluating LLM Embodied Spatial Reasoning through Multi-Frame Trajectories
- Beyond Needle(s) in the Embodied Haystack: Environment, Architecture, and Training Considerations for Long Context Reasoning
- LongRLVR: Long-Context Reinforcement Learning Requires Verifiable Context Rewards
- SpatialThinker: Reinforcing 3D Reasoning in Multimodal LLMs via Spatial Rewards
- SATORI-R1: Incentivizing Multimodal Reasoning with Spatial Grounding and Verifiable Rewards
- 3D-RFT: Reinforcement Fine-Tuning for Video-based 3D Scene Understanding
- SPELL: Self-Play Reinforcement Learning for Evolving Long-Context Language Models
- 3ViewSense: Spatial and Mental Perspective Reasoning from Orthographic Views in Vision-Language Models
- Extending LLM Context via Associative Recurrent Memory
- What's "up" with vision-language models? Investigating their struggle with spatial reasoning