Manuscript Offprint

arXiv:2609.31544

A Flow Matching Framework for Neural Representational Dissimilarity

Zeyuan Ye, Xue-Xin Wei

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

Abstract

Neural representational dissimilarity quantifies differences between neural response distributions, and is essential for comparing neural codes across stimuli, brain areas, tasks, and models. Commonly used distance metrics involve different assumptions and are estimated with separate methods. Here, we show that a variety of distance metrics can be unified under a flow matching framework developed in deep generative models. That is, these distances arise as Jeffreys divergences under different velocity constraints. We find that flow matching has advantages for estimating distances involving complicated distributions and continuous variables. Furthermore, this framework enables the design of new distance metrics in a principled way. Together, flow matching provides a unified approach for understanding, estimating, and designing neural representational dissimilarity metrics.

A

Figure

B

Figure 1: Overview of the proposed flow matching framework for neural representational dissimilarity. (A) Different stimuli evoke condition-specific neural responses, producing different population-response distributions whose dissimilarity is to be quantified. (B) Flow matching learns velocity fields v1V(x,t)v_1^\mathcal{V}(x,t) and v2V(x,t)v_2^\mathcal{V}(x,t) that transport a shared source distribution to the fitted distributions q1Vq_1^\mathcal{V} and q2Vq_2^\mathcal{V}. Here, we define representational dissimilarity as the Jeffreys divergence between q1Vq_1^\mathcal{V} and q2Vq_2^\mathcal{V}. We prove that different choices of V\mathcal{V} correspond to different distance metrics.

1 Introduction

A central question in neuroscience is how the brain represents information through stochastic neural population responses. Representing information means not only “storing” it but also “structuring” it in an appropriate format to support downstream computation given the biological constraints [Kriegeskorte and Kievit, 2013, Kriegeskorte and Wei, 2021]. How can we study representational

*Code: https://github.com/AgeYY/FlowRDM.

Preprint.

structures? Representational similarity analysis (RSA) takes a geometric perspective, probing representational structure by measuring pairwise distances between neural population response distributions across conditions, such as stimuli or task states [Kriegeskorte et al., 2008a, Nili et al., 2014]. RSA has been widely used to study how neural representations support perception and task performance [Kriegeskorte et al., 2008a, Cichy et al., 2014, Diedrichsen and Kriegeskorte, 2017] and to compare representational systems across species and computational models, including deep neural network models [Kriegeskorte et al., 2008b, Kriegeskorte, 2009, Kornblith et al., 2019].

A key step in RSA is to define and estimate representational distances. Because neural responses are stochastic, this often becomes a mathematical question of how to compare distributions. No single distance metric is best for every purpose as different metrics reveal different properties of the distributions [Walther et al., 2016, Diedrichsen and Kriegeskorte, 2017, Kriegeskorte and Wei, 2021]. For example, correlation distance compares the relative pattern of mean activity across neurons. Euclidean distance measures separation between mean response vectors. Mahalanobis distance additionally accounts for response covariance. Kullback-Leibler (KL) divergence compares full response distributions. Lastly, Fisher information measures how sensitive the response distribution changes with a small change of the stimulus variable [Kullback and Leibler, 1951, Amari, 2016].

Given the diversity of these useful distance metrics, a natural question arises: can they be unified under a single mathematical framework? Such a framework, if exists, could offer several benefits. First, it would make the statistical assumptions underlying different metrics more explicit, clarifying their interpretation. Second, it would provide a principled way to design new distance metrics. Finally, it could provide a unified estimator for these metrics, so that improvements to the estimator could benefit multiple metrics rather than requiring separate efforts for each one.

Here, we provide such a framework using flow matching. Flow matching is a modern deep generative modeling method that is widely used in image, video, and language generation [Lipman et al., 2023, Esser et al., 2024, Davtyan et al., 2023, Hu et al., 2024]. It starts by generating a data sample from a simple source distribution (e.g., a Gaussian distribution) and then evolves the sample toward a target distribution through a velocity field. In our flow-matching framework for neural dissimilarity, we define the representational distance as the Jeffreys divergence between two target neural-response distributions under a given velocity constraint. We mathematically prove that this Jeffreys divergence reduces to existing distance metrics under different velocity-field constraints (Fig. 1). We show that flow matching offers advantages when estimating distances involving complex distributions and continuous variables, and allows the principled design of new distance metrics.

References (74)