MMaDA icon indicating copy to clipboard operation
MMaDA copied to clipboard

Margin-Based Remasking Strategy for Improved Text-to-Image Generation

Open zhongweixie opened this issue 6 months ago • 0 comments

Hi MMaDA team,

We have been experimenting with the remasking strategies during the parallel non-autoregressive sampling phase of MMaDA. We found that replacing the default top-1 "low-confidence" score with a Margin-Based strategy can yield more stable improvements.

The Limitation of Top-1 Confidence The default implementation relies on the top-1 softmax probability. However, this ignores the broader shape of the predictive probability distribution, failing to distinguish between a sharply peaked distribution and a flat, uncertain one.

Our Approach: Margin-Based Remasking We evaluate true confidence by looking at the gap (margin) between the best and second-best choices. A small margin indicates the model is hesitating between tokens (Action: Remask), while a large margin indicates high certainty (Action: Keep). We also explored an entropy-based strategy, but found it suffered from long-tail noise.

Key Findings We conducted an extensive training-free sampling ablation on the MMaDA-8B-MixCoT checkpoint. While many inference-time heuristics struggled to generalize robustly at scale, our focused follow-up for the Margin strategy showed:

  • COCO-VAL: A stable positive trend. Evaluated on 293 prompts across 3 seeds, Margin achieved a mean CLIP score lift of +0.326 (25.082 vs baseline 24.756).
  • WISE Evaluation: Showed improvements in Natural Science (+0.314) and Spatio-temporal reasoning (+0.274).

We have open-sourced our code, and our detailed analysis can be found in this report: https://github.com/zhongweixie/mmada-margin-remask/blob/main/mmada_margin_remask.pdf.

We thought these findings might be useful for the community and future iterations of MMaDA's inference pipeline. Let us know if you'd be interested in further discussions or a potential PR to integrate this decoding trick!

Best regards,

Haoyu Huang & Zhongwei Xie

zhongweixie avatar May 13 '26 16:05 zhongweixie