WorksComputer Science
Euclidean Distance-Based Flow Matching
Abstract
Flow Matching has recently become popular as a technique for generative modeling with applications in many domains. In the standard Flow Matching formulation, we interpret the vector field as the solution of a least-squares regression problem, which is known to be sensitive to contamination. Therefore we leverage the viewpoint of robust statistics and replace the squared Euclidean distance with the Euclidean distance as a regression objective. This seemingly minor change strongly affects the properties of Flow Matching. We provide a probabilistic interpretation of the new regression target as a conditional geometric median and use this characterization to study distributional robustness of the Euclidean Distance-based Flow Matching. We analyze the mathematical properties of this changed objective and the effect of a contaminated target distribution on the involved conditional velocity distributions. We discuss the challenge of directly characterizing the distribution that our method induces. In specific contamination settings we show theoretically that our method yields an improvement for severe contamination. Finally, we present numerical experiments conducted on the CIFAR-10 image dataset where a proportion of the samples has been contaminated. Our Euclidean distance-based Flow Matching shows a clear advantage in scenarios of severe contamination of the target distribution.
Introduction
Flow Matching (FM) [12, 13, 2, 14] is a framework for training a flow model [3, 5] to generate samples from a target distribution that is available only through data. Starting from a known source distribution from which we can sample, FM learns a time-dependent vector field that drives the generation process. New samples are generated by drawing from the source distribution and applying the flow induced by this learned time-dependent vector field. It is well known that under suitable regularity assumptions, the (population) optimal vector field for the standard formulation generates the prescribed target distribution exactly.
Real-life datasets often do not only contain samples from the assumed true distribution, but they contain contaminated samples as well. A classical example is the Belgium telephone calls dataset [21] that includes several wrongly recorded data points. Therefore we model the observed distribution as a mixture model of the clean and a contaminating distribution, rather than only the target distribution. Consequently, robustness is the desirable property that the learned distribution stays close to the clean distribution, even in the presence of contamination without manually filtering the samples.
Flow Matching is a powerful technique to produce samples from the target, but suffers from replication of the exact target including the contamination. We present a remedy for this by a simple modification of the Flow Matching objective. Our approach replaces the squared Euclidean distance loss in the standard Flow Matching objective with the Euclidean distance loss. The latter penalizes large regression residuals linearly rather than quadratically, motivating its use to reduce sensitivity to contamination. At the population level, the modified field is a geometric median of the conditional velocity distribution, whereas the standard squared-loss field is its mean. We demonstrate that this change also improves distributional robustness, yielding a generated distribution closer to the clean target under contamination. Clearly the necessary trade-off that we accept is that we lose the general guarantee that the population-optimal field reproduces the prescribed target distribution, even when the data are uncontaminated.
To be more precise, we characterize the population-optimal Euclidean distance Flow Matching vector field as a conditional geometric median. On clean data, we derive bounds comparing this field with the standard squared-loss field. We then analyze how contamination affects the regression fields and prove that, in specific contamination settings, our adaptation yields an improvement in the Wasserstein distance. Finally, we evaluate both objectives on contaminated CIFAR-10 data, comparing their generation quality across different contamination models and proportions.
Related Work
Several works focus on improving Flow Matching by modifying the coupling between source and target samples, for instance Pooladian et al. [20] and Tong et al. [25]. Repeated rectification also straightens trajectories [14]. These approaches modify the coupling or transport path while retaining the standard squared regression objective. Song et al. [24] consider a related alternative objective in visuomotor learning. In their main method, they reformulate velocity prediction as terminal-sample prediction and train the resulting model using a componentwise absolute-deviation loss together with a two-step sampling procedure, although they also test their loss with conventional flow integration. They empirically demonstrate faster convergence on visuomotor-learning benchmarks. We use Euclidean-distance based loss, which is invariant under orthogonal changes of coordinates and yields a conditional geometric median rather than coordinatewise conditional medians. Moreover, our focus is distributional robustness.
Robustness was recently studied in the closely related setting of diffusion models and score matching. Khrapov et al. [9] replace the standard squared denoising objective with a scheduled pseudo-Huber loss with a time-varying threshold. They empirically demonstrate improved resistance to contaminated training data in both image and speech generation tasks. Similarly Li and Dong [11] study replacing the mean squared error denoising loss with transformations induced by f-divergences. Their framework includes bounded-influence choices that downweight samples with large residuals and empirically improve generation under contamination. In the distinct setting of parametric score matching, Schwank et al. [22] construct a robust estimator through geometric median of means aggregation and establish theoretical guarantees with particular attention to exponential-family models. Our approach differs in that the geometric median is not introduced as an external aggregation procedure but instead arises directly as the population-optimal regression target of our modified objective.
Technical Background
Let us briefly recall technical foundations of Flow Matching. Denote the source distribution as and the target distribution as . Throughout we assume the source to be Gaussian . We follow the interpolation path which is the linear path interpolating independent random vectors (Peyré, 2026):
Throughout we assume that all endpoint distributions have finite second moments. The goal is to find a time dependent vector field , such that the pair satisfies the continuity equation (technically understood in the weak sense)
The flow induced by is defined as the solution to the following ordinary differential equation (ODE)
If is sufficiently regular it follows from Villani [27] that its induced flow generates the previously defined probability path in the sense that . In particular, it follows that . Consequently such a vector field enables generating samples from the target distribution, by sampling from the source and integrating the ODE which is done numerically. In standard Flow Matching the population objective is
Throughout the paper, we denote by a measurable population minimizer of (1). By the optimal regression property under a squared objective, we obtain that population-level minimizer can be written as a conditional expectation ([1] (Peyré 2026)):
Then and solve the continuity equation in the weak sense. In practice we work with (1) which is tractable via empirical risk minimization. Using a simple source distribution we can generate samples from and the target distribution is available through data samples.
Euclidean distance regression objective
We aim to study the effects of replacing the squared Euclidean norm in the regression problem with the norm . We investigate whether the reduced sensitivity of this regression target to contamination can yield a terminal distribution closer to the clean target when the observed target distribution is contaminated. Lipman et al. [13] show that the optimal vector field after replacing the loss in (1) by a Bregman divergence, applied with the target velocity as the first argument and the prediction as the second, preserves the probability path. Our proposed loss is not covered by this and we have no guarantee that our method generates the probability path . In particular, we cannot guarantee that the learned target coincides with the observed target. We highlight that this is an important property of our method, since we do not want to replicate contaminated distributions.
Removing the square in (1) our regression objective becomes
We denote by a measurable population minimizer of (3). The integral can be seen as a mixed norm and consequently we will also call the method Flow Matching.
Discussion of mathematical details
All of our proofs can be found in the supplementary material A. Since conditional distributions are unique only -almost everywhere, characterizations of vector fields as quantities of conditional distributions, as in (2), only hold for Lebesgue-almost every and -almost every . The same holds for all pointwise identities and inequalities involving these vector fields. When the conditional geometric median, which is introduced below, is not unique, denotes a chosen measurable population minimizer. Note that even when the conditional-mean field admits a continuous representative, the same does not need to hold for the geometric-median field. Although the almost-everywhere characterizations are sufficient for the population regression problems, they do not by themselves identify regular representatives whose associated ODEs are well posed. The existence and uniqueness of induced flows are separate questions that require choosing suitable representatives and imposing additional regularity assumptions. Whenever we analyze an induced distribution, we therefore either construct a particular measurable representative explicitly or state the required existence and regularity assumptions. We make no general claims concerning ODE well-posedness for the population minimizer.
Geometric Median Characterization
In this section we first introduce the geometric median and use it to characterize the population minimizer for the -Flow Matching objective. The geometric median properties used in this section are classical and we include their proofs for convenience. We then apply these properties of the geometric median to help us to compare the resulting vector field with the standard Flow Matching vector field. In one dimension, the median is a measure of location that is more robust to contamination than the mean. The generalization to higher dimensions is not straightforward and multiple generalizations have been suggested [23]. One possible way to do so is the geometric median [6, 17]. For a probability measure on with finite first moment define its geometric median as
Its existence is established in Minsker [17]. If the distribution is not concentrated on an affine line, this object is unique [16]. We will give a probabilistic interpretation of the solution of (3), similar to the mean characterization of squared Flow Matching. For a random variable we write
and similarly for a conditional distribution, we write
Comparison with standard Flow Matching
Now we want to connect the geometric median to our proposed Flow Matching method and analyze the difference in the resulting vector fields.
Lemma 3.1. It holds that
for almost every and -almost every . Moreover, if this conditional distribution is not concentrated on an affine line for almost every and -almost every , then the minimizer is unique up to almost everywhere equality.
While this result yields a probabilistic interpretation of the -regression objective, we are unable to give a characterization of the general induced probability path. The proof for standard Flow Matching relies on the tower property of conditional expectations, which to our knowledge does not have a counterpart for the geometric median. Consequently, the standard Flow Matching argument does not show that the -population field generates the prescribed interpolation, and our analysis does not provide a general explicit description.
In the following we analyze the difference between the two vector fields for special scenarios. We first derive that for symmetric distributions, the two vector fields coincide.
Lemma 3.2. Assume that, for almost every and -almost every , the conditional distribution of given is not concentrated on an affine line and is centrally symmetric around its mean, i.e., for any random variable having this distribution, say , we have that matches, in distribution, . Then we have that
for almost every and -almost every .
Generally, the target distribution being symmetric around its mean does not imply that the same holds for the conditional velocity distribution of given , even though the Gaussian source is symmetric. As a sufficient condition, if the target distribution is Gaussian, then we can show that the conditional velocity distributions are also Gaussian and thus we obtain the following:
Corollary 3.3. If the source distribution is a standard Gaussian distribution and the target distribution is nondegenerate Gaussian where and are independent, then
for almost every and -almost every .
The setting of Corollary 3.3 seems to be quite special however, it is known to be a good proxy in high-dimensional statistics. More generally, the integrated squared difference between the two vector fields is bounded by the optimal squared Flow Matching regression loss.
Theorem 3.4. In our Flow Matching setup we have that:
where the right-hand side is the optimal squared FM regression loss.
Intuitively this shows that the better the velocity can be predicted from interpolation points, the closer the two fields are to each other. This derived velocity field bound is generally not sharp. For instance, for Gaussian targets we have established that both target vector fields are equal, while our bounds do not reflect this. Under additional regularity assumptions, for instance if admits a globally Lipschitz representative the above vector field bound could be translated into a Wasserstein bound between the induced distributions. We do not pursue such flow level estimates here.
Robustness analysis
In this section, we study how contamination of the target distribution affects the population vector fields of both the squared and the method. The robustness of the geometric median has been assessed in various works [23]. It also appears in more recent works, as an aggregate estimator [17, 18]. However, in our Flow Matching setting the geometric median is only applied on a conditional distribution at every time and space position to yield a vector field, whose integration in turn yields the generative model. Therefore the robustness properties are highly non-trivial. We separate our analysis into two levels. First, we study how target contamination affects the conditional velocity distributions and the corresponding population vector fields. Second, we investigate whether this robustness can translate into a generated distribution that is closer to the clean target.
We consider a Huber contamination model [8], i.e. we assume that the true target distribution is and a proportion of observations are instead replaced with a contaminating distribution :
A crucial property is given by the geometric median’s so-called high finite-sample breakdown point. That is the smallest proportion of observations that must be replaced by arbitrary values to make an estimator arbitrarily large or otherwise uninformative. Its finite-sample replacement breakdown point is [15]. This means that if a proportion smaller than of the observations is replaced, then the displacement of the geometric median is bounded, regardless of the strength of the contamination. In contrast, replacing even a single observation by a point arbitrarily far from the rest of the data can cause an arbitrarily large displacement of the sample mean. This property motivates our use of the geometric median as a velocity estimator, as it remains stable under a substantial proportion of arbitrarily corrupted observations. However, this property does not mean that the geometric median yields better results in all contamination settings. In particular, the mean of a contaminated distribution may be closer to the clean mean than the geometric median.
Robustness properties of the geometric median field
We first study how contamination of the target distribution changes the conditional velocity distributions and the corresponding standard and -vector fields. Since population minimizers are defined only up to almost-everywhere equivalence, we fix measurable representatives , for the clean target and , for the contaminated target. Let
be mutually independent. Let
and
For , let be a measurable version of the posterior contamination probability
Intuitively, this quantifies the likelihood that after we have sampled and the corresponding interpolation point, the sampled endpoint was caused by the contaminating distribution. Using the law of total probability we obtain
This is again a mixture distribution, but its weight is the posterior probability rather than . Moreover, depends on the geometry and magnitude of the contamination. Consequently, moving the contamination farther from the clean data does not uniformly improve the relative robustness of the geometric median. When , the clean conditional component no longer has a strict majority, so the robustness guarantee below does not apply. Using the linearity of the mean, we can characterize the influence of contamination on the squared vector field
We notice that in the norm, only the clean conditional mean is independent of the contamination, whereas both and the contaminated conditional mean depend on the contamination. The difference between the conditional means may become arbitrarily large as the contamination is moved farther from the clean data. To fully understand this, one would need to control the posterior contamination probability . On the other hand, for we have the following bound, adapted from a general result for the geometric median by Minsker [17].
Lemma 4.1. For almost every and -almost every satisfying , there exists , depending only on the clean model and not on the contamination, such that
For the factor is positive and finite, although it diverges as . Generally, those bounds do not directly compare to each other. The squared vector field identity depends on the outlier magnitude and the posterior contamination probability. The -vector field bound depends on a constant that is independent of the contamination and the posterior contamination probability. This suggests that the -vector field can be less distorted by remote contamination whenever , but it does not imply that it is uniformly closer to the clean field.
Since solves the continuity equation with the clean probability path, we are interested in how much the contaminated -vector field deviates from it. Using the triangle inequality gives
This decomposition separates the discrepancy of the mean and the median from the additional distortion caused by contamination. In § 3.1 we discussed bounds for the first term, while in this section we have established under which conditions we can control the second term. Since this is usually not enough to provide distributional guarantees, we will now present two special settings where we can control the distributional error.
Wasserstein bounds for special cases
To quantify the discrepancy between generated and clean distributions, we use the 1-Wasserstein distance. For probability measures and on with finite first moments, it is defined as
where denotes the set of couplings of and . Throughout this subsection, since we use linear interpolation with Gaussian source, for an endpoint distribution we fix the posterior
where the right-hand side is normalized to unit mass. This choice allows us to impose the geometric median condition for every . Then given a Borel measurable satisfying for every the corresponding pointwise velocity field is
Throughout this subsection, solutions of the associated ODE are understood in the sense that their paths are locally absolutely continuous and satisfy the ODE almost everywhere on . We first consider a point-mass clean target with point-mass contamination and show that our proposed method yields a smaller Wasserstein distance to the clean target in this setting.
Theorem 4.2. Let be a Dirac distribution in centered at . Let . For , consider the contaminated distribution
For every pointwise -velocity field coming from a Borel geometric-median selection as defined in (5), the associated ODE admits a solution process with . Every such solution converges almost surely as and its terminal law satisfies
For a point-mass clean target, the preceding theorem establishes improvement for every nonzero displacement of the contaminating point. We now present our main theoretical result, which establishes a corresponding improvement for bounded clean target distributions when the contaminating point is sufficiently far away.
Theorem 4.3. Let be a distribution supported in the closed ball . Let , and fix a unit vector . For , set and
For each , let be any pointwise -velocity field associated with as defined in (5). Assume that its associated ODE admits a solution process with initial distribution . Let be any such solution process, and write . Then, for all sufficiently large ,
Standard FM aims to reproduce the observed target distribution, which in our setting includes contamination. Our theorems establish that the robustness of the geometric median can translate into a smaller distributional error, in comparison to the contaminated target. For a point-mass target, improvement holds for every nonzero contaminating point. Our main result establishes improvement for bounded target distributions if the contaminating point is sufficiently far away. In this more general setting, the limit superior means that the improvement holds for all times sufficiently close to the final time. This formulation does not require convergence to the final distribution.
Experiments
We compare classical Flow Matching with our proposed formulation under clean and contaminated distributions. Specifically, we investigate how our -Flow Matching retains the performance of classical Flow Matching on clean data, whether it is more robust under contamination, and whether it depends on the proportion and type of contamination. The clean-target dataset we use is CIFAR-10 [10] and we consider several contamination mechanisms. We evaluate generation quality using the Fréchet Inception distance (FID) [7].
Li and Dong [11] perform similar studies on CIFAR-10 as we do and we adopt several contamination mechanisms used in their experiments. They use a different framework and report that they deliberately use a small model and limited training budget. We use a well-performing Flow Matching configuration instead and first verify that both regression objectives attain FID values comparable to the established result on clean CIFAR-10. This shows that the objective achieves generation quality comparable to standard Flow Matching on clean data and allows us to study its robustness in a competitive Flow Matching setting. Because the modeling frameworks, training budgets, and evaluation procedures differ, the absolute FID values across the two studies are not directly comparable. A limitation of our results is that the theoretical results concern optimal vector fields at the population level. They do not account for estimation from finite data, approximation by neural networks, or optimization error. The extent to which the theoretical robustness properties carry over to trained models therefore remains unresolved. To perform the experiments, we use the U-Net architecture from Tong et al. [25]1. The difference between our method and classic flow matching is the norm training objective: squared Euclidean vs. . All remaining components of training and sampling are held fixed across experiments. Tong et al. [25] report a FID of 3.659 for independent FM on CIFAR-10. We use a standard Gaussian source distribution, linear interpolation and independent couplings. We use the same interpolation, optimizer, batch size and training budget. Specifically, models are trained for 400 000 gradient steps with Adam and a learning rate of , batch size of 128, 5000 warm-up steps, gradient clipping at 1.0, and an EMA decay of 0.9999. We report the mean and standard deviation over three seeds. We fix the seeds 1, 2, 3. Both methods use the same initialization seeds, and contamination is applied to the same images. FID is evaluated against the clean CIFAR-10 training set using 50 000 samples generated from the exponential moving average (EMA) model using the adaptive Dormand-Prince (DOPRI5) Dormand and Prince, [4] solver with tolerance .
Contamination mechanisms
As discussed in § 4 we use the contamination model
where denotes the CIFAR-10 distribution. We consider contamination proportions and one clean reference setting where . The contamination models we are testing are described in Table 1 and an example visualization is included in the supplementary material in Figure 1. Theorem 4.3 suggests that our Flow Matching method should be particularly advantageous when the contaminating distribution is well separated from the clean target. Motivated by this observation, we consider contamination mechanisms with different degrees of severity and structure. These range from replacement by noise through global and localized pixel perturbations, to blur transformations. The contaminating distribution may either be a completely independent replacement distribution or induced by applying corruption to clean images. Several of our contamination models are taken from Li and Dong [11]. Note that they combine the contamination models into one mixture contamination distribution, while we evaluate them separately.
| Contamination | Description | Parameters |
| Random noise | Replace the entire image by independent uniform noise | |
| Gaussian noise | Add independent Gaussian noise and clip to | |
| Salt and pepper | Replace selected pixels by either or | |
| Patch noise | Replace a uniformly located square patch by uniform noise | patch |
| Inversion | Invert all normalized pixel values, | – |
| Gaussian blur | Convolve the image with an isotropic Gaussian kernel | , |
| Motion blur | Convolve the image with a horizontal motion-blur kernel | kernel size 7 |
Table 1. Contamination mechanisms used in the experiments. Images represented in .

Figure 1. Representative examples of the seven contamination mechanisms considered in our experiments. Except for random-noise replacement, all examples are obtained from the same clean CIFAR-10 image using the parameters reported in Table 1.
Results
The results for the clean experiments are presented in Table 2. Both the standard and our method achieve similarly low FID values, while our method yields a lower mean FID. This is close to the 3.659 baseline reported by Tong et al. [25].
| Objective | FID |
| Squared | |
| Unsquared |
Table 2. FID on clean CIFAR-10 (lower is better). Entries report the mean standard deviation over three seeds. The lower mean is shown in bold.
Table 3 reports the FID for the contaminated experiments with . Our method performs better, across all proportions of contamination, for Random noise, Gaussian noise, Salt and Pepper, Patch noise and Inversion. The standard method performs better, again across all proportions of contamination, for the Gaussian blur and Motion blur.
| Contamination | Objective | |||
| Random noise | Squared | 9.69 ± 0.20 | 19.16 ± 0.33 | 29.73 ± 0.61 |
| Unsquared | 6.82 ± 0.26 | 12.21 ± 0.28 | 19.40 ± 0.82 | |
| Gaussian noise | Squared | 3.79 ± 0.06 | 4.92 ± 0.17 | 6.72 ± 0.20 |
| Unsquared | 3.51 ± 0.07 | 4.17 ± 0.06 | 5.31 ± 0.05 | |
| Salt and pepper | Squared | 4.45 ± 0.04 | 6.49 ± 0.17 | 9.44 ± 0.53 |
| Unsquared | 3.92 ± 0.10 | 5.00 ± 0.09 | 6.65 ± 0.32 | |
| Patch noise | Squared | 3.98 ± 0.05 | 4.61 ± 0.07 | 5.49 ± 0.08 |
| Unsquared | 3.68 ± 0.07 | 4.10 ± 0.08 | 4.70 ± 0.11 | |
| Inversion | Squared | 3.96 ± 0.10 | 4.84 ± 0.18 | 6.06 ± 0.15 |
| Unsquared | 3.66 ± 0.07 | 4.37 ± 0.06 | 5.52 ± 0.13 | |
| Gaussian blur | Squared | 4.58 ± 0.07 | 6.18 ± 0.10 | 8.84 ± 0.25 |
| Unsquared | 5.09 ± 0.11 | 7.98 ± 0.09 | 11.85 ± 0.07 | |
| Motion blur | Squared | 4.45 ± 0.06 | 6.13 ± 0.11 | 8.48 ± 0.13 |
| Unsquared | 4.71 ± 0.09 | 7.18 ± 0.22 | 10.40 ± 0.21 |
Table 3. FID on clean CIFAR-10 (lower is better) after training under contamination. Entries report the mean ± standard deviation over three seeds. The lower mean within each pair is bold.
Discussion and Limitations
The results on clean data suggest that in this particular model, the modified Flow Matching objective can preserve generation quality. Lemma 3.2 gives a sufficient condition for this to hold. However, we cannot verify its assumptions for the CIFAR-10 distribution, although the empirical observations are consistent with it.
The pattern for the contaminated models suggests that the -Flow Matching method is effective for certain kinds of contamination. In particular, in the models under which the method performs better, contamination consists of strong perturbations of pixels, individually or across the whole image. We suspect that these contamination models result in substantial deviations from the clean image distribution, under which the objective is beneficial. The standard method performs better for both Gaussian blur and Motion blur. A possible explanation is that the blurring we applied produces a contamination that is less separated from the original distribution. This hypothesis is partially supported by Theorem 4.3. We showed that under the stated assumptions, for bounded clean data with increasingly distant Dirac contamination, eventually the method will yield a better result, in the Wasserstein metric. Moreover, this resembles the intuition that the geometric median is generally more useful for contamination that is strongly separated from the original data. Nevertheless, we should be careful with this intuition. The intuition regarding the geometric median applies only partially, because the velocity distributions Law, which are the basis of the geometric median, have different mixture weights than the contaminated target distributions.
Conclusion
In this work we proposed an adaptation of the Flow Matching method, obtained by replacing the regression objective with an objective. We gave a characterization of the solution as a conditional geometric median and established conditions under which this changed objective yields the same result as the standard method. We then investigated the effect that contamination has on the vector fields and provided bounds on the influence of contamination. We have established improvement in the Wasserstein distance for our method in specific contamination settings under stated assumptions. Empirically, the method achieves comparable performance on clean CIFAR-10 and improves generation quality under several, though not all, contamination mechanisms. We do not establish general regularity or uniqueness results for trajectories induced by the formulation. Moreover, pointwise robustness of the velocity field does not by itself guarantee that the generated distribution is closer to the clean target. Extending our distributional guarantees beyond the specific contamination settings that we analyzed therefore remains an important direction for future research.
Acknowledgments
We acknowledge funding by the German Research Foundation under the number OC 150/7-1.
AI use statement
In this work, we used generative AI tools to assist with formulating mathematical claims, providing critical ingredients for proving mathematical claims, assisting in writing of proofs and implementing methods and proposing or refining hypotheses. We have not used generative AI tools for generating synthetic data sets, helping develop theoretical models or conceptual frameworks, designing or providing feedback on research methodology or experiments, cleaning and reformatting datasets, supporting qualitative and thematic data analysis, or to help interpret results. Assisting with translation is not applicable to this work. Additionally, we used generative AI tools for creating or modifying scientific figures or images, creating or editing software code, summarizing or analyzing existing literature, sourcing/searching for information, editing a research paper to improve readability, identifying relevant literature, suggesting a structure for a research paper.
We have reviewed all AI-assisted work. In particular, we independently checked all AI-assisted mathematical claims and proof ideas. Moreover, we inspected the reviewed AI-assisted code and verified literature-related suggestions against their original sources. We take responsibility for the final content of this work, including text, claims or artifacts produced with the aid of generative AI.
Proofs
Here we prove the statements from the main text. Throughout this appendix, we retain the notation and assumptions introduced in the main text. For convenience, we reintroduce the statements we prove.
Lemma (3.1). Let be a measurable minimizer of (3). Then it holds that
for almost every and -almost every . Moreover, if this conditional distribution is not concentrated on an affine line for almost every and -almost every , then the minimizer is unique up to almost everywhere equality.
Proof. Let denote a jointly measurable probability kernel representing the conditional law of given . Then
For fixed the inner integral
is minimized exactly when is a geometric median of . This holds for almost every . Assume that would not minimize on a set that has positive measure that we denote by . By continuity in the last argument and since is dense there has to exist a rational vector such that
for in a set of positive measure. To see that, let
Since is continuous in its last argument and is dense we can write
Since has positive measure, there has to exist a such that has positive measure. Consequently, replacing with on would decrease , contradicting minimality. The uniqueness claim follows immediately from Milasevic and Ducharme [16]. □
Lemma (3.2). Assume that, for almost every and -almost every , the conditional distribution of given is not concentrated on an affine line and is centrally symmetric around its mean, i.e., for any random variable having this distribution, say , we have that matches, in distribution, . Then we have that
for almost every and -almost every .
Proof. This holds for general distributions. Let be a distribution satisfying the assumptions above. Let
be the expectation of . Consider
Since has finite expectation, the minimizer of is the geometric median, which is unique by assumption. Since is assumed to be centrally symmetric around its mean, it holds that
Since is convex
implying that is the unique geometric median. Applying this result to the conditional distribution of given and using the characterizations of and proves the claim.
Corollary (3.3). If the source distribution is a standard Gaussian distribution and the target distribution is nondegenerate Gaussian where and are independent, then
for almost every and -almost every $x.
Proof. Since and are independent Gaussian random variables it follows that is Gaussian. As both and are linear combinations of and , the pair is jointly Gaussian. Thus given is nondegenerate Gaussian. The statement then follows since Gaussian distributions have a unique geometric median equal to their mean.
Theorem (3.4). Let be the law of . Under the standing assumptions, we have that:
where the right-hand side is the optimal squared FM regression loss.
Proof. The following inequalities hold for almost every and -almost every . Let
and
Then
Since is a geometric median of the conditional distribution, it minimizes the conditional expected Euclidean distance. Consequently
Moreover
Consequently
and integrating with respect to yields
Lemma (4.1). For almost every and -almost every satisfying , there exists , depending only on the clean model and not on the contamination, such that
Proof. Fix and . We have shown in (4) that we can decompose the velocity distribution as
Let and . By definition minimizes , because is the clean conditional velocity distribution. On the other hand, by the decomposition of , it holds that minimizes
Denote and . Due to the optimality mentioned above
Let .
Using the reverse triangle inequality we have
and
By taking the appropriate expectations this implies
and
Plugging those into (6):
after reformulating
equivalent to
Since by assumption it holds that and we conclude
With
the claim follows.
Theorem 4.2. Let be a Dirac distribution in centered at . Let . For , consider the contaminated distribution
For every pointwise -velocity field coming from a Borel geometric-median selection as defined in (5), the associated ODE admits a solution process with . Every such solution converges almost surely as and its terminal law satisfies
Proof. As described in the main text, we will condition on the endpoint being either the clean or the contaminated target. We consider . Conditioned on either the clean or the contaminated endpoint, the distribution of the interpolation is Gaussian
where . Define the posterior contamination probability and
We want to analyze this quantity, since it explains the behavior of the field. From (7) we obtain that admits a density. Using and the law of total probability we obtain that for the density of the following holds:
Consequently using Bayes’ theorem
Similarly,
For the common denominator cancels and it follows that
With the characterization of these densities in (7) we obtain
Taking the logarithm yields
Conditioned on an endpoint and the interpolation point, the source point is deterministic. Conditioning on and gives
For each define the conditional field
In the sense of probability laws we have
For fixed and , this conditional law is a two-point mixture. If , its geometric median is the atom with higher assigned probability. Note that . Fix any Borel geometric-median selection as defined in the main text and write
Since the relevant conditional law is a two-point mixture as discussed, the field satisfies
where is determined by the fixed Borel selection, which we leave arbitrary. Note that this is relevant since for both mixture weights are equal, thus the set of geometric medians is the line segment . For fixed source points, we can analyze the trajectories induced by the field. For a starting point , the trajectory induced by the uncontaminated field is . Let and . Using (8):
Let . Then this is a concave quadratic in :
Since the transformation is a continuous increasing function from onto it suffices to study the time-reparametrized quadratic . If then its maximum over is , while for its maximum is . Consequently, if
then
for every . We are interested in the sign of , since
Define and let . By what we have shown above, for every . In particular this implies that the vector field selects the clean velocity along the candidate clean trajectory
Since
the clean trajectory is indeed a trajectory of the -field ODE on . Note that is continuous and the trajectory is also continuous. Since , for every there exists a neighborhood around such that . Consequently the geometric median field agrees with
for all in that neighborhood. This field is locally Lipschitz in space and hence the clean trajectory is indeed the unique trajectory starting from .
Hence, starting points follow and consequently get transported to the clean target since for .
Now define and let . Consider as defined above. Since it has a positive maximum and consequently has the two positive roots
Consider and . Consider any locally absolutely continuous trajectory with initial value , solving the flow ODE for almost every . Analogously to the previous argument, since for the trajectory initially follows the clean field for . After a potential switch, the candidate trajectory is where . Its posterior log-odds are
with and since we have
implying for every . Note that and . Since , the corresponding time derivatives are also positive at the switching point. By a continuity argument analogous to the one above, the derivatives of the log-odds along both branch velocities remain bounded below by a common positive constant in a neighborhood of the switching point. On the tie surface, the velocity is a convex combination of and . Write . For the selected velocity, the chain rule gives
where is the coefficient of the convex combination and is the common positive lower bound. All quantities are evaluated at . Hence, along any absolutely continuous solution through this point, the log-odds increase strictly for a sufficiently short time, so the solution immediately enters the contaminated region. Local uniqueness there identifies it with the candidate trajectory, which remains in that region since for every .
Hence, the trajectory after is . As , so the trajectory converges to . This means that initial points get transported to .
Putting this together, the trajectories follow
This map is Borel measurable and the paths are locally absolutely continuous. Let and define
This establishes the existence of a solution process. Our preceding calculations show that for every satisfying , satisfies the selected ODE almost everywhere. Since this condition holds almost surely. Moreover, the preceding uniqueness arguments show that every solution starting from with coincides with . Consequently, every solution process with the stated Gaussian initial distribution agrees almost surely, for all , with . The previously established trajectory limits therefore give almost-sure convergence and the same terminal law for every such process.
We want to analyze the induced terminal distribution. Since it follows that
since is a normalized linear projection. Thus
Consequently, the induced distribution is
from which the Wasserstein statement follows immediately since for :
Then
concluding the proof.
Theorem 4.3. Let be a distribution supported in the closed ball . Let , and fix a unit vector . For , set and
For each , let be any pointwise -velocity field associated with as defined in (5). Assume that its associated ODE admits a solution process with initial distribution . Let be any such solution process, and write . Then, for all sufficiently large ,
Proof. For each , let be the Borel geometric-median selection defining , and let be any associated solution process as in the theorem. We suppress the dependence on in and . By the definition of a solution, almost surely,
The beginning of this proof is analogous to the proof of Theorem 4.2. First we condition on the endpoint. For it holds that
where . Since those again admit densities we can write
The same Bayes computation as before yields
The main difference is that in the denominator we have to integrate over the target distribution, since it is no longer a point mass distribution. The clean posterior is . For this distribution it holds that . The conditional distribution can now be characterized as
By the definition of the fixed selection , we therefore have
for every .
In the earlier proof, we could give a precise formula for the geometric median, since the velocity distribution consisted of two atoms. Since we are working with a general bounded target distribution, we will instead provide a bound for the geometric median. Fix a threshold and introduce constants
Along the trajectory define
with the convention that the infimum of the empty set is 1. This is the first time that the posterior contamination probability along the trajectory reaches the threshold. Let
and its complement. On the event we have that and thus
This allows us to bound the median by using Lemma A.1. Independently of , since the clean conditional endpoint distribution is supported in , the mixed conditional endpoint distribution is supported in . Note that the geometric median remains inside because otherwise projecting it onto this ball would strictly decrease its distance to every support point. Thus
In particular, this yields the following bound:
Now we want to use the bound on the median to provide a bound on the resulting distribution. Let . Take independent of the generated process. Then this yields an admissible coupling between and . Since the Wasserstein distance is the infimum of the transport cost of all admissible couplings, we can use this to bound the Wasserstein distance. We have
since almost surely. In the proof of Lemma A.2 we have shown
Consequently
Using (12) we obtain
Plugging this into (15) and explicitly computing the integral yields
Taking now we obtain
Dividing by and also sending to infinity yields
where the last inequality is by Lemma A.2. Since this inequality holds for all and the right hand side is decreasing in we can take the infimum over and obtain
Note that this is the same constant as in the proof of the Dirac contamination theorem. Moreover
implying
Since we have shown that
the statement follows.
Lemma A.1. Consider the setting of Theorem 4.3. Let , let be any distribution supported in and let be any geometric median of
for . Then
Proof. Note that this is a similar setup to Lemma 4.1 and a related result is [17 Lemma 2.1]. Let . Then is its minimizer. Consequently . Thus
implying that the right-hand side is non-positive. Consequently
Lemma A.2. In the setting of Theorem 4.3 and with the notation introduced in its proof, for every ,
Proof. The function is increasing on . For , we have , so Lemma A.1 yields
By the assumptions of Theorem 4.3, the sample paths of are locally absolutely continuous and satisfy the integral equation almost surely. Therefore, for almost every ,
Integrating this from to yields
For with define
This yields
and using we obtain that , which is useful because it is independent of .
Now suppose occurs.
The posterior formula is continuous as well as . Consequently, since we have . Consider now , . From the explicit posterior odds formula (11) this yields
where
The inequality holds, since is supported on the unit ball. Denote
and take . From (16) we obtain
Denoting we obtain
Using , and yields:
where . Consequently, for all we have
where . Now for all sufficiently large it holds that . Combining the posterior-odds identity with the preceding uniform estimate yields
where . Since and for large enough, it holds that , we have . Consequently
This is equivalent to
and is now independent of the hitting time . Let be a Gaussian random variable independent of the other variables. Let
Since has the same distribution as and using (17), the following holds:
Note that
almost surely and
Using the bounded convergence theorem on the indicator variables of the events yields
Using that for sufficiently large , (18) holds we consequently have
Implementation Details
Our implementation is based on the CIFAR-10 code released in the TorchCFM repository accompanying Tong et al. [25]. We use their CIFAR-10 I-CFM configuration and retain its U-Net architecture, data preprocessing, and principal training configuration. We modify the regression objective in the experiments and introduce the contamination mechanisms described in Table 1. CIFAR-10 images are converted to tensors, and normalized channelwise with mean and standard deviation 0.5, yielding images in . For a batch of residuals , with , the squared loss is implemented as
while the loss is implemented as
No smoothing is applied to the Euclidean norm. Since the dimension-dependent normalization factors are constant they do not change the population minimizers, but they can affect gradient clipping and are therefore reported as used in training. For each of the contamination experiments, the contamination is generated online: every target image occurring in a minibatch is independently corrupted with probability . Whether an image gets corrupted and associated noise are generated using a separate seeded random-number generator, so that matching randomization is used across objectives. We use a U-Net with 128 base channels, channel multipliers , attention at resolution 16, dropout 0.1, four attention heads and 64 channels per head. Models are trained for 400,000 optimizer updates using Adam with learning rate , batch size 128, 5,000 linear warm-up steps, global gradient-norm clipping at 1.0, and EMA decay 0.9999.
For FID evaluation, we use the CIFAR-10 evaluation script provided in the TorchCFM repository accompanying Tong et al. [25], with only the modifications required to load and evaluate our trained models. We otherwise retain the original evaluation procedure and use the same pipeline for both the squared and objectives.
Example Images

Figure 2. (a) Squared FM (b) FM. Generated samples for Random noise with contamination level . The same source samples are used for squared and Flow Matching.

Figure 3. (a) Squared FM (b) FM. Generated samples for Gaussian noise with contamination level . The same source samples are used for squared and Flow Matching.
::::

(a) (a) Squared FM

(b) (b) FM
Figure 4. Generated samples for Salt-and-Pepper noise with contamination level . The same source samples are used for squared and Flow Matching.
::::
::::

(a) (a) Squared FM

(b) (b) FM
Figure 5. Generated samples for Patch noise with contamination level . The same source samples are used for squared and Flow Matching.
::::

Figure 6. Generated samples for Inversion with contamination level . The same source samples are used for squared and Flow Matching.

Figure 7. Generated samples for Gaussian blur with contamination level . The same source samples are used for squared and Flow Matching.

(a) Squared FM

(b) FM
Figure 8. Generated samples for Motion blur with contamination level . The same source samples are used for squared and Flow Matching.
References
- [1]Michael Albergo, Nicholas M Boffi, and Eric Vanden-Eijnden. Stochastic interpolants: A unifying framework for flows and diffusions. Journal of Machine Learning Research, 26(209):1–80, 2025.
- [2]Michael Samuel Albergo and Eric Vanden-Eijnden. Building normalizing flows with stochastic interpolants. In The Eleventh International Conference on Learning Representations, 2023. URL https://openreview.net/forum?id=li7qeBbCR1t.arxiv.org/abs/2209.15571
- [3]Ricky T. Q. Chen, Yulia Rubanova, Jesse Bettencourt, and David K Duvenaud. Neural ordinary differential equations. In S. Bengio, H. Wallach, H. Larochelle, K. Grauman, N. Cesa-Bianchi, and R. Garnett, editors, Advances in Neural Information Processing Systems, volume 31. Curran Associates, Inc., 2018. URL https://proceedings.neurips.cc/paper_files/paper/2018/file/69386fb8b6edf866922a24c8686939b9-Paper.pdf.arxiv.org/abs/1806.07366
- [4]J.R. Dormand and P.J. Prince. A family of embedded Runge-Kutta formulae. Journal of Computational and Applied Mathematics, 6(1):19–26, 1980. ISSN 0377-0427. doi: 10.1016/0771-050X(80)90013-3. URL https://www.sciencedirect.com/science/article/pii/0771050X80900133.DOI
- [5]Will Grathwohl, Ricky T. Q. Chen, Jesse Bettencourt, and David Duvenaud. Scalable reversible generative models with free-form continuous dynamics. In International Conference on Learning Representations, 2019. URL https://openreview.net/forum?id=rJxgknCcK7.arxiv.org/abs/1810.01367
- [6]J. B. S. Haldane. Note on the median of a multivariate distribution. Biometrika, 35(3-4):414–417, 1948. ISSN 0006-3444. doi: 10.1093/biomet/35.3-4.414. URL https://doi.org/10.1093/biomet/35.3-4.414.
- [7]Martin Heusel, Hubert Ramsauer, Thomas Unterthiner, Bernhard Nessler, and Sepp Hochreiter. GANs trained by a two time-scale update rule converge to a local Nash equilibrium. In I. Guyon, U. Von Luxburg, S. Bengio, H. Wallach, R. Fergus, S. Vishwanathan, and R. Garnett, editors, Advances in Neural Information Processing Systems, volume 30. Curran Associates, Inc., 2017. URL https://proceedings.neurips.cc/paper_files/paper/2017/file/8a1d694707eb0fefe65871369074926d-Paper.pdf.
- [8]Peter J. Huber. Robust Estimation of a Location Parameter. The Annals of Mathematical Statistics, 35(1):73 – 101, 1964. doi: 10.1214/aoms/1177703732. URL https://doi.org/10.1214/aoms/1177703732.
- [9]Artem Khrapov, Vadim Popov, Tasnima Sadekova, Assel Yermekova, and Mikhail Kudinov. Improving diffusion models’s data-corruption resistance using scheduled Pseudo-Huber loss, 2024. URL https://arxiv.org/abs/2403.16728.
- [10]Alex Krizhevsky. Learning multiple layers of features from tiny images. Technical report, University of Toronto, 2009. URL https://www.cs.toronto.edu/~kriz/learning-features-2009-TR.pdf.
- [11]Lei Li and Yuexiao Dong. Robust diffusion models via divergence-induced weighted denoising, 2026. URL https://arxiv.org/abs/2606.22521.
- [12]Yaron Lipman, Ricky T. Q. Chen, Heli Ben-Hamu, Maximilian Nickel, and Matthew Le. Flow matching for generative modeling. In The Eleventh International Conference on Learning Representations, 2023. URL https://openreview.net/forum?id=PqvMRDCJT9t.arxiv.org/abs/2210.02747
- [13]Yaron Lipman, Marton Havasi, Peter Holderrieth, Neta Shaul, Matt Le, Brian Karrer, Ricky T. Q. Chen, David Lopez-Paz, Heli Ben-Hamu, and Itai Gat. Flow matching guide and code, 2024. URL https://arxiv.org/abs/2412.06264.
- [14]Xingchao Liu, Chengyue Gong, and Qiang Liu. Flow straight and fast: Learning to generate and transfer data with rectified flow. In The Eleventh International Conference on Learning Representations, 2023. URL https://openreview.net/forum?id=XVjTI1mw5z.arxiv.org/abs/2209.03003
- [15]Hendrik Lopuhaä and Peter Rousseeuw. Breakdown points of affine equivariant estimators of multivariate location and covariance matrices. The Annals of Statistics, 19:229–248, 1991. doi: 10.1214/aos/1176347978.DOI
- [16]P. Milasevic and G. R. Ducharme. Uniqueness of the Spatial Median. The Annals of Statistics, 15(3): 1332–1333, 1987. doi: 10.1214/aos/1176350511. URL https://doi.org/10.1214/aos/1176350511.
- [17]Stanislav Minsker. Geometric median and robust estimation in Banach spaces. Bernoulli, 21(4):2308–2335, 2015. ISSN 1350-7265. doi: 10.3150/14-BEJ645. URL http://dx.doi.org/10.3150/14-BEJ645.
- [18]Stanislav Minsker and Nate Strawn. The geometric median and applications to robust mean estimation. SIAM Journal on Mathematics of Data Science, 6(2):504–533, 2024. doi: 10.1137/23M1592420. URL https://doi.org/10.1137/23M1592420.
- [20]Aram-Alexandre Poladian, Heli Ben-Hamu, Carles Domingo-Enrich, Brandon Amos, Yaron Lipman, and Ricky T. Q. Chen. Multisample flow matching: Straightening flows with minibatch couplings. In Andreas Krause, Emma Brunskill, Kyunghyun Cho, Barbara Engelhardt, Sivan Sabato, and Jonathan Scarlett, editors, Proceedings of the 40th International Conference on Machine Learning, volume 202 of Proceedings of Machine Learning Research, pages 28100–28127. PMLR, 23–29 Jul 2023. URL https://proceedings.mlr.press/v202/poladian23a.html.
- [21]Peter Rousseeuw and Annick Leroy. Robust Regression and Outlier Detection. John Wiley & Sons, 1987. doi: 10.1002/0471725382.DOI
- [22]Richard Schwank, Andrew McCormack, and Mathias Drton. Robust score matching. In Yingzhen Li, Stephan Mandt, Shilpa Agrawal, and Emtiyaz Khan, editors, Proceedings of The 28th International Conference on Artificial Intelligence and Statistics, volume 258 of Proceedings of Machine Learning Research, pages 1234–1242. PMLR, 03–05 May 2025. URL https://proceedings.mlr.press/v258/schwank25a.html.arxiv.org/abs/2501.05105
- [23]Christopher G. Small. A survey of multidimensional medians. International Statistical Review / Revue Internationale de Statistique, 58(3):263–277, 1990. ISSN 03067734, 17515823. URL http://www.jstor.org/stable/1403809.DOI
- [24]Weixi Song, Zhetao Chen, Tao Xu, Xianchao Zeng, Xinyu Zhou, Lixin Yang, Donglin Wang, Cewu Lu, and Yong-Lu Li. L1 sample flow for efficient visuomotor learning, 2025. URL https://arxiv.org/abs/2511.17898.
- [25]Alexander Tong, Kilian Fatras, Nikolay Malkin, Guillaume Huguet, Yanlei Zhang, Jarrid Rector-Brooks, Guy Wolf, and Yoshua Bengio. Improving and generalizing flow-based generative models with mini-batch optimal transport. Transactions on Machine Learning Research, 2024a. ISSN 2835-8856. URL https://openreview.net/forum?id=CD9Snc73AW.arxiv.org/abs/2302.00482
- [27]Cédric Villani. Optimal Transport: Old and New, volume 338 of Grundlehren der mathematischen Wissenschaften. Springer Berlin, Heidelberg, 2009. doi: 10.1007/978-3-540-71050-9.