M6-078M6: Multimodal & Generative ModelsFlow Matching & Rectified FlowHard
⚡Flashcard Drill➔Mastery:
Classifier-Free Guidance Formulation and Implementation in Flow Matching
🎯 Active Recall Self-Check (Draft First, Verify After)
Login-free practice tracker: recall core answer, audit pitfalls, and log review status.
Step 1 · Draft your concise answer & assumptions
Step 2 · Check Pitfalls & Follow-up Inquiries
📐 Mathematical Definition
⚡ One-Sentence Core Answer
Classifier-Free Guidance in Flow Matching extrapolates between conditional and unconditional vector fields, steering probability transport velocity toward prompt conditions without modifying straight ODE integration.
📌 Key Takeaways
- •Velocity extrapolation formula: calculates guided velocity field as , amplifying prompt adherence
- •Integration compatibility: guided velocity integrates directly into standard numerical ODE solvers (Euler, Midpoint) without altering integration mechanics
- •Guidance scale dynamics: Flow Matching operates effectively at lower guidance scales () than traditional diffusion () due to superior condition alignment
📐 Mathematical Derivations
Mathematical Mechanism: 1. Flow Matching Guidance Extrapolation: Let be the velocity predicted conditioned on prompt , and be the unconditional velocity (conditioned on null prompt ). The guided vector field with guidance scale is: When , the update reduces to standard conditional transport. When , the difference vector amplifies velocity components that point toward conditional density modes while canceling out generic unconditional background drift. 2. Guided Probability Flow ODE Integration: The guided trajectory evolves according to the modified initial value problem: Under a 1st-order Euler discretization step from to with step size : 3. Dual-Stream Batched Execution: Conditional and unconditional inputs are processed in a unified batch through the Flow Matching Transformer: Forward pass outputs . The guided vector is passed directly to the ODE integrator.
🏭 Production Trade-offs
Deep Dive & Engineering Trade-offs: ① Lower Guidance Scale Requirements in Flow Matching: Traditional diffusion models (SD 1.5) required high guidance scales () because curved Brownian paths easily drifted away from prompt conditions. Modern Flow Matching foundation models (SD3, Flux.1) enforce straight transport paths and leverage massive text encoders (T5-XXL, CLIP-G). Consequently, they achieve crisp prompt alignment at much lower guidance scales (). Operating at lower scale prevents the harsh color saturation and high-frequency edge burning that plagued early diffusion models. ② Negative Prompting in Flow Matching: Substituting negative text prompt in place of the empty condition : . The vector difference pushes velocity directly away from the negative semantic direction. ③ Guidance Distillation in Flux.1-Schnell: Guidance distillation trains a student model on paired inputs to predict the guided velocity directly in a single forward pass, eliminating the unconditional branch entirely. This cuts serving latency by 50% while operating with 4-step Euler sampling. ⑤ Interview Strategy: Formulate the guided velocity equation , show how it integrates into the Euler ODE update, explain why Flow Matching models operate at lower guidance scales, and describe negative prompting and guidance distillation.
⚠️ Common Interview Pitfalls
- ✕Using legacy diffusion guidance scales () on Flow Matching models, causing severe over-saturation and visual blowouts
- ✕Assuming CFG changes the mathematical ODE solver in Flow Matching; CFG modifies only the evaluated vector field
- ✕Running conditional and unconditional passes as separate sequential operations instead of batched execution
🎯 Interviewer Follow-up Inquiries
- ?Why do modern Flow Matching architectures achieve superior prompt adherence at lower guidance scales () than traditional diffusion models ()?
- ?How does Guidance Distillation eliminate the unconditional forward pass in real-time Flow Matching models like Flux.1-Schnell?
⚡
Test muscle memory on this topic via 3-Layer Flashcards
Active Recall: Mentally formulate Prompt ➔ Math Derivation ➔ Benchmark Implementation in 3 minutes.
📚