How it works

Source or prefix? Keep what helps.

A fixed anatomical anchor. An evolving target context.
SPIRA learns how much of each prefix correction to retain.

Source and prefixThe source anchors anatomy and the prefix supplies target-side context.

The source anchors anatomy; the prefix supplies target-side context.

THE IDEA

Explore any chapter, or play the full story.

Source Prefix Balanced prediction

The method, in words and a note on the illustrations

Source & prefix. An aligned source volume anchors anatomy. Previously generated target blocks supply target-side context. Their usefulness varies across regions.

Effect is not utility. The same change in predictive probabilities can help or hurt, depending on the true target. The animation uses a three-class example with identical probability changes and different ground-truth classes.

Isolate the correction. A shared autoregressive predictor produces source-only logits zS (target prefix masked) and full-prefix logits zF. Their difference is the prefix correction r = zF − zS. Retraction acts on logits: z(s) = zF − s r. At s = 0, retain the full correction; at s = 1, return to the source-only prediction.

Learn to retract. During joint training of the predictor and gate, a ground-truth oracle finds the largest retraction that does not increase target loss relative to the full-prefix prediction at the current state. The gate learns to match the oracle’s predictive distribution through KL distillation.

Generate. At inference, the gate uses source and correction features without ground truth. It predicts a separate retraction for each token. Spatial tokens in each block are predicted in parallel; completed blocks are appended to the prefix in a fixed raster order. The frozen decoder maps the completed latent grid to the target volume.

Based on Figs. 1–3 of the supplied SPIRA manuscript. Medical images are extracted from the original figure sources. Probability bars, retraction positions, region highlights, and token actions are illustrative, not recorded model outputs. “Safe” refers to the training oracle’s local target-loss condition. The method retracts a logit correction; it does not remove past prefix blocks.