---
title: Conditional Mean Faithful Generation (cMFG)
url: https://www.emergentmind.com/topics/conditional-mean-faithful-generation-cmfg
type: topic
---

# Conditional Mean Faithful Generation (cMFG)

Conditional Mean Faithful Generation (cMFG) is a synthesis paradigm introduced to address the inefficiencies of traditional stochastic denoising strategies in conditional generative models. Originally proposed within the MeanAudio framework for text-to-audio generation, cMFG integrates mean-flow regression, conditional flow matching, and classifier-free guidance directly into the model objective and architecture. This results in a single-step or efficient multi-step generator that offers high semantic faithfulness to conditional input while providing significant gains in inference speed compared to diffusion-based or standard flow-matching approaches [2508.06098].

## 1. Theoretical Foundations and Formal Objectives

Conditional Mean Faithful Generation extends deterministic Flow Matching (FM) by generalizing the target from the instantaneous velocity field to the mean velocity over arbitrarily sized time intervals. Let $x \sim p_{\rm data}$ denote latent representations and $\epsilon \sim \mathcal{N}(0, I)$ denote noise. The linear path between data and noise is parametrized as
\[
x_t = (1-t)x + t\epsilon, \quad t \in [0,1]
\]
with instantaneous velocity
\[
v_t(x_t) = \epsilon - x.
\]
Traditional Conditional Flow Matching trains a model $f_\theta(x_t, t)$ to minimize
\[
\mathcal{L}_{\rm CFM} = \mathbb{E}_{t,x,\epsilon}\left\|f_\theta(x_t,t) - v_t(x_t)\right\|^2.
\]

Mean Flow–guided training instead regresses the average velocity field over intervals:
\[
u(x_t, r, t) \triangleq \frac{1}{t - r} \int_r^t v_\tau(x_\tau) d\tau,
\]
and the loss is
\[
\mathcal{L}_{\rm MF} = \mathbb{E}_{t,r,x,\epsilon} \left\| f_\theta(x_t,r,t) - \mathrm{sg}(u_{\rm tgt}(x_t,r,t)) \right\|^2,
\]
where $\mathrm{sg}$ denotes stop-gradient and $u_{\rm tgt}$ backpropagate through
\[
u_{\rm tgt}(x_t,r,t) = v_t(x_t) - (t - r)\,\frac{d}{dt}f_\theta(x_t,r,t).
\]
When $r = t$, this reduces to the original FM loss, ensuring compatibility and stable interpolation between learning regimes.

## 2. Architecture: Flux-Style Latent Transformer

MeanAudio’s implementation of cMFG leverages a flux-style Transformer operating in the VAE latent space. The model $f_\theta$ consists of:

- $N_1=4$ Multi-modal MMDiT blocks for joint audio/text attention.
- $N_2=8$ Audio-only DiT blocks, each with hidden dimension 448, totaling 120M parameters.
- Audio tokens (mel-spectrogram latents) are handled via ConvMLP (1D convolutions, kernel size 3) for local temporal feature extraction.
- Text features are provided by FLAN-T5 token embeddings and injected through cross-attention in MMDiT, supported by CLAP vectors projected into the time embedding space.
- Adaptive LayerNorm (AdaLN) and rotary positional embeddings (RoPE) are employed, with RMSNorm for stabilizing attention.

This architecture allows efficient, semantically aligned fusion of audio and text modalities, critical for conditional mean flow learning.

## 3. Integrated Classifier-Free Guidance (CFG)

Conventional CFG doubles runtime during inference by requiring both conditional and unconditional model evaluations. In cMFG, CFG is incorporated into the training target, eliminating inference overhead. The guided instantaneous velocity is given by:
\[
v_t^{\rm cfg} = \omega v_t(x_t) + \kappa f_\theta(x_t, t, t \mid C) + (1-\omega-\kappa) f_\theta(x_t, t, t \mid \varnothing),
\]
with $C$ as the conditioning text, $\varnothing$ indicating conditioning dropout (10% rate), and weights $\omega = 0.3$, $\kappa = 0.9$. The effective CFG scale is $\frac{\omega}{1-\kappa}$. The mean-flow regression target is updated to
\[
u_{\rm tgt}^{\rm cfg}(x_t, r, t) = v_t^{\rm cfg} - (t - r) \frac{d}{dt} f_\theta(x_t, r, t).
\]
The training loss regresses $f_\theta(x_t, r, t)$ directly to this integrated CFG target, so only a single network evaluation is necessary for guided sampling.

## 4. Training Regime: Instantaneous-to-Mean Curriculum with Flow Mix-Up

Direct training with mean velocity targets is unstable, necessitating a staged curriculum:

- **Pre-training (Stage I):** On large weakly labeled data (WavCaps ∪ AudioCaps ∪ Clotho), with $r = t$, minimizing $\mathcal{L}_{\rm CFM}$. This encourages accurate learning of local, instantaneous velocity.
- **Fine-tuning (Stage II):** On high-quality data (AudioCaps), $(t, r)$ are sampled from a log-normal prior. With probability $\alpha=0.75$, $r = t$; otherwise, $r < t$. The objective becomes
    \[
    \mathcal{L}_{\rm mix} = \alpha\, \mathbb{E}_{t,x,\epsilon} \left\| f_\theta(x_t, t, t) - v_t^{\rm cfg} \right\|^2 + (1-\alpha)\, \mathbb{E}_{t, r < x, \epsilon} \left\| f_\theta(x_t, r, t) - u_{\rm tgt}^{\rm cfg} \right\|^2.
    \]
The flow "mix-up" ensures fine-grained denoising skill is preserved while enabling modeling of long-step, global mean displacements.

## 5. Sampling Procedure and Generation Dynamics

cMFG’s generative sampling exploits the learned mean velocity for direct trajectory integration from the noise prior. For general $N$-step integration:
```
x ← ε ∼ N(0,I)                 # draw prior at t=1
for i=N−1 downto 0 do
  Δt ← t_{i+1} − t_i
  x ← x − Δt ⋅ f_θ(x, t_i, t_{i+1}, condition)
end
return x
```
The one-step ($N=1$) variant becomes:
\[
x_0 = x_1 - f_\theta(x_1, 0, 1), \quad x_1 = \epsilon,
\]
yielding a direct map from a Gaussian to the data manifold, guided by the conditional input.

## 6. Performance: Faithfulness and Speed

In empirical evaluations, cMFG via MeanAudio achieves strong trade-offs between speed and fidelity. On the AudioCaps test set, single-step generation yields:

| Metric | Value | Change vs Prior |
|--------|-------|----------------|
| FAD    | 1.77  | −23%           |
| FD     | 15.4  | −22%           |
| KL     | 1.31  | −8%            |
| IS     | 9.78  | +7%            |
| CLAP   | 0.292 | +9%            |

Single-step real time factor is $0.013$ (RTX 3090), a $100\times$ improvement over diffusion-based TTA systems ($\sim$2.5). Multi-step generation further improves fidelity, suggesting robustness of the mean flow modeling [2508.06098].

cMFG's text alignment is enhanced by embedding classical classifier-free guidance into the regression target, and two-stage curriculum learning ensures both global and local structure are maintained throughout training and generation.

## 7. Significance and Outlook

Conditional Mean Faithful Generation unifies conditional flow matching, mean-velocity regression, integrated classifier-free guidance, and multi-phase curriculum strategies into a coherent framework for rapid, conditional generative modeling. By eliminating redundant inference passes and harnessing mean velocity fields, cMFG achieves both inferential efficiency and semantic faithfulness. The demonstrated real time acceleration and consistent performance gains in text-to-audio suggest applicability in real-time synthesis tasks and inspire potential adaptations in other conditional sequence generation domains [2508.06098].

Source: https://www.emergentmind.com/topics/conditional-mean-faithful-generation-cmfg