# Train for the Worst, Plan for the Best: Understanding Token Ordering in Masked Diffusions

最悪に備えた学習と最善のための計画：マスクド拡散におけるトークン順序の理解

Jaeyeon Kim, Kulin Shah, Vasilis Kontonis, Sham Kakade, Sitan Chen · arXiv · 2025年2月10日

- **課題** マスク拡散モデルは、学習時には難しいマスキングの部分問題を解く必要がある一方、推論時にはトークンの順序を柔軟に選べます。この論文は、学習の複雑さと推論の柔軟性のどちらが優位かを問うています。
- **手法** ランダムなマスク解除の代わりに、不確実性を基準とする適応的な順序オラクルを用いて、難しいマスキングの部分問題を避ける推論方法を提案しています。
- **結果** Sudokuでは、Top probability marginによる適応的推論がバニラMDMを大きく上回る精度を示しました。LLaDA 8Bでも一部のタスクでスコアが改善しています。これらの結果は、該当するデータとモデルの条件で得られたものです。

![Figure 3: Generative Perplexity. We compare the resulting gener- ative perplexity (GenPPL) of adaptive vs. vanilla MDM inference. We employ a pretrained 170M M…](https://refivu.com/papers/64d5ed83-79ac-4425-8629-7aff772bd0c4/figures/figure-3c9f7b2d7a81ae79673c345ffeebb2c7.png?thumb=512)

**Figure 3** . Generative Perplexity. We compare the resulting gener- ative perplexity (GenPPL) of adaptive vs. vanilla MDM inference. We employ a pretrained 170M MDM and LLaMA-7B (Touvron et al., 2023) as inference and evaluation, respectively. Adaptive MDM inference (Blue) leads to a substantial reduction in genera- tive perplexity, while maintaining the entropy.

[出典](https://arxiv.org/abs/2502.06768v3) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Jaeyeon Kim, Kulin Shah, Vasilis Kontonis, Sham Kakade, Sitan Chen · Train for the Worst, Plan for the Best: Understanding Token Ordering in Masked Diffusions · 論文の図を引用 · 元のPDFの7ページ目から図の部分を抽出しています。

## マスク拡散モデルの学習と推論の順序問題

マスク拡散モデル（MDM）は離散データを生成する有望な手法として注目されていますが、言語モデリングでは自己回帰モデル（ARM）より低い性能にとどまる場合が多くあります。この論文は、MDMの長所と限界を2つの要因に分けて検討しています。学習時のMDMは、任意の位置にある観測トークンからトークンを予測しなければならないため、学習の複雑さが大きくなります。一方、推論時にはトークンを任意の順序で復元できるため、柔軟性が高いです。

この論文は、学習の複雑さが実際に性能を下げるのか、そして推論の柔軟性がそのコストを相殺できるのかを問うています。中心となる問いは、どのマスキングの部分問題が計算上難しいのか、そして推論の順序を適応的に選べば、その難しい部分問題を避けられるのかということです。

## 順序無関係の学習とバニラ推論

MDMの損失は、取り得るすべてのマスク集合について、トークンを予測する損失の線形結合として書けます。この損失は、任意の順列について自己回帰の損失を平均したものと同じ形であり、特定の順序を優先しないことから、順序無関係の学習と呼ばれます。自己回帰モデルは1つの順序に対応する部分問題だけを学習しますが、MDMは指数的に多くの部分問題を学習することになります。

バニラMDMの推論は2段階に分かれます。まず、マスクされた位置の集合Sをランダムに選びます。そのうえで、各位置iについて、事前学習済みの予測分布p\_θ(x\_i\|x\_t)からトークンの値をサンプリングします。したがって、順序の選択はランダムであり、学習が十分でなかった部分問題の予測値がそのまま使われることがあります。

## L&O分布と計算上難しいマスキングの部分問題

この論文は、潜在トークンと観測トークンから成るL&O分布を定義しています。潜在トークンは独立にサンプリングされ、観測トークンは潜在トークンの関数として生成されます。この構造では、順序を意識した学習は、潜在トークンを先に置き、観測トークンをその後に予測するため、扱いやすいです。一方、順序無関係の学習は、観測トークンだけが与えられた状態で潜在トークンを復元する部分問題にしばしば直面し、その一部は計算上難しいとされています。

スパース述語の観測例では、サイズkの部分集合に対して述語gの値を観測として与えます。命題3.3は、マスキング率が特定の範囲にあるとき、Kesten-Stigum および凝縮閾値に関連する条件のもとで、多くのマスキングの部分問題が多項式時間アルゴリズムでは解けないことを示しています。この結果は1RSBキャビティ予測という推測に依拠しているため、条件付きの証明として読むべきです。

## テキストと合成データにおける難易度の差の確認

理論的な例に加えて、著者らは実際のテキストデータで、順列ごとのπ-learnerの尤度を比較しています。ランダムな順列πを用いる学習器は、自己回帰モデルより悪いスケーリング曲線を示します。順列が恒等順列に近づくほど、曲線は自己回帰モデルに近づきます。

また、L&O-NAE-SATデータでは、MDMは観測位置のマスキング問題は比較的よく解けるものの、潜在位置の予測では誤差がより大きくなります。この結果は、MDMがすべての部分問題を一様に学習できていないことを示す証拠として挙げられています。テキスト実験はSlimpajamaデータと長さ2048のシーケンスで行われ、学習率とモデル構成は付録C.1に記載されています。

![Figure 2: Left: MDMs train on hard problems (Section 3.2). x-axis and y-axis correspond to log(FLOPs) and − log pθ(x), respectively. MDM (Blue) is worse than A…](https://refivu.com/papers/64d5ed83-79ac-4425-8629-7aff772bd0c4/figures/figure-06731c1c772d33f10fff2bb8fd432487.png?thumb=512)

**Figure 2** . Left: MDMs train on hard problems (Section 3.2). x-axis and y-axis correspond to log(FLOPs) and − log pθ(x), respectively. MDM (Blue) is worse than ARM (Orange) in likelihood modeling. Most masking problems (Other lines) that MDM is trained on are harder than those encountered by ARM, as indicated by small log-likelihoods. Right: Task error imbalance (Section 3.3). MDM’s performance varies across different tasks. For text data (top right), this is indicated by validation loss. For L&O-NAE-SAT (bottom right), MDM performs well on the masking problems for observation positions (light region) but struggles with latent positions (dark region).

[出典](https://arxiv.org/abs/2502.06768v3) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Jaeyeon Kim, Kulin Shah, Vasilis Kontonis, Sham Kakade, Sitan Chen · Train for the Worst, Plan for the Best: Understanding Token Ordering in Masked Diffusions · 論文の図を引用 · 元のPDFの5ページ目から図の部分を抽出しています。

## 適応的推論と2種類の順序オラクル

この論文は、推論時にマスク位置をランダムに選ぶのではなく、オラクルF(θ, x\_t)で選ぶ適応的MDM推論を提案しています。事前学習済みのMDMが難しい部分問題で弱くても、ロジットには、どの位置を先に復元すべきかについての情報が残っていると考えています。

Top probabilityオラクルは、各位置の最大確率を確信度とみなし、上位K個の位置を選びます。Top probability marginオラクルは、各位置で最も可能性の高い2つの値の確率差を確信度として使います。2つの値がどちらも同程度に高いとき、Top probabilityは不確実な位置を誤って選ぶことがありますが、marginはこうした場合をより適切に反映します。

## 論理パズルの結果と自己回帰モデルとの比較

Sudokuでは、バニラMDM推論の精度は6.88%、Top probabilityは18.51%、Top probability marginは89.49%でした。Zebraパズルでは、バニラMDMが76.9%、Top probabilityが98.5%、Top probability marginが98.3%でした。これらの数値は、同じShah et al. (2024)のデータセットと、該当実験のモデル構成で得られた結果です。

![Table 2: Comparison of accuracy for solving the Sudoku puzzle](https://refivu.com/papers/64d5ed83-79ac-4425-8629-7aff772bd0c4/figures/figure-9d803b7244143384c2b3fe130625ef98.png?thumb=512)

**Table 2** . Comparison of accuracy for solving the Sudoku puzzle.

[出典](https://arxiv.org/abs/2502.06768v3) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Jaeyeon Kim, Kulin Shah, Vasilis Kontonis, Sham Kakade, Sitan Chen · Train for the Worst, Plan for the Best: Understanding Token Ordering in Masked Diffusions · 論文の図を引用 · 元のPDFの8ページ目から図の部分を抽出しています。

![Table 3: Comparison of accuracy for solving the Zebra puzzle](https://refivu.com/papers/64d5ed83-79ac-4425-8629-7aff772bd0c4/figures/figure-36c4dc105586fac76e9bf5e22f45bb4c.png?thumb=512)

**Table 3** . Comparison of accuracy for solving the Zebra puzzle.

[出典](https://arxiv.org/abs/2502.06768v3) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Jaeyeon Kim, Kulin Shah, Vasilis Kontonis, Sham Kakade, Sitan Chen · Train for the Worst, Plan for the Best: Understanding Token Ordering in Masked Diffusions · 論文の図を引用 · 元のPDFの9ページ目から図の部分を抽出しています。

同じSudoku比較では、順序情報なしで学習したARMは9.73%、順序情報を含めて学習したARMは87.18%でした。したがって、適応的MDM推論は、順序情報を明示的に与えられた自己回帰モデルより高い精度を示しました。この比較は、該当データとパラメータ数が異なるモデル同士の結果です。

## LLaDA 8Bの自然言語タスクとテキスト生成の評価

LLaDA 8Bモデルでは、適応的推論によってHumanEval系列とMathタスクのスコアが、バニラ推論より高くなりました。たとえばMathタスクでは、バニラ推論が28.5%、Top probability margin推論が34.3%でした。著者らは、複数のトークンの確率が近い難しいタスクでは、marginを用いたほうがより信頼できる確信度になると解釈しています。

![Table 4: Performance of different inference strategies for LLaDa 8B model on coding and math tasks](https://refivu.com/papers/64d5ed83-79ac-4425-8629-7aff772bd0c4/figures/figure-9ac977a0a4b5b4694284e04056e8a91a.png?thumb=512)

**Table 4** . Performance of different inference strategies for LLaDa 8B model on coding and math tasks.

[出典](https://arxiv.org/abs/2502.06768v3) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Jaeyeon Kim, Kulin Shah, Vasilis Kontonis, Sham Kakade, Sitan Chen · Train for the Worst, Plan for the Best: Understanding Token Ordering in Masked Diffusions · 論文の図を引用 · 元のPDFの10ページ目から図の部分を抽出しています。

テキスト生成では、1.1B MDMの生成サンプルをLLaMA2-7Bで評価したgenerative perplexityが、適応的推論で大きく下がりました。この評価は、サンプリング温度を加えた変種と、エントロピーが維持されるかどうかを合わせて検討した結果です。

## 適用範囲と残された課題

この論文の適応的オラクルは、Top probabilityとTop probability marginという2つの単純な戦略に限られます。著者らは、より良い生成順序を見つけることが今後の課題だと述べています。また、理論結果である命題3.3は、1RSBキャビティ予測という推測と特定のL&O分布に依拠しているため、すべてのMDM学習に対する一般的な証明として読んではいけません。

論理パズルの実験は、特定のSudokuおよびZebraデータセットと小型のMDMで行われました。難しいSudoku評価も、Radcliffeデータから選び出した別のデータです。したがって、この結果をすべての推論タスクや大型モデルに広げるには、根拠が限られています。

![Table 5: Comparison of accuracy for solving the hard Sudokus](https://refivu.com/papers/64d5ed83-79ac-4425-8629-7aff772bd0c4/figures/figure-21b04dd2d7bcae347bdf4b01406ccc35.png?thumb=512)

**Table 5** . Comparison of accuracy for solving the hard Sudokus.

[出典](https://arxiv.org/abs/2502.06768v3) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Jaeyeon Kim, Kulin Shah, Vasilis Kontonis, Sham Kakade, Sitan Chen · Train for the Worst, Plan for the Best: Understanding Token Ordering in Masked Diffusions · 論文の図を引用 · 元のPDFの10ページ目から図の部分を抽出しています。

## 論文情報

- **著者**: Jaeyeon Kim, Kulin Shah, Vasilis Kontonis, Sham Kakade, Sitan Chen
- **学会・ジャーナル**: arXiv · プレプリント
- **公開日**: 2025年2月10日
- **登録日**: 2026年10月30日
- **更新日**: 2025年8月19日
- **バージョン**: v3
- **arXiv**: 2502.06768
- **カテゴリ**: cs.LG
- **ライセンス**: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)
- **掲載内容**: 論文情報・解説・論文の図

[元論文 ↗](https://arxiv.org/abs/2502.06768v3) · [PDF ↗](https://arxiv.org/pdf/2502.06768v3)

この解説は、Refivuの韓国語解説をAIで翻訳したものです。不正確な翻訳や誤りが含まれる可能性があります。論文と図の利用条件は各出典に従います。

## アブストラクト

In recent years, masked diffusion models (MDMs) have emerged as a promising alternative approach for generative modeling over discrete domains. Compared to autoregressive models (ARMs), MDMs trade off complexity at training time with flexibility at inference time. At training time, they must learn to solve an exponentially large number of infilling problems, but at inference time, they can decode tokens in essentially arbitrary order. In this work, we closely examine these two competing effects. On the training front, we theoretically and empirically demonstrate that MDMs indeed train on computationally intractable subproblems compared to their autoregressive counterparts. On the inference front, we show that a suitable strategy for adaptively choosing the token decoding order significantly enhances the capabilities of MDMs, allowing them to sidestep hard subproblems. On logic puzzles like Sudoku, we show that adaptive inference can boost solving accuracy in pretrained MDMs from $\<7$% to $\\approx 90$%, even outperforming ARMs with $7\\times$ as many parameters and that were explicitly trained via teacher forcing to learn the right order of decoding.

## この論文を引用

Jaeyeon Kim, Kulin Shah, Vasilis Kontonis, Sham Kakade, Sitan Chen (2025). Train for the Worst, Plan for the Best: Understanding Token Ordering in Masked Diffusions. arXiv:2502.06768v3. https://arxiv.org/abs/2502.06768v3

**BibTeX**

```
@misc{kim2025train,
  title = {{Train for the Worst, Plan for the Best: Understanding Token Ordering in Masked Diffusions}},
  author = {Jaeyeon Kim and Kulin Shah and Vasilis Kontonis and Sham Kakade and Sitan Chen},
  year = {2025},
  eprint = {2502.06768},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2502.06768v3}
}
```

## この論文の用語

- [HumanEval](https://refivu.com/ja/terms/3c3dbcadfdda-humaneval)
- [Autoregressive models](https://refivu.com/ja/terms/66bedb44b32b-autoregressive-models)
- [belief propagation](https://refivu.com/ja/terms/3844b41c7d64-belief-propagation)
- [Masked Diffusion Models](https://refivu.com/ja/terms/a7a1026d65e1-masked-diffusion-models)
- [Sudoku](https://refivu.com/ja/terms/24129dac3ad6-sudoku)

## ほかの論文解説

- [Flow Straight and Fast: Learning to Generate and Transfer Data with Rectified Flow](https://refivu.com/ja/papers/a0c4439d-88d7-4d0f-be30-5509d158003e-flow-straight-and-fast-learning-to-generate-and.md)
- [Photorealistic Text-to-Image Diffusion Models with Deep Language Understanding](https://refivu.com/ja/papers/eaa0c3ba-e0e4-4517-8ef7-d6ec6ba261b6-photorealistic-text-to-image-diffusion-models-with-deep.md)
- [Consistency Models](https://refivu.com/ja/papers/f97e5129-1522-4b93-9b60-0a1f3af22d42-consistency-models.md)
- [Adding Conditional Control to Text-to-Image Diffusion Models](https://refivu.com/ja/papers/071adc96-6d0d-4210-ac05-74ff8d4cb5aa-adding-conditional-control-to-text-to-image-diffusion.md)
- [Flow Matching for Generative Modeling](https://refivu.com/ja/papers/7c239b51-40c6-4227-afa0-fb98cb12b475-flow-matching-for-generative-modeling.md)
- [An Image is Worth One Word: Personalizing Text-to-Image Generation using Textual Inversion](https://refivu.com/ja/papers/10be0954-63d9-4478-b280-16d81b4acc93-an-image-is-worth-one-word-personalizing-text.md)
- [Learning to (Learn at Test Time): RNNs with Expressive Hidden States](https://refivu.com/ja/papers/6a02f8bd-d757-4f00-9d97-6829bf6db29f-learning-to-learn-at-test-time-rnns-with.md)
- [Reinforcement Learning via Self-Distillation](https://refivu.com/ja/papers/020d237b-90b6-4f93-9da6-e25bde98d4ec-reinforcement-learning-via-self-distillation.md)
- [Self-Distilled Reasoner: On-Policy Self-Distillation for Large Language Models](https://refivu.com/ja/papers/733bb47f-1989-4658-a978-6131bad900ad-self-distilled-reasoner-on-policy-self-distillation-for.md)
- [CAMR: Compatibility-Aware Memory Replay for Continual Learning in Large Language Models](https://refivu.com/ja/papers/24445413-cb2e-4d23-a34a-5020794de1e7-camr-compatibility-aware-memory-replay-for-continual.md)
- [CogACT: A Foundational Vision-Language-Action Model for Synergizing Cognition and Action in Robotic Manipulation](https://refivu.com/ja/papers/52aadf90-b60a-4301-8fb3-f8cf89016dc5-cogact-a-foundational-vision-language-action-model-for.md)
- [NORA: A Small Open-Sourced Generalist Vision Language Action Model for Embodied Tasks](https://refivu.com/ja/papers/76e5e347-64e6-45f9-956f-64d76903407c-nora-a-small-open-sourced-generalist-vision-language.md)

---

AI解説には誤りが含まれることがあります。 [Refivu](https://refivu.com/ja/papers/64d5ed83-79ac-4425-8629-7aff772bd0c4-train-for-the-worst-plan-for-the-best)
