Files
myWiki/concepts/rectified-flows.md

53 lines
1.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: "Rectified Flows"
created: 2026-05-13
updated: 2026-05-13
type: concept
tags: [flow-matching, generative-modeling, ODE]
sources:
- https://arxiv.org/abs/2209.03003
---
# Rectified Flows
Rectified Flows 是 [[flow-matching|Flow Matching]] 框架中的一种**直线插值路径**,定义从噪声到数据的线性变换。
## 定义
```
z_t = t·x + (1-t)·ε
```
其中:
- x ~ p_data干净数据
- ε ~ p_noise通常 N(0,I)):噪声
- t ∈ [0,1]:时间参数
速度场为常数:`v = dz/dt = x - ε`
## 特性
1. **直线轨迹**:在概率空间中寻找近乎直线的 transport map
2. **常数速度**(在 x,ε 确定时):使得 ODE 求解特别简单
3. **可整流rectifiable**:通过反复"整流"reflow可以进一步拉直轨迹减少采样步数
## 与其他插值路径对比
| 路径 | 公式 | 特点 |
|------|------|------|
| Rectified Flow | t·x + (1-t)·ε | 直线、速度恒定 |
| VP-SDE (DDPM) | α_t·x + σ_t·ε | 曲线、方差保持 |
| VE-SDE | x + σ_t·ε | 曲线、方差爆炸 |
## 在 ELF 中的应用
[[embedded-language-flows|ELF]] 使用 Rectified Flows 作为默认插值路径。直线轨迹使得:
- ODE 求解步数可以较少32 步即可)
- 与 x-prediction 的参数化配合简洁
- 训练稳定特别是在高维嵌入空间512-768d per token
## 参考
- Liu et al., "Flow Straight and Fast: Learning to Generate and Transfer Data with Rectified Flow", ICLR 2023
- Albergo et al., "Stochastic Interpolants", JMLR 2025