完整搜尋頁面 →

InstaFlow:先 reflow,再蒸餾端點(ICLR 2024)

選讀・DLCV 12B・單步生成 的論文導讀(第 3/7 篇)。引用編號對應本頁底部的參考文獻。

導覽:本頁與本系列: 導覽:本頁與本系列

本頁內容

補充資料 · 2

  1. 瞬時速度與區間速度
  2. 無教師的三種意思

論文導讀 · 7

  1. Progressive Distillation:教師兩步壓成學生一步(ICLR 2022)
  2. Consistency Models:沿同一路徑預測相同端點(ICML 2023)
  3. InstaFlow:先 reflow,再蒸餾端點(ICLR 2024)
  4. Latent Consistency Models:受引導潛在流的端點(2023)
  5. Adversarial Diffusion Distillation:教師與判別器(ECCV 2024)
  6. DMD:匹配教師定義的分布(CVPR 2024)
  7. DMD2:追蹤學生,加入真實資料(NeurIPS 2024)

電腦視覺深度學習

  1. 02 · 深度影像分類
  2. 03 · 物件偵測:從 R-CNN 到 DETR
  3. 09 · 深度影像復原:低階視覺
查看完整課程樹 →

挑戰

文字生成教師的雜訊—影像映射可能高度彎曲、難以直接迴歸。InstaFlow [13] 先用文字條件 reflow 改善映射,再做端點蒸餾。

一步 Euler 的 reflow 模型仍預測局部速度;從 reflow 教師蒸餾的一步學生,則明確學有限終點位移。兩者須分開比較。

方法

Reflow 先調整耦合,使軌跡較直,再蒸餾終點;單步推論不會消除準備與教師產生資料的工作。
原論文圖 3 — Reflow 先調整耦合,使軌跡較直,再蒸餾終點;單步推論不會消除準備與教師產生資料的工作。

圖片來源: [13], arXiv:2309.06380v2, PDF 第 4 頁. 原始 PDF.

初始傳輸。 預訓練文字條件機率流將隨機 zz 映射至潛在影像 x=Φ(z,c)x=\Phi(z,c),cc 是提示詞。固定自動編碼器 [11] 負責解碼。產生配對資料時仍要執行多步教師。

文字條件流。 在 xt=(1−t)z+txx_t=(1-t)z+tx 上,以 x−zx-z 訓練速度,並輸入時間、提示詞嵌入。配對來自前一取樣器,不是獨立雜訊與資料;邊際速度的訓練線仍可能相交。

Reflow。 從新流抽取終點,再建構耦合。理想條件下可保留邊際分布、改善傳輸成本並促進拉直 [12];有限資料、ODE 與擬合誤差削弱精確性,因此輪數不宜無限制增加。

單步蒸餾。 對教師端點 ΦRF(z,c)\Phi_{\mathrm{RF}}(z,c),訓練學生位移 gθ(z,c)g_\theta(z,c),使:

L=E d ⁣(z+gθ(z,c),ΦRF(z,c)).\mathcal L=\mathbb E\,d\!\left(z+g_\theta(z,c),\Phi_{\mathrm{RF}}(z,c)\right).

dd 衡量所選表示的端點差異。z+gθz+g_\theta 是完整潛在樣本,不是任意時間的局部 Euler 預測。映射雖確定,隨機輸入仍提供生成隨機性。

架構與條件。 原文比較一般 U-Net 與較大的堆疊 U-Net;容量同時影響品質與速度,不能當成純目標消融。提示與引導行為屬教師映射的一部分,蒸餾後不保證所有控制仍可互換。

部署。 學生一次推論後解碼;教師資料生成、reflow 及端點訓練是訓練成本。仍需自動編碼器,計時須說明是否含文字編碼與解碼。

結果

初步 COCO 2017 的 5,000 樣本比較:直接從 Stable Diffusion 1.4 蒸餾一步為 FID 40.9,初步二輪 rectified-flow 模型直接走一步 Euler 為 68.3,再蒸餾其端點為 31.0。三者清楚顯示路徑與端點目標不同。

後續完整系統的 9 億參數一步模型,在 COCO-2014 FID-30k 為 13.10、報告時間 0.09 秒,使用 A100、批次一。這與初步實驗是不同訓練設定;不能和其他 CPU、解析度或快取條件拼出純方法加速比。

消融實驗

初步 U-Net 的 reflow 再蒸餾使 FID-5k 從 40.9 到 31.0;堆疊網路直接蒸餾為 52.0,reflow 再蒸餾為 24.6,顯示容量本身無法解釋改善。第三輪堆疊 reflow 為 26.3,反比第二輪 24.6 差;輪數更多不保證更好。

引導與訓練研究支持特定實驗下的組合,不代表任意模型恰好一輪 reflow 就容易蒸餾。

結論

耦合設計與端點近似是兩個工具。Reflow 可讓映射適合低預算學生,再由端點蒸餾學完整位移。

限制與問題

產生教師端點昂貴,各階段都可能引入誤差,學生仍受選定耦合限制。罕見提示、引導外推與高解析細節需另測;分布匹配 [16] 放寬逐樣本對應,卻新增估計學生分布的問題。

參考文獻

  1. Y. Song, J. Sohl-Dickstein, D. P. Kingma, A. Kumar, S. Ermon, B. Poole, “Score-Based Generative Modeling through Stochastic Differential Equations,” ICLR, 2021. paper
  2. Y. Lipman, M. Havasi, P. Holderrieth, et al., “Flow Matching Guide and Code,” arXiv tutorial, 2024. paper
  3. T. Karras, M. Aittala, T. Aila, S. Laine, “Elucidating the Design Space of Diffusion-Based Generative Models,” NeurIPS, 2022. source
  4. X. Fan, Z. Wu, H. Wu, L. Cao, “A Survey on Pre-Trained Diffusion Model Distillations,” arXiv preprint, version 2, 2025. paper
  5. J. Song, C. Meng, S. Ermon, “Denoising Diffusion Implicit Models,” ICLR, 2021. paper
  6. C. Lu, Y. Zhou, F. Bao, J. Chen, C. Li, J. Zhu, “DPM-Solver: A Fast ODE Solver for Diffusion Probabilistic Model Sampling in Around 10 Steps,” NeurIPS, 2022. paper
  7. T. Salimans, J. Ho, “Progressive Distillation for Fast Sampling of Diffusion Models,” ICLR, 2022. paper
  8. Y. Song, P. Dhariwal, M. Chen, I. Sutskever, “Consistency Models,” ICML, 2023. paper
  9. Y. Song, P. Dhariwal, “Improved Techniques for Training Consistency Models,” ICLR, 2024. paper
  10. S. Luo, Y. Tan, L. Huang, J. Li, H. Zhao, “Latent Consistency Models: Synthesizing High-Resolution Images with Few-Step Inference,” arXiv preprint, 2023. paper
  11. R. Rombach, A. Blattmann, D. Lorenz, P. Esser, B. Ommer, “High-Resolution Image Synthesis with Latent Diffusion Models,” CVPR, 2022. source
  12. X. Liu, C. Gong, Q. Liu, “Flow Straight and Fast: Learning to Generate and Transfer Data with Rectified Flow,” ICLR, 2023. paper
  13. X. Liu, X. Zhang, J. Ma, J. Peng, Q. Liu, “InstaFlow: One Step is Enough for High-Quality Diffusion-Based Text-to-Image Generation,” ICLR, 2024. paper
  14. A. Sauer, D. Lorenz, A. Blattmann, R. Rombach, “Adversarial Diffusion Distillation,” ECCV, 2024. paper
  15. A. Sauer, F. Boesel, T. Dockhorn, A. Blattmann, P. Esser, R. Rombach, “Fast High-Resolution Image Synthesis with Latent Adversarial Diffusion Distillation,” SIGGRAPH Asia Conference Papers, 2024. paper · published version
  16. T. Yin, M. Gharbi, R. Zhang, E. Shechtman, F. Durand, W. T. Freeman, T. Park, “One-step Diffusion with Distribution Matching Distillation,” CVPR, 2024. paper
  17. T. H. Nguyen, A. Tran, “SwiftBrush: One-Step Text-to-Image Diffusion Model with Variational Score Distillation,” CVPR, 2024. paper
  18. M. Zhou, H. Zheng, Z. Wang, M. Yin, H. Huang, “Score identity Distillation: Exponentially Fast Distillation of Pretrained Diffusion Models for One-Step Generation,” ICML, 2024. paper
  19. T. Yin, M. Gharbi, T. Park, R. Zhang, E. Shechtman, F. Durand, W. T. Freeman, “Improved Distribution Matching Distillation for Fast Image Synthesis,” NeurIPS, 2024. paper
  20. K. Frans, D. Hafner, S. Levine, P. Abbeel, “One Step Diffusion via Shortcut Models,” ICLR, 2025. paper
  21. Z. Geng, M. Deng, X. Bai, J. Z. Kolter, K. He, “Mean Flows for One-step Generative Modeling,” NeurIPS, 2025. paper
  22. M. Heusel, H. Ramsauer, T. Unterthiner, B. Nessler, S. Hochreiter, “GANs Trained by a Two Time-Scale Update Rule Converge to a Local Nash Equilibrium,” NeurIPS, 2017. source
  23. A. Radford, J. W. Kim, C. Hallacy, et al., “Learning Transferable Visual Models From Natural Language Supervision,” ICML, 2021. paper
  24. D. Ghosh, H. Hajishirzi, L. Schmidt, “GenEval: An Object-Focused Framework for Evaluating Text-to-Image Alignment,” NeurIPS Datasets and Benchmarks, 2023. paper
  25. A. Krizhevsky, V. Nair and G. Hinton, “CIFAR-10 and CIFAR-100 datasets,” official dataset page; companion technical report: A. Krizhevsky, “Learning Multiple Layers of Features from Tiny Images,” 2009. dataset and report
  26. J. Deng, W. Dong, R. Socher, L. Li, Kai Li, Li Fei-Fei, “ImageNet: A large-scale hierarchical image database,” CVPR, 2009. doi
  27. T. Lin, M. Maire, S. Belongie, et al., “Microsoft COCO: Common Objects in Context,” ECCV, 2014. paper
  28. L. Yang, Z. Zhang, Y. Song, et al., “Diffusion Models: A Comprehensive Survey of Methods and Applications,” ACM Computing Surveys, 2023. paper
  29. Z. Yu, J. Yuan, H. Yang, et al., “DMAD: Distribution Matching as Adversarial Distillation for Fast Visual Generation,” arXiv preprint, 2026. paper
  30. R. Zhang, P. Isola, A. A. Efros, E. Shechtman and O. Wang, “The Unreasonable Effectiveness of Deep Features as a Perceptual Metric,” in Proc. IEEE/CVF CVPR, 2018, pp. 586–595. doi · arXiv
  31. C. Schuhmann, R. Beaumont, R. Vencu, et al., “LAION-5B: An open large-scale dataset for training next generation image-text models,” NeurIPS Datasets and Benchmarks, 2022. paper