# 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의 장점과 한계를 두 요인으로 나누어 살펴봅니다. 학습 시점에서 MDM은 임의의 위치에 있는 관측 토큰으로부터 토큰을 예측해야 하므로 학습 복잡도가 커집니다. 반면 추론 시점에서는 토큰을 임의의 순서로 복원할 수 있어 유연성이 큽니다.

이 논문은 학습 복잡도가 실제로 성능을 떨어뜨리는지, 그리고 추론의 유연성이 그 비용을 상쇄할 수 있는지를 묻습니다. 핵심 질문은 어떤 마스킹 부분문제가 계산적으로 어려운지, 그리고 추론 순서를 적응적으로 고르면 그 어려운 부분문제를 피할 수 있는지입니다.

## 순서 무관 학습과 바닐라 추론

MDM의 손실은 가능한 모든 마스크 집합에 대해 토큰을 예측하는 손실들의 선형 결합으로 쓰입니다. 이 손실은 임의의 순열에 대해 자기회귀 손실을 평균한 형태와 같으며, 특정 순서를 선호하지 않는다는 점에서 순서 무관 학습이라고 불립니다. 자기회귀 모델은 한 가지 순서에 해당하는 부분문제만 학습하므로, MDM은 지수적으로 많은 부분문제를 학습하게 됩니다.

바닐라 MDM 추론은 두 단계로 나뉩니다. 먼저 마스크된 위치 집합 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쪽에서 그림 영역을 추출했습니다.

## 적응형 추론과 두 가지 순서 오라클

이 논문은 추론 시점에 마스크 위치를 무작위로 고르지 않고 오라클 F(θ, x\_t)로 고르는 적응형 MDM 추론을 제안합니다. 사전학습된 MDM이 어려운 부분문제에서 약하더라도, 로짓에는 어떤 위치를 먼저 복원할지에 대한 정보가 남아 있다고 봅니다.

Top probability 오라클은 각 위치의 최댓값 확률을 확신도로 보고 상위 K개 위치를 고릅니다. Top probability margin 오라클은 각 위치에서 가장 가능성이 높은 두 값의 확률 차이를 확신도로 씁니다. 두 값이 비슷하게 높을 때 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이라는 두 단순 전략에 한정됩니다. 저자들은 더 좋은 생성 순서를 찾는 일이 향후 과제라고 밝힙니다. 또한 이론 결과인 명제 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)

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/terms/3c3dbcadfdda-humaneval)
- [Slimpajama](https://refivu.com/terms/49417fc10791-slimpajama)
- [Masked diffusion models](https://refivu.com/terms/a7a1026d65e1-masked-diffusion-models)
- [Sudoku](https://refivu.com/terms/24129dac3ad6-sudoku)
- [belief propagation](https://refivu.com/terms/3844b41c7d64-belief-propagation)
- [Autoregressive models](https://refivu.com/terms/66bedb44b32b-autoregressive-models)
- [generative perplexity](https://refivu.com/terms/143312ae4508-generative-perplexity)
- [Top probability](https://refivu.com/terms/1cfb6fa3c301-top-probability)

## 다른 논문 해설

- [SBGD: Improving Graph Diffusion Generative Model via Stochastic Block Diffusion](https://refivu.com/papers/6d352278-b3a3-4fd6-a348-effd4712615f-sbgd-improving-graph-diffusion-generative-model-via.md)
- [A Non-Asymptotic Convergent Analysis for Scored-Based Graph Generative Model via a System of Stochastic Differential Equations](https://refivu.com/papers/7ed4f4aa-efac-4613-a978-016a7c813d92-a-non-asymptotic-convergent-analysis-for-scored-based.md)
- [Energy-Based Flow Matching for Generating 3D Molecular Structure](https://refivu.com/papers/0c5ea30e-e1dd-4afa-b058-77baea5ad8b4-energy-based-flow-matching-for-generating-3d-molecular.md)
- [Pareto-frontier Entropy Search with Variational Lower Bound Maximization](https://refivu.com/papers/4a68478a-a524-4679-9764-cc925c4b9ca0-pareto-frontier-entropy-search-with-variational-lower-bound.md)
- [PAK-UCB Contextual Bandit: An Online Learning Approach to Prompt-Aware Selection of Generative Models and LLMs](https://refivu.com/papers/513a246a-acb4-4fe6-a126-225b5f22a8c9-pak-ucb-contextual-bandit-an-online-learning-approach.md)
- [Controlled Generation with Equivariant Variational Flow Matching](https://refivu.com/papers/f7a0ae68-e9e4-4a46-a6a4-4799a6790c6f-controlled-generation-with-equivariant-variational-flow.md)
- [On the Interplay between Graph Structure and Learning Algorithms in Graph Neural Networks](https://refivu.com/papers/9b65b8e3-14f3-4b3e-9b82-c012afbdaea0-on-the-interplay-between-graph-structure-and-learning.md)
- [InfAlign: Inference-aware language model alignment](https://refivu.com/papers/c8a29ed9-8ab2-4e59-9865-5055bb8ee487-infalign-inference-aware-language-model-alignment.md)
- [Near Optimal Non-asymptotic Sample Complexity of 1-Identification](https://refivu.com/papers/ad027f65-6875-475f-91d9-1d62327d7c60-near-optimal-non-asymptotic-sample-complexity-of-1.md)
- [Mirror, Mirror of the Flow: How Does Regularization Shape Implicit Bias?](https://refivu.com/papers/77ccf2a0-8669-4016-9919-017506bb62ec-mirror-mirror-of-the-flow-how-does-regularization.md)
- [Making Hard Problems Easier with Custom Data Distributions and Loss Regularization: A Case Study in Modular Arithmetic](https://refivu.com/papers/3f87239f-196c-4cf7-ad33-c79663a9d9c4-making-hard-problems-easier-with-custom-data-distributions.md)

---

AI 해설에는 오류가 있을 수 있습니다. [Refivu](https://refivu.com/papers/64d5ed83-79ac-4425-8629-7aff772bd0c4-train-for-the-worst-plan-for-the-best)
