Estimating Neural Representation Alignment from Sparsely Sampled Inputs and Features — part 5/5

Cleaned-text code points [63020, 77842). Bibliography omitted here; source.md includes it.

( ∫ d ​ μ ​ ( t ) ​ f ​ ( t ) ) 2 ∫ d ​ μ ​ ( t ) ​ f ​ ( t ) 2 , \frac{\left(\int d\mu(t)\,f(t)\right)^{2}}{\int d\mu(t)\,f(t)^{2}}, which we call PR of f f w.r.t. to μ \mu . With these definitions, we can interpret γ a \gamma_{a} as the PR of the eigenvalues of T k a T_{k_{a}} , i.e. intrinsic dimensionality of T k T_{k} , ψ a \psi_{a} as the PR of ∫ d ​ ρ 𝒰 ​ ( w ) ​ ϕ a ​ ( ⋅ , w ) 2 \int d\rho_{\mathcal{U}}(w)\>\phi_{a}(\cdot,w)^{2} w.r.t. ρ 𝒳 \rho_{\mathcal{X}} , ψ ~ a \tilde{\psi}_{a} as the PR of ∫ d ​ ρ 𝒳 ​ ( x ) ​ ϕ a ​ ( x , ⋅ ) 2 \int d\rho_{\mathcal{X}}(x)\>\phi_{a}(x,\cdot)^{2} w.r.t. ρ 𝒰 \rho_{\mathcal{U}} , and ρ a \rho_{a} as the PR of ϕ a 2 \phi_{a}^{2} w.r.t. ρ 𝒳 ⊗ ρ 𝒰 \rho_{\mathcal{X}}\otimes\rho_{\mathcal{U}} . Suppose Φ ∞ ( a ) \Phi_{\infty}^{(a)} is the measurement matrix in the limit of infinite stimulus and neuron samples, and 𝐊 ∞ ( a ) \mathbf{K}_{\infty}^{(a)} is the corresponding Gram matrix, equivalent to T k a T_{k_{a}} . Then we can loosely say γ a \gamma_{a} is the intrinsic dimensionality of 𝐊 ∞ \mathbf{K}_{\infty} , ψ a \psi_{a} is the effective number of rows of Φ ∞ ( a ) \Phi_{\infty}^{(a)} with non-zero lengths, ψ a ~ \tilde{\psi_{a}} is the effective number of columns of Φ ∞ ( a ) \Phi_{\infty}^{(a)} with non-zero lengths, and ρ a \rho_{a} is the effective number of non-zero entries in Φ ∞ ( a ) \Phi_{\infty}^{(a)} .

Then, with the expected values of ℋ ^ 0 \widehat{\mathcal{H}}_{0} derived above the expected value of CKA ^ 0 \widehat{\text{CKA}}_{0} can be approximated as

⟨ CKA ^ 0 ​ ( ϕ a , ϕ b , 𝒮 𝒳 , ℱ 𝒰 , ℱ 𝒱 ) ⟩ ≈ ( 1 + 1 P ​ ( ζ a ​ b − 1 ) ) ​ CKA ( 1 + γ a ψ a − 1 P + γ a ψ ~ a − 1 Q a − γ a ψ a + γ a ψ ~ a − γ a ρ a − 1 P ​ Q a ) ​ ( 1 + γ b ψ b − 1 P + γ b ψ ~ b − 1 Q b − γ b ψ b + γ b ψ ~ b − γ b ρ b − 1 P ​ Q b ) \left\langle\widehat{\text{CKA}}_{0}(\phi_{a},\phi_{b},\mathcal{S}_{\mathcal{X}},\mathcal{F}_{\mathcal{U}},\mathcal{F}_{\mathcal{V}})\right\rangle\approx\frac{\left(1+\frac{1}{P}\left(\zeta_{ab}-1\right)\right)\text{CKA}}{\sqrt{\left(1+\frac{\frac{\gamma_{a}}{\psi_{a}}-1}{P}+\frac{\frac{\gamma_{a}}{\tilde{\psi}_{a}}-1}{Q_{a}}-\frac{\frac{\gamma_{a}}{\psi_{a}}+\frac{\gamma_{a}}{\tilde{\psi}_{a}}-\frac{\gamma_{a}}{\rho_{a}}-1}{PQ_{a}}\right)\left(1+\frac{\frac{\gamma_{b}}{\psi_{b}}-1}{P}+\frac{\frac{\gamma_{b}}{\tilde{\psi}_{b}}-1}{Q_{b}}-\frac{\frac{\gamma_{b}}{\psi_{b}}+\frac{\gamma_{b}}{\tilde{\psi}_{b}}-\frac{\gamma_{b}}{\rho_{b}}-1}{PQ_{b}}\right)}} (S9)

where CKA ≔ ⟨ k a ​ ( x , y ) ​ k b ​ ( x , y ) ⟩ ⟨ k a ​ ( x , y ) 2 ⟩ ​ ⟨ k b ​ ( x , y ) 2 ⟩ \text{CKA}\coloneqq\frac{\left\langle k_{a}(x,y)k_{b}(x,y)\right\rangle}{\sqrt{\left\langle k_{a}(x,y)^{2}\right\rangle\left\langle k_{b}(x,y)^{2}\right\rangle}} is the true CKA. Taking P → ∞ P\to\infty , we obtain the expected value of CKA ^ S ​ ( ϕ a , ϕ b , 𝒮 𝒳 , ℱ 𝒰 , ℱ 𝒱 ) \widehat{\text{CKA}}_{S}(\phi_{a},\phi_{b},\mathcal{S}_{\mathcal{X}},\mathcal{F}_{\mathcal{U}},\mathcal{F}_{\mathcal{V}}) estimator:

⟨ CKA ^ S ​ ( ϕ a , ϕ b , 𝒮 𝒳 , ℱ 𝒰 , ℱ 𝒱 ) ⟩ ≈ CKA ( 1 + γ a ψ ~ a − 1 Q a ) ​ ( 1 + γ b ψ ~ b − 1 Q b ) \left\langle\widehat{\text{CKA}}_{S}(\phi_{a},\phi_{b},\mathcal{S}_{\mathcal{X}},\mathcal{F}_{\mathcal{U}},\mathcal{F}_{\mathcal{V}})\right\rangle\approx\frac{\text{CKA}}{\sqrt{\left(1+\frac{\frac{\gamma_{a}}{\tilde{\psi}_{a}}-1}{Q_{a}}\right)\left(1+\frac{\frac{\gamma_{b}}{\tilde{\psi}_{b}}-1}{Q_{b}}\right)}} If ∫ d ​ ρ 𝒳 ​ ( x ) ​ ϕ a ​ ( x , ⋅ ) 2 \int d\rho_{\mathcal{X}}(x)\>\phi_{a}(x,\cdot)^{2} and ∫ d ​ ρ 𝒳 ​ ( x ) ​ ϕ b ​ ( x , ⋅ ) 2 \int d\rho_{\mathcal{X}}(x)\>\phi_{b}(x,\cdot)^{2} are constant, i.e. the norm of the activation is normalized for each neuron, then ψ ~ a = ψ ~ b = 1 \tilde{\psi}_{a}=\tilde{\psi}_{b}=1 , which gives

⟨ CKA ^ S ​ ( ϕ a , ϕ b , 𝒮 𝒳 , ℱ 𝒰 , ℱ 𝒱 ) ⟩ ≈ CKA ( 1 + γ a − 1 Q a ) ​ ( 1 + γ b − 1 Q b ) \left\langle\widehat{\text{CKA}}_{S}(\phi_{a},\phi_{b},\mathcal{S}_{\mathcal{X}},\mathcal{F}_{\mathcal{U}},\mathcal{F}_{\mathcal{V}})\right\rangle\approx\frac{\text{CKA}}{\sqrt{\left(1+\frac{\gamma_{a}-1}{Q_{a}}\right)\left(1+\frac{\gamma_{b}-1}{Q_{b}}\right)}}

### B.3 Analyzing the overall ℋ ^ \widehat{\mathcal{H}} -based CKA estimators

All CKA estimators based on ℋ ^ \widehat{\mathcal{H}} , including ours, have bias coming from taking the product of ℋ ^ \widehat{\mathcal{H}} ’s that are correlated to each other, taking inverse, and taking the square root. As a simple analog of CKA estimator, consider the following problem. We have fixed quantities X X , A A , and B B , and corresponding potentially biased estimators x x , a a , and b b , respectively. Here, x x , a a , and b b are correlated. We wish to study the properties of the estimator T = x a ​ b , T=\frac{x}{\sqrt{ab}}, as an estimator for θ = X A ​ B . \theta=\frac{X}{\sqrt{AB}}. Here, the fixed quantities X X , A A , and B B correspond to the ground truth ℋ \mathcal{H} values, and x x , a a , and b b correspond to the ℋ ^ \widehat{\mathcal{H}} estimators.

We denote δ x \displaystyle\delta_{x} = E [ x ] − X , δ a = E [ a ] − A , δ b = E [ b ] − B , \displaystyle=E[x]-X,\quad\delta_{a}=E[a]-A,\quad\delta_{b}=E[b]-B, σ x 2 \displaystyle\sigma_{x}^{2} = Var ( x ) , σ a 2 = Var ( a ) , σ b 2 = Var ( b ) , \displaystyle=\text{Var}(x),\quad\sigma_{a}^{2}=\text{Var}(a),\quad\sigma_{b}^{2}=\text{Var}(b), σ x ​ a \displaystyle\sigma_{xa} = Cov ( x , a ) , σ x ​ b = Cov ( x , b ) , σ a ​ b = Cov ( a , b ) . \displaystyle=\text{Cov}(x,a),\quad\sigma_{xb}=\text{Cov}(x,b),\quad\sigma_{ab}=\text{Cov}(a,b). We also define the deviations: Δ ​ x = x − X , Δ ​ a = a − A , Δ ​ b = b − B , \Delta x=x-X,\quad\Delta a=a-A,\quad\Delta b=b-B, with E ⁡ [ Δ ​ x ] = δ x , E ⁡ [ Δ ​ a ] = δ a , E ⁡ [ Δ ​ b ] = δ b . E[\Delta x]=\delta_{x},\quad E[\Delta a]=\delta_{a},\quad E[\Delta b]=\delta_{b}.

We consider the function f ⁡ ( x , a , b ) = x a ​ b , f(x,a,b)=\frac{x}{\sqrt{ab}}, and expand it about the point ( X , A , B ) (X,A,B) to second order:

f ⁡ ( x , a , b ) ≈ f ⁡ ( X , A , B ) + f x ​ Δ ​ x + f a ​ Δ ​ a + f b ​ Δ ​ b + 1 2 ​ [ f x ​ x ​ ( Δ ​ x ) 2 + f a ​ a ​ ( Δ ​ a ) 2 + f b ​ b ​ ( Δ ​ b ) 2 + 2 ​ f x ​ a ​ Δ ​ x ​ Δ ​ a + 2 ​ f x ​ b ​ Δ ​ x ​ Δ ​ b + 2 ​ f a ​ b ​ Δ ​ a ​ Δ ​ b ] f(x,a,b)\approx f(X,A,B)+f_{x}\Delta x+f_{a}\Delta a+f_{b}\Delta b+\frac{1}{2}\left[f_{xx}(\Delta x)^{2}+f_{aa}(\Delta a)^{2}+f_{bb}(\Delta b)^{2}+2f_{xa}\Delta x\Delta a+2f_{xb}\Delta x\Delta b+2f_{ab}\Delta a\Delta b\right] with all derivatives evaluated at ( X , A , B ) (X,A,B) .

The zeroth-order term:

f ⁡ ( X , A , B ) = X A ​ B . f(X,A,B)=\frac{X}{\sqrt{AB}}.

The first order derivatives: f x ​ ( X , A , B ) = 1 A ​ B , f a ​ ( X , A , B ) = − X 2 ​ A ​ A ​ B , f b ​ ( X , A , B ) = − X 2 ​ B ​ A ​ B . f_{x}(X,A,B)=\frac{1}{\sqrt{AB}},\quad f_{a}(X,A,B)=-\frac{X}{2A\sqrt{AB}},\quad f_{b}(X,A,B)=-\frac{X}{2B\sqrt{AB}}.

Next, the second-order derivatives:

f x ​ x ​ ( X , A , B ) = 0 , f x ​ a ​ ( X , A , B ) = − 1 2 ​ A ​ A ​ B , f x ​ b ​ ( X , A , B ) = − 1 2 ​ B ​ A ​ B , f_{xx}(X,A,B)=0,\quad f_{xa}(X,A,B)=-\frac{1}{2A\sqrt{AB}},\quad f_{xb}(X,A,B)=-\frac{1}{2B\sqrt{AB}},\quad

f a ​ a ​ ( X , A , B ) = 3 ​ X 4 ​ A 2 ​ A ​ B , f b ​ b ​ ( X , A , B ) = 3 ​ X 4 ​ B 2 ​ A ​ B , f a ​ b ​ ( X , A , B ) = X 4 ​ A ​ B ​ A ​ B . f_{aa}(X,A,B)=\frac{3X}{4A^{2}\sqrt{AB}},\quad f_{bb}(X,A,B)=\frac{3X}{4B^{2}\sqrt{AB}},\quad f_{ab}(X,A,B)=\frac{X}{4AB\sqrt{AB}}. Plugging them into our expansion, we get

x a ​ b ≈ X A ​ B ​ ( 1 + Δ ​ x X − 1 2 ​ Δ ​ a A − 1 2 ​ Δ ​ b B + 3 8 ​ ( Δ ​ a ) 2 A 2 + 3 8 ​ ( Δ ​ b ) 2 B 2 − 1 2 ​ Δ ​ x ​ Δ ​ a X ​ A − 1 2 ​ Δ ​ x ​ Δ ​ b X ​ B + 1 4 ​ Δ ​ a ​ Δ ​ b A ​ B ) \frac{x}{\sqrt{ab}}\approx\frac{X}{\sqrt{AB}}\left(1+\frac{\Delta x}{X}-\frac{1}{2}\frac{\Delta a}{A}-\frac{1}{2}\frac{\Delta b}{B}+\frac{3}{8}\frac{(\Delta a)^{2}}{A^{2}}+\frac{3}{8}\frac{(\Delta b)^{2}}{B^{2}}-\frac{1}{2}\frac{\Delta x\Delta a}{XA}-\frac{1}{2}\frac{\Delta x\Delta b}{XB}+\frac{1}{4}\frac{\Delta a\Delta b}{AB}\right)

Now let us take the expected value of the above. We use E ⁡ [ Δ ​ x ] \displaystyle E[\Delta x] = δ x , E [ Δ a ] = δ a , E [ Δ b ] = δ b , \displaystyle=\delta_{x},\quad E[\Delta a]=\delta_{a},\quad E[\Delta b]=\delta_{b}, E ⁡ [ ( Δ ​ x ) 2 ] \displaystyle E[(\Delta x)^{2}] = σ x 2 + δ x 2 , E [ ( Δ a ) 2 ] = σ a 2 + δ a 2 , E [ ( Δ b ) 2 ] = σ b 2 + δ b 2 , \displaystyle=\sigma_{x}^{2}+\delta_{x}^{2},\quad E[(\Delta a)^{2}]=\sigma_{a}^{2}+\delta_{a}^{2},\quad E[(\Delta b)^{2}]=\sigma_{b}^{2}+\delta_{b}^{2}, E ⁡ [ Δ ​ x ​ Δ ​ a ] \displaystyle E[\Delta x\Delta a] = σ x ​ a + δ x δ a , E [ Δ x Δ b ] = σ x ​ b + δ x δ b , E [ Δ a Δ b ] = σ a ​ b + δ a δ b . \displaystyle=\sigma_{xa}+\delta_{x}\delta_{a},\quad E[\Delta x\Delta b]=\sigma_{xb}+\delta_{x}\delta_{b},\quad E[\Delta a\,\Delta b]=\sigma_{ab}+\delta_{a}\delta_{b}. With these definitions, we get the following as the expected value up to the second order approximation: E ⁡ [ x a ​ b ] ≈ X A ​ B ​ ( 1 + δ x X − 1 2 ​ δ a A − 1 2 ​ δ b B + 3 8 ​ σ a 2 + δ a 2 A 2 + 3 8 ​ σ b 2 + δ b 2 B 2 − 1 2 ​ σ x ​ a + δ x ​ δ a X ​ A − 1 2 ​ σ x ​ b + δ x ​ δ b X ​ B + 1 4 ​ σ a ​ b + δ a ​ δ b A ​ B ) . E\left[\frac{x}{\sqrt{ab}}\right]\approx\frac{X}{\sqrt{AB}}\left(1+\frac{\delta_{x}}{X}-\frac{1}{2}\frac{\delta_{a}}{A}-\frac{1}{2}\frac{\delta_{b}}{B}+\frac{3}{8}\frac{\sigma_{a}^{2}+\delta_{a}^{2}}{A^{2}}+\frac{3}{8}\frac{\sigma_{b}^{2}+\delta_{b}^{2}}{B^{2}}-\frac{1}{2}\frac{\sigma_{xa}+\delta_{x}\delta_{a}}{XA}-\frac{1}{2}\frac{\sigma_{xb}+\delta_{x}\delta_{b}}{XB}+\frac{1}{4}\frac{\sigma_{ab}+\delta_{a}\delta_{b}}{AB}\right). Therefore, the bias is given by

E ⁡ [ x a ​ b ] − X A ​ B ≈ X A ​ B ​ ( δ x X − 1 2 ​ δ a A − 1 2 ​ δ b B + 3 8 ​ σ a 2 + δ a 2 A 2 + 3 8 ​ σ b 2 + δ b 2 B 2 − 1 2 ​ σ x ​ a + δ x ​ δ a X ​ A − 1 2 ​ σ x ​ b + δ x ​ δ b X ​ B + 1 4 ​ σ a ​ b + δ a ​ δ b A ​ B ) . E\left[\frac{x}{\sqrt{ab}}\right]-\frac{X}{\sqrt{AB}}\approx\frac{X}{\sqrt{AB}}\left(\frac{\delta_{x}}{X}-\frac{1}{2}\frac{\delta_{a}}{A}-\frac{1}{2}\frac{\delta_{b}}{B}+\frac{3}{8}\frac{\sigma_{a}^{2}+\delta_{a}^{2}}{A^{2}}+\frac{3}{8}\frac{\sigma_{b}^{2}+\delta_{b}^{2}}{B^{2}}-\frac{1}{2}\frac{\sigma_{xa}+\delta_{x}\delta_{a}}{XA}-\frac{1}{2}\frac{\sigma_{xb}+\delta_{x}\delta_{b}}{XB}+\frac{1}{4}\frac{\sigma_{ab}+\delta_{a}\delta_{b}}{AB}\right).

Now let us put this back into the perspective of the CKA estimation. In that context, δ x \delta_{x} is the bias of an ℋ \mathcal{H} -estimator for the numerator, whereas δ a \delta_{a} and δ b \delta_{b} are the bias of the ℋ \mathcal{H} -estimators in the numerator of CKA estimator. The variances σ x 2 \sigma_{x}^{2} , σ a 2 \sigma_{a}^{2} , and σ b 2 \sigma_{b}^{2} are the variances of the corresponding ℋ \mathcal{H} -estimators. Again, X X , A A , B B corresponds to the true ℋ \mathcal{H} -values in the true CKA. In our estimator CKA ^ C \widehat{\text{CKA}}_{C} , the ℋ ^ C \widehat{\mathcal{H}}_{C} biases δ x \delta_{x} , δ a \delta_{a} , and δ b \delta_{b} are zero, substantially reducing the bias in CKA ^ C \widehat{\text{CKA}}_{C} . However, in CKA ^ 0 \widehat{\text{CKA}}_{0} and CKA ^ S \widehat{\text{CKA}}_{S} , their ℋ \mathcal{H} estimators have non-zero biases δ x , δ a , δ b > 0 \delta_{x},\delta_{a},\delta_{b}>0 of order 𝒪 ⁡ ( 1 P + 1 Q ) \mathcal{O}\left(\frac{1}{P}+\frac{1}{Q}\right) (except, for some setups, δ x \delta_{x} is zero in CKA ^ S \widehat{\text{CKA}}_{S} ), adding even more bias to the CKA estimations. Note that all ℋ \mathcal{H} estimators have variance ( σ x 2 \sigma_{x}^{2} , σ a 2 \sigma_{a}^{2} , σ b 2 \sigma_{b}^{2} , σ x ​ a \sigma_{xa} , σ x ​ b \sigma_{xb} , and σ a ​ b \sigma_{ab} ) of order 𝒪 ⁡ ( 1 P + 1 Q ) \mathcal{O}\left(\frac{1}{P}+\frac{1}{Q}\right) . Therefore, as long as CKA estimation is built based on the ℋ \mathcal{H} estimators, the overall bias of CKA is of order 𝒪 ⁡ ( 1 P + 1 Q ) \mathcal{O}\left(\frac{1}{P}+\frac{1}{Q}\right) .

In a scenario where we have two systems (a) and (b) and we aim to compare the representations in (a) and (b) for a single input distribution. However, for each trial, one uses a unique set of inputs and observes a unique set of neurons independently drawn from distributions. Then, instead of taking the empirical average of CKA ^ \widehat{\text{CKA}} , one can take the empirical averages of ℋ ^ \widehat{\mathcal{H}} and use that average to compute CKA. If there are N N trials, these empirical averages of ℋ ^ \widehat{\mathcal{H}} have the variance of order 𝒪 ​ ( 1 N ​ ( 1 P + 1 Q ) ) \mathcal{O}\left(\frac{1}{N}\left(\frac{1}{P}+\frac{1}{Q}\right)\right) . This situation corresponds to when N N number of labs use distinct individual animals to study V1 and they use distinct sets of natural images. Alternatively, if one aims to compute trial-to-trial CKA and there are M M trials, then by performing all pairwise comparisons, one can reduce the bias of CKA estimators significantly since N = ( M 2 ) N=\binom{M}{2} . In summary, having multiple trials allows our estimator CKA ^ C \widehat{\text{CKA}}_{C} to have bias of 𝒪 ​ ( 1 N ​ ( 1 P + 1 Q ) ) \mathcal{O}\left(\frac{1}{N}\left(\frac{1}{P}+\frac{1}{Q}\right)\right) , while the other estimators CKA ^ 0 \widehat{\text{CKA}}_{0} and CKA ^ S \widehat{\text{CKA}}_{S} still has bias of 𝒪 ⁡ ( 1 P + 1 Q ) \mathcal{O}\left(\frac{1}{P}+\frac{1}{Q}\right) .

## Appendix C Additional results on neural data

In this section, we present the results on the second monkey subject. Overall, our observations are consistent across the two monkeys.

### C.1 Brain-to-model alignment

The CKA estimates between CNNs and the second monkey is shown in Figure S1 .

### C.2 Object disentanglement

The CKA estimates object disentanglement in the second monkey is shown in Figure S2 .

## Appendix D Code availability

The code for the estimators and generating all figures is available in https://github.com/badooki/CKA/ .

## Instructions for reporting errors

We are continuing to improve HTML versions of papers, and your feedback helps enhance accessibility and mobile support. To report errors in the HTML that will help us improve conversion and rendering, choose any of the methods listed below:

Click the "Report Issue" ( ) button, located in the page header.

Tip: You can select the relevant text first, to include it in your report.

Our team has already identified the following issues . We appreciate your time reviewing and reporting rendering errors we may not have found yet. Your efforts will help us improve the HTML versions for all readers, because disability should not be a barrier to accessing research. Thank you for your continued support in championing open access for all.

Have a free development cycle? Help support accessibility at arXiv! Our collaborators at LaTeXML maintain a list of packages that need conversion , and welcome developer contributions .