Dissecting AI
From the paper: MJev-Spatial: System One Spatial Intelligence via Native Attention Matching

Joint Supervision and Balanced Batching for Spatial Decisions

Repeated refinement decisions make training expensive and uneven, so MJev-Spatial supervises every ground-truth stage in one teacher-forced pass and balances heterogeneous sequence work across GPUs.

Read the paper ↗
The short version

What it is

  • Joint stage supervision Put a question’s known sequence of refinement decisions into one causal training pass and score each decision along that path.
  • Balanced batching Group similarly sized examples, then distribute the resulting work across GPUs so padding and waiting are reduced.

Why it matters

Refinement creates multiple decisions per question, and spatial examples vary in sequence and image work. Joint supervision avoids a separate backbone pass for each training stage; stage averaging prevents longer paths from automatically counting more. Length-aware scheduling targets wasted padding and uneven GPU workloads.

Before I get into the mechanics, here is the short version: a spatial answer can be a path of decisions rather than one token, and you can train against that known path in one causal pass. Then, because those paths have different lengths and image work, you organize the batch so GPUs do less padding and less waiting.

  1. Repeated work: A refinement path has several supervised decisions. Running the language backbone separately for every stage repeats computation; the useful opportunity is to place the known stages into one causal sequence.
  2. Unequal influence: A question with more stages should not win more training weight just because its answer takes more steps. The concrete comparison is a one-decision choice question versus a multi-step point-refinement question: average a question’s stage losses first, so each question contributes one question-sized amount.
  3. Uneven workload: A choice example and a point example do not necessarily cost the same. Point examples add image crops, while candidate descriptions and stage counts also change sequence length. Batching similar lengths reduces padding, but similar lengths alone do not guarantee that every GPU gets comparable work.

So how can all those targets be used without letting the model peek ahead? The canonical example is a point answer refined through successive decisions, with image crops between stages. During training, the annotated answer tells us the full target path and the crops to place in the sequence. Think of teacher forcing as replaying a route with the turns already marked: the model sees prior turns when predicting the next one, not future turns. That is the causal constraint. At inference, the route is not marked; the model’s current selection determines what candidates or crop come next, so those decisions still happen sequentially. How should the stages share credit?

I’d treat the question, not the individual turn, as the unit of weight. Compute a categorical loss at each supervised decision, average those losses within that question, then average across real questions in the batch. In symbols, Lq=(1/Sq)∑sℓq,sL_q = (1/S_q)\sum_s \ell_{q,s}; in words, add the stage losses and divide by the number of stages for that question. A longer point path then does not automatically outweigh a one-stage choice. Tail placeholders used for batch shape alignment get zero weight; they are not extra questions. What happens when those questions have very different costs?

The canonical batching contrast is a short choice sequence next to a point example that includes extra crop tokens. If you pad them to the same shape, some of the short example’s allocated sequence work is wasted. Group sequences of similar length within each global optimizer batch, then assign the heaviest remaining microbatch to the GPU with the least work assigned so far. The scheduling cost includes padded sequence length and visual-token work. This is a load-balancing heuristic, not a promise that estimated cost perfectly matches runtime. Keep questions as separate causal rows, too: packing unrelated questions would require isolating the model’s Gated DeltaNet states. The open question is how well the cost estimate tracks the real hardware workload.

Read the deep dive

Why People Wanted It

A spatial answer may not be one decision. A numerical estimate can be refined through successive choices, and a point prediction can make decisions around image crops. Training each stage with its own backbone pass repeats work; combining examples of very different lengths can waste computation in padding or leave some GPUs waiting. The real question is how to teach the full decision path without paying for a separate pass at every step—and how to keep the resulting workload balanced.

The Core Move

Put the known refinement path into one causal sequence, score every supervised decision in that sequence, and divide each question’s total loss across its stages:

Lq=1Sq∑s=1Sqℓq,sL_q = \frac{1}{S_q}\sum_{s=1}^{S_q} \ell_{q,s}

Here, SqS_q is the number of supervised decisions for question qq, and ℓq,s\ell_{q,s} is its categorical cross-entropy at stage ss.

Quiz
A question has three supervised refinement stages. Why divide its summed stage losses by three before averaging across questions?
To keep a multi-stage question from receiving more total weight solely because it has more stages.
To let earlier stages attend to later target choices.
To make inference evaluate all dependent stages in parallel.
To remove the need for categorical cross-entropy at each decision.

Why Teacher Forcing Can Supervise the Whole Path

Now the version for readers who want more of the machinery: the key constraint is causal order, not that each stage gets a separate forward pass. The annotated answer determines the complete target path and any crops before training. Serialize each decision’s target choice—and any subsequent crop—after that decision position. A causal model can then compute every stage loss in one backbone pass: earlier positions cannot attend to future target choices or crops, while teacher forcing supplies the known preceding choices.

This makes training different from inference. At inference, the next candidates and any crop depend on the model’s current selection, so stages must be evaluated sequentially. Joint supervision reuses a training pass; it does not make a dependent inference path parallel.

Why Stage Averaging Preserves Question Weight

Here is the part that gets technical: summing stage losses would give questions with longer refinement paths more total influence. Instead, average the categorical cross-entropies within each question, then average over the real questions in the optimizer batch. A one-stage choice and a three-stage point example therefore each contribute one question’s total weight, rather than the point example counting three times as much.

The batch denominator is the number of actual questions. Any tail placeholders used to make batch shapes line up receive zero weight; they do not change the normalization. This defines the intended objective even when the distributed batch contains padding placeholders.

Why Similar-Length Work Still Needs Global Scheduling

Now the deeper systems detail: examples differ not only in token length, but also in visual-token work. Point examples add two image crops, and choice and numerical examples can differ in candidate length and stage count. Sort expanded sequences by length within each global optimizer batch to form similar-length microbatches, then assign the most expensive remaining microbatch to the GPU with the least assigned work. The cost accounts for padded sequence length and visual-token work.

The scheduling changes where work runs, not which questions belong to the optimizer batch or their loss weights. Keep each QA as an independent causal row: packing unrelated questions together would require isolating the model’s Gated DeltaNet states as well. The open question is how much throughput the schedule recovers on a particular hardware and data mix.

Minimal Causal Code

This toy loop shows the per-question stage average and zero-weight placeholders. It omits the model-specific serialization, crop handling, and distributed scheduler.

import torch
import torch.nn.functional as F

# Each row is one question; valid stages are already in causal order.
# logits: [questions, stages, classes]
# targets: [questions, stages]
# valid: [questions, stages], False for absent stages/placeholders
logits = model(input_ids)
per_stage = F.cross_entropy(
    logits.transpose(1, 2), targets, reduction="none"
)

stage_counts = valid.sum(dim=1).clamp_min(1)
per_question = (per_stage * valid).sum(dim=1) / stage_counts
real_question = stage_counts.gt(0)  # production code tracks tail placeholders explicitly
loss = per_question[real_question].mean()
loss.backward()

What You Gain, and What You Lose

Joint supervision avoids a separate language-backbone training pass for every refinement stage, and stage averaging keeps a longer path from automatically receiving more total question weight. Length grouping reduces padding among dissimilar sequences; global work assignment aims to reduce GPU imbalance.

There are constraints. Training needs the annotated target path and crops in advance, while inference remains sequential when later decisions depend on earlier selections. Scheduling also adds bookkeeping, and the reported method keeps questions as separate causal rows rather than packing them together. Balanced batches improve utilization only insofar as the cost estimate captures actual work. These are efficiency choices around the objective—not a guarantee that every stage or every GPU costs the same.

Core Takeaway

Teach the whole known path in one causal pass, but let each question—not each stage—own the loss weight.