Flow-OPD  by CostaliyA

On-policy distillation for flow matching models

Created 2 months ago
258 stars

Top 98.0% on SourcePulse

GitHubView on GitHub
Project Summary

Summary

Flow-OPD integrates On-Policy Distillation into Flow Matching models, replacing sparse rewards with dense, multi-teacher vector field supervision. This approach targets researchers and practitioners working with generative models, offering significant performance gains on tasks like OCR and DeQA by leveraging diverse expert knowledge.

How It Works

The method employs a two-stage process: Cold Start Initialization (via SFT or model merging) followed by Multi-Teacher On-Policy Distillation. This distillation uses dense vector field supervision derived from multiple expert models (e.g., GenEval, OCR, DeQA, PickScore), enabling more nuanced learning. Key innovations include On-Policy Sampling via SDE for diverse trajectory generation and Manifold Anchor Regularization (MAR) to prevent aesthetic degradation.

Quick Start & Requirements

Installation involves cloning the repository, creating a Python 3.10.16 Conda environment, and running pip install -e .. Prerequisites include specific pre-downloaded models (e.g., stabilityai/stable-diffusion-3.5-medium, various teacher models) and potentially complex, isolated environment setups for reward models like PaddleOCR, sglang, and vllm to manage dependencies. Official resources include a Project WebPage, arXiv Paper, GitHub Repo, and HuggingFace Model.

Highlighted Details

  • Achieves a +18pt average improvement over vanilla GRPO on SD-3.5-Medium.
  • Outperforms individual teacher models on OCR and DeQA tasks.
  • Demonstrates strong performance metrics: 0.92 GenEval score, 0.94 OCR accuracy, and 23.08 PickScore.
  • Utilizes dense, trajectory-level, multi-teacher vector field supervision for enhanced learning.

Maintenance & Community

The project is actively being open-sourced, optimized, and refactored. Direct contact is encouraged for questions. No specific community channels (e.g., Discord, Slack) or detailed contributor information are provided in the README.

Licensing & Compatibility

The README does not specify a software license. Consequently, compatibility for commercial use or integration into closed-source projects remains undetermined.

Limitations & Caveats

The project is described as gradually being open-sourced, optimized, and refactored, suggesting ongoing development. Setting up and managing dependencies for various reward models requires careful, isolated environment configuration to avoid conflicts.

Health Check
Last Commit

2 weeks ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
1
Star History
25 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.