arXiv:2610.21332cs.CVOct 2026

Manuscript Offprint

arXiv:2610.21332

Semantic Latent Alignment for Flow Matching with Invertible Bi-Lipschitz Adapters

Felix Nützel, Mischa Dombrowski, Luca Hagen, Bernhard Kainz

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

ABSTRACT

Pretrained latent spaces trade compression, reconstruction, and the learnability of the coordinates a downstream generator has to work in, which complicates adapting these spaces to different domains or tasks: continued training is expensive, and without a new alignment objective it often fails to improve downstream generation. We instead leave the encoder and decoder fixed and change only the coordinates between them, using an invertible bi-Lipschitz adapter aligned offline to a semantic teacher and frozen during class-conditional flow matching. Invertibility preserves compatibility with the pretrained autoencoder, while the bi-Lipschitz constraint limits how far alignment can distort its latent geometry. This provides a simple way to improve semantic organization while retaining the compression and reconstruction properties of the original latent space. On two medical imaging datasets, constrained latent adaptation improves feature metrics, seed stability and counterfactual edit strength, while remaining competitive on downstream classification. In contrast, unconstrained adaptation can become highly anisotropic and sensitive despite remaining invertible, highlighting the importance of controlling geometric distortion. Our results suggest that carefully constrained post-hoc adaptation offers a parameter-efficient and tuning-free alternative to jointly modifying the representation during generative training.

1 INTRODUCTION

Latent generative models, including latent diffusion (Rombach et al., 2022) and flow matching (Lipman et al., 2023), operate on compressed representations produced by pretrained variational autoencoders (VAEs) (Kingma & Welling, 2013). VAEs are typically optimized for a rate-distortion trade-off between compression and reconstruction fidelity (Alemi et al., 2018; Bozkurt et al., 2021). However, a representation that reconstructs well is not necessarily easy for a downstream model to learn (Skorokhodov et al., 2025; Zheng et al., 2026; Dombrowski et al., 2026). Latent representation design therefore involves a third axis: downstream learnability. We define learnability as the ease with which a bounded-capacity learner can recover task-relevant structure from a representation under the measurement process used by the downstream pipeline. It depends not only on which information the representation retains, but also on how that information is arranged (Yao et al., 2025; Black Forest Labs, 2025).

Fine-tuning the autoencoder can adapt the representation, but it also changes the decoder coordinates, requires a new latent cache, and adds a costly adaptation stage, with the adapted latents often still showing low learnability (Dombrowski et al., 2026). Meanwhile, methods such as REPA (Yu et al., 2025) align features inside the generative model during training. They improve the generator instead of the latent representation and repeat the alignment cost for each training run. We study a post-hoc alternative: adapt the latent coordinates once, then reuse them across flow-matching models.

We place a spatial invertible adapter between the frozen autoencoder and the generator. The adapter is trained offline on cached latents using features from a frozen semantic teacher. Flow matching consumes the adapted latents, while the adapter inverse returns generated samples to the coordinates expected by the pretrained decoder. Under exact inversion, the encoder-decoder reconstruction mapping remains unchanged. An unconstrained invertible map can still produce essentially collapsed

Figure

Figure 1: Semantic latent adaptation. Top: an invertible adapter gθg_{\theta} is trained offline on the cached latents zz of a frozen autoencoder, maximizing the linear CKA between the similarity structure of the adapted latents gθ(z)g_{\theta}(z) and that of a frozen semantic teacher ϕ(x)\phi(x). The bi-Lipschitz constraint bounds how far this alignment can distort the original latent geometry, and gθ−1g_{\theta}^{-1} returns exactly to the coordinates the decoder expects. Bottom: the adapter is then frozen, and flow matching is trained and sampled in the adapted space. The whole noise path is pushed through gθg_{\theta}, so the source distribution becomes gθ#N(0,I)g_{\theta\#} \mathcal{N}(0, I), and generated latents are mapped back by gθ−1g_{\theta}^{-1} before decoding. We evaluate the generators by training classifiers on synthetic data and by counterfactual edits that add or remove a finding.

latents, so we use a bi-Lipschitz design that bounds the distortion in both directions with a single scalar, estimated from the data.

For teacher alignment, we measure linear Centered Kernel Alignment (CKA) (Kornblith et al., 2019), which only compares the relative similarity matrices of the two spaces. This matters because the adapted latent and the teacher embedding have different, very high dimensionalities and no shared coordinate system. We evaluate generation on two medical imaging datasets, using sample quality, semantic coverage, train-on-synthetic utility and counterfactual generation. Comparisons include the unchanged latent space, online generator alignment, autoencoder adaptation, and less constrained invertible maps.

Our contributions are:

  1. We propose a post-hoc latent adapter that is invertible and bi-Lipschitz by construction, aligned offline to a semantic teacher via CKA and frozen during flow matching. It leaves the autoencoder and the flow-matching objective unchanged, while a single scalar λ\lambda bounds its distortion in both directions with a closed-form certificate.

  2. We make the adapter tuning-free: λ\lambda can be estimated from a necessary condition on teacher triplets and the teacher from label geometry on training data, both fixed before any generator is trained. On both datasets the teacher choice agrees with the downstream results, and the method works across an eightfold range of λ\lambda.

  3. On our tested datasets, the adapter is competitive with online generator alignment and autoencoder adaptation, has the lowest seed variance in domain FID among the adaptation methods, and produces stronger counterfactual edits, at 405×405 \times fewer parameters than REPA's projection head and a fraction of the compute of autoencoder fine-tuning.

  4. We show that invertibility alone is insufficient: invertible maps without Lipschitz control become nearly rank-deficient and fail as generators, and adapting only the clean endpoint instead of the whole flow path gives good but unreliable runs.

References (53)