﻿# MAR and DiffLoss: unmasking rounds and diffusion-head steps are separate controls

Distinguish MAR outer masked autoregressive iterations from the inner diffusion distribution used to sample continuous visual tokens, with a reproducible tuning plan.

Author: Retrivium editorial team
Updated: 2026-11-04
Canonical URL: https://retrivium.ai/journal/fg2-mar-diffloss-outer-unmask-inner-sampling/
Language: en

## Remove an unnecessary assumption about tokens

The [MAR research paper](https://arxiv.org/abs/2406.11838) models per-token probability with a diffusion procedure in a continuous-valued space. Autoregression therefore does not require that every visual token be a discrete codebook identifier selected with categorical cross-entropy. In this method, a token can be a continuous latent vector. This distinction prevents an integration from substituting an unrelated vector-quantized image tokenizer merely because both systems describe their intermediate representation as tokens.

## Locate the outer reveal process

The [official MAR source](https://raw.githubusercontent.com/LTH14/mar/main/models/mar.py) exposes `num_iter` in its sampling routine. The outer loop updates which latent positions remain masked and which positions are predicted during the current round. The context changes as additional positions become available. Reducing this count changes the reveal schedule and the number of outer model evaluations; it does not merely rename a setting in the continuous token distribution's internal sampler.

## Identify the inner distribution sampler

The same implementation passes `num_sampling_steps` into DiffLoss. This controls sampling inside the diffusion-based token model, separately from the outer masking iterations. The [author repository](https://github.com/LTH14/mar) exposes these controls independently in its examples. A configuration containing only a generic field called steps is ambiguous unless the wrapper documents which mechanism it controls. Silently mapping both controls to the same value would make later quality and runtime comparisons difficult to interpret.

## Design a diagnostic comparison

Consider a worker whose results change after a speed-oriented configuration edit. Hold the outer reveal count fixed while varying the inner sampling setting, then reverse the comparison. Save decoded images and both parameter values rather than reporting a single undifferentiated step budget. This separates changes in available context from changes in sampling each continuous token. It is an experimental design, not a prediction of which setting is best or a claim that computation scales by a simple product.

## Preserve the continuous-latent artifact contract

Record the MAR checkpoint, matching latent autoencoder, source revision, masking schedule, diffusion-head configuration, and final decode. Guides to [diffusion parameterizations](/journal/diffusion-score-noise-parameterizations/) and [masked objectives](/journal/masked-causal-language-objectives/) supply background. Acceptance should verify the continuous representation and both sampling layers. A successful transformer forward pass does not establish that the selected latent decoder, token distribution, and reveal process form the trained generation system described by the paper.
