TangoFlux: Super Fast and Faithful Text to Audio Generation with Flow Matching and Clap-Ranked Preference Optimization

Chia-Yu Hung, Navonil Majumder, Zhifeng Kong, Ambuj Mehrish, Rafael Valle, Bryan Catanzaro, Soujanya Poria · DOI

TL;DR

TangoFlux is a new text-to-audio model that generates high-quality, prompt-aligned audio much faster than existing methods. It achieves this through a novel alignment technique called CLAP-Ranked Preference Optimization (CRPO), which dynamically creates and refines training data, leading to state-of-the-art performance with fewer parameters and significantly reduced inference times.

What Problem Does This Paper Address?

Generating high-quality audio from text (Text-to-Audio or TTA) is a rapidly advancing field, but existing models often struggle with accurately capturing all the nuances of complex prompts, sometimes leading to audio that omits events or includes unintended elements (hallucinations). A major hurdle in improving these models is the difficulty of "aligning" them with human preferences, similar to how Large Language Models (LLMs) are aligned. Unlike LLMs, TTA lacks readily available "gold standard" answers or structured reward mechanisms to guide this alignment process. Creating preference pairs (e.g., "audio A is better than audio B for this prompt") is labor-intensive and challenging to scale.

Methods

TangoFlux employs a hybrid Diffusion Transformer (DiT) and Multimodal Diffusion Transformer (MMDiT) architecture, making it efficient with 515M parameters. Instead of traditional diffusion, it uses a rectified flow matching framework. This approach is known for its robustness to noise scheduler choices and its ability to generate audio with fewer sampling steps.

The core innovation is CLAP-Ranked Preference Optimization (CRPO). This framework addresses the challenge of creating preference data for TTA:

  1. CLAP as a Reward Model: The paper leverages the CLAP (Contrastive Language-Audio Pretraining) model as a proxy reward model. CLAP can effectively measure the similarity between text prompts and generated audio, providing a way to rank audio outputs.
  2. Iterative Data Generation and Optimization: CRPO works in iterative cycles. In each cycle, the current model generates multiple audio samples for a set of prompts. CLAP is used to rank these samples, creating "winner" and "loser" pairs. This preference data is then used to fine-tune the model using Direct Preference Optimization (DPO), adapted for rectified flows.
  3. Online Learning: Crucially, CRPO generates new preference data at each iteration, allowing the model to continuously self-improve and adapt. This "online" approach is contrasted with "offline" methods that use static datasets, which the paper shows can lead to performance degradation.
  4. LCRPO (Loss-CRPO): To further stabilize training and prevent over-optimization, the authors introduce LCRPO, which combines the DPO loss with the original flow matching loss. This regularization helps maintain the audio's structural and semantic fidelity.

Datasets

  • Training: The model is trained on publicly available datasets: WavCaps (approximately 400k audios) and AudioCaps (45k audios).
  • Evaluation:
    • AudioCaps Test Set: Used for objective metrics.
  • Multi-event Prompts: A subset of AudioCaps prompts designed to test the model's ability to handle complex instructions with multiple distinct events.
  • Out-of-Distribution Dataset: 50 challenging, GPT-4 generated prompts describing 3-6 events, designed to test robustness and instruction following.
  • CRPO Dataset: A preference dataset generated during the CRPO training process, which the paper shows outperforms static datasets like BATON and Audio-Alpaca.

Key Insights and Ideas

  • CLAP is a Viable Proxy Reward for TTA: The paper demonstrates that CLAP, a pre-trained text-audio model, can effectively serve as a reward signal for aligning TTA models, overcoming a significant gap in the field.
  • Online Preference Data Generation is Crucial: Continuously generating and using new preference data in each training iteration (CRPO) is significantly more effective than using static datasets. Offline training leads to performance saturation and degradation.
  • Rectified Flows Offer Efficiency: Using rectified flows instead of traditional diffusion models allows for faster generation with fewer sampling steps, leading to substantial inference time savings without sacrificing quality.
  • CRPO Outperforms Static Datasets: The dynamically generated preference data from CRPO leads to better objective and subjective performance compared to using fixed datasets like BATON or Audio-Alpaca.
  • LCRPO Prevents Over-optimization: Combining DPO with the original flow matching loss (LCRPO) provides a more stable and robust optimization process, preventing performance degradation often seen with pure DPO.

Key Results

  • Speed: TangoFlux generates 30 seconds of 44.1kHz audio in just 3.7 seconds on an A40 GPU, significantly faster than other models (e.g., Stable Audio Open takes 8.6s for 47s, AudioLDM 2 takes 24.8s for 10s).
  • Quality: TangoFlux achieves state-of-the-art performance on objective metrics like CLAP score and Fréchet Distance (FDopenl3) on the AudioCaps benchmark. It also shows superior performance on multi-event prompts, indicating better understanding of complex instructions.
  • Efficiency: With 515M parameters, TangoFlux is smaller than many comparable models (e.g., AudioLDM 2-large at 712M, Stable Audio Open at 1056M) while achieving better or comparable results.
  • Human Evaluation: TangoFlux received the highest scores in human evaluations for both overall audio quality (OVL) and relevance to the text prompt (REL), outperforming other leading models.
  • Robustness: The model shows less performance degradation when using fewer inference steps compared to other models.

Limitations and Future Work

  • KL Divergence: While TangoFlux excels in most metrics, the paper notes that Tango 2 marginally surpasses it in KLpasst.
  • Over-optimization: The paper discusses the phenomenon of "reward over-optimization" in DPO, where increasing the margin between winning and losing losses can lead to performance degradation. LCRPO is proposed as a solution, but the underlying dynamics are still an area of research.
  • Future Work: The authors plan to release their code and model weights to facilitate further research in TTA generation. The success of CRPO suggests potential for applying similar iterative alignment strategies to other generative domains.

Summary updated

BibTeX
@misc{hung2024tangoflux,
  author = {Chia-Yu Hung and Navonil Majumder and Zhifeng Kong and Ambuj Mehrish and Rafael Valle and Bryan Catanzaro and Soujanya Poria},
  title = {{TangoFlux: Super Fast and Faithful Text to Audio Generation with Flow Matching and Clap-Ranked Preference Optimization}},
  year = {2024},
  eprint = {2412.21037},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2412.21037},
}
Figure