Introduction
Joint-embedding predictive architectures (JEPA) [27 ] are trained to predict the embedding of one view, such as a randomly cropped image, from the embedding of another view of the same image. Feature collapse, i.e., features that can be predicted reliably across different views but are not sufficiently informative of the downstream task, is a major issue while instantiating this idea. Popular methods like DINO [11 ] , iBOT [47 ] , and I-JEPA [3 ] use heuristics to work around this issue. More recently, LeJEPA [5 ] and its variants like VISReg [45 ] argue that they are effective at preventing feature collapse, without these heuristics, because of a specific regularization term.
Project page: https://www.engineering.upenn.edu/~richeek/polarreg/
The LeJEPA objective consists of an alignment term and a regularization term. The alignment term pulls together the embeddings of different views of the same image. The regularization term, called sketched isotropic Gaussian regularization (SIGReg), is computed over a batch of images. The original authors argue that it is a test statistic for whether the embeddings are independent samples from a standard Gaussian distribution. More formally, let f θ : X → R d f_\theta: X \to\mathbb{R}^d f θ : X → R d denote the encoder that maps inputs x ∈ X x \in X x ∈ X to embeddings u ∈ R d u \in\mathbb{R}^d u ∈ R d using weights θ \theta θ . For a batch of ϑ \vartheta ϑ images x 1 , … , x ϑ x_1,\ldots,x_\vartheta x 1 , … , x ϑ , each with ν \nu ν augmented views x i v x_i^v x i v , let u i v = f θ ( x i v ) u_i^v = f_\theta(x_i^v) u i v = f θ ( x i v ) be the embedding of view v v v of image i i i . The LeJEPA objective
ℓ ( θ ) = 1 ϑ ν d ∑ i = 1 ϑ ∑ v = 1 ν ∥ u i v − m i ∥ 2 + Ω S I G R e g , where (1) \ell(\theta) = \frac{1}{\vartheta\nu d}\sum_{i=1}^{\vartheta}\sum_{v=1}^{\nu}\left\lVert u_i^v-m_i\right\rVert^2+\Omega_{\mathrm{SIGReg}},
\qquad\text{where} \tag*{(1)} ℓ ( θ ) = ϑ ν d 1 i = 1 ∑ ϑ v = 1 ∑ ν ∥ u i v − m i ∥ 2 + Ω SIGReg , where (1)
Ω S I G R e g = λ ν κ ∑ v = 1 ν ∑ k = 1 κ ∫ ∣ w ( t ) ∣ ∣ φ k v ( t ) − e − t 2 / 2 ∣ 2 d t . \Omega_{\mathrm{SIGReg}} = \frac{\lambda}{\nu\kappa}\sum_{v=1}^{\nu}\sum_{k=1}^{\kappa}\int\left|w(t)\right|\left|\varphi_k^v(t)-e^{-t^2/2}\right|^2\,\mathrm{d}t. Ω SIGReg = ν κ λ v = 1 ∑ ν k = 1 ∑ κ ∫ ∣ w ( t ) ∣ φ k v ( t ) − e − t 2 /2 2 d t .
The first term is the alignment term, where m i = ν − 1 ∑ v u i v m_i=\nu^{-1}\sum_v u_i^v m i = ν − 1 ∑ v u i v is the mean embedding of the views of image i i i . The second term, SIGReg, encourages the embeddings to have an isotropic Gaussian distribution. It projects the embeddings of a view onto k k k random unit vectors a 1 , … , a k ∈ R d a_1,\ldots,a_k \in\mathbb{R}^d a 1 , … , a k ∈ R d called slices and φ k ( t ) = ℓ − 1 ∑ i exp ( i t a k ⊤ u i ) \varphi_k(t)=\ell^{-1}\sum_i\exp(\mathrm{i}t a_k^\top u_i) φ k ( t ) = ℓ − 1 ∑ i exp ( i t a k ⊤ u i ) is the empirical characteristic function of these projections. The integral corresponds to the Epps–Pulley test statistic [13 ] against the characteristic function of the standard Gaussian N ( 0 , 1 ) \mathcal{N}(0,1) N ( 0 , 1 ) , weighted by a function w ( t ) w(t) w ( t ) to keep the integral finite. By the Cramér–Wold theorem, as k → ∞ k \to\infty k → ∞ , matching such projections to N ( 0 , 1 ) \mathcal{N}(0,1) N ( 0 , 1 ) is equivalent to matching the distribution of embeddings to N ( 0 , I d × d ) \mathcal{N}(0,I_{d \times d}) N ( 0 , I d × d ) . Our first result is to show that SIGReg only weakly enforces its objective in practice (see Remark B.1). SIGReg is small even when the embedding distribution is quite different from an isotropic Gaussian. We prove that using more slices does not fix this (§ 2.1 ), even though the regularizer is sound as k → ∞ k \to\infty k → ∞ .
The authors of LeJEPA argue [5 Theorem 1] that embeddings should be distributed as an isotropic Gaussian because the downstream task is not known a priori. Indeed, if the embeddings are anisotropic, their projections onto different unit vectors have different variances and a linear probe for the task can be more biased. However, this claim holds only in the worst case over all downstream tasks. Natural tasks have structure and can benefit from anisotropic embeddings [34 ] . Our second result is to show that SIGReg conflicts with the alignment term in LeJEPA. An isotropic Gaussian embedding distribution makes the magnitudes and directions of the embeddings independent of each other. We show that the alignment term instead introduces dependence between the two. In fact, the minimizer of the alignment term assigns smaller magnitudes to more ambiguous images (see Figure 1 and § 2.3 ). We therefore argue that, in LeJEPA-like objectives, the magnitudes of the embeddings should depend on their directions. We show that this enables the encoder to train faster and more accurately. We prove that such embeddings do not collapse (Remark B.4 ).
Figure 1. Left: LeJEPA embeddings do not have an isotropic Gaussian distribution. The distribution of embedding magnitudes for black-footed ferret images, from a ViT-B encoder trained using LeJEPA on ImageNet-1k. Histograms show this distribution for 25% of images nearest (dark) to and farthest (light) from the class center in cosine similarity. Far away images tend to be ambiguous and have embeddings with smaller magnitudes. Right: We develop a new regularizer, named PolarReg, that replaces SIGReg in LeJEPA. On ImageNet-1k, a ViT-L encoder trained with PolarReg reaches the final accuracy of LeJEPA and its variants like VISReg in 86 epochs, 4.7 × 4.7\times 4.7 × fewer.
Since the two terms in LeJEPA work against each other, the accuracy of the approach depends heavily on the regularization weight λ \lambda λ . On ImageNet-100, the classification accuracy of the original LeJEPA encoders varies by up to 7.7% points for different values of λ \lambda λ . The best λ \lambda λ depends on the number of views ν \nu ν , the number of slices k k k and how the integral is approximated [5 Table 7] . On ImageNet-1k, the accuracy varies by up to 3.8% points depending upon these settings [5 Table 1] . LeJEPA uses hyper-parameter search to choose these settings. A new dataset, architecture, number of views or embedding dimension may need a new search. Our third result is to develop a new regularizer, called PolarReg, that replaces SIGReg. This regularizer matches the marginal distributions of the embedding magnitudes, and the pairwise inner products between embedding directions, to those of an isotropic Gaussian, computed analytically. PolarReg is very simple; it is designed with optimization techniques to ensure that its hyper-parameters need no tuning for different batch sizes, embedding dimensions or magnitudes (see § 2.4 ). All experiments in this paper use a single hyper-parameter setting for PolarReg. On ImageNet-1k, PolarReg matches the accuracy of VISReg in 4.7× fewer epochs, and reaches a final accuracy 1.8% better than VISReg (Figure 1 and § 3.1 ). It uses the same training hyper-parameters as VISReg, with no additional search. Finally, we show that the magnitude of embeddings obtained with our approach, serves as a confidence score and reliably detects out-of-domain images without any labels (§ 3.3 ). Related work is discussed in Sec. A.
Methods
SIGReg cannot detect collapsed embeddings
Consider Eq. (1) with the number of views ν = 1 \nu=1 ν = 1 . SIGReg is a test statistic for the null hypothesis that u 1 , … , u ℓ u_1,\ldots,u_\ell u 1 , … , u ℓ are independent samples from N ( 0 , I d × d ) \mathcal{N}(0,I_{d \times d}) N ( 0 , I d × d ) . Suppose a batch of embeddings consists of u i = B z i u_i=Bz_i u i = B z i where B ∈ R d × r B\in\mathbb{R}^{d\times r} B ∈ R d × r is a uniformly random matrix with orthonormal columns and z i ∈ R r z_i\in\mathbb{R}^r z i ∈ R r for i = 1 , … , ℓ i=1,\ldots,\ell i = 1 , … , ℓ . This batch has a rank of at most r r r . If we minimize SIGReg using gradient descent on z i z_i z i initialized from z i ∼ N ( 0 , I r × r ) z_i\sim\mathcal{N}(0,I_{r\times r}) z i ∼ N ( 0 , I r × r ) , we can obtain batches of rank at most r r r that are deemed maximally similar to an isotropic Gaussian distribution by SIGReg. Embeddings that have an isotropic Gaussian distribution by construction act as controls for this experiment. If the Epps–Pulley statistic in SIGReg accepts such batches at a level say 0.05, this would show that SIGReg can lead to collapsed embeddings, not distributed as an isotropic Gaussian.
Figure 2a,c show that SIGReg deems embeddings with rank as little as 75% of the embedding dimension as having an isotropic Gaussian distribution. In fact, the values of SIGReg for such batches are lower than on any of the control batches, e.g., pink histogram in Figure 2 a with rank r = 48 r=48 r = 48 for d = 64 d=64 d = 64 . Even when the embeddings span only a 32-dimensional subspace out of d = 64 d=64 d = 64 dimensions, SIGReg accepts 90% of such batches as being isotropic. Figure 2 d shows that using more slices k k k does not make the test more discriminative, but using a larger batch size ℓ \ell ℓ does.
Figure 2. SIGReg cannot sufficiently distinguish between samples of an isotropic Gaussian distribution and rank-collapsed embeddings that minimize SIGReg. The criteria are shown as ratios relative to their mean values on the control batches. (a) SIGReg computed on 1000 control batches of b = 256 b = 256 b = 256 samples of N ( 0 , I 64 × 64 ) \mathcal{N}(0, I_{64 \times64}) N ( 0 , I 64 × 64 ) (gray) and on batches restricted to r = 48 r = 48 r = 48 (pink) and r = 32 r = 32 r = 32 (yellow) dimensions. The Epps–Pulley statistic in SIGReg accepts all the pink batches and 90% of the yellow batches. (b) The angular penalty ℓ u ^ \ell_{\hat{u}} ℓ u ^ in Eq. (5) on the same batches as in (a). It correctly rejects the rank-collapsed embeddings. (c) SIGReg and the angular penalty ℓ u ^ \ell_{\hat{u}} ℓ u ^ , each minimized over batches in an r r r -dimensional subspace. The dashed lines indicate the acceptance thresholds at the 95th percentile of the respective quantity. The angular penalty rejects low-rank embeddings. Both criteria grow as r r r decreases. (d) SIGReg, as in (c), for r = 48 r = 48 r = 48 , computed for different numbers of slices K \mathcal{K} K against the batch size ℓ \ell ℓ . Only with a large enough batch size ℓ = 1024 \ell= 1024 ℓ = 1024 , SIGReg correctly rejects the rank-collapsed embeddings.
Proposition B.1 explains this observation. We consider embeddings sampled from N ( 0 , Σ ) \mathcal{N}(0,\Sigma) N ( 0 , Σ ) where Σ ∈ R d × d \Sigma\in\mathbb{R}^{d\times d} Σ ∈ R d × d has r r r nonzero eigenvalues, all equal to d / r d/r d / r . We show that the expected SIGReg on such embeddings exceeds its expectation on control batches by a term that grows with the batch size ℓ \ell ℓ . For intuition, consider projections of the ℓ \ell ℓ embeddings along a particular slice. The variance of projections along a slice a a a is a ⊤ Σ a a^\top\Sigma a a ⊤ Σ a . We show that the variance of this quantity across random slices a a a equals 2 ( d − r ) / ( r ( d + 2 ) ) 2(d-r)/(r(d+2)) 2 ( d − r ) / ( r ( d + 2 )) . The empirical variance of ℓ \ell ℓ samples of N ( 0 , 1 ) \mathcal{N}(0,1) N ( 0 , 1 ) has variance about 2 / ℓ 2/\ell 2/ ℓ . Therefore, SIGReg can identify non-isotropic embeddings if
2 ( d − r ) / ( r ( d + 2 ) ) 2(d-r)/(r(d+2)) 2 ( d − r ) / ( r ( d + 2 )) and 2 / ℓ 2/\ell 2/ ℓ are significantly different from each other. These quantities do not depend on the number of slices K \mathcal{K} K , which explains why the discriminative ability of SIGReg does not improve with a larger K \mathcal{K} K . This also shows why the two quantities can differ a lot for large batch sizes ℓ \ell ℓ . For a fixed ratio r / d r/d r / d , the first variance falls as 1 / d 1/d 1/ d . Therefore, SIGReg is less discriminative for higher-dimensional embeddings. For example, at d = 256 d = 256 d = 256 , the test accepts a batch of embeddings where 75% of the dimensions are collapsed.
This failure of SIGReg also manifests in LeJEPA training. As Figure 1 shows, LeJEPA embeddings are anisotropic. In Remark B.1, we measure this anisotropy using a quantity called the participation ratio, which is the effective dimensionality of the embeddings. It is d d d only for isotropic embeddings. Figure B.1 shows that throughout training, the participation ratio of LeJEPA embeddings is much smaller than d d d .
A polar decomposition of the isotropic Gaussian regularization
The magnitude and direction of embeddings with an isotropic Gaussian distribution are independent of each other. In this section, we calculate analytical expressions for the marginal distributions of the magnitude and direction of such embeddings. This will enable us to enforce the isotropic Gaussian regularization more precisely.
Theorem 1 (Polar decomposition of an isotropic Gaussian). For u ∈ R d u \in\mathbb{R}^{d} u ∈ R d , let ν = ρ u ^ \nu= \rho\hat{u} ν = ρ u ^ where ρ = ∥ u ∥ \rho= \lVert u \rVert ρ = ∥ u ∥ is the magnitude and u ^ = u / ∥ u ∥ \hat{u} = u/\lVert u \rVert u ^ = u / ∥ u ∥ is a unit vector. A nonzero random vector u ∼ N ( 0 , I d × d ) u \sim\mathcal{N}(0, I_{d \times d}) u ∼ N ( 0 , I d × d ) if and only if (i) ρ \rho ρ is distributed according to the χ d \chi_d χ d distribution, (ii) u ^ \hat{u} u ^ is uniform on the ( d − 1 ) (d - 1) ( d − 1 ) -dimensional sphere S d − 1 S^{d-1} S d − 1 , and (iii) ρ \rho ρ and u ^ \hat{u} u ^ are independent.
Section B.2 provides the proof. Thm. 1 shows that, for embeddings u u u to be samples of an isotropic Gaussian, the marginal distribution of the magnitude must be χ d \chi_d χ d , while their directions should be distributed uniformly on the ( d − 1 ) (d-1) ( d − 1 ) -dimensional sphere. By the third condition, magnitudes and directions are independent random variables, that is, every direction has the same marginal of the magnitudes, and vice versa. For intuition, note that for large d d d , the distribution χ d \chi_d χ d concentrates around d \sqrt{d} d , that is, the embeddings lie on a thin shell. Two points sampled independently and uniformly on a ( d − 1 ) (d-1) ( d − 1 ) -dimensional sphere are nearly orthogonal for large d d d . Their inner product has mean zero and variance 1 / d 1/d 1/ d .
Using Thm. 1, we can set the regularization term in Eq. (1) to be
Ω = λ ρ ℓ ρ ( θ ) + λ u ^ ℓ u ^ ( θ ) + λ ⊥ ℓ ⊥ ( θ ) (2) \Omega= \lambda_{\rho}\ell_{\rho}(\theta) + \lambda_{\hat{u}}\ell_{\hat{u}}(\theta) + \lambda_{\perp}\ell_{\perp}(\theta) \tag*{(2)} Ω = λ ρ ℓ ρ ( θ ) + λ u ^ ℓ u ^ ( θ ) + λ ⊥ ℓ ⊥ ( θ ) (2)
where ℓ ρ \ell_{\rho} ℓ ρ and ℓ u ^ \ell_{\hat{u}} ℓ u ^ enforce the conditions on the marginals of the magnitude and the direction, respectively, and ℓ ⊥ \ell_{\perp} ℓ ⊥ enforces their independence. The coefficients λ ρ \lambda_{\rho} λ ρ , λ u ^ \lambda_{\hat{u}} λ u ^ and λ ⊥ \lambda_{\perp} λ ⊥ are hyper-parameters that we will discuss later. We will refer to Eq. (2) with λ ⊥ = 0 \lambda_{\perp} = 0 λ ⊥ = 0 as Ω P o l a r R e g - n a i v e \Omega_{\mathrm{PolarReg\text{-}naive}} Ω PolarReg - naive .
The marginals in Thm. 1 can be matched using any reasonable notion of divergence between two distributions. Since these constraints are enforced during training using empirical distributions of the embeddings, they need to scale well—both statistically and computationally—with the batch size ℓ \ell ℓ and dimensionality d d d . We next discuss how to impose these constraints using only scalar quantities.
The magnitude regularizer ℓ ρ \ell_{\rho} ℓ ρ .
For two probability distributions supported on a one-dimensional space, the 2Wasserstein distance W 2 W_2 W 2 is the ℓ 2 \ell^2 ℓ 2 distance between the inverses of their cumulative distribution functions (CDFs) [41 Theorem 2.18] . It is zero if and only if the two distributions are equal [41 Theorem 7.3] . Suppose we have n n n samples z = ( z 1 , … , z n ) z=(z_1,\ldots,z_n) z = ( z 1 , … , z n ) with each scalar z i ∼ P z_i\sim P z i ∼ P . We can compute a differentiable approximation of W 2 2 ( P , Q ) W_2^2(P,Q) W 2 2 ( P , Q ) given by,
W 2 2 ( z , Q ) = 1 n ∑ r = 1 n ( z ( r ) − q r ) 2 , (3) W_2^2(z,Q)=\frac{1}{n}\sum_{r=1}^{n}\left(z_{(r)}-q_r\right)^2, \tag*{(3)} W 2 2 ( z , Q ) = n 1 r = 1 ∑ n ( z ( r ) − q r ) 2 , (3)
where z ( 1 ) ≤ ⋯ ≤ z ( n ) z_{(1)}\leq\cdots\leq z_{(n)} z ( 1 ) ≤ ⋯ ≤ z ( n ) is the sorted sequence and q r = F Q − 1 ( ( r − 1 / 2 ) / n ) q_r=F_Q^{-1}((r-1/2)/n) q r = F Q − 1 (( r − 1/2 ) / n ) is the r r r -th of n n n midpoint quantiles of the target distribution with CDF F Q F_Q F Q . It is therefore straightforward to enforce ρ ∼ χ d \rho\sim\chi_d ρ ∼ χ d in Thm. 1, using the 2-Wasserstein distance. We apply Eq. (3) to the magnitudes ρ i v = ∥ u i v ∥ \rho_i^v=\lVert u_i^v\rVert ρ i v = ∥ u i v ∥ of the embeddings in the batch, for all ℓ \ell ℓ images and ν \nu ν views, with target χ d \chi_d χ d ,
ℓ ρ ( θ ) = 1 ℓ ν ∑ r = 1 ℓ ν ( ρ ( r ) − q r ) 2 , (4) \ell_\rho(\theta)=\frac{1}{\ell\nu}\sum_{r=1}^{\ell\nu}\left(\rho_{(r)}-q_r\right)^2, \tag*{(4)} ℓ ρ ( θ ) = ℓ ν 1 r = 1 ∑ ℓ ν ( ρ ( r ) − q r ) 2 , (4)
where ρ ( r ) \rho_{(r)} ρ ( r ) is the r r r -th smallest magnitude and q r q_r q r is the r r r -th quantile of χ d \chi_d χ d .
The angular regularizer ℓ u ^ \ell_{\hat{u}} ℓ u ^ . We show in Thm. B.2 that directions u ^ \hat{u} u ^ are uniformly distributed on the sphere if and only if the inner product of two independent directions follows a distribution C d C_d C d with density proportional to ( 1 − s 2 ) ( d − 3 ) / 2 (1-s^2)^{(d-3)/2} ( 1 − s 2 ) ( d − 3 ) /2 on [ − 1 , 1 ] [-1,1] [ − 1 , 1 ] . Equivalently, ( 1 + s ) / 2 ∼ Beta ( β , β ) (1+s)/2\sim\operatorname{Beta}(\beta,\beta) ( 1 + s ) /2 ∼ Beta ( β , β ) with β = ( d − 1 ) / 2 \beta=(d-1)/2 β = ( d − 1 ) /2 . The quantiles of C d C_d C d are therefore those of Beta ( β , β ) \operatorname{Beta}(\beta,\beta) Beta ( β , β ) , rescaled to [ − 1 , 1 ] [-1,1] [ − 1 , 1 ] . We can enforce the embedding directions to be uniform on the sphere by matching the pairwise inner products C d C_d C d . Since different views of an image are not independent, we compute this regularizer on the directions m ^ i \hat{m}_i m ^ i of the mean embeddings m i m_i m i over the ν \nu ν views of each image i i i . Let s i j = ⟨ m ^ i , m ^ j ⟩ s_{ij}=\langle\hat{m}_i,\hat{m}_j\rangle s ij = ⟨ m ^ i , m ^ j ⟩ be the inner product between the directions of the mean embeddings of images i i i and j j j , for i < j i<j i < j . We set the angular regularizer to the squared 2-Wasserstein distance Eq. (3) between these inner products and the target distribution C d C_d C d :
ℓ u ^ ( θ ) = 2 ℓ ( ℓ − 1 ) ∑ r = 1 ℓ ( ℓ − 1 ) / 2 ( s ( r ) − q r ) 2 , (5) \ell_{\hat{u}}(\theta)=\frac{2}{\ell(\ell-1)}\sum_{r=1}^{\ell(\ell-1)/2}\left(s_{(r)}-q_r\right)^2, \tag*{(5)} ℓ u ^ ( θ ) = ℓ ( ℓ − 1 ) 2 r = 1 ∑ ℓ ( ℓ − 1 ) /2 ( s ( r ) − q r ) 2 , (5)
where s ( r ) s_{(r)} s ( r ) is the r r r -th smallest inner product and q r q_r q r here is the r r r -th quantile of C d C_d C d .
The independence regularizer ℓ ⊥ \ell_\perp ℓ ⊥ . Since magnitudes ρ \rho ρ and directions u ^ \hat{u} u ^ have different dimensions, we enforce independence using the maximum mean discrepancy (MMD) between their joint distribution and the product of their marginals [18 , 19 ] . Let κ ρ ( ρ , ρ ′ ) = exp ( − ( ρ − ρ ′ ) 2 / ( 2 σ ρ 2 ) ) \kappa_\rho(\rho,\rho')=\exp\left(-(\rho-\rho')^2/(2\sigma_\rho^2)\right) κ ρ ( ρ , ρ ′ ) = exp ( − ( ρ − ρ ′ ) 2 / ( 2 σ ρ 2 ) ) and κ u ^ ( u ^ , u ^ ′ ) = exp ( − ∥ u ^ − u ^ ′ ∥ 2 / ( 2 σ u ^ 2 ) ) \kappa_{\hat{u}}(\hat{u},\hat{u}')=\exp\left(-\lVert\hat{u}-\hat{u}'\rVert^2/(2\sigma_{\hat{u}}^2)\right) κ u ^ ( u ^ , u ^ ′ ) = exp ( − ∥ u ^ − u ^ ′ ∥ 2 / ( 2 σ u ^ 2 ) ) be Gaussian kernels, and let κ ( ( ρ , u ^ ) , ( ρ ′ , u ^ ′ ) ) = κ ρ ( ρ , ρ ′ ) κ u ^ ( u ^ , u ^ ′ ) \kappa((\rho,\hat{u}),(\rho',\hat{u}'))=\kappa_\rho(\rho,\rho')\kappa_{\hat{u}}(\hat{u},\hat{u}') κ (( ρ , u ^ ) , ( ρ ′ , u ^ ′ )) = κ ρ ( ρ , ρ ′ ) κ u ^ ( u ^ , u ^ ′ ) . Let P P P be the joint distribution of ( ρ , u ^ ) (\rho,\hat{u}) ( ρ , u ^ ) and P ρ P u ^ P_\rho P_{\hat{u}} P ρ P u ^ the product of its marginals. The squared MMD between them is
MMD 2 = E [ κ ( z , z ′ ) ] + E [ κ ( w , w ′ ) ] − 2 E [ κ ( z , w ) ] , (6) \operatorname{MMD}^2=\mathbb{E}\left[\kappa(z,z')\right]+\mathbb{E}\left[\kappa(w,w')\right]-2\mathbb{E}\left[\kappa(z,w)\right], \tag*{(6)} MMD 2 = E [ κ ( z , z ′ ) ] + E [ κ ( w , w ′ ) ] − 2 E [ κ ( z , w ) ] , (6)
where z , z ′ ∼ P z,z'\sim P z , z ′ ∼ P and w , w ′ ∼ P ρ P u ^ w,w'\sim P_\rho P_{\hat{u}} w , w ′ ∼ P ρ P u ^ are independent. MMD 2 \operatorname{MMD}^2 MMD 2 is zero if and only if P = P ρ P u ^ P=P_\rho P_{\hat{u}} P = P ρ P u ^ , i.e., if and only if ρ \rho ρ and u ^ \hat{u} u ^ are independent [37 Section 2.3] . We compute the expectations in Eq. (6) separately for each view v v v , over distinct images i i i and j j j in the batch. Let K i j v = κ ρ ( ρ i v , ρ j v ) K_{ij}^v=\kappa_\rho(\rho_i^v,\rho_j^v) K ij v = κ ρ ( ρ i v , ρ j v ) and L i j v = κ u ^ ( u ^ i v , u ^ j v ) L_{ij}^v=\kappa_{\hat{u}}(\hat{u}_i^v,\hat{u}_j^v) L ij v = κ u ^ ( u ^ i v , u ^ j v ) for i ≠ j i\ne j i = j . We set
ℓ ⊥ ( θ ) = 1 ν ∑ v = 1 ν [ ( ℓ − 2 ) ! ℓ ! ∑ i , j K i j v L i j v + ( ℓ − 4 ) ! ℓ ! ∑ i , j , p , q K i j v L p q v − 2 ( ℓ − 3 ) ! ℓ ! ∑ i , j , p K i j v L i p v ] , (7) \ell_\perp(\theta)=\frac{1}{\nu}\sum_{v=1}^{\nu}\left[\frac{(\ell-2)!}{\ell!}\sum_{i,j}K_{ij}^vL_{ij}^v+\frac{(\ell-4)!}{\ell!}\sum_{i,j,p,q}K_{ij}^vL_{pq}^v-\frac{2(\ell-3)!}{\ell!}\sum_{i,j,p}K_{ij}^vL_{ip}^v\right], \tag*{(7)} ℓ ⊥ ( θ ) = ν 1 v = 1 ∑ ν [ ℓ ! ( ℓ − 2 )! i , j ∑ K ij v L ij v + ℓ ! ( ℓ − 4 )! i , j , p , q ∑ K ij v L pq v − ℓ ! 2 ( ℓ − 3 )! i , j , p ∑ K ij v L i p v ] , (7)
where each sum runs over pairwise distinct indices. The bandwidths σ ρ \sigma_\rho σ ρ and σ u ^ \sigma_{\hat{u}} σ u ^ are chosen as the median pairwise distances in the batch, and ℓ ⊥ \ell_\perp ℓ ⊥ does not backpropagate through them or the magnitudes ρ \rho ρ , see Sec. C.1.
Does this modified regularizer improve discriminative ability compared to SIGReg? Remark B.3 shows that on control batches in d d d dimensions, the average squared inner product between pairs of directions is 1 / d 1/d 1/ d in expectation, with standard deviation ∼ 2 / ( d ℓ ) \sim2/(d\ell) ∼ 2/ ( d ℓ ) . If the embeddings span r < d r<d r < d dimensions, it is at least ( ℓ / r − 1 ) / ( ℓ − 1 ) (\ell/r-1)/(\ell-1) ( ℓ / r − 1 ) / ( ℓ − 1 ) . This bounds the angular regularizer from below, so even at small batch sizes, it stays far above its values on control batches, however the directions are arranged. In Figure 2 b, the angular regularizer rejects every collapsed batch of embeddings that SIGReg accepts. In Figure 2 c, the angular regularizer, minimized over lower-rank batches as in § 2.1 , remains discriminative for all ranks r r r .
The angular term can easily detect duplicated images in a batch. We show in Remark B.2 that if a fraction p p p of the embeddings are the same in a batch, SIGReg grows only by a factor 1 + 2 p 1+2p 1 + 2 p irrespective of the number of slices or batch size. Section D.2 helps put this into perspective, if there is one repeated image in a batch of size ℓ = 256 \ell=256 ℓ = 256 for d = 64 d=64 d = 64 dimensional embeddings, SIGReg only increases 0.8% while the angular regularizer increases 6.2 times. This is important in practice because large image datasets often contain duplicates [32 ] .
The modified regularizer, PolarReg-naive, performs better than SIGReg. Table 1 compares SIGReg with two versions of Eq. (2) ; one with all three kinds of penalties (PolarReg-naive + Independence), and one without the independence penalty, λ ⊥ = 0 \lambda_\perp=0 λ ⊥ = 0 (PolarReg-naive). It reports the accuracy of linear probing on ImageNet-100, the indedence measure between embedding magnitude and direction, and how much faster each reaches the final accuracy of SIGReg. With all three penalties, accuracy is higher than with SIGReg, magnitudes and directions are more independent, and training is 1.3× faster. Surprisingly, without the independence regularizer, accuracy improves further, and training is 1.5× faster than SIGReg. As expected, MMD2 ^2 2 is much higher without the independence regularizer. We will exploit this observation further. The following section argues that independence between magnitudes and directions is not necessary, and is in fact the wrong constraint to enforce.
Table 1. SIGReg compared with two variants of Eq. (2) , with and without the independence penalty. Average linear probing accuracy for a ViT-B trained on ImageNet-100 for 100 epochs with d = 256 d = 256 d = 256 , over 3 seeds. MMD2 ^2 2 is reported here after dividing by its standard deviation over random shuffles of the magnitudes across images. This makes it comparable across methods (see Sec. C.1).
Embedding magnitudes and directions should not be independent of each other
We show in Proposition B.2 that if all views of an image i i i have the same magnitude ρ i \rho_i ρ i , the alignment term in LeJEPA is proportional to ∑ i ρ i 2 D i \sum_i \rho_i^2 D_i ∑ i ρ i 2 D i . Here D i = ∑ v ∥ u ^ i v − u ˉ i ∥ 2 D_i = \sum_v \lVert\hat{\mathbf{u}}_i^v - \bar{\mathbf{u}}_i \rVert^2 D i = ∑ v ∥ u ^ i v − u ˉ i ∥ 2 is the view disagreement of image i i i and u ^ i = u i / ρ i \hat{\mathbf{u}}_i = \mathbf{u}_i / \rho_i u ^ i = u i / ρ i are the directions of the views and u ˉ i \bar{\mathbf{u}}_i u ˉ i is their mean over v v v views. The view disagreement D i D_i D i varies with the embedding direction. It is large for ambiguous images that typically lie in between two semantically distinct classes, and it is small for embeddings that lie near their class centroid. Since swapping the magnitudes of two images does not alter the distribution of the magnitudes, the alignment term is minimized only when images with larger view disagreement get smaller magnitude embeddings. This, in effect, makes the magnitude and direction dependent on each other. Conceptually, this dependence encodes the structure in the data learned during self-supervised learning. Enforcing the embeddings to have an isotropic Gaussian distribution prevents this structure from crystallizing during training.
Figure 3a,b show that in encoders trained with SIGReg and PolarReg, the magnitude of an embedding falls as its angle to the mean embedding of its class grows. Additionally, images with larger view disagreement lie at larger angles, and at a given angle, they have smaller magnitudes. Figure B.2 shows that images with larger view disagreement consequently get less weight in the alignment term. Figure 3 c and d measure these trends over whole datasets. In (c), averaged over classes, the magnitude falls as the angle to
Figure 3. Dependence of embedding magnitude and direction in trained encoders. (a) and (b) are polar charts where, each point is an image from a six class subset of ImageNet-1k. A point lies at the magnitude of the image embedding and at its angle from the mean embedding of its class, which is at 0°. Color shows the view disagreement D i D_i D i of each image, and the black arc marks magnitude d \sqrt{d} d . The embeddings are from ViT-B encoders trained on ImageNet-1k with d = 256 d = 256 d = 256 . (a) Embeddings from SIGReg, same encoder as Figure 1 (left). (b) Embeddings from PolarReg. (c) Within each class, embeddings are split in terms of quantiles of their relative angle to the mean embedding of the class. This plot shows the mean magnitude for each such quantile, averaged over classes. For both methods, the magnitude falls with increasing relative angle. (d) Mean magnitude of image embeddings for different quantiles of view disagreement. We use 10,000 validation images of Tiny-ImageNet-200 with d = 64 d = 64 d = 64 dimensional embeddings and υ = 8 \upsilon= 8 υ = 8 augmented views.
Figure 3a.
Figure 3b.
Figure 3c.
Figure 3d.
the class mean grows, for both SIGReg and PolarReg-naive on three datasets. In (d), on Tiny-ImageNet-200, it falls as the view disagreement grows. Just like Figure 1 , these results further corroborate our findings in § 2.1 . SIGReg embeddings are anisotropic, their magnitudes depend strongly on the directions. Section B.4 discusses Proposition B.2 and verifies its assumption on trained encoders.
We therefore keep only the magnitude and angular regularizers and drop the independence term. We prove in Remark B.4 that forgoing the independence term cannot result in collapsed embeddings. To elaborate, if the embedding magnitudes are distributed as χ d \chi_d χ d and directions are uniform on the sphere, we show that every eigenvalue of the second-moment matrix of the embeddings is within 2 / d 2/\sqrt{d} 2/ d of 1, i.e., the embeddings do not collapse, whatever the dependence between magnitude and direction.
Making PolarReg-naive independent of the batch size, embedding dimension and scale
The optimal coefficients λ ρ \lambda_\rho λ ρ and λ u ^ \lambda_{\hat{u}} λ u ^ depend on the batch size ℓ \ell ℓ , embedding dimension d d d , and the structure in the data. For example, when the embeddings are isotropic Gaussian, the angular penalty converges to zero as 1 / ℓ 2 1/\ell^2 1/ ℓ 2 [7 Theorems 5.1 and 5.9] . Thus, a coefficient tuned on large batch sizes is stronger than necessary on small ones (Sec. C.2). It is possible to tune the coefficients once and scale them heuristically to be effective across different datasets. For example, we tuned λ u ^ = 20 \lambda_{\hat{u}}=20 λ u ^ = 20 and λ ρ = 0.045 \lambda_\rho=0.045 λ ρ = 0.045 on Tiny-ImageNet-200 with ℓ = 256 \ell=256 ℓ = 256 and d = 64 d=64 d = 64 (see the ablation in Tab. C.1). Section C.2 shows that for a new setting, we can rescale both coefficients so that the gradient norms of the alignment term and the two regularizers, with respect to the embeddings, keep their ratios from our original tuned setting.
We can develop the key ideas of PolarReg-naive to obtain a more robust approach. Equations (4) and (5) are minimized when the r r r -th smallest magnitude or inner product equals the r r r -th quantile of χ d \chi_d χ d or C d C_d C d , respectively. So at each iteration, we can compute targets u i v ∗ u_i^{v*} u i v ∗ for embeddings u i v u_i^v u i v and move the latter towards the former. Since both penalties are quadratic in the magnitudes and inner products, doing so is easy. We discuss this idea next, see Sec. B.5.1 for more details.
Moving the embedding magnitudes. A batch has ℓ v \ell v ℓ v embeddings, one for each image view. Suppose ρ i v \rho_i^v ρ i v is the r r r -th smallest of their magnitudes and q i v q_i^v q i v is the r r r -th quantile of χ d \chi_d χ d . We set the “target” magnitude for u i v u_i^v u i v to
∀ i , v : ρ i v ∗ = ρ i v + η ρ ( q i v − ρ i v ) , (8) \forall i,v:\quad\rho_i^{v*}=\rho_i^v+\eta_\rho(q_i^v-\rho_i^v), \tag*{(8)} ∀ i , v : ρ i v ∗ = ρ i v + η ρ ( q i v − ρ i v ) , (8)
where η ρ \eta_\rho η ρ is a step size. The rationale behind this is that minimizing the alignment term in Eq. (1) reduces the magnitudes of the embeddings (see § 2.3 ). Therefore, in practice, we use η ρ > 1 \eta_\rho>1 η ρ > 1 to keep the target magnitude past the target quantile q i v q_i^v q i v .
Moving the embedding directions. Inner products cannot be moved to their target quantiles individually, since the direction of the mean of each image m ^ i \hat{m}_i m ^ i affects ℓ − 1 \ell-1 ℓ − 1 inner products in Eq. (5) . In general, when ℓ > 2 d − 1 \ell>2d-1 ℓ > 2 d − 1 , there might not be a set of directions m ^ 1 , … , m ^ ℓ \hat{m}_1,\ldots,\hat{m}_\ell m ^ 1 , … , m ^ ℓ with inner products all equal to their respective quantiles because there are ℓ ( ℓ − 1 ) / 2 \ell(\ell-1)/2 ℓ ( ℓ − 1 ) /2 inner products to match and only ℓ ( d − 1 ) \ell(d-1) ℓ ( d − 1 ) free coordinates for the directions.
Suppose s i j s_{ij} s ij be the r r r -th smallest inner product and q i j q_{ij} q ij be the r r r -th quantile of C d C_d C d . We want to find vectors Δ i ∈ R d \Delta_i\in\mathbb{R}^d Δ i ∈ R d to ensure that the new directions
∀ i : m ^ i ∗ ∝ m ^ i + η u ^ Δ i (9) \forall i:\ \hat{m}_i^*\propto\hat{m}_i+\eta_{\hat{u}}\Delta_i \tag*{(9)} ∀ i : m ^ i ∗ ∝ m ^ i + η u ^ Δ i (9)
have inner products s i j ∗ = ⟨ m ^ i ∗ , m ^ j ∗ ⟩ s_{ij}^*=\langle\hat{m}_i^*,\hat{m}_j^*\rangle s ij ∗ = ⟨ m ^ i ∗ , m ^ j ∗ ⟩ that minimize Eq. (5) . Again we have used a step size η u ^ \eta_{\hat{u}} η u ^ to provide us a tuning knob to balance the angular penalty against the alignment term. Since m ^ i \hat{m}_i m ^ i and m ^ i ∗ \hat{m}_i^* m ^ i ∗ are unit vectors that lie on a sphere, the step Δ i \Delta_i Δ i must be tangent to the sphere at m ^ i \hat{m}_i m ^ i , that is, Δ i ⊥ m ^ i \Delta_i\perp\hat{m}_i Δ i ⊥ m ^ i . We show in Sec. B.5.1 how to exploit the Riemannian structure of the sphere to choose Δ i = α q i \Delta_i=\alpha q_i Δ i = α q i , where q i q_i q i is proportional to the descent direction of the angular penalty on the sphere and α \alpha α is a scalar that depends on the Hessian of Eq. (5) . Proposition B.3b shows how this step is independent of the batch size, embedding dimension and scale of the embeddings. It also discusses how to compute such an α \alpha α efficiently.
Simplifying the regularizer to PolarReg. Now that we know the target magnitude ρ i v ∗ \rho_i^{v*} ρ i v ∗ of each view and the target direction m ^ i ∗ \hat{m}_i^* m ^ i ∗ of each image, we can find a target embedding for each view
u i v ∗ = ρ i v ∗ ( u i v + d i ∥ u i v + d i ∥ ) , u_i^{v*}=\rho_i^{v*}\left(\frac{u_i^v+d_i}{\lVert u_i^v+d_i\rVert}\right), u i v ∗ = ρ i v ∗ ( ∥ u i v + d i ∥ u i v + d i ) ,
where adding d i = ∥ m i ∥ m ^ i ∗ − m i d_i=\lVert m_i\rVert\hat{m}_i^* - m_i d i = ∥ m i ∥ m ^ i ∗ − m i to every view of image i i i moves the direction of their mean embedding from m ^ i \hat{m}_i m ^ i to m ^ i ∗ \hat{m}_i^* m ^ i ∗ , without changing its magnitude ∥ m i ∥ \lVert m_i\rVert ∥ m i ∥ . It also maintains the offset of each view from the mean. Altogether, Ω P o l a r R e g − n a i v e \Omega_{\mathrm{PolarReg-naive}} Ω PolarReg − naive is replaced by
\Omega_{\mathrm{PolarReg}}=\frac{1}{\ell vd}\sum_{i=1}^{\ell}\sum_{v=1}^{v}\left\lVert u_i^v-\operatorname{stop\mathchar`-grad}(u_i^{v*})\right\rVert^2, \tag*{(10)}
where stop-grad means that no gradient is backpropagated through the target u i v ∗ u_i^{v*} u i v ∗ . Recall that Ω P o l a r R e g − n a i v e \Omega_{\mathrm{PolarReg-naive}} Ω PolarReg − naive sets λ ⊥ = 0 \lambda_\perp=0 λ ⊥ = 0 in Eq. (2) and does not use the independence penalty.
Proposition B.3c shows that, to first order in the difference u i v − u i v ∗ u_i^v-u_i^{v*} u i v − u i v ∗ between each embedding and its target, the gradient of Ω P o l a r R e g \Omega_{\mathrm{PolarReg}} Ω PolarReg is the same as that of Ω P o l a r R e g − n a i v e \Omega_{\mathrm{PolarReg-naive}} Ω PolarReg − naive . It also discusses how, if PolarReg-naive were implemented as written, a gradient step on ℓ u ^ \ell_{\hat{u}} ℓ u ^ in Eq. (5) also changes the magnitudes of the embeddings. This makes choosing the coefficients λ ρ \lambda_\rho λ ρ and λ u ^ \lambda_{\hat{u}} λ u ^ more difficult. By exploiting the Riemannian structure in Eq. (9) , we decouple the two step sizes; η ρ \eta_\rho η ρ only changes the target magnitudes, and η u ^ \eta_{\hat{u}} η u ^ the target directions. Proposition B.3d shows that the gradient of Ω P o l a r R e g \Omega_{\mathrm{PolarReg}} Ω PolarReg is zero if and only if the gradients of both ℓ ρ \ell_\rho ℓ ρ and ℓ u ^ \ell_{\hat{u}} ℓ u ^ are zero. Proposition B.3e shows that its gradient is also bounded by the magnitudes of the mean embeddings and absolute differences between the magnitudes and their target quantiles. The gradient of ℓ u ^ \ell_{\hat{u}} ℓ u ^ in PolarReg-naive instead scales with 1 / ∥ m i ∥ 1/\lVert m_i\rVert 1/ ∥ m i ∥ . Hence, Ω P o l a r R e g \Omega_{\mathrm{PolarReg}} Ω PolarReg needs no gradient clipping (see Sec. C.3), and, unlike coefficients λ ρ \lambda_{\rho} λ ρ and λ u ^ \lambda_{\hat{u}} λ u ^ in Eq. (2) , the step sizes η ρ \eta_{\rho} η ρ and η u ^ \eta_{\hat{u}} η u ^ do not need to change with batch size, embedding dimension or magnitudes of the embeddings. We set η u ^ = 2 \eta_{\hat{u}} = 2 η u ^ = 2 and η ρ = 3 \eta_{\rho} = 3 η ρ = 3 for all experiments in this paper. Therefore PolarReg is robust to hyper-parameters. Section D.3 shows that, with these fixed step sizes, PolarReg outperforms PolarReg-naive in every setting, and that its accuracy changes little when either step size changes.
Experimental Results
In this section, we discuss results obtained using PolarReg on a number of benchmark datasets. Additionally, we show that PolarReg can be easily used for multi-modal learning and that the embedding magnitude can be used as a confidence score and to reliably detect out-of-domain images.
PolarReg learns better features than sliced objectives in 4.7× fewer epochs
Table 1 showed that on ImageNet-100, PolarReg-naive obtains a higher accuracy than SIGReg (81.00% against 78.92%) and that it reaches the final accuracy of SIGReg in 1.5× fewer epochs. In the same setting, PolarReg (not in table) reaches a final accuracy of 82.42% and matches the final accuracy of SIGReg with 1.8× fewer epochs.
On larger datasets like ImageNet-1k, PolarReg reaches the linear probing accuracy of sliced objectives with about 4.7× fewer epochs (see Table 2 ). We train ViT-B and L architectures with the same training hyper-parameters as VISReg; Sec. C.4 provides training and evaluation details. A ViT-B encoder trained with PolarReg for 100 epochs performs about the same as VISReg trained for 400 epochs. It exceeds LeJEPA trained for 100 epochs by 3.4%. A ViT-L encoder trained with PolarReg for 100 epochs exceeds VISReg trained for 400 epochs, and is 1.6% above both VISReg and LeJEPA trained for 100 epochs. When trained for 400 epochs it is 1.8% above VISReg trained for 400 epochs. PolarReg shows consistent scaling behavior across model sizes (ViT-B to L) and training length (100 to 400 epochs).
Table 2. PolarReg reaches the classification accuracy of sliced objectives with a quarter of the epochs. Linear probing accuracy (%) on ImageNet-1k and smaller datasets, using frozen features of encoders pretrained on ImageNet-1k. The classifier is trained for 100 epochs on ImageNet-1k and 10 epochs on other datasets (details in Sec. C.4). † Denotes that the classifier is trained for 100 epochs for all datasets.
Features of PolarReg encoders on ImageNet-1k transfer quite well to other datasets in Table 2 . In particular, the ViT-B encoder trained with PolarReg for 400 epochs transfers much better than the VISReg or LeJEPA encoders. It is on par with modern SSL methods on ImageNet to CIFAR transfer evaluation. Figure 4 qualitatively analyzes PolarReg features. It shows that they are semantically consistent, and illustrates that the embedding magnitude is smaller for semantically ambiguous images.
Figure 4. Qualitative analysis of the embeddings of a ViT-B encoder pretrained on ImageNet-1k for 400 epochs using Polar-Reg. (a) The first three principal components of the patch features, colored as RGB, separate object parts. (b) Five of the strongest matches between patch features of a photo (left) and a variant from ImageNet-R [22 ] (right). The encoder was pretrained only on photos like those on the left, from ImageNet-1k. (c) Images of black-footed ferrets, sorted by increasing embedding magnitude. Their view disagreement, averaged over draws of 10 augmented views, falls from left to right; these ferrets also look less occluded or ambiguous. (d) Linear probing accuracy on ImageNet-1k is higher on images with larger embedding magnitudes.
PolarReg generalizes across domains, tasks and dataset sizes. Features of PolarReg encoders on ImageNet-1k transfer to six datasets from other domains, such as galaxies, chest X-rays and abdominal CT, and to tasks like semantic segmentation of ADE20K (Tab. D.4). For these tasks, PolarReg performs similar to most other SSL methods, including the sliced objectives. Compared to other methods, PolarReg is also better at pretraining small models on small datasets. A ViT-S/8 encoder pretrained using PolarReg on Galaxy10, with about 16,000 training images, outperforms all other methods in Tab. D.5 at the end of training, and matches other methods with 2× fewer epochs.
PolarReg is more memory and compute efficient than sliced objectives. On a single RTX 4090, computing PolarReg takes ∼0.52 ms for batch sizes ranging from 224 to 1024. It is 4–18× faster than VISReg and 35–164× faster than SIGReg, both computed with 4096 slices. See Sec. D.6 for details. The computation time of PolarReg is bound by GPU kernel launch overhead, whereas sliced objectives are memory-bound with latency that scales with b b b . As shown in Figure 5 , PolarReg forward and backward passes need much less GPU memory, about 0.14 GB at b = 2048 b = 2048 b = 2048 against 2.4 GB for VISReg and 34 GB for SIGReg.
Figure 5. Peak GPU memory usage of the regularizers in a forward and backward pass.
PolarReg generalizes to other modalities, and classifiers trained on one modality can transfer to others
PolarReg can be readily used for other modalities, such as depth images, with the same objective and hyper-parameters. We train one ViT-S/8 encoder per modality on RGB and depth images of TartanAir v2 [33 ] , using only daytime data, and test on both daytime and nighttime data. A linear classifier on frozen features is used to predict the scene (out of 18 scenes) given the RGB or depth image. See Sec. D.4 for details. Figure D.1b shows that the PolarReg depth encoder achieves a classification accuracy of 79.3% on daytime data as opposed to 95.9% for the RGB data. At night, the RGB classifier falls to 30.3%, while the depth classifier is only mildly affected, with an accuracy of 71.6%.
In Fig. D.1b, the two encoders are trained separately, so their features are not aligned. As expected, classifiers trained on RGB encoders perform poorly on depth features. An orthogonal map, fitted on just 8192 unlabeled pairs of daytime RGB and depth samples, can be used to align the features. After doing so, the RGB classifier is almost as accurate on depth encoder features as the depth classifier (75.1% against 79.3% at day, 68.5% against 71.6% at night), without using any depth labels. This shows that separately trained encoders can be aligned with just a few unlabeled pairs. Using PolarReg, one can transfer a classifier trained on one modality to another without ground truth labels.
The embedding magnitude detects out-of-domain images and acts as a confidence score for classification
In Figure 4 c, the ferrets look less ambiguous and have lower view disagreement with rising embedding magnitude. This is demonstrated in Figure 3 and explained further in Proposition B.2, suggesting that the embedding magnitude can be a label-free measure of the semantic ambiguity of an image.
Since images with higher view disagreement get smaller magnitudes, most images unlike the training data should fall in the lower tail of χ d \chi_d χ d . We test this on a ViT-B trained with PolarReg on ImageNet-1k by thresholding the magnitude. We report the AUROC of the fraction of test images it rejects against the fraction of ImageNet-1k validation images it rejects. See Sec. D.1 for details. Table D.1 shows that this detects heavy corruptions (AUROC 0.99 for 8 × 8 8 \times8 8 × 8 block averaging) and out-of-domain images such as galaxies, chest X-rays and retina scans (0.80–0.95). It misses mild blur and contrast changes, to which augmentations make the encoder invariant. This test needs no calibration data. The threshold that rejects a given fraction of in-domain images should be a quantile of χ d \chi_d χ d , known before training.
Images whose augmented views disagree more are often ambiguous, for instance when an object is small, occluded or placed among other objects. We expect images with larger embedding magnitudes to be classified more accurately. We sort the ImageNet-1k validation images by their embedding magnitudes and measure accuracy on different fractions of images with the largest magnitudes. As Figure 4 d shows, keeping fewer images, from all of them to the 10% with the largest magnitude, accuracy of the probe rises monotonically from 76.7% to 91.8%. Hence, the probe is more accurate on images with larger embedding magnitudes.
LLM Usage Statement
We used Claude Code, a coding agent built by Anthropic. The authors wrote the text. The tool proposed edits for grammar, and checked the notation and terms for consistency. The authors reviewed and edited every sentence. The tool implemented and modified scripts for the figures, and parts of the training, evaluation and timing code, following the authors’ specifications. The authors checked every figure and reported evaluation. The tool checked the proofs in the supplementary material, both analytically and numerically. The authors verified every proof. The research questions, methods and conclusions are the authors’ own. No other AI tools were used. The authors take full responsibility for all content in this paper.
Related work
Several variants of LeJEPA [5 ] change its regularizer or its target. VISReg [45 ] matches the sliced projections of SIGReg with a Wasserstein distance. KerJEPA [48 ] replaces the sliced projections with a kernel discrepancy between the embeddings and the target. SPHERE-JEPA [31 ] normalizes the embeddings and changes the target of SIGReg to the uniform distribution on the sphere. UR-JEPA [26 ] changes the target to distributions that concentrate near a low-dimensional subset of the embedding space. Others change the target when domain-specific geometric priors are available [38 ] or to handle multiple modalities [4 ] . We enforce the marginal distributions of an isotropic Gaussian for the magnitude and the direction of the embeddings, without requiring the two to be independent. Our angular penalty is related to losses that make the embedding directions uniform on a sphere [8 , 15 , 29 , 42 ] . A regularizer must also prevent dimensional collapse, where the embeddings end up only in a lower-dimensional subspace [23 , 25 , 28 ] . Such collapse is often measured by the rank or the spectrum of the embeddings [1 , 17 , 39 ] . Many methods prevent it by constraining the covariance of the embeddings [6 , 14 , 44 , 46 ] . PolarReg prevents it by constraining the distributions of the magnitudes and of the pairwise inner products (Remark B.4).
Proofs
Expected value of SIGReg on non-isotropic Gaussian embeddings
For each view, SIGReg tests a batch of embeddings u 1 , … , u b u_1,\ldots,u_b u 1 , … , u b one slice at a time. Along a slice a a a , it compares the empirical characteristic function (ECF) of the embedding projections a ⊤ u 1 , … , a ⊤ u b a^\top u_1,\ldots,a^\top u_b a ⊤ u 1 , … , a ⊤ u b with e − t 2 / 2 e^{-t^2/2} e − t 2 /2 , the characteristic function of N( 0 , 1 ) (0,1) ( 0 , 1 ) (Eq. (1) ). If the embeddings are samples of N( 0 , Σ ) (0,\Sigma) ( 0 , Σ ) , their projections along a slice a a a are samples of N( 0 , a ⊤ Σ a ) (0,a^\top\Sigma a) ( 0 , a ⊤ Σ a ) . So on a slice, the expected value of SIGReg depends on Σ \Sigma Σ only through ϵ a = a ⊤ Σ a − 1 \epsilon_a=a^\top\Sigma a-1 ϵ a = a ⊤ Σ a − 1 , which is zero for control batches. Proposition B.1 computes how large ϵ a \epsilon_a ϵ a is on a random slice, and what this implies for the expectation. Particularly, it formalizes why more slices do not help in differentiating between collapsed and control batches, but more batches do.
Proposition B.1. Let the embeddings be independent samples of N( 0 , Σ ) (0,\Sigma) ( 0 , Σ ) with tr ( Σ ) = d \operatorname{tr}(\Sigma)=d tr ( Σ ) = d , and let ω = ∥ Σ − I ∥ F \omega=\lVert\Sigma-I\rVert_F ω = ∥ Σ − I ∥ F measure how far Σ \Sigma Σ is from isotropic. For Σ \Sigma Σ with r r r equal nonzero eigenvalues, ω 2 / d 2 = 1 / r − 1 / d \omega^2/d^2=1/r-1/d ω 2 / d 2 = 1/ r − 1/ d . Along a uniformly random unit slice a a a , the projections of the embeddings are samples from N( 0 , 1 + ϵ a ) (0,1+\epsilon_a) ( 0 , 1 + ϵ a ) , with E [ ϵ a ] = 0 \mathbb{E}[\epsilon_a]=0 E [ ϵ a ] = 0 and E [ ϵ a 2 ] = 2 ω 2 / ( d ( d + 2 ) ) \mathbb{E}[\epsilon_a^2]=2\omega^2/(d(d+2)) E [ ϵ a 2 ] = 2 ω 2 / ( d ( d + 2 )) . SIGReg with ℓ \ell ℓ slices on a batch of ℓ \ell ℓ embeddings, denoted by T K T_{\mathcal{K}} T K , has, up to terms of third order in ϵ a \epsilon_a ϵ a , the expectation
E [ T K ] = c 0 + c 1 ( K − 2 ) 2 ω 2 d ( d + 2 ) , (11) \mathbb{E}[T_{\mathcal{K}}]=c_0+c_1(\mathcal{K}-2)\frac{2\omega^2}{d(d+2)}, \tag*{(11)} E [ T K ] = c 0 + c 1 ( K − 2 ) d ( d + 2 ) 2 ω 2 , (11) where c 0 c_0 c 0 and c 1 c_1 c 1 depend only on the weight w w w in Eq. (1) . The expectation does not depend on K \mathcal{K} K .
For Σ = I \Sigma=I Σ = I the embeddings form a control batch and E [ T K ] = c 0 \mathbb{E}[T_{\mathcal{K}}]=c_0 E [ T K ] = c 0 , so Eq. (11) tells how far, on average, SIGReg on a collapsed batch sits above its value on control batches. The test rejects the collapse when this gap exceeds the spread of T K T_{\mathcal{K}} T K on control batches. For Σ \Sigma Σ with r r r equal nonzero eigenvalues, the variance of a ⊤ Σ a a^\top\Sigma a a ⊤ Σ a across random slices is E [ ϵ a 2 ] = 2 ( d − r ) / ( r ( d + 2 ) ) \mathbb{E}[\epsilon_a^2]=2(d-r)/(r(d+2)) E [ ϵ a 2 ] = 2 ( d − r ) / ( r ( d + 2 )) . On a control batch, the empirical variance of the ℓ \ell ℓ projections along a slice has variance 2 / ℓ 2/\ell 2/ ℓ , since each squared projection has variance 2. Since the gap is c 1 ( ℓ − 2 ) E [ ϵ a 2 ] c_1(\ell-2)\mathbb{E}[\epsilon_a^2] c 1 ( ℓ − 2 ) E [ ϵ a 2 ] , it is large only when 2 ( d − r ) / ( r ( d + 2 ) ) 2(d-r)/(r(d+2)) 2 ( d − r ) / ( r ( d + 2 )) is large compared with 2 / ℓ 2/\ell 2/ ℓ . Neither quantity depends on K \mathcal{K} K ; more slices only reduce the variance of T K T_{\mathcal{K}} T K across slices. At a fixed ratio r / d r/d r / d , 2 ( d − r ) / ( r ( d + 2 ) ) 2(d-r)/(r(d+2)) 2 ( d − r ) / ( r ( d + 2 )) falls as 1 / d 1/d 1/ d , so the gap also falls with the embedding dimension. To prove the proposition, we use two quantities: the fourth moments of a uniformly random unit vector (Lemma B.1), and the mean and variance of an ECF [16 ] .
Gaussian embeddings and the sliced statistic. We assume that the embeddings are independent samples from N ( 0 , Σ ) \mathcal{N}(0,\Sigma) N ( 0 , Σ ) with tr Σ = d \operatorname{tr}\Sigma=d tr Σ = d . The matrix Σ − I \Sigma-I Σ − I is symmetric with tr ( Σ − I ) = 0 \operatorname{tr}(\Sigma-I)=0 tr ( Σ − I ) = 0 , and ω = ∥ Σ − I ∥ F \omega=\lVert\Sigma-I\rVert_F ω = ∥ Σ − I ∥ F measures how far Σ \Sigma Σ is from isotropic. The slices a 1 , … , a K a_1,\ldots,a_{\mathcal{K}} a 1 , … , a K are independent, uniform on the unit sphere S d − 1 S^{d-1} S d − 1 , and independent of the batch. Along a slice a a a , SIGReg computes
T ( a ) = ℓ ∫ w ( t ) ∣ φ a ( t ) − e − t 2 / 2 ∣ 2 d t , φ a ( t ) = 1 ℓ ∑ i = 1 ℓ e i t a ⊤ u i , (12) T(a)=\ell\int w(t)\left\lvert\varphi_a(t)-e^{-t^2/2}\right\rvert^2\,\mathrm{d}t,\qquad\varphi_a(t)=\frac{1}{\ell}\sum_{i=1}^{\ell}e^{\mathrm{i}t a^\top u_i}, \tag*{(12)} T ( a ) = ℓ ∫ w ( t ) φ a ( t ) − e − t 2 /2 2 d t , φ a ( t ) = ℓ 1 i = 1 ∑ ℓ e i t a ⊤ u i , (12)
where w ( t ) w(t) w ( t ) is the weight function in Eq. (1) that keeps the integral finite. SIGReg then averages T ( a ) T(a) T ( a ) over the K \mathcal{K} K slices, T K = K − 1 ∑ k = 1 K T ( a k ) T_{\mathcal{K}}=\mathcal{K}^{-1}\sum_{k=1}^{\mathcal{K}}T(a_k) T K = K − 1 ∑ k = 1 K T ( a k ) , which for one view is Ω S I G R e g / λ \Omega_{\mathrm{SIGReg}}/\lambda Ω SIGReg / λ in Eq. (1) . The arguments below hold for any w w w with ∫ w ( t ) ( 1 + t 6 ) d t < ∞ \int w(t)(1+t^6)\,\mathrm{d}t<\infty ∫ w ( t ) ( 1 + t 6 ) d t < ∞ , including the weights LeJEPA uses.
For example, if Σ \Sigma Σ has r r r equal nonzero eigenvalues, each is d / r d/r d / r because tr Σ = d \operatorname{tr}\Sigma=d tr Σ = d , and Σ = ( d / r ) P r \Sigma=(d/r)P_r Σ = ( d / r ) P r , where P r P_r P r is the orthogonal projection onto the r r r -dimensional subspace spanned by the corresponding eigenvectors. Then Σ − I = ( d / r ) P r − I \Sigma-I=(d/r)P_r-I Σ − I = ( d / r ) P r − I . Since P r 2 = P r P_r^2=P_r P r 2 = P r and tr P r = r \operatorname{tr}P_r=r tr P r = r ,
ω 2 = tr ( ( Σ − I ) 2 ) = d 2 r 2 r − 2 d r r + d = d 2 r − d , so ω 2 d 2 = 1 r − 1 d . (13) \omega^2=\operatorname{tr}\left((\Sigma-I)^2\right)=\frac{d^2}{r^2}r-2\frac{d}{r}r+d=\frac{d^2}{r}-d,\qquad\text{so}\qquad\frac{\omega^2}{d^2}=\frac{1}{r}-\frac{1}{d}. \tag*{(13)} ω 2 = tr ( ( Σ − I ) 2 ) = r 2 d 2 r − 2 r d r + d = r d 2 − d , so d 2 ω 2 = r 1 − d 1 . (13)
Lemma B.1 (Moments of a random slice). Let a a a be uniform on S d − 1 S^{d-1} S d − 1 and let A A A be a symmetric d × d d\times d d × d matrix. Then
E [ a ⊤ A a ] = tr A d , E [ ( a ⊤ A a ) 2 ] = ( tr A ) 2 + 2 tr ( A 2 ) d ( d + 2 ) . (14) \mathbb{E}\left[a^\top A a\right]=\frac{\operatorname{tr}A}{d},\qquad\mathbb{E}\left[\left(a^\top A a\right)^2\right]=\frac{(\operatorname{tr}A)^2+2\operatorname{tr}(A^2)}{d(d+2)}. \tag*{(14)} E [ a ⊤ A a ] = d tr A , E [ ( a ⊤ A a ) 2 ] = d ( d + 2 ) ( tr A ) 2 + 2 tr ( A 2 ) . (14)
Proof. Let g ∼ N ( 0 , I d × d ) g\sim\mathcal{N}(0,I_{d\times d}) g ∼ N ( 0 , I d × d ) . Since g ≠ 0 g\ne0 g = 0 with probability one and H g Hg H g has the same distribution as g g g for every orthogonal matrix H H H , the vector g / ∥ g ∥ g/\lVert g\rVert g / ∥ g ∥ is uniform on S d − 1 S^{d-1} S d − 1 and independent of ∥ g ∥ \lVert g\rVert ∥ g ∥ [30 Theorem 1.5.6] . So we may take a = g / ∥ g ∥ a=g/\lVert g\rVert a = g / ∥ g ∥ , and then g ⊤ A g = ∥ g ∥ 2 a ⊤ A a g^\top A g=\lVert g\rVert^2a^\top A a g ⊤ A g = ∥ g ∥ 2 a ⊤ A a . We can write A = Q Λ Q ⊤ A=Q\Lambda Q^\top A = Q Λ Q ⊤ with eigenvalues λ 1 , … , λ d \lambda_1,\ldots,\lambda_d λ 1 , … , λ d . Then z = Q ⊤ g ∼ N ( 0 , I d × d ) z=Q^\top g\sim\mathcal{N}(0,I_{d\times d}) z = Q ⊤ g ∼ N ( 0 , I d × d ) and g ⊤ A g = ∑ i λ i z i 2 g^\top A g=\sum_i\lambda_i z_i^2 g ⊤ A g = ∑ i λ i z i 2 . Since the z i z_i z i are independent with E [ z i 2 ] = 1 \mathbb{E}[z_i^2]=1 E [ z i 2 ] = 1 and E [ z i 4 ] = 3 \mathbb{E}[z_i^4]=3 E [ z i 4 ] = 3 ,
E [ g ⊤ A g ] = ∑ i λ i = tr A , E [ ( g ⊤ A g ) 2 ] = ∑ i ≠ j λ i λ j + 3 ∑ i λ i 2 = ( tr A ) 2 + 2 tr ( A 2 ) . \mathbb{E}\left[g^\top A g\right]=\sum_i\lambda_i=\operatorname{tr}A,\qquad\mathbb{E}\left[\left(g^\top A g\right)^2\right]=\sum_{i\ne j}\lambda_i\lambda_j+3\sum_i\lambda_i^2=(\operatorname{tr}A)^2+2\operatorname{tr}(A^2). E [ g ⊤ A g ] = i ∑ λ i = tr A , E [ ( g ⊤ A g ) 2 ] = i = j ∑ λ i λ j + 3 i ∑ λ i 2 = ( tr A ) 2 + 2 tr ( A 2 ) .
The squared norm ∥ g ∥ 2 \lVert g\rVert^2 ∥ g ∥ 2 has a chi-squared distribution with d d d degrees of freedom, with mean d d d and variance 2 d 2d 2 d , so E [ ∥ g ∥ 2 ] = d \mathbb{E}[\lVert g\rVert^2]=d E [∥ g ∥ 2 ] = d and E [ ∥ g ∥ 4 ] = 2 d + d 2 = d ( d + 2 ) \mathbb{E}[\lVert g\rVert^4]=2d+d^2=d(d+2) E [∥ g ∥ 4 ] = 2 d + d 2 = d ( d + 2 ) . Since ∥ g ∥ \lVert g\rVert ∥ g ∥ and a a a are independent, E [ g ⊤ A g ] = d E [ a ⊤ A a ] \mathbb{E}[g^\top A g]=d\mathbb{E}[a^\top A a] E [ g ⊤ A g ] = d E [ a ⊤ A a ] and E [ ( g ⊤ A g ) 2 ] = d ( d + 2 ) E [ ( a ⊤ A a ) 2 ] \mathbb{E}[(g^\top A g)^2]=d(d+2)\mathbb{E}[(a^\top A a)^2] E [( g ⊤ A g ) 2 ] = d ( d + 2 ) E [( a ⊤ A a ) 2 ] , proving the lemma. □
Proof of Proposition B.1. On a slice, the covariance of the embeddings affects only the variance of their projections. Fix a slice a a a . Since a a a is independent of the batch, the projections a ⊤ u 1 , … , a ⊤ u ℓ a^\top u_1,\ldots,a^\top u_{\ell} a ⊤ u 1 , … , a ⊤ u ℓ are independent samples of N ( 0 , a ⊤ Σ a ) \mathcal{N}(0,a^\top\Sigma a) N ( 0 , a ⊤ Σ a ) , and a ⊤ Σ a = a ⊤ a + a ⊤ ( Σ − I ) a = 1 + ϵ a a^\top\Sigma a=a^\top a+a^\top(\Sigma-I)a=1+\epsilon_a a ⊤ Σ a = a ⊤ a + a ⊤ ( Σ − I ) a = 1 + ϵ a with ϵ a = a ⊤ ( Σ − I ) a \epsilon_a=a^\top(\Sigma-I)a ϵ a = a ⊤ ( Σ − I ) a . The difference Σ − I \Sigma-I Σ − I affects the slice only through ϵ a \epsilon_a ϵ a .
By Lemma B.1 with A = Σ − I A=\Sigma-I A = Σ − I , tr ( Σ − I ) = 0 \operatorname{tr}(\Sigma-I)=0 tr ( Σ − I ) = 0 and tr ( ( Σ − I ) 2 ) = ω 2 \operatorname{tr}((\Sigma-I)^2)=\omega^2 tr (( Σ − I ) 2 ) = ω 2 ,
E [ ϵ a ] = 0 , E [ ϵ a 2 ] = 2 ω 2 d ( d + 2 ) . (15) \mathbb{E}[\epsilon_a]=0,\qquad\mathbb{E}[\epsilon_a^2]=\frac{2\omega^2}{d(d+2)}. \tag*{(15)} E [ ϵ a ] = 0 , E [ ϵ a 2 ] = d ( d + 2 ) 2 ω 2 . (15)
On one slice, the expected statistic is ℓ \ell ℓ times a squared bias plus sampling noise. We use the mean and covariance of an ECF from [16 Section 3] , and state them here for ease of reference. If x 1 , … , x ℓ x_1,\ldots,x_{\ell} x 1 , … , x ℓ are independent samples of a distribution with characteristic function ψ \psi ψ , and φ ( t ) = 1 ℓ ∑ i = 1 ℓ e i t x i \varphi(t)=\frac{1}{\ell}\sum_{i=1}^{\ell}e^{\mathrm{i}tx_i} φ ( t ) = ℓ 1 ∑ i = 1 ℓ e i t x i , then for all t 1 t_1 t 1 and t 2 t_2 t 2 ,
E [ φ ( t 1 ) ] = ψ ( t 1 ) , E [ ( φ ( t 1 ) − ψ ( t 1 ) ) ( φ ( t 2 ) − ψ ( t 2 ) ) ] = ψ ( t 1 + t 2 ) − ψ ( t 1 ) ψ ( t 2 ) ℓ . (16) \mathbb{E}[\varphi(t_1)]=\psi(t_1),\qquad\mathbb{E}[(\varphi(t_1)-\psi(t_1))(\varphi(t_2)-\psi(t_2))]=\frac{\psi(t_1+t_2)-\psi(t_1)\psi(t_2)}{\ell}. \tag*{(16)} E [ φ ( t 1 )] = ψ ( t 1 ) , E [( φ ( t 1 ) − ψ ( t 1 )) ( φ ( t 2 ) − ψ ( t 2 ))] = ℓ ψ ( t 1 + t 2 ) − ψ ( t 1 ) ψ ( t 2 ) . (16)
Since φ ( − t ) \varphi(-t) φ ( − t ) and ψ ( − t ) \psi(-t) ψ ( − t ) are the complex conjugates of φ ( t ) \varphi(t) φ ( t ) and ψ ( t ) \psi(t) ψ ( t ) , setting t 1 = t t_1=t t 1 = t and t 2 = − t t_2=-t t 2 = − t gives E [ ∣ φ ( t ) − ψ ( t ) ∣ 2 ] = ( 1 − ∣ ψ ( t ) ∣ 2 ) / b \mathbb{E}\left[\lvert\varphi(t)-\psi(t)\rvert^2\right]=\left(1-\lvert\psi(t)\rvert^2\right)/\mathfrak{b} E [ ∣ φ ( t ) − ψ ( t ) ∣ 2 ] = ( 1 − ∣ ψ ( t ) ∣ 2 ) / b . Given a a a , the projections have the characteristic function ψ a ( t ) = e − ( 1 + ε a ) t 2 / 2 \psi_a(t)=e^{-(1+\varepsilon_a)t^2/2} ψ a ( t ) = e − ( 1 + ε a ) t 2 /2 . We can split φ a ( t ) − e − t 2 / 2 \varphi_a(t)-e^{-t^2/2} φ a ( t ) − e − t 2 /2 into its mean, ψ a ( t ) − e − t 2 / 2 \psi_a(t)-e^{-t^2/2} ψ a ( t ) − e − t 2 /2 , and its sampling error, φ a ( t ) − ψ a ( t ) \varphi_a(t)-\psi_a(t) φ a ( t ) − ψ a ( t ) , which has mean zero. Then,
E [ ∣ φ a ( t ) − e − t 2 / 2 ∣ 2 ∣ a ] = ( e − ( 1 + ε a ) t 2 / 2 − e − t 2 / 2 ) 2 + 1 − e − ( 1 + ε a ) t 2 b , (17) \mathbb{E}\left[\left\lvert\varphi_a(t)-e^{-t^2/2}\right\rvert^2\mid a\right]=\left(e^{-(1+\varepsilon_a)t^2/2}-e^{-t^2/2}\right)^2+\frac{1-e^{-(1+\varepsilon_a)t^2}}{\mathfrak{b}}, \tag*{(17)} E [ φ a ( t ) − e − t 2 /2 2 ∣ a ] = ( e − ( 1 + ε a ) t 2 /2 − e − t 2 /2 ) 2 + b 1 − e − ( 1 + ε a ) t 2 , (17)
since the cross term is zero under expectation. The first term is the squared bias, how far the distribution of projections is from an isotropic Gaussian. The second is sampling noise, that is present even when ε a = 0 \varepsilon_a=0 ε a = 0 . It shrinks as 1 / b 1/\mathfrak{b} 1/ b . SIGReg multiplies both by b \mathfrak{b} b , so the first term grows with the batch while the second stays at a fixed level,
E [ T ( a ) ∣ a ] = ∫ w ( t ) [ b ( e − ( 1 + ε a ) t 2 / 2 − e − t 2 / 2 ) 2 + 1 − e − ( 1 + ε a ) t 2 ] d t . (18) \mathbb{E}[T(a)\mid a]=\int w(t)\left[\mathfrak{b}\left(e^{-(1+\varepsilon_a)t^2/2}-e^{-t^2/2}\right)^2+1-e^{-(1+\varepsilon_a)t^2}\right]\,\mathrm{d}t. \tag*{(18)} E [ T ( a ) ∣ a ] = ∫ w ( t ) [ b ( e − ( 1 + ε a ) t 2 /2 − e − t 2 /2 ) 2 + 1 − e − ( 1 + ε a ) t 2 ] d t . (18)
We expand in ε a \varepsilon_a ε a . The bias is e − t 2 / 2 ( e − ε a t 2 / 2 − 1 ) = − 1 2 ε a t 2 e − t 2 / 2 + O ( ε a 2 ) e^{-t^2/2}\left(e^{-\varepsilon_a t^2/2}-1\right)=-\frac{1}{2}\varepsilon_a t^2e^{-t^2/2}+O(\varepsilon_a^2) e − t 2 /2 ( e − ε a t 2 /2 − 1 ) = − 2 1 ε a t 2 e − t 2 /2 + O ( ε a 2 ) , so its square is 1 4 ε a 2 t 4 e − t 2 + O ( ε a 3 ) \frac{1}{4}\varepsilon_a^2t^4e^{-t^2}+O(\varepsilon_a^3) 4 1 ε a 2 t 4 e − t 2 + O ( ε a 3 ) . The sampling term is 1 − e − t 2 + ε a t 2 e − t 2 − 1 2 ε a 2 t 4 e − t 2 + O ( ε a 3 ) 1-e^{-t^2}+\varepsilon_at^2e^{-t^2}-\frac{1}{2}\varepsilon_a^2t^4e^{-t^2}+O(\varepsilon_a^3) 1 − e − t 2 + ε a t 2 e − t 2 − 2 1 ε a 2 t 4 e − t 2 + O ( ε a 3 ) . Collecting powers of ε a \varepsilon_a ε a ,
E [ T ( a ) ∣ a ] = c 0 + c ′ ε a + c 1 ( b − 2 ) ε a 2 + O ( ( b + 1 ) ∣ ε a ∣ 3 ) , (19) \mathbb{E}[T(a)\mid a]=c_0+c'\varepsilon_a+c_1(\mathfrak{b}-2)\varepsilon_a^2+O\left((\mathfrak{b}+1)\lvert\varepsilon_a\rvert^3\right), \tag*{(19)} E [ T ( a ) ∣ a ] = c 0 + c ′ ε a + c 1 ( b − 2 ) ε a 2 + O ( ( b + 1 ) ∣ ε a ∣ 3 ) , (19)
where
c 0 = ∫ w ( t ) ( 1 − e − t 2 ) d t , c ′ = ∫ w ( t ) t 2 e − t 2 d t , c 1 = 1 4 ∫ w ( t ) t 4 e − t 2 d t . c_0=\int w(t)\left(1-e^{-t^2}\right)\,\mathrm{d}t,\qquad c'=\int w(t)t^2e^{-t^2}\,\mathrm{d}t,\qquad c_1=\frac{1}{4}\int w(t)t^4e^{-t^2}\,\mathrm{d}t. c 0 = ∫ w ( t ) ( 1 − e − t 2 ) d t , c ′ = ∫ w ( t ) t 2 e − t 2 d t , c 1 = 4 1 ∫ w ( t ) t 4 e − t 2 d t .
depend only on the weight w w w . By Taylor’s theorem with the Lagrange form of the remainder, and since 1 + ε a ≥ 0 1+\varepsilon_a\ge0 1 + ε a ≥ 0 , the squared bias and sampling term each differ from their expansions above by at most ∣ ε a ∣ 3 t 6 / 6 \lvert\varepsilon_a\rvert^3t^6/6 ∣ ε a ∣ 3 t 6 /6 . So the remainder in Eq. (19) is at most ( b + 1 ) ∣ ε a ∣ 3 ∫ w ( t ) t 6 d t / 6 (\mathfrak{b}+1)\lvert\varepsilon_a\rvert^3\int w(t)t^6\,\mathrm{d}t/6 ( b + 1 ) ∣ ε a ∣ 3 ∫ w ( t ) t 6 d t /6 in absolute value.
Figure B.1. Encoders trained with SIGReg keep a low participation ratio. Participation ratio of the 64-dimensional embeddings of the Tiny-ImageNet-200 validation images during training. PR of SIGReg rises from 22.6 at epoch 40 to 40.0 at epoch 200. PR of PolarReg-naive is 49–53 from epoch 40. This shows that embeddings obtained with SIGReg are quite anisotropic in practice.
Averaging over slices cancels the term linear in ε a \varepsilon_a ε a , and the result is independent of k k k . Each slice a k a_k a k is uniform on S d − 1 S^{d-1} S d − 1 and independent of the batch, so E [ T ( a k ) ] = E a [ E [ T ( a ) ∣ a ] ] \mathbb{E}[T(a_k)]=\mathbb{E}_a[\mathbb{E}[T(a)\mid a]] E [ T ( a k )] = E a [ E [ T ( a ) ∣ a ]] for every k k k , and the mean T k T_k T k of the k k k values has this expectation for every k k k . The linear term vanishes because E [ ε a ] = 0 \mathbb{E}[\varepsilon_a]=0 E [ ε a ] = 0 , and Eq. (15) gives
E [ T k ] = c 0 + c 1 ( b − 2 ) 2 ω 2 d ( d + 2 ) + O ( ( b + 1 ) E [ ∣ ε a ∣ 3 ] ) . (20) \mathbb{E}[T_k]=c_0+c_1(\mathfrak{b}-2)\frac{2\omega^2}{d(d+2)}+O\left((\mathfrak{b}+1)\mathbb{E}\left[\lvert\varepsilon_a\rvert^3\right]\right). \tag*{(20)} E [ T k ] = c 0 + c 1 ( b − 2 ) d ( d + 2 ) 2 ω 2 + O ( ( b + 1 ) E [ ∣ ε a ∣ 3 ] ) . (20)
This concludes our proof of Proposition B.1.
in 0.10 at PR = 48 and 0.09 at PR = 51. The same blindness appears in training. On Tiny-ImageNet-200 with d = 64 d = 64 d = 64 , the embeddings of the 10,000 validation images from an encoder trained with SIGReg have PR = 22.6 at epoch 40 (Fig. B.1). PR only rises to ∼ 40.0 \sim40.0 ∼ 40.0 at epoch 200, showing that embeddings obtained with SIGReg are quite anisotropic in practice. Consequently, this is also the range in which the test of § 2.1 finds SIGReg weak. For PolarReg-naive, described in § 2.2 , PR is 49–53 from epoch 40.
Proof. Along a slice a a a , projections of distinct samples are independent samples of N ( 0 , 1 ) \mathcal{N}(0, 1) N ( 0 , 1 ) , with characteristic function e − t 2 / 2 e^{-t^2/2} e − t 2 /2 , and empirical characteristic function φ a \varphi_a φ a from Eq. (12) . For each embedding, let z i ( t ) = e i t a ⊤ u i − e − t 2 / 2 z_i(t) = e^{\mathrm{i}t\,a^\top u_i} - e^{-t^2/2} z i ( t ) = e i t a ⊤ u i − e − t 2 /2 , so that φ a ( t ) − e − t 2 / 2 = 1 ℓ ∑ i = 1 ℓ z i ( t ) \varphi_a(t) - e^{-t^2/2} = \frac{1}{\ell}\sum_{i=1}^{\ell} z_i(t) φ a ( t ) − e − t 2 /2 = ℓ 1 ∑ i = 1 ℓ z i ( t ) . If u i u_i u i and u j u_j u j are distinct samples, z i ( t ) z_i(t) z i ( t ) and z j ( t ) z_j(t) z j ( t ) are independent, both have mean zero, and each has E [ ∣ z i ( t ) ∣ 2 ] = 1 − e − t 2 \mathbb{E}\left[|z_i(t)|^2\right] = 1 - e^{-t^2} E [ ∣ z i ( t ) ∣ 2 ] = 1 − e − t 2 by Eq. (16) with ℓ = 1 \ell= 1 ℓ = 1 . A duplicated sample creates two equal z i ( t ) z_i(t) z i ( t ) , whose sum 2 z i ( t ) 2z_i(t) 2 z i ( t ) has E [ ∣ 2 z i ( t ) ∣ 2 ] = 4 ( 1 − e − t 2 ) \mathbb{E}\left[|2z_i(t)|^2\right] = 4\left(1-e^{-t^2}\right) E [ ∣2 z i ( t ) ∣ 2 ] = 4 ( 1 − e − t 2 ) ; two independent samples lead to 2 ( 1 − e − t 2 ) 2\left(1-e^{-t^2}\right) 2 ( 1 − e − t 2 ) , since the expected cross term is zero. So, with ( 1 − 2 p ) ℓ (1-2p)\ell ( 1 − 2 p ) ℓ samples that appear once and p ℓ p\ell p ℓ that appear twice,
E [ ∣ φ a ( t ) − e − t 2 / 2 ∣ 2 ] = ( 1 − 2 p ) ℓ + 4 p ℓ ℓ 2 ( 1 − e − t 2 ) = ( 1 + 2 p ) 1 − e − t 2 ℓ . \mathbb{E}\left[\left|\varphi_a(t)-e^{-t^2/2}\right|^2\right]=\frac{(1-2p)\ell+4p\ell}{\ell^2}\left(1-e^{-t^2}\right)=(1+2p)\frac{1-e^{-t^2}}{\ell}. E [ φ a ( t ) − e − t 2 /2 2 ] = ℓ 2 ( 1 − 2 p ) ℓ + 4 p ℓ ( 1 − e − t 2 ) = ( 1 + 2 p ) ℓ 1 − e − t 2 .
Integrating against ℓ w ( t ) \ell\,w(t) ℓ w ( t ) , we have, E [ T ( a ) ] = ( 1 + 2 p ) c 0 \mathbb{E}[T(a)] = (1+2p)c_0 E [ T ( a )] = ( 1 + 2 p ) c 0 for every slice. Hence, E [ T k ] = ( 1 + 2 p ) c 0 \mathbb{E}[T_k] = (1+2p)c_0 E [ T k ] = ( 1 + 2 p ) c 0 .
At ℓ = 256 \ell= 256 ℓ = 256 , one duplicated pair, p = 1 / 256 p = 1/256 p = 1/256 , raises E [ T k ] \mathbb{E}[T_k] E [ T k ] by 0.8%, well inside its variation across control batches. Neither a larger batch nor more slices change the ratio.
Polar decomposition of the isotropic Gaussian
Thm. 1 shows that a simple polar decomposition of the isotropic Gaussian is possible and exact. Here, we provide a short proof.
Theorem B.1 (Polar decomposition of an isotropic Gaussian). Let u u u be a nonzero random vector in R d \mathbb{R}^d R d , and write u = ρ u ^ u=\rho\hat{u} u = ρ u ^ with magnitude ρ = ∥ u ∥ \rho=\lVert u\rVert ρ = ∥ u ∥ and direction u ^ = u / ∥ u ∥ \hat{u}=u/\lVert u\rVert u ^ = u / ∥ u ∥ on the unit sphere S d − 1 S^{d-1} S d − 1 . Then u ∼ N ( 0 , I d × d ) u\sim\mathcal{N}(0,I_{d\times d}) u ∼ N ( 0 , I d × d ) if and only if ρ ∼ χ d \rho\sim\chi_d ρ ∼ χ d , u ^ ∼ Unif ( S d − 1 ) \hat{u}\sim\operatorname{Unif}(S^{d-1}) u ^ ∼ Unif ( S d − 1 ) , and ρ \rho ρ and u ^ \hat{u} u ^ are independent.
Proof. This is a quite standard result on spherical distributions [30 Section 1.5] . We give a short proof. Suppose that u ∼ N ( 0 , I d × d ) u\sim\mathcal{N}(0,I_{d\times d}) u ∼ N ( 0 , I d × d ) . Its d d d coordinates are independent samples of N ( 0 , 1 ) \mathcal{N}(0,1) N ( 0 , 1 ) , so ρ 2 = ∥ u ∥ 2 \rho^2=\lVert u\rVert^2 ρ 2 = ∥ u ∥ 2 , the sum of their squares, follows a chi-squared distribution with d d d degrees of freedom, denoted by χ d 2 \chi_d^2 χ d 2 . For every orthogonal d × d d\times d d × d matrix H H H , H u ∼ N ( 0 , I d × d ) Hu\sim\mathcal{N}(0,I_{d\times d}) H u ∼ N ( 0 , I d × d ) , so H u Hu H u has the same distribution as u u u . If a nonzero random vector has this property, its direction is uniform on S d − 1 S^{d-1} S d − 1 and independent of its magnitude [30 Theorem 1.5.6] . This directly shows u ^ ∼ Unif ( S d − 1 ) \hat{u}\sim\operatorname{Unif}(S^{d-1}) u ^ ∼ Unif ( S d − 1 ) , and ρ \rho ρ and u ^ \hat{u} u ^ to be independent.
Conversely, suppose that ρ ∼ χ d \rho\sim\chi_d ρ ∼ χ d , u ^ ∼ Unif ( S d − 1 ) \hat{u}\sim\operatorname{Unif}(S^{d-1}) u ^ ∼ Unif ( S d − 1 ) , and ρ \rho ρ and u ^ \hat{u} u ^ are independent. Let g ∼ N ( 0 , I d × d ) g\sim\mathcal{N}(0,I_{d\times d}) g ∼ N ( 0 , I d × d ) . With the forward direction, ∥ g ∥ ∼ χ d \lVert g\rVert\sim\chi_d ∥ g ∥ ∼ χ d and g / ∥ g ∥ ∼ Unif ( S d − 1 ) g/\lVert g\rVert\sim\operatorname{Unif}(S^{d-1}) g / ∥ g ∥ ∼ Unif ( S d − 1 ) , and the two are independent. The joint distribution of two independent variables is the product of their distributions, so the pairs ( ρ , u ^ ) (\rho,\hat{u}) ( ρ , u ^ ) and ( ∥ g ∥ , g / ∥ g ∥ ) (\lVert g\rVert,g/\lVert g\rVert) (∥ g ∥ , g / ∥ g ∥) have the same joint distribution. The vectors u = ρ u ^ u=\rho\hat{u} u = ρ u ^ and g = ∥ g ∥ ( g / ∥ g ∥ ) g=\lVert g\rVert\left(g/\lVert g\rVert\right) g = ∥ g ∥ ( g / ∥ g ∥ ) are the same function of these two pairs, so they have the same distribution, and u ∼ N ( 0 , I d × d ) u\sim\mathcal{N}(0,I_{d\times d}) u ∼ N ( 0 , I d × d ) .
Distribution of inner products of uniform directions
Thm. B.2 derives C d \mathcal{C}_d C d , the distribution of the inner product of two independent uniform directions; the target of the angular penalty in Eq. (5) . Quantiles of C d \mathcal{C}_d C d are those of a Beta distribution, scaled and shifted to [ − 1 , 1 ] [-1,1] [ − 1 , 1 ] .
Theorem B.2 (Distribution of inner products of uniform directions). Let d ≥ 2 d \ge2 d ≥ 2 , and let u ^ \hat{u} u ^ and u ^ ′ \hat{u}' u ^ ′ be independent and uniform on S d − 1 S^{d-1} S d − 1 . Their inner product s = ⟨ u ^ , u ^ ′ ⟩ s = \langle\hat{u},\hat{u}' \rangle s = ⟨ u ^ , u ^ ′ ⟩ has the density
C d ( s ) = Γ ( d / 2 ) π Γ ( ( d − 1 ) / 2 ) ( 1 − s 2 ) ( d − 3 ) / 2 , s ∈ [ − 1 , 1 ] , (22) C_d(s) = \frac{\Gamma(d/2)}{\sqrt{\pi}\Gamma((d-1)/2)}\left(1-s^2\right)^{(d-3)/2}, \qquad s \in[-1,1], \tag*{(22)} C d ( s ) = π Γ (( d − 1 ) /2 ) Γ ( d /2 ) ( 1 − s 2 ) ( d − 3 ) /2 , s ∈ [ − 1 , 1 ] , (22) so ( s + 1 ) / 2 ∼ Beta ( β , β ) (s+1)/2 \sim\operatorname{Beta}(\beta,\beta) ( s + 1 ) /2 ∼ Beta ( β , β ) with β = ( d − 1 ) / 2 \beta=(d-1)/2 β = ( d − 1 ) /2 . The mean and variance of s s s are 0 0 0 and 1 / d 1/d 1/ d , respectively. Conversely, let u ^ \hat{u} u ^ and u ^ ′ \hat{u}' u ^ ′ be two independent draws from some distribution on S d − 1 S^{d-1} S d − 1 . If their inner product has the density C d C_d C d , then u ^ \hat{u} u ^ is uniform on S d − 1 S^{d-1} S d − 1 [24 Proposition 1] .
Proof. This is a standard result on spherical distributions [30 Section 1.5] . We give a short derivation of the first part; the converse is from [24 ] .
The squared inner product follows a Beta distribution. Let e e e be a unit vector. The distribution of u ^ \hat{u} u ^ does not change under orthogonal transformations, and e e T ee^\mathsf{T} e e T is symmetric and idempotent with rank one. So ⟨ u ^ , e ⟩ 2 = u ^ T e e T u ^ / ∥ u ^ ∥ 2 ∼ Beta ( 1 / 2 , ( d − 1 ) / 2 ) \langle\hat{u},e\rangle^2 = \hat{u}^\mathsf{T}ee^\mathsf{T}\hat{u}/\lVert\hat{u}\rVert^2 \sim\operatorname{Beta}(1/2,(d-1)/2) ⟨ u ^ , e ⟩ 2 = u ^ T e e T u ^ / ∥ u ^ ∥ 2 ∼ Beta ( 1/2 , ( d − 1 ) /2 ) [30 Theorem 1.5.7(ii)] . Since u ^ \hat{u} u ^ is independent of u ^ ′ \hat{u}' u ^ ′ , it is still uniform given u ^ ′ \hat{u}' u ^ ′ . So s 2 = ⟨ u ^ , u ^ ′ ⟩ 2 ∼ Beta ( 1 / 2 , ( d − 1 ) / 2 ) s^2=\langle\hat{u},\hat{u}'\rangle^2\sim\operatorname{Beta}(1/2,(d-1)/2) s 2 = ⟨ u ^ , u ^ ′ ⟩ 2 ∼ Beta ( 1/2 , ( d − 1 ) /2 ) as well.
The inner product is symmetric about zero, leading to its density. The vector − u ^ -\hat{u} − u ^ is also uniform on S d − 1 S^{d-1} S d − 1 and independent of u ^ ′ \hat{u}' u ^ ′ , so s s s and − s -s − s have the same distribution. For 0 < x < 1 0<x<1 0 < x < 1 , the event s 2 > x 2 s^2>x^2 s 2 > x 2 is a disjoint union of s > x s>x s > x and s < − x s<-x s < − x . These have the same probability, so
P ( s > x ) = 1 2 P ( s 2 > x 2 ) = 1 2 ∫ x 2 1 h ( t ) d t , \mathbb{P}(s>x)=\frac{1}{2}\mathbb{P}(s^2>x^2)=\frac{1}{2}\int_{x^2}^{1}h(t)\,\mathrm{d}t, P ( s > x ) = 2 1 P ( s 2 > x 2 ) = 2 1 ∫ x 2 1 h ( t ) d t , where h ( t ) = Γ ( d / 2 ) Γ ( 1 / 2 ) Γ ( ( d − 1 ) / 2 ) t − 1 / 2 ( 1 − t ) ( d − 3 ) / 2 h(t)=\frac{\Gamma(d/2)}{\Gamma(1/2)\Gamma((d-1)/2)}t^{-1/2}(1-t)^{(d-3)/2} h ( t ) = Γ ( 1/2 ) Γ (( d − 1 ) /2 ) Γ ( d /2 ) t − 1/2 ( 1 − t ) ( d − 3 ) /2 . Differentiating in x x x we get the density of s s s at x x x , and by symmetry also at − x -x − x ,
− d d x P ( s > x ) = x h ( x 2 ) = Γ ( d / 2 ) π Γ ( ( d − 1 ) / 2 ) ( 1 − x 2 ) ( d − 3 ) / 2 = C d ( x ) , -\frac{\mathrm{d}}{\mathrm{d}x}\mathbb{P}(s>x)=xh(x^2)=\frac{\Gamma(d/2)}{\sqrt{\pi}\Gamma((d-1)/2)}\left(1-x^2\right)^{(d-3)/2}=C_d(x), − d x d P ( s > x ) = x h ( x 2 ) = π Γ (( d − 1 ) /2 ) Γ ( d /2 ) ( 1 − x 2 ) ( d − 3 ) /2 = C d ( x ) , since Γ ( 1 / 2 ) = π \Gamma(1/2)=\sqrt{\pi} Γ ( 1/2 ) = π . Changing variables to ( s + 1 ) / 2 (s+1)/2 ( s + 1 ) /2 in C d C_d C d leads to a density Beta ( β , β ) \operatorname{Beta}(\beta,\beta) Beta ( β , β ) . Mean of s s s is 0 0 0 by symmetry, and its variance E [ s 2 ] \mathbb{E}[s^2] E [ s 2 ] is the mean of Beta ( 1 / 2 , ( d − 1 ) / 2 ) \operatorname{Beta}(1/2,(d-1)/2) Beta ( 1/2 , ( d − 1 ) /2 ) , which is 1 / d 1/d 1/ d .
The angular penalty compares the whole distribution of inner products with C d C_d C d . A rank collapse changes the second moment of this distribution. Remark B.3 computes this change, the variance of its finite-sample estimate on uniform directions, and a lower bound for batches constrained to r r r dimensions. Its last statement turns this second moment into a lower bound on the angular penalty itself.
Remark B.3 (Second moment of the distribution of inner products of uniform directions). Let u ^ 1 , … , u ^ b \hat{u}_1,\ldots,\hat{u}_b u ^ 1 , … , u ^ b be unit vectors in R d \mathbb{R}^d R d , and let s 2 ‾ \overline{s^2} s 2 be the average of s i j 2 = ⟨ u ^ i , u ^ j ⟩ 2 s_{ij}^2=\langle\hat{u}_i,\hat{u}_j\rangle^2 s ij 2 = ⟨ u ^ i , u ^ j ⟩ 2 over the b ( b − 1 ) / 2 b(b-1)/2 b ( b − 1 ) /2 pairs. (i) If the u ^ i \hat{u}_i u ^ i are independent and uniform on S d − 1 S^{d-1} S d − 1 , s 2 ‾ \overline{s^2} s 2 has mean 1 / d 1/d 1/ d and standard deviation about 2 / ( d b ) 2/(db) 2/ ( d b ) . (ii) If the u ^ i \hat{u}_i u ^ i lie in an r r r -dimensional subspace, s 2 ‾ ≥ ( b / r − 1 ) / ( b − 1 ) \overline{s^2}\ge(b/r-1)/(b-1) s 2 ≥ ( b / r − 1 ) / ( b − 1 ) . (iii) For any u ^ i \hat{u}_i u ^ i , the angular penalty in Eq. (5) on their inner products satisfies ℓ ^ a ≥ ( s 2 ‾ − q 2 ‾ ) 2 \widehat{\ell}_{a}\ge\left(\sqrt{\overline{s^2}}-\sqrt{\overline{q^2}}\right)^2 ℓ a ≥ ( s 2 − q 2 ) 2 , where q 2 ‾ ≈ 1 / d \overline{q^2}\approx1/d q 2 ≈ 1/ d is the average of the squared targets in Eq. (5) .
Proof. For two random directions, the mean squared inner product is the inverse participation ratio. Let u ^ \hat{u} u ^ and u ^ ′ \hat{u}' u ^ ′ be independent draws from any distribution on S d − 1 S^{d-1} S d − 1 , with second-moment matrix M = E [ u ^ u ^ T ] M=\mathbb{E}\left[\hat{u}\hat{u}^{\mathsf{T}}\right] M = E [ u ^ u ^ T ] , and let s = ⟨ u ^ , u ^ ′ ⟩ s=\langle\hat{u},\hat{u}'\rangle s = ⟨ u ^ , u ^ ′ ⟩ . The scalar s 2 = u ^ T u ^ ′ u ^ ′ T u ^ s^2=\hat{u}^{\mathsf{T}}\hat{u}'\hat{u}'^{\mathsf{T}}\hat{u} s 2 = u ^ T u ^ ′ u ^ ′ T u ^ equals its trace, tr ( u ^ u ^ T u ^ ′ u ^ ′ T ) = 1 \operatorname{tr}(\hat{u}\hat{u}^{\mathsf{T}}\hat{u}'\hat{u}'^{\mathsf{T}})=1 tr ( u ^ u ^ T u ^ ′ u ^ ′ T ) = 1 . Since u ^ \hat{u} u ^ and u ^ ′ \hat{u}' u ^ ′ are independent with the same distribution, E [ s 2 ] = tr ( M 2 ) \mathbb{E}[s^2]=\operatorname{tr}(M^2) E [ s 2 ] = tr ( M 2 ) . Since tr M = E [ ∥ u ^ ∥ 2 ] = 1 \operatorname{tr}M=\mathbb{E}[\lVert\hat{u}\rVert^2]=1 tr M = E [∥ u ^ ∥ 2 ] = 1 , the participation ratio of M M M is ( tr M ) 2 / tr ( M 2 ) = 1 / tr ( M 2 ) (\operatorname{tr}M)^2/\operatorname{tr}(M^2)=1/\operatorname{tr}(M^2) ( tr M ) 2 / tr ( M 2 ) = 1/ tr ( M 2 ) , and
∥ M − I / d ∥ F 2 = tr ( M 2 ) − 2 d tr M + 1 d = E [ s 2 ] − 1 d (23) \lVert M-I/d\rVert_F^2=\operatorname{tr}(M^2)-\frac{2}{d}\operatorname{tr}M+\frac{1}{d}=\mathbb{E}[s^2]-\frac{1}{d} \tag*{(23)} ∥ M − I / d ∥ F 2 = tr ( M 2 ) − d 2 tr M + d 1 = E [ s 2 ] − d 1 (23)
which is zero only for M = I / d M = I/d M = I / d . Directions uniform on r r r of the d d d dimensions have M = P r / r M = P_r/r M = P r / r , where P r P_r P r is the orthogonal projection onto them, so E [ s 2 ] = tr ( M 2 ) = 1 / r \mathbb{E}\left[s^2\right] = \operatorname{tr}(M^2) = 1/r E [ s 2 ] = tr ( M 2 ) = 1/ r .
(i) On uniform directions, the average s ˉ 2 \bar{s}^2 s ˉ 2 has mean 1 / d 1/d 1/ d and standard deviation about 2 / ( d ℓ ) 2/(d\ell) 2/ ( d ℓ ) . Using the proof of Thm. B.2, s i j 2 ∼ Beta ( 1 / 2 , ( d − 1 ) / 2 ) s_{ij}^2 \sim\operatorname{Beta}(1/2,(d-1)/2) s ij 2 ∼ Beta ( 1/2 , ( d − 1 ) /2 ) , with mean 1 / d 1/d 1/ d and variance 2 ( d − 1 ) / ( d 2 ( d + 2 ) ) 2(d-1)/(d^2(d+2)) 2 ( d − 1 ) / ( d 2 ( d + 2 )) . So s ˉ 2 \bar{s}^2 s ˉ 2 has mean 1 / d 1/d 1/ d . Two pairs that share one direction, say ( i , j ) (i,j) ( i , j ) and ( i , l ) (i,l) ( i , l ) , are uncorrelated. Given u ^ i \hat{u}_i u ^ i , the terms s i j 2 s_{ij}^2 s ij 2 and s i l 2 s_{il}^2 s i l 2 are independent, and each has the mean u ^ i T E [ u ^ j u ^ j T ] u ^ i = 1 / d \hat{u}_i^{\mathsf{T}}\mathbb{E}\left[\hat{u}_j\hat{u}_j^{\mathsf{T}}\right]\hat{u}_i = 1/d u ^ i T E [ u ^ j u ^ j T ] u ^ i = 1/ d whatever u ^ i \hat{u}_i u ^ i is. Two pairs that share no direction are independent. Hence, the variance of s ˉ 2 \bar{s}^2 s ˉ 2 is the variance of one term divided by the number of pairs,
4 ( d − 1 ) d 2 ( d + 2 ) ℓ ( ℓ − 1 ) ≈ ( 2 d ℓ ) 2 . \frac{4(d-1)}{d^2(d+2)\ell(\ell-1)} \approx\left(\frac{2}{d\ell}\right)^2. d 2 ( d + 2 ) ℓ ( ℓ − 1 ) 4 ( d − 1 ) ≈ ( d ℓ 2 ) 2 .
(ii) Constraining unit vectors to r r r dimensions lower bounds their mean squared inner product. For ℓ \ell ℓ unit vectors in an r r r -dimensional space, the sum of their squared inner products over all ordered pairs, including each vector with itself, is at least ℓ 2 / r \ell^2/r ℓ 2 / r [43 p. 397] . Removing the ℓ \ell ℓ terms of each vector with itself and averaging over the ℓ ( ℓ − 1 ) \ell(\ell-1) ℓ ( ℓ − 1 ) ordered pairs gives
s ˉ 2 ≥ ℓ 2 / r − ℓ ℓ ( ℓ − 1 ) = ℓ / r − 1 ℓ − 1 . \bar{s}^2 \ge\frac{\ell^2/r-\ell}{\ell(\ell-1)} = \frac{\ell/r-1}{\ell-1}. s ˉ 2 ≥ ℓ ( ℓ − 1 ) ℓ 2 / r − ℓ = ℓ − 1 ℓ / r − 1 .
This is at most 1 / d 1/d 1/ d only when ℓ ≤ ( d − 1 ) r / ( d − r ) \ell\le(d-1)r/(d-r) ℓ ≤ ( d − 1 ) r / ( d − r ) .
(iii) The mean squared inner product bounds the angular penalty from below. Let n = ℓ ( ℓ − 1 ) / 2 n = \ell(\ell-1)/2 n = ℓ ( ℓ − 1 ) /2 , and for x ∈ R n x \in\mathbb{R}^n x ∈ R n let ∥ x ∥ n = ∥ x ∥ / n \lVert x\rVert_n = \lVert x\rVert/\sqrt{n} ∥ x ∥ n = ∥ x ∥ / n , the root mean square of its entries, which is a norm. Let s ~ ∈ R n \tilde{s} \in\mathbb{R}^n s ~ ∈ R n hold the inner products in increasing order and q ∈ R n q \in\mathbb{R}^n q ∈ R n the targets of Eq. (5) , so that ℓ u ^ = ∥ s ~ − q ∥ n 2 \ell_{\hat{u}} = \lVert\tilde{s}-q\rVert_n^2 ℓ u ^ = ∥ s ~ − q ∥ n 2 . Sorting does not change a sum of squares, so ∥ s ~ ∥ n 2 = s ˉ 2 \lVert\tilde{s}\rVert_n^2 = \bar{s}^2 ∥ s ~ ∥ n 2 = s ˉ 2 , and ∥ q ∥ n 2 = q ˉ 2 \lVert q\rVert_n^2 = \bar{q}^2 ∥ q ∥ n 2 = q ˉ 2 by definition. With the triangle inequality we have ∥ s ~ − q ∥ n ≥ ∣ ∥ s ~ ∥ n − ∥ q ∥ n ∣ \lVert\tilde{s}-q\rVert_n \ge\lvert\lVert\tilde{s}\rVert_n-\lVert q\rVert_n\rvert ∥ s ~ − q ∥ n ≥ ∣∥ s ~ ∥ n − ∥ q ∥ n ∣ , and squaring both sides leads to the bound. Since the targets are quantiles of C d C_d C d , q ˉ 2 \bar{q}^2 q ˉ 2 is close to the second moment of C d C_d C d , which is 1 / d 1/d 1/ d by Thm. B.2.
To summarize, the angular penalty detects a rank collapse, however the directions are arranged. If ℓ > ( d − 1 ) r / ( d − r ) \ell> (d-1)r/(d-r) ℓ > ( d − 1 ) r / ( d − r ) , a batch confined to r r r dimensions has a mean squared inner product larger than 1 / d 1/d 1/ d , its mean on control batches. So the angular penalty of such a batch has a positive lower bound. On control batches, the angular penalty instead goes to zero as 1 / ℓ 2 1/\ell^2 1/ ℓ 2 (§ 2.4 ). This is why the angular penalty rejects every collapsed batch in Figure 2 , even those optimized to look uniform.
Properties of coupling embedding magnitude and direction by the alignment term
Proposition B.2 shows that the alignment term is minimized only when images with larger view disagreement get smaller magnitude embeddings. The view disagreement varies with the embedding direction, for instance with its cosine similarity to the class center, and hence so does the magnitude. The independence of magnitude and direction in an isotropic Gaussian forbids this dependence, and works against the alignment term. We also verify that the assumption of the proposition, that all views of an image have the same magnitude, holds closely on trained encoders. Replacing the magnitudes of the views by their mean changes the alignment term of most images by less than 5%. In Remark B.4, we prove that forgoing the independence term cannot result in collapsed embeddings.
Proposition B.2. Suppose the views of each image i i i share a magnitude ρ i \rho_i ρ i , so their embeddings are u i v = ρ i u ^ i v u_i^v = \rho_i \hat{u}_i^v u i v = ρ i u ^ i v with unit directions u ^ i v \hat{u}_i^v u ^ i v . Let u ˉ i = v − 1 ∑ v = 1 v u ^ i v \bar{u}_i = v^{-1}\sum_{v=1}^{v}\hat{u}_i^v u ˉ i = v − 1 ∑ v = 1 v u ^ i v be the mean direction of image i i i , and D i = ∑ v = 1 v ∥ u ^ i v − u ˉ i ∥ 2 D_i = \sum_{v=1}^{v}\lVert\hat{u}_i^v-\bar{u}_i\rVert^2 D i = ∑ v = 1 v ∥ u ^ i v − u ˉ i ∥ 2 its view disagreement. Then the alignment term of Eq. (1) is
1 ℓ v d ∑ i = 1 ℓ ∑ v = 1 v ∥ u i v − m i ∥ 2 = 1 ℓ v d ∑ i = 1 ℓ ρ i 2 D i . (24) \frac{1}{\ell v d}\sum_{i=1}^{\ell}\sum_{v=1}^{v}\lVert u_i^v-m_i\rVert^2 = \frac{1}{\ell v d}\sum_{i=1}^{\ell}\rho_i^2 D_i. \tag*{(24)} ℓ v d 1 i = 1 ∑ ℓ v = 1 ∑ v ∥ u i v − m i ∥ 2 = ℓ v d 1 i = 1 ∑ ℓ ρ i 2 D i . (24)
Swapping the magnitudes of two images does not change the magnitude regularizer ℓ ρ \ell_\rho ℓ ρ in Eq. (4) . Over all such swaps, the alignment term is smallest only when images whose views disagree more have smaller magnitudes: D i < D j D_i < D_j D i < D j implies ρ i ≥ ρ j \rho_i \ge\rho_j ρ i ≥ ρ j . If D i D_i D i depends on the direction of the image embedding, then so does ρ i \rho_i ρ i , so ρ \rho ρ and u ^ \hat{u} u ^ are not independent.
Proof of Proposition B.2. With a shared magnitude of embeddings for all views of an image, the alignment term weighs view disagreement of each image by its squared magnitude. The mean of views of image i i i is m i = ρ i u ˉ i m_i = \rho_i \bar{u}_i m i = ρ i u ˉ i , so u i v − m i = ρ i ( u ^ i v − u ˉ i ) u_i^v - m_i = \rho_i(\hat{u}_i^v - \bar{u}_i) u i v − m i = ρ i ( u ^ i v − u ˉ i ) . Squaring, summing over views and images, and dividing by b v d b v d b v d results in Eq. (23).
Swapping magnitudes of two images changes neither the magnitude regularizer nor the view disagreements. The magnitude regularizer compares the distribution of magnitudes in the batch with χ d \chi_d χ d , and a swap does not alter it. Of course, a swap keeps every D i D_i D i unchanged. Sequences of swaps reach every rearrangement of magnitudes among images, so a minimum of the alignment term over swaps maximizes ∑ i ( − D i ) ρ i 2 \sum_i(-D_i)\rho_i^2 ∑ i ( − D i ) ρ i 2 over all rearrangements of the squared magnitudes.
To minimize the alignment term, images whose views disagree more must have smaller magnitudes. For real numbers a 1 , … , a b a_1,\ldots,a_b a 1 , … , a b and b 1 , … , b b b_1,\ldots,b_b b 1 , … , b b , if ∑ i a i b i \sum_i a_i b_i ∑ i a i b i is at least as large as for every rearrangement of b i b_i b i , then ( a i − a j ) ( b i − b j ) ≥ 0 (a_i-a_j)(b_i-b_j) \ge0 ( a i − a j ) ( b i − b j ) ≥ 0 for all i i i and j j j [20 Theorem 369] . With a i = − D i a_i=-D_i a i = − D i and b i = ρ i 2 b_i=\rho_i^2 b i = ρ i 2 , we have ( D j − D i ) ( ρ i 2 − ρ j 2 ) ≥ 0 (D_j-D_i)(\rho_i^2-\rho_j^2) \ge0 ( D j − D i ) ( ρ i 2 − ρ j 2 ) ≥ 0 . Since magnitudes are nonnegative, D i < D j D_i < D_j D i < D j implies ρ i ≥ ρ j \rho_i \ge\rho_j ρ i ≥ ρ j . Hence, to minimize the alignment term, the magnitude of an image must be a strictly decreasing function of its view disagreement, ρ i = h ( D i ) \rho_i=h(D_i) ρ i = h ( D i ) . Since h h h is one-to-one, two regions of the sphere whose images differ in view disagreement also differ in magnitude. To conclude, in this scenario, ρ \rho ρ and u ^ \hat{u} u ^ are not independent.
Figure B.2 shows the resulting weight ρ i 2 / d \rho_i^2/d ρ i 2 / d of each image in the alignment term, at d = 64 d=64 d = 64 , 256 256 256 and 1024 1024 1024 . However, Proposition B.2 assumes that all view embeddings of an image share a magnitude. The following discussion argues why this assumption is mild.
Figure B.2. Without independence, ambiguous images get less weight in the alignment term. Weight ρ i 2 / d \rho_i^2/d ρ i 2 / d of each image in the alignment term against its D i D_i D i quantile, for a batch of 256 images with exact χ d \chi_d χ d magnitudes. Under independence the weight is flat; otherwise it falls with view disagreement. At the minimum of the alignment term, the image at D i D_i D i quantile x x x gets the ( 1 − x ) (1-x) ( 1 − x ) -quantile of χ d \chi_d χ d as its magnitude.
On trained encoders, shared magnitude of image view embeddings is not a strong assumption. The magnitude regularizer compares the magnitudes of all b v b v b v embeddings in the batch with χ d \chi_d χ d . It does not force the views of an image to share a magnitude. Write the magnitude of image i i i and view v v v as ρ ˉ i + ϵ i v \bar{\rho}_i+\epsilon_i^v ρ ˉ i + ϵ i v , where ρ ˉ i \bar{\rho}_i ρ ˉ i is the mean magnitude over views, and ∑ v = 1 v ϵ i v = 0 \sum_{v=1}^v\epsilon_i^v=0 ∑ v = 1 v ϵ i v = 0 . Let μ i v = v − 1 ∑ v = 1 v ϵ i v u ^ i v \mu_i^v=v^{-1}\sum_{v=1}^v\epsilon_i^v\hat{u}_i^v μ i v = v − 1 ∑ v = 1 v ϵ i v u ^ i v . Then u i v − m i = ρ ˉ i ( u ^ i v − u ˉ i ) + ( ϵ i v u ^ i v − μ i ) u_i^v-m_i=\bar{\rho}_i(\hat{u}_i^v-\bar{u}_i)+(\epsilon_i^v\hat{u}_i^v-\mu_i) u i v − m i = ρ ˉ i ( u ^ i v − u ˉ i ) + ( ϵ i v u ^ i v − μ i ) . Summing the squares over views, we have
∑ v = 1 v ∥ u i v − m i ∥ 2 = ρ ˉ i 2 D i + ∑ v = 1 v ∥ ϵ i v u ^ i v − μ i ∥ 2 − 2 ρ ˉ i ∑ v = 1 v ϵ i v ⟨ u ˉ i , u ^ i v − u ˉ i ⟩ \sum_{v=1}^{v}\lVert u_i^v-m_i\rVert^2=\bar{\rho}_i^2D_i+\sum_{v=1}^{v}\lVert\epsilon_i^v\hat{u}_i^v-\mu_i\rVert^2
-2\bar{\rho}_i\sum_{v=1}^{v}\epsilon_i^v\langle\bar{u}_i,\hat{u}_i^v-\bar{u}_i\rangle v = 1 ∑ v ∥ u i v − m i ∥ 2 = ρ ˉ i 2 D i + v = 1 ∑ v ∥ ϵ i v u ^ i v − μ i ∥ 2 − 2 ρ ˉ i v = 1 ∑ v ϵ i v ⟨ u ˉ i , u ^ i v − u ˉ i ⟩
The first term is the one in Eq. (23), with ρ i = ρ ˉ i \rho_i=\bar{\rho}_i ρ i = ρ ˉ i . The second is at most ∑ v = 1 v ( ϵ i v ) 2 \sum_{v=1}^{v}(\epsilon_i^v)^2 ∑ v = 1 v ( ϵ i v ) 2 , that is v v v times the variance of magnitudes of the views. By Cauchy–Schwarz inequality, the third is at most 2 ρ ˉ i D i ∑ v = 1 v ( ϵ i v ) 2 2\bar{\rho}_i\sqrt{D_i\sum_{v=1}^{v}(\epsilon_i^v)^2} 2 ρ ˉ i D i ∑ v = 1 v ( ϵ i v ) 2 in absolute value. Both vanish when the views share a magnitude. Relative to the first term, both are small when standard deviation of magnitudes of the views is much smaller than ρ ˉ i D i / v \bar{\rho}_i\sqrt{D_i/v} ρ ˉ i D i / v . For PolarReg-naive trained on Tiny-ImageNet-200, with 8 augmented views of the 10,000 validation images, the alignment term is within 5% of the first term for 91% of images at d = 64 d=64 d = 64 and for 97% at d = 256 d=256 d = 256 . If one sums the alignment term over all images, as in the loss, the first term matches it within 0.5% for PolarReg-naive and within 3% for SIGReg, at both embedding dimensions.
Proposition B.2 suggests that enforcing independence between magnitude and direction works against the alignment term. However, without independence, magnitude can depend on direction freely, as long as the magnitude follows χ d \chi_d χ d and the direction is uniform. Remark B.4 shows that this freedom, provably does not lead to any feature collapse.
Proof. Let c = ⟨ e , u ^ ⟩ c = \langle e,\hat{u}\rangle c = ⟨ e , u ^ ⟩ . By Thm. B.2, c 2 ∼ Beta ( 1 / 2 , ( d − 1 ) / 2 ) c^2 \sim\operatorname{Beta}(1/2,(d-1)/2) c 2 ∼ Beta ( 1/2 , ( d − 1 ) /2 ) , with mean 1 / d 1/d 1/ d and variance 2 ( d − 1 ) / ( d 2 ( d + 2 ) ) 2(d-1)/(d^2(d+2)) 2 ( d − 1 ) / ( d 2 ( d + 2 )) . Since ρ ∼ χ d \rho\sim\chi_d ρ ∼ χ d , ρ 2 \rho^2 ρ 2 is distributed with a mean d d d and variance 2 d 2d 2 d . So E [ ∥ u ∥ 2 ] = E [ ρ 2 ] = d \mathbb{E}\left[\lVert u\rVert^2\right] = \mathbb{E}\left[\rho^2\right] = d E [ ∥ u ∥ 2 ] = E [ ρ 2 ] = d , and
e T E [ u u T ] e = E [ ⟨ e , u ⟩ 2 ] = E [ ρ 2 c 2 ] = E [ ρ 2 ] E [ c 2 ] + Cov ( ρ 2 , c 2 ) = 1 + Cov ( ρ 2 , c 2 ) . e^{\mathsf{T}}\mathbb{E}\left[uu^{\mathsf{T}}\right]e = \mathbb{E}\left[\langle e,u\rangle^2\right] = \mathbb{E}\left[\rho^2c^2\right] = \mathbb{E}\left[\rho^2\right]\mathbb{E}\left[c^2\right] + \operatorname{Cov}\left(\rho^2,c^2\right) = 1 + \operatorname{Cov}\left(\rho^2,c^2\right). e T E [ u u T ] e = E [ ⟨ e , u ⟩ 2 ] = E [ ρ 2 c 2 ] = E [ ρ 2 ] E [ c 2 ] + Cov ( ρ 2 , c 2 ) = 1 + Cov ( ρ 2 , c 2 ) .
For every joint distribution, eigenvalues of the second-moment matrix stay close to 1. In absolute value, the covariance is at most product of the standard deviations, c d = 2 d ⋅ 2 ( d − 1 ) / ( d 2 ( d + 2 ) ) c_d = \sqrt{2d}\cdot\sqrt{2(d-1)/(d^2(d+2))} c d = 2 d ⋅ 2 ( d − 1 ) / ( d 2 ( d + 2 )) , and c d < 2 / d c_d < 2/\sqrt{d} c d < 2/ d since d − 1 < d + 2 d-1<d+2 d − 1 < d + 2 . Eigenvalues of E [ u u T ] \mathbb{E}\left[uu^{\mathsf{T}}\right] E [ u u T ] lie between the smallest and largest value of e T E [ u u T ] e e^{\mathsf{T}}\mathbb{E}\left[uu^{\mathsf{T}}\right]e e T E [ u u T ] e over unit vectors e ∈ S d − 1 e \in S^{d-1} e ∈ S d − 1 . Therefore the eigenvalues are in [ 1 − c d , 1 + c d ] [1-c_d,1+c_d] [ 1 − c d , 1 + c d ] .
The mean of the embeddings stays close to origin. Since − u ^ -\hat{u} − u ^ is also uniform, E [ c ] = 0 \mathbb{E}[c]=0 E [ c ] = 0 , and the variance of c c c is E [ c 2 ] = 1 / d \mathbb{E}[c^2]=1/d E [ c 2 ] = 1/ d . Hence ⟨ e , E [ u ] ⟩ = E [ ρ c ] = Cov ( ρ , c ) \langle e,\mathbb{E}[u]\rangle= \mathbb{E}[\rho c] = \operatorname{Cov}(\rho,c) ⟨ e , E [ u ]⟩ = E [ ρ c ] = Cov ( ρ , c ) , which by Cauchy–Schwarz inequality is at most sd ( ρ ) / d \operatorname{sd}(\rho)/\sqrt{d} sd ( ρ ) / d in absolute value. Taking e e e along E [ u ] \mathbb{E}[u] E [ u ] bounds its norm.
For perspective, at d = 256 d=256 d = 256 , c d = 0.12 c_d=0.12 c d = 0.12 and sd ( ρ ) / d = 0.044 \operatorname{sd}(\rho)/\sqrt{d}=0.044 sd ( ρ ) / d = 0.044 : every eigenvalue lies between 0.88 and 1.12, and the mean is within 0.044 of the origin. So no joint distribution with these marginals collapses the embeddings: their mean squared magnitude stays at d d d , and every eigenvalue of E [ u u T ] \mathbb{E}\left[uu^{\mathsf{T}}\right] E [ u u T ] is at least 1 − c d 1-c_d 1 − c d , so there is no rank collapse. Without independence, distribution of the magnitudes can couple with the directions in interesting ways, which it cannot for the isotropic Gaussian. For example, magnitude can peak in some directions, say class centroids and dip at class boundaries, as in Figure 3 a,Figure 3 b. Magnitude still follows χ d \chi_d χ d and the direction stays uniform; trained encoders consistently have this shape (see Figure 3 c, Figure 3 d).
Details of PolarReg
The optimal coefficients λ ρ \lambda_\rho λ ρ and λ u ^ \lambda_{\hat{u}} λ u ^ of PolarReg-naive depend on the batch size ℓ \ell ℓ , embedding dimension d d d , and the structure in the data (§ 2.4 ). For instance, the angular penalty averages over ℓ ( ℓ − 1 ) / 2 \ell(\ell-1)/2 ℓ ( ℓ − 1 ) /2 pairs and ignores the magnitudes of the embeddings, so its gradient with respect to an embedding falls with ℓ \ell ℓ and as 1 / ∥ m i ∥ 1/\lVert m_i\rVert 1/ ∥ m i ∥ , while the gradient of the alignment term grows with the magnitudes. One way to remove these dependencies is to precondition the gradient of each penalty with its inverse Hessian, as in a Gauss–Newton step. Since both penalties here, are squared 2-Wasserstein distances, they are quadratic, and this Newton step is simple. We write the result of this step as a target embedding u i ∗ u_i^* u i ∗ and pull u i ′ u_i' u i ′ towards it with Ω P o l a r R e g \Omega_{\mathrm{PolarReg}} Ω PolarReg in Eq. (10) , a squared distance between embeddings. This introduces step sizes η ρ \eta_\rho η ρ and η u ^ \eta_{\hat{u}} η u ^ which do not change with the batch size, embedding dimension or magnitudes of the embeddings (Proposition B.3). Figure B.3 illustrates the construction on a toy batch.
Construction of the target embeddings for PolarReg
§ 2.4 builds the target u i ∗ u_i^* u i ∗ of each embedding in three steps. It moves the magnitudes (Eq. (8) ), moves the directions of the mean embeddings (Eq. (9) ), and combines the two into u i ∗ u_i^* u i ∗ . Here we provide more details of each step. The first two steps use a property of Eq. (3) . For n n n samples with quantiles q 1 ≤ ⋯ ≤ q n q_1 \le\cdots\le q_n q 1 ≤ ⋯ ≤ q n , its gradient with respect to the r r r -th smallest sample z ( r ) z_{(r)} z ( r ) is 1 n ( z ( r ) − q r ) \frac{1}{n}(z_{(r)}-q_r) n 1 ( z ( r ) − q r ) , and its Hessian is 1 n I \frac{1}{n}I n 1 I . So a Newton step moves each sample to the quantile at its desired sorted rank.
Figure B.3. Illustration of the construction of PolarReg in Eq. (10) from the magnitude and angular regularizers in Eqs. (4) and (5) . The targets of Eq. (10) on a toy batch in three dimensions. The batches are shown in blue, the targets are shown in red and the references if any are shown in gray. (a) Inner products between image directions, sorted, against quantiles of C 16 \mathcal{C}_{16} C 16 , with gaps δ i j \delta_{ij} δ ij . (b) Magnitudes of embeddings, sorted, against quantiles of χ 16 \chi_{16} χ 16 , each with an arrow to the quantile at its sorted rank. (c) The field g i g_i g i lies in the tangent plane at m ^ i \hat{m}_i m ^ i , along the descent direction of ℓ u ^ \ell_{\hat{u}} ℓ u ^ . The step η u ^ α g i \eta_{\hat{u}}\alpha g_i η u ^ α g i leaves the sphere, and normalization brings it back along the ray to the center, which gives the target direction m ^ i ∗ \hat{m}_i^* m ^ i ∗ . The drawing is inspired by Boumal [10, Chapter 3]. (d) The mean embedding m i m_i m i of the views changes its direction to m ^ i ∗ \hat{m}_i^* m ^ i ∗ , without changing its magnitude. It moves by d i = ∥ m i ∥ ( m ^ i ∗ − m ^ i ) d_i = \lVert m_i\rVert(\hat{m}_i^*-\hat{m}_i) d i = ∥ m i ∥ ( m ^ i ∗ − m ^ i ) . Every view u i u_i u i shifts by the same d i d_i d i , to u i + d i u_i+d_i u i + d i (hollow). It is then rescaled along its ray from the center by ρ i ∗ / ∥ u i + d i ∥ \rho_i^*/\lVert u_i+d_i\rVert ρ i ∗ / ∥ u i + d i ∥ , to its target magnitude from (b). This gives us the target embedding u i ∗ u_i^* u i ∗ . (e) A schematic of Eq. (10) for one image: each view is pulled toward the mean embedding m i m_i m i by the alignment term and toward its target u i ∗ u_i^* u i ∗ by PolarReg. This formulation replaces both regularizers of PolarReg-naive.
For the magnitude regularizer, each target magnitude fixes a target embedding. The r r r -th smallest magnitude of the β v \beta v β v views of a batch should equal the quantile q r q_r q r of χ d \chi_d χ d . The target magnitude ρ i ∗ = ρ i + η ρ ( q i v − ρ i v ) \rho_i^* = \rho_i + \eta_\rho(q_i^v-\rho_i^v) ρ i ∗ = ρ i + η ρ ( q i v − ρ i v ) in Eq. (8) moves each magnitude to its quantile q i v q_i^v q i v (Fig. B.3b) with a step size η ρ \eta_\rho η ρ . With η ρ > 1 \eta_\rho> 1 η ρ > 1 , the target lies past the quantile, compensating for the alignment term pulling the magnitudes down.
For the angular regularizer, each direction affects β − 1 \beta- 1 β − 1 inner products. The r r r -th smallest of the β ( β − 1 ) / 2 \beta(\beta-1)/2 β ( β − 1 ) /2 inner products s i j s_{ij} s ij in Eq. (5) should equal the quantile q r q_r q r of C d \mathcal{C}_d C d . Let δ i j = q i j − s i j \delta_{ij}=q_{ij}-s_{ij} δ ij = q ij − s ij be the gap (Fig. B.3a) between s i j s_{ij} s ij and its quantile q i j q_{ij} q ij . The target of s i j s_{ij} s ij is shared by images i i i and j j j . In general, no set of directions satisfies all the inner product targets. When β ≥ 2 d − 1 \beta\ge2d-1 β ≥ 2 d − 1 , the inner products outnumber the β ( d − 1 ) \beta(d-1) β ( d − 1 ) free coordinates of the directions. Inner products assigned by the sorted quantiles may not be realizable either. Equation (9) therefore moves each direction by a step that best satisfies the targets, m ^ i ∗ ∝ m ^ i + η u ^ Δ i \hat{m}_i^* \propto\hat{m}_i+\eta_{\hat{u}}\Delta_i m ^ i ∗ ∝ m ^ i + η u ^ Δ i , with Δ i ⊥ m ^ i \Delta_i \perp\hat{m}_i Δ i ⊥ m ^ i , tangent to the sphere. To find the steps, consider the moved directions m ^ i ′ = ( m ^ i + Δ i ) / ∥ m ^ i + Δ i ∥ \hat{m}_i'=(\hat{m}_i+\Delta_i)/\lVert\hat{m}_i+\Delta_i\rVert m ^ i ′ = ( m ^ i + Δ i ) / ∥ m ^ i + Δ i ∥ , with inner products s i j ′ = ⟨ m ^ i ′ , m ^ j ′ ⟩ s_{ij}'=\langle\hat{m}_i',\hat{m}_j'\rangle s ij ′ = ⟨ m ^ i ′ , m ^ j ′ ⟩ . The best step Δ = ( Δ 1 , … , Δ β ) \Delta=(\Delta_1,\ldots,\Delta_\beta) Δ = ( Δ 1 , … , Δ β ) minimizes
∑ i < j ( s i j ′ − q i j ) 2 . (25) \sum_{i<j}\left(s_{ij}'-q_{ij}\right)^2. \tag*{(25)} i < j ∑ ( s ij ′ − q ij ) 2 . (25)
This is a nonlinear least-squares problem, since each s i j ′ s_{ij}' s ij ′ is a nonlinear function of the steps Δ i \Delta_i Δ i and Δ j \Delta_j Δ j .
Linearizing the inner products, we have a linear least-squares problem. Since Δ i ⊥ m ^ i \Delta_i \perp\hat{m}_i Δ i ⊥ m ^ i , ∥ m ^ i + Δ i ∥ = ( 1 + ∥ Δ i ∥ 2 ) 1 / 2 = 1 + O ( ∥ Δ i ∥ 2 ) \lVert\hat{m}_i+\Delta_i\rVert=(1+\lVert\Delta_i\rVert^2)^{1/2}=1+O(\lVert\Delta_i\rVert^2) ∥ m ^ i + Δ i ∥ = ( 1 + ∥ Δ i ∥ 2 ) 1/2 = 1 + O (∥ Δ i ∥ 2 ) , so the normalization changes the inner products s i j ′ s'_{ij} s ij ′ only at second order. The inner product ⟨ m ^ i + Δ i , m ^ j + Δ j ⟩ = s i j + ⟨ Δ i , m ^ j ⟩ + ⟨ m ^ i , Δ j ⟩ + ⟨ Δ i , Δ j ⟩ \langle\hat{m}_i+\Delta_i,\hat{m}_j+\Delta_j\rangle=s_{ij}+\langle\Delta_i,\hat{m}_j\rangle+\langle\hat{m}_i,\Delta_j\rangle+\langle\Delta_i,\Delta_j\rangle ⟨ m ^ i + Δ i , m ^ j + Δ j ⟩ = s ij + ⟨ Δ i , m ^ j ⟩ + ⟨ m ^ i , Δ j ⟩ + ⟨ Δ i , Δ j ⟩ has one first-order term for each direction of the pair, and its last term is of second order. With q i j = s i j + δ i j q_{ij}=s_{ij}+\delta_{ij} q ij = s ij + δ ij ,
s i j ′ − q i j = ⟨ Δ i , m ^ j ⟩ + ⟨ m ^ i , Δ j ⟩ − δ i j + O ( ∥ Δ ∥ 2 ) , s'_{ij}-q_{ij}=\langle\Delta_i,\hat{m}_j\rangle+\langle\hat{m}_i,\Delta_j\rangle-\delta_{ij}+O(\lVert\Delta\rVert^2), s ij ′ − q ij = ⟨ Δ i , m ^ j ⟩ + ⟨ m ^ i , Δ j ⟩ − δ ij + O (∥ Δ ∥ 2 ) ,
is the first-order Taylor expansion of s i j ′ s'_{ij} s ij ′ at Δ = 0 \Delta=0 Δ = 0 . Minimizing the sum of squares of the linear part over all steps is one Gauss–Newton step for Eq. (25) . It is a linear least-squares problem with ( ϑ 2 ) \binom{\vartheta}{2} ( 2 ϑ ) equations and ϑ ( d − 1 ) \vartheta(d-1) ϑ ( d − 1 ) unknowns.
We restrict the step to the descent direction of the angular regularizer. Solving this full linear problem at every training step is costly. Instead, we fix each step to the descent direction of the angular regularizer on the sphere (Proposition B.3a), that is Δ i = t g i \Delta_i=t g_i Δ i = t g i with
g i = ( I − m ^ i m ^ i T ) ∑ j ≠ i δ i j m ^ j . g_i=\left(I-\hat{m}_i\hat{m}_i^{\mathsf T}\right)\sum_{j\ne i}\delta_{ij}\hat{m}_j. g i = ( I − m ^ i m ^ i T ) j = i ∑ δ ij m ^ j .
This leaves a single unknown, the scale t t t , and the problem becomes a line search along g = ( g 1 , … , g ϑ ) g=(g_1,\ldots,g_{\vartheta}) g = ( g 1 , … , g ϑ ) . With this, each linearized residual becomes t c i j − δ i j t c_{ij}-\delta_{ij} t c ij − δ ij with c i j = ⟨ g i , m ^ j ⟩ + ⟨ m ^ i , g j ⟩ c_{ij}=\langle g_i,\hat{m}_j\rangle+\langle\hat{m}_i,g_j\rangle c ij = ⟨ g i , m ^ j ⟩ + ⟨ m ^ i , g j ⟩ . The sum of their squares, ∑ i < j ( t c i j − δ i j ) 2 \sum_{i<j}(t c_{ij}-\delta_{ij})^2 ∑ i < j ( t c ij − δ ij ) 2 , is a parabola in t t t that is smallest at t = ⟨ c , δ ⟩ / ∥ c ∥ 2 t=\langle c,\delta\rangle/\lVert c\rVert^2 t = ⟨ c , δ ⟩ / ∥ c ∥ 2 . Here c = ( c i j ) i < j c=(c_{ij})_{i<j} c = ( c ij ) i < j and δ = ( δ i j ) i < j \delta=(\delta_{ij})_{i<j} δ = ( δ ij ) i < j are vectors in R ( ϑ 2 ) \mathbb{R}^{\binom{\vartheta}{2}} R ( 2 ϑ ) , with one entry for each pair of images. We call this minimizer α \alpha α . So α \alpha α is a Newton step along g g g , which is how it depends on the Hessian of Eq. (5) . Like η ρ \eta_\rho η ρ for the magnitudes, η u ^ \eta_{\hat{u}} η u ^ scales this step, and the target direction in Eq. (9) is m ^ i ∗ ∝ m ^ i + η u ^ α g i \hat{m}_i^*\propto\hat{m}_i+\eta_{\hat{u}}\alpha g_i m ^ i ∗ ∝ m ^ i + η u ^ α g i (Fig. B.3c). Normalization is a retraction, that brings the step back on the sphere and matches moving along it, to first order [10 Example 3.49] . This operation is one step of Riemannian gradient descent on the directions [10 Algorithm 4.1] .
Combining the angular shift and the magnitude rescaling provides a target embedding for every view. Shifting every view of image i i i by d i = ∥ m i ∥ m ^ i ∗ − m i d_i=\lVert m_i\rVert\hat{m}_i^*-m_i d i = ∥ m i ∥ m ^ i ∗ − m i turns the direction of their mean embedding to m ^ i ∗ \hat{m}_i^* m ^ i ∗ , without changing its magnitude ∥ m i ∥ \lVert m_i\rVert ∥ m i ∥ . This transformation keeps the offset of each view from the mean (Fig. B.3d). Since g i ⊥ m ^ i g_i\perp\hat{m}_i g i ⊥ m ^ i , ∥ m ^ i + η u ^ α g i ∥ = 1 + O ( η u ^ 2 α 2 ∥ g i ∥ 2 ) \lVert\hat{m}_i+\eta_{\hat{u}}\alpha g_i\rVert=1+O(\eta_{\hat{u}}^2\alpha^2\lVert g_i\rVert^2) ∥ m ^ i + η u ^ α g i ∥ = 1 + O ( η u ^ 2 α 2 ∥ g i ∥ 2 ) . So d i = η u ^ α ∥ m i ∥ g i d_i=\eta_{\hat{u}}\alpha\lVert m_i\rVert g_i d i = η u ^ α ∥ m i ∥ g i to first order; a displacement in the embedding space. Each view is then rescaled to its target magnitude, leading to the target embedding,
u i v ∗ = ρ i v ∗ u i v + d i ∥ u i v + d i ∥ . u_i^{v*}=\rho_i^{v*}\frac{u_i^v+d_i}{\lVert u_i^v+d_i\rVert}. u i v ∗ = ρ i v ∗ ∥ u i v + d i ∥ u i v + d i .
as shown in Fig. B.3d. Regressing onto these target embeddings gives Ω P o l a r R e g \Omega_{\mathrm{PolarReg}} Ω PolarReg in Eq. (10) , replacing Ω P o l a r R e g - n a i v e \Omega_{\mathrm{PolarReg\text{-}naive}} Ω PolarReg - naive . In total, each view u i v u_i^v u i v is pulled toward its target u i v ∗ u_i^{v*} u i v ∗ and its mean embedding m i m_i m i (Fig. B.3e).
Properties of PolarReg
Proposition B.3 compares Ω P o l a r R e g \Omega_{\mathrm{PolarReg}} Ω PolarReg in Eq. (10) with the magnitude and angular regularizers in Eqs. (4) and (5) . To first order, Ω P o l a r R e g \Omega_{\mathrm{PolarReg}} Ω PolarReg pulls embeddings along gradients of the magnitude and angular regularizers, with coefficients set by the batch. The gradient of Ω P o l a r R e g \Omega_{\mathrm{PolarReg}} Ω PolarReg is zero if and only if the gradients of both regularizers are zero.
Proposition B.3. Let η ρ , η u ^ > 0 \eta_\rho,\eta_{\hat{u}}>0 η ρ , η u ^ > 0 , and let n = ( ϑ 2 ) n=\binom{\vartheta}{2} n = ( 2 ϑ ) be the number of pairs of images. Assume that the embeddings u i v u_i^v u i v and the mean embeddings m i m_i m i are nonzero, the inner products s i j s_{ij} s ij are distinct, and the magnitudes of the embeddings are distinct. These assumptions ensure that ℓ ρ \ell_\rho ℓ ρ and ℓ u ^ \ell_{\hat{u}} ℓ u ^ in Eqs. (4) and (5) are differentiable. The following hold.
(a) The descent direction g i g_i g i is − n / 2 -n/2 − n /2 times the Riemannian gradient of ℓ u ^ \ell_{\hat{u}} ℓ u ^ at m ^ i \hat{m}_i m ^ i on the sphere, and α > 0 \alpha>0 α > 0 unless g = ( g 1 , … , g ϑ ) = 0 g=(g_1,\ldots,g_{\vartheta})=0 g = ( g 1 , … , g ϑ ) = 0 . Hence the target direction m ^ i ∗ \hat{m}_i^* m ^ i ∗ moves every direction m ^ i \hat{m}_i m ^ i along the step that gradient descent on Eq. (5) takes.
(b) The step Δ i = α g i \Delta_i=\alpha g_i Δ i = α g i changes each inner product s i j s_{ij} s ij by α c i j \alpha c_{ij} α c ij to first order. The mean of the squared changes, ∥ α c ∥ 2 / n \lVert\alpha c\rVert^2/n ∥ α c ∥ 2 / n , is at most ℓ u ^ \ell_{\hat{u}} ℓ u ^ , for any batch size and any scale of the embeddings. In contrast, the gradient of ℓ u ^ \ell_{\hat{u}} ℓ u ^
with respect to an embedding u i v u_i^v u i v is inversely proportional to the number of pairs n n n and magnitude ∥ m i ∥ \lVert m_i\rVert ∥ m i ∥ .
(c) To first order in u i v ∗ − u i v u_i^{v*}-u_i^v u i v ∗ − u i v , the gradient of Ω P o l a r R e g \Omega_{\mathrm{PolarReg}} Ω PolarReg with respect to u i v u_i^v u i v is the gradient of the magnitude regularizer of Ω P o l a r R e g - n a i v e \Omega_{\mathrm{PolarReg\text{-}naive}} Ω PolarReg - naive in Eq. (2) with λ ρ = η ρ / d \lambda_\rho=\eta_\rho/d λ ρ = η ρ / d , plus the component orthogonal to u i v ∗ u_i^{v*} u i v ∗ of the gradient of its angular regularizer with λ u ^ = η u ^ α ( b − 1 ) ∥ m i ∥ 2 / ( 2 d ) \lambda_{\hat{u}}=\eta_{\hat{u}}\alpha(b-1)\lVert m_i\rVert^2/(2d) λ u ^ = η u ^ α ( b − 1 ) ∥ m i ∥ 2 / ( 2 d ) .
(d) The target embeddings equal the embeddings, u i v ∗ = u i v u_i^{v*}=u_i^v u i v ∗ = u i v for all v v v and i i i , if and only if every magnitude ρ i v \rho_i^v ρ i v equals its quantile q i v q_i^v q i v and the directions m ^ 1 , … , m ^ b \hat{m}_1,\ldots,\hat{m}_b m ^ 1 , … , m ^ b are a critical point of ℓ u ^ \ell_{\hat{u}} ℓ u ^ . Hence the gradient of Ω P o l a r R e g \Omega_{\mathrm{PolarReg}} Ω PolarReg is zero if and only if the gradients of both regularizers in Eqs. (4) and (5) are zero.
(e) For every view, ∥ u i v ∗ − u i v ∥ < η ρ ∣ q i v − ρ i v ∣ + 2 2 ∥ m i ∥ \lVert u_i^{v*}-u_i^v\rVert< \eta_\rho\lvert q_i^v-\rho_i^v\rvert+2\sqrt{2}\lVert m_i\rVert ∥ u i v ∗ − u i v ∥ < η ρ ∣ q i v − ρ i v ∣ + 2 2 ∥ m i ∥ . Hence the gradient of Ω P o l a r R e g \Omega_{\mathrm{PolarReg}} Ω PolarReg is bounded by the magnitudes of the mean embeddings and the absolute differences between the magnitudes and their quantiles, irrespective of the scale α \alpha α and gaps δ i j \delta_{ij} δ ij .
Proof. Let P i = I − m ^ i m ^ i T P_i=I-\hat{m}_i\hat{m}_i^{\mathsf T} P i = I − m ^ i m ^ i T be the orthogonal projection onto vectors orthogonal to m ^ i \hat{m}_i m ^ i —the tangent space of the unit sphere at m ^ i \hat{m}_i m ^ i . As discussed earlier, ℓ u ^ = 1 n ∑ i < j ( s i j − q i j ) 2 = 1 n ∑ i < j δ i j 2 \ell_{\hat{u}}=\frac{1}{n}\sum_{i<j}(s_{ij}-q_{ij})^2=\frac{1}{n}\sum_{i<j}\delta_{ij}^2 ℓ u ^ = n 1 ∑ i < j ( s ij − q ij ) 2 = n 1 ∑ i < j δ ij 2 .
Proof of (a). Treating m ^ i \hat{m}_i m ^ i as a vector in R d \mathbb{R}^d R d , ∂ s i j / ∂ m ^ i = m ^ j \partial s_{ij}/\partial\hat{m}_i=\hat{m}_j ∂ s ij / ∂ m ^ i = m ^ j , and
∂ ℓ u ^ ∂ m ^ i = 2 n ∑ j ≠ i ( s i j − q i j ) m ^ j = − 2 n ∑ j ≠ i δ i j m ^ j . \frac{\partial\ell_{\hat{u}}}{\partial\hat{m}_i}
=\frac{2}{n}\sum_{j\ne i}(s_{ij}-q_{ij})\hat{m}_j
=-\frac{2}{n}\sum_{j\ne i}\delta_{ij}\hat{m}_j. ∂ m ^ i ∂ ℓ u ^ = n 2 j = i ∑ ( s ij − q ij ) m ^ j = − n 2 j = i ∑ δ ij m ^ j .
A tangent vector ξ ⊥ m ^ i \xi\perp\hat{m}_i ξ ⊥ m ^ i moves m ^ i \hat{m}_i m ^ i along the curve ( m ^ i + t ξ ) / ∥ m ^ i + t ξ ∥ (\hat{m}_i+t\xi)/\lVert\hat{m}_i+t\xi\rVert ( m ^ i + t ξ ) / ∥ m ^ i + t ξ ∥ . The normalization in the denominator changes m ^ i + t ξ \hat{m}_i+t\xi m ^ i + t ξ only to second order in t t t . The curve has derivative ξ \xi ξ at t = 0 t=0 t = 0 ; ℓ u ^ \ell_{\hat{u}} ℓ u ^ changes along the curve at the rate ⟨ ∂ ℓ u ^ / ∂ m ^ i , ξ ⟩ = ⟨ P i ∂ ℓ u ^ / ∂ m ^ i , ξ ⟩ \langle\partial\ell_{\hat{u}}/\partial\hat{m}_i,\xi\rangle=\langle P_i\partial\ell_{\hat{u}}/\partial\hat{m}_i,\xi\rangle ⟨ ∂ ℓ u ^ / ∂ m ^ i , ξ ⟩ = ⟨ P i ∂ ℓ u ^ / ∂ m ^ i , ξ ⟩ , since ξ ⊥ m ^ i \xi\perp\hat{m}_i ξ ⊥ m ^ i . The Riemannian gradient of ℓ u ^ \ell_{\hat{u}} ℓ u ^ at m ^ i \hat{m}_i m ^ i is the tangent vector whose inner product with every tangent ξ \xi ξ has this derivative [10 Definition 3.58] . Hence it is P i ∂ ℓ u ^ / ∂ m ^ i = − ( 2 / n ) g i P_i\partial\ell_{\hat{u}}/\partial\hat{m}_i=-(2/n)g_i P i ∂ ℓ u ^ / ∂ m ^ i = − ( 2/ n ) g i [10 Proposition 3.61] .
Now let a i = ∑ j ≠ i δ i j m ^ j a_i=\sum_{j\ne i}\delta_{ij}\hat{m}_j a i = ∑ j = i δ ij m ^ j , so that g i = P i a i g_i=P_i a_i g i = P i a i . Since δ i j = δ j i \delta_{ij}=\delta_{ji} δ ij = δ j i , we have
⟨ c , δ ⟩ = ∑ i < j δ i j ( ⟨ g i , m ^ j ⟩ + ⟨ m ^ i , g j ⟩ ) = ∑ i ⟨ g i , a i ⟩ = ∑ i ⟨ P i a i , P i a i ⟩ = ∑ i ∥ g i ∥ 2 , \langle c,\delta\rangle=\sum_{i<j}\delta_{ij}\left(\langle g_i,\hat{m}_j\rangle+\langle\hat{m}_i,g_j\rangle\right)=\sum_i\langle g_i,a_i\rangle=\sum_i\langle P_i a_i,P_i a_i\rangle=\sum_i\lVert g_i\rVert^2, ⟨ c , δ ⟩ = i < j ∑ δ ij ( ⟨ g i , m ^ j ⟩ + ⟨ m ^ i , g j ⟩ ) = i ∑ ⟨ g i , a i ⟩ = i ∑ ⟨ P i a i , P i a i ⟩ = i ∑ ∥ g i ∥ 2 ,
where the third equality holds because P i P_i P i is an orthogonal projection. So α = ∑ i ∥ g i ∥ 2 / ∥ c ∥ 2 > 0 \alpha=\sum_i\lVert g_i\rVert^2/\lVert c\rVert^2>0 α = ∑ i ∥ g i ∥ 2 / ∥ c ∥ 2 > 0 when g ≠ 0 g\ne0 g = 0 . The target direction m ^ i ∗ ∝ m ^ i + η u ^ α g i \hat{m}_i^*\propto\hat{m}_i+\eta_{\hat{u}}\alpha g_i m ^ i ∗ ∝ m ^ i + η u ^ α g i moves m ^ i \hat{m}_i m ^ i along the great circle in the direction g i g_i g i .
Proof of (b). By Sec. B.5.1, the step t g i t g_i t g i changes s i j s_{ij} s ij by t c i j t c_{ij} t c ij to first order in t t t , and α \alpha α minimizes ∑ i < j ( t c i j − δ i j ) 2 = t 2 ∥ c ∥ 2 − 2 t ⟨ c , δ ⟩ + ∥ δ ∥ 2 \sum_{i<j}(t c_{ij}-\delta_{ij})^2=t^2\lVert c\rVert^2-2t\langle c,\delta\rangle+\lVert\delta\rVert^2 ∑ i < j ( t c ij − δ ij ) 2 = t 2 ∥ c ∥ 2 − 2 t ⟨ c , δ ⟩ + ∥ δ ∥ 2 . Then α c \alpha c α c is the orthogonal projection of δ \delta δ onto the line through c c c , so ∥ α c ∥ ≤ ∥ δ ∥ \lVert\alpha c\rVert\le\lVert\delta\rVert ∥ α c ∥ ≤ ∥ δ ∥ . The entries of α c \alpha c α c and δ \delta δ are the changes α c i j \alpha c_{ij} α c ij and gaps δ i j \delta_{ij} δ ij of the n n n pairs of images. The mean of the squared changes is ∥ α c ∥ 2 / n ≤ ∥ δ ∥ 2 / n = ℓ u ^ \lVert\alpha c\rVert^2/n\le\lVert\delta\rVert^2/n=\ell_{\hat{u}} ∥ α c ∥ 2 / n ≤ ∥ δ ∥ 2 / n = ℓ u ^ , the mean of the squared gaps. Since the inner products depend only on the directions m ^ i \hat{m}_i m ^ i , this bound holds for any batch size, embedding dimension and scale of the embeddings.
Proof of (c). By Sec. B.5.1, d i = η u ^ α ∥ m i ∥ g i d_i=\eta_{\hat{u}}\alpha\lVert m_i\rVert g_i d i = η u ^ α ∥ m i ∥ g i to first order in the step size η u ^ α ∥ g i ∥ \eta_{\hat{u}}\alpha\lVert g_i\rVert η u ^ α ∥ g i ∥ , and u i v ∗ = ρ i v ∗ ( u i v + d i ) / ∥ u i v + d i ∥ u_i^{v*}=\rho_i^{v*}(u_i^v+d_i)/\lVert u_i^v+d_i\rVert u i v ∗ = ρ i v ∗ ( u i v + d i ) / ∥ u i v + d i ∥ . To first order in ∥ d i ∥ \lVert d_i\rVert ∥ d i ∥ , ∥ u i v + d i ∥ = ρ i v + ⟨ u ^ i v , d i ⟩ \lVert u_i^v+d_i\rVert=\rho_i^v+\langle\hat{u}_i^v,d_i\rangle ∥ u i v + d i ∥ = ρ i v + ⟨ u ^ i v , d i ⟩ , so
u i v ∗ − u i v = ( I − u ^ i v ( u ^ i v ) T ) d i + η ρ ( q i v − ρ i v ) u ^ i v . u_i^{v*}-u_i^v=\left(I-\hat{u}_i^v(\hat{u}_i^v)^{\mathsf T}\right)d_i+\eta_\rho\left(q_i^v-\rho_i^v\right)\hat{u}_i^v. u i v ∗ − u i v = ( I − u ^ i v ( u ^ i v ) T ) d i + η ρ ( q i v − ρ i v ) u ^ i v .
The magnitude of the embedding is only affected by the target magnitude, and its direction only through the target direction of the mean embedding. With the fixed target embeddings, the gradient of Ω P o l a r R e g \Omega_{\mathrm{PolarReg}} Ω PolarReg with respect to u i v u_i^v u i v is 2 ( u i v − u i v ∗ ) / ( β v d ) 2(u_i^v-u_i^{v*})/(\beta v d) 2 ( u i v − u i v ∗ ) / ( β v d ) , which to first order (in the step size) is
− 2 β v d [ η u ^ α ∥ m i ∥ ( I − u ^ i v ( u ^ i v ) T ) g i + η ρ ( q i v − ρ i v ) u ^ i v ] . -\frac{2}{\beta v d}\left[\eta_{\hat{u}}\alpha\lVert m_i\rVert\left(I-\hat{u}_i^v(\hat{u}_i^v)^{\mathsf T}\right)g_i+\eta_\rho\left(q_i^v-\rho_i^v\right)\hat{u}_i^v\right]. − β v d 2 [ η u ^ α ∥ m i ∥ ( I − u ^ i v ( u ^ i v ) T ) g i + η ρ ( q i v − ρ i v ) u ^ i v ] .
The gradients of Ω P o l a r R e g - n a i v e \Omega_{\mathrm{PolarReg\text{-}naive}} Ω PolarReg - naive in Eq. (2) with respect to u i v u_i^v u i v are − 2 λ ρ ( q i v − ρ i v ) u ^ i v / ( β v ) -2\lambda_\rho(q_i^v-\rho_i^v)\hat{u}_i^v/(\beta v) − 2 λ ρ ( q i v − ρ i v ) u ^ i v / ( β v ) for the magnitude regularizer and − 2 λ u ^ g i / ( n v ∥ m i ∥ ) -2\lambda_{\hat{u}}g_i/(nv\lVert m_i\rVert) − 2 λ u ^ g i / ( n v ∥ m i ∥) for the angular regularizer. Comparing, the magnitude parts agree for λ ρ = η ρ / d \lambda_\rho=\eta_\rho/d λ ρ = η ρ / d , and the angular parts agree for λ u ^ = η u ^ α ( β − 1 ) ∥ m i ∥ 2 / ( 2 d ) \lambda_{\hat{u}}=\eta_{\hat{u}}\alpha(\beta-1)\lVert m_i\rVert^2/(2d) λ u ^ = η u ^ α ( β − 1 ) ∥ m i ∥ 2 / ( 2 d ) , except that Ω P o l a r R e g \Omega_{\mathrm{PolarReg}} Ω PolarReg keeps only the component orthogonal to u i v u_i^v u i v . In Ω P o l a r R e g - n a i v e \Omega_{\mathrm{PolarReg\text{-}naive}} Ω PolarReg - naive , the angular gradient − 2 λ u ^ g i / ( n ν ∥ m i ∥ ) -2\lambda_{\hat{u}}g_i/(n\nu\lVert m_i\rVert) − 2 λ u ^ g i / ( n ν ∥ m i ∥) is orthogonal to m ^ i \hat{m}_i m ^ i but in general not to u i v u_i^v u i v . Its component along u ^ v \hat{u}^v u ^ v , proportional to ⟨ g i , u ^ v ⟩ \langle g_i,\hat{u}^v\rangle ⟨ g i , u ^ v ⟩ , changes the magnitude of each view, so a gradient step on the angular regularizer also moves the magnitudes, while in Ω P o l a r R e g \Omega_{\mathrm{PolarReg}} Ω PolarReg only the target magnitude does.
Proof of (d). If every magnitude equals its quantile and g = 0 g=0 g = 0 , then d i = 0 d_i=0 d i = 0 and ρ i v ∗ = ρ i v \rho_i^{v*}=\rho_i^v ρ i v ∗ = ρ i v , hence u i v ∗ = u i v u_i^{v*}=u_i^v u i v ∗ = u i v . Conversely, suppose that u i v ∗ = u i v u_i^{v*}=u_i^v u i v ∗ = u i v for every embedding. Their magnitudes are equal, so η ρ ( q i v − ρ i v ) = ρ i v ∗ − ρ i v = 0 \eta_\rho(q_i^v-\rho_i^v)=\rho_i^{v*}-\rho_i^v=0 η ρ ( q i v − ρ i v ) = ρ i v ∗ − ρ i v = 0 . Every magnitude equals its quantile since η ρ > 0 \eta_\rho>0 η ρ > 0 . Substituting ρ i v ∗ = ρ i v \rho_i^{v*}=\rho_i^v ρ i v ∗ = ρ i v into u i v = u i v ∗ = ρ i v ∗ ( u i v + d i ) / ∥ u i v + d i ∥ u_i^v=u_i^{v*}=\rho_i^{v*}(u_i^v+d_i)/\lVert u_i^v+d_i\rVert u i v = u i v ∗ = ρ i v ∗ ( u i v + d i ) / ∥ u i v + d i ∥ we have u i v + d i u_i^v+d_i u i v + d i to be a positive multiple of u i v u_i^v u i v , for every view. If d i ≠ 0 d_i\ne0 d i = 0 , every view of image i i i , and so m i m_i m i , would be parallel to d i d_i d i . But d i d_i d i has the component η u ^ α ∥ m i ∥ g i / ∥ m ^ i + η u ^ α g i ∥ \eta_{\hat{u}}\alpha\lVert m_i\rVert g_i/\lVert\hat{m}_i+\eta_{\hat{u}}\alpha g_i\rVert η u ^ α ∥ m i ∥ g i / ∥ m ^ i + η u ^ α g i ∥ orthogonal to m ^ i \hat{m}_i m ^ i , which is nonzero whenever d i ≠ 0 d_i\ne0 d i = 0 . Hence d i = 0 d_i=0 d i = 0 , which means m ^ i ∗ = m ^ i \hat{m}_i^*=\hat{m}_i m ^ i ∗ = m ^ i and α g i = 0 \alpha g_i=0 α g i = 0 for every i i i . By (a), α > 0 \alpha>0 α > 0 unless g = 0 g=0 g = 0 , so g = 0 g=0 g = 0 , and the Riemannian gradient of ℓ u ^ \ell_{\hat{u}} ℓ u ^ , − ( 2 / n ) g i -(2/n)g_i − ( 2/ n ) g i at each m ^ i \hat{m}_i m ^ i , is zero. The gradients of the two regularizers in Eqs. (4) and (5) are zero when every magnitude equals its quantile and g = 0 g=0 g = 0 , which proves (d).
Proof of (e). Note that u i v ∗ = ρ i v ∗ e u_i^{v*}=\rho_i^{v*}e u i v ∗ = ρ i v ∗ e and u i v + d i = ∥ u i v + d i ∥ e u_i^v+d_i=\lVert u_i^v+d_i\rVert e u i v + d i = ∥ u i v + d i ∥ e with the unit vector e = ( u i v + d i ) / ∥ u i v + d i ∥ e=(u_i^v+d_i)/\lVert u_i^v+d_i\rVert e = ( u i v + d i ) / ∥ u i v + d i ∥ . Hence,
∥ u i v ∗ − u i v ∥ ≤ ∣ ρ i v ∗ − ∥ u i v + d i ∥ ∣ + ∥ d i ∥ ≤ ∣ ρ i v ∗ − ρ i v ∣ + 2 ∥ d i ∥ . \lVert u_i^{v*}-u_i^v\rVert\le\lvert\rho_i^{v*}-\lVert u_i^v+d_i\rVert\rvert+\lVert d_i\rVert\le\lvert\rho_i^{v*}-\rho_i^v\rvert+2\lVert d_i\rVert. ∥ u i v ∗ − u i v ∥ ≤ ∣ ρ i v ∗ − ∥ u i v + d i ∥∣ + ∥ d i ∥ ≤ ∣ ρ i v ∗ − ρ i v ∣ + 2 ∥ d i ∥ .
where the second inequality uses the reverse triangle inequality ∣ ∥ u i v + d i ∥ − ρ i v ∣ ≤ ∥ d i ∥ \lvert\lVert u_i^v+d_i\rVert-\rho_i^v\rvert\le\lVert d_i\rVert ∣∥ u i v + d i ∥ − ρ i v ∣ ≤ ∥ d i ∥ . The first term is η ρ ∣ q i v − ρ i v ∣ \eta_\rho\lvert q_i^v-\rho_i^v\rvert η ρ ∣ q i v − ρ i v ∣ . Since g i ⊥ m ^ i g_i\perp\hat{m}_i g i ⊥ m ^ i , the target direction m ^ i ∗ \hat{m}_i^* m ^ i ∗ has an angle ψ i = arctan ( η u ^ α ∥ g i ∥ ) < π / 2 \psi_i=\arctan(\eta_{\hat{u}}\alpha\lVert g_i\rVert)<\pi/2 ψ i = arctan ( η u ^ α ∥ g i ∥) < π /2 with m ^ i \hat{m}_i m ^ i , so ∥ d i ∥ = ∥ m i ∥ ∥ m ^ i ∗ − m ^ i ∥ = 2 ∥ m i ∥ sin ( ψ i / 2 ) < 2 ∥ m i ∥ \lVert d_i\rVert=\lVert m_i\rVert\lVert\hat{m}_i^*-\hat{m}_i\rVert=2\lVert m_i\rVert\sin(\psi_i/2)<\sqrt{2}\,\lVert m_i\rVert ∥ d i ∥ = ∥ m i ∥ ∥ m ^ i ∗ − m ^ i ∥ = 2 ∥ m i ∥ sin ( ψ i /2 ) < 2 ∥ m i ∥ .
This shows that Ω P o l a r R e g \Omega_{\mathrm{PolarReg}} Ω PolarReg enforces the same distributions of the magnitudes and directions as Ω P o l a r R e g - n a i v e \Omega_{\mathrm{PolarReg\text{-}naive}} Ω PolarReg - naive , with coefficients set by each batch. Its gradient is bounded by the magnitudes of the embeddings and their quantiles, and it is zero only where the gradients of the regularizers in Eqs. (4) and (5) are zero.
Experimental details
Implementation of the independence regularizer in Eq. (7)
§ 2.2 enforces independence of magnitude and direction by penalizing M M D 2 \mathrm{MMD}^2 MMD 2 . Results with this enforcement are presented in the “PolarReg-naive + Independence” row of Table 1 . In this section, we provide details on which views ℓ ⊥ \ell_\perp ℓ ⊥ uses, why it does not backpropagate through the magnitudes and bandwidths, its coefficient λ ⊥ \lambda_\perp λ ⊥ , and how we measure M M D 2 \mathrm{MMD}^2 MMD 2 in Table 1 .
In Eq. (7) , we average only over the global views of each image; there are 2 global views on ImageNet-100. A constant magnitude makes M M D 2 \mathrm{MMD}^2 MMD 2 zero for any set of directions. Hence, a gradient of ℓ ⊥ \ell_\perp ℓ ⊥ with respect to the magnitudes would lower it by collapsing all magnitudes to one value. Therefore, for ℓ ⊥ \ell_\perp ℓ ⊥ we do not backpropagate through the magnitudes ρ i v \rho_i^v ρ i v . We also treat the bandwidths σ ρ \sigma_\rho σ ρ and σ u ^ \sigma_{\hat{u}} σ u ^ as constants, so ℓ ⊥ \ell_\perp ℓ ⊥ moves only the directions, through the kernel values L i j v , v ′ L_{ij}^{v,v'} L ij v , v ′ . We set λ ⊥ \lambda_\perp λ ⊥ , so that the gradient of λ ⊥ ℓ ⊥ \lambda_\perp\ell_\perp λ ⊥ ℓ ⊥ with respect to the embeddings has a similar norm as the gradient of λ u ^ ℓ u ^ \lambda_{\hat{u}}\ell_{\hat{u}} λ u ^ ℓ u ^ .
In Table 1 , we compute Eq. (7) on one view of 3000 validation images, with bandwidths σ ρ \sigma_\rho σ ρ and σ u ^ \sigma_{\hat{u}} σ u ^ from a random subset of 2000 of them. Raw values of M M D 2 \mathrm{MMD}^2 MMD 2 are not comparable across methods, since the bandwidths are set from the embeddings of each method. We divide the result by its standard deviation over 200 shuffles of the magnitudes across images, which make magnitude and direction independent; this ratio is comparable across methods.
The coefficients of PolarReg-naive can be tuned once and scaled to new settings
The angular coefficient λ u ^ \lambda_{\hat{u}} λ u ^ and magnitude coefficient λ ρ \lambda_\rho λ ρ of PolarReg-naive have a broad optimum. We tune the coefficients once, on Tiny-ImageNet-200 with b = 256 b=256 b = 256 and d = 64 d=64 d = 64 , to λ u ^ = 20 \lambda_{\hat{u}}=20 λ u ^ = 20 and λ ρ = 0.045 \lambda_\rho=0.045 λ ρ = 0.045 . In Tab. C.1, scaling tuned coefficients by 0.25 0.25 0.25 –4 × 4\times 4 × , the resulting linear probe changes by at most 1 point in accuracy.
The coefficients can be rescaled to a new setting or dataset with a gradient measurement. The coefficients λ u ^ \lambda_{\hat{u}} λ u ^ and λ ρ \lambda_\rho λ ρ in Eq. (2) weigh the regularizers with respect to the alignment term. This conversion changes with the batch size, embedding dimension and data. For example, for n n n independent samples of a distribution with CDF F F F and density f f f , the expected W 2 2 W_2^2 W 2 2 to that distribution falls as 1 / n 1/n 1/ n if ∫ F ( 1 − F ) / f < ∞ \int\sqrt{F(1-F)}/f < \infty ∫ F ( 1 − F ) / f < ∞ [7 Theorems 5.1 and 5.9] , which holds for the inner products. For the angular regularizer, samples are the ϑ ( ϑ − 1 ) / 2 \vartheta(\vartheta- 1)/2 ϑ ( ϑ − 1 ) /2 pairs. A coefficient tuned for such a regularizer at ϑ = 256 \vartheta= 256 ϑ = 256 acts about 15 times stronger at ϑ = 64 \vartheta= 64 ϑ = 64 . In a new setting, we measure the gradient norms g a l i g n g_{\mathrm{align}} g align , g u ^ g_{\hat{u}} g u ^ and g ρ g_{\rho} g ρ of the three terms at the first step after warm-up. We rescale the coefficients λ u ^ \lambda_{\hat{u}} λ u ^ and λ ρ \lambda_{\rho} λ ρ so that the terms keep the gradient ratios they had in the tuned setting,
λ u ^ ′ = λ u ^ g u ^ g a l i g n ′ g a l i g n g u ^ ′ , λ ρ ′ = λ ρ g ρ g a l i g n ′ g a l i g n g ρ ′ . (26) \lambda'_{\hat{u}} = \lambda_{\hat{u}} \frac{g_{\hat{u}}g'_{\mathrm{align}}}{g_{\mathrm{align}}g'_{\hat{u}}}, \qquad\lambda'_{\rho} = \lambda_{\rho} \frac{g_{\rho}g'_{\mathrm{align}}}{g_{\mathrm{align}}g'_{\rho}}. \tag*{(26)} λ u ^ ′ = λ u ^ g align g u ^ ′ g u ^ g align ′ , λ ρ ′ = λ ρ g align g ρ ′ g ρ g align ′ . (26)
where λ ′ \lambda' λ ′ and g ′ g' g ′ are the coefficients and gradient norms in the new setting. The rescaled coefficients are then kept fixed. On CIFAR-10, rescaling by Eq. (26) recovers the coefficients within 4% of the tuned coefficients. At ImageNet-1k, it is very expensive in terms of compute, to search for the optimum coefficients. In all our PolarReg-naive, ImageNet-1k experiments, we report performance with the coefficients rescaled from Tiny-ImageNet-200.
Table C.1. Both coefficients work over a broad range around their tuned values. Linear-probe accuracy (%) at the last epoch when one coefficient is scaled and the other is kept at its tuned value, λ u ^ = 20 \lambda_{\hat{u}} = 20 λ u ^ = 20 or λ ρ = 0.045 \lambda_{\rho} = 0.045 λ ρ = 0.045 . Tiny-ImageNet-200, ϑ = 256 \vartheta= 256 ϑ = 256 , d = 64 d = 64 d = 64 , 200 epochs, one seed per cell.
Clipping each optimizer step is a simple way to stabilize training of PolarReg-naive and sliced objectives
In some PolarReg-naive and SIGReg runs, training collapses. A collapse starts with an update of ordinary gradient norm that moves the embeddings far from their target distribution, and the regularizer amplifies the change in a few steps. Gradient clipping is a poor fix. Its threshold depends on the scale of the loss, which differs 30 times across our datasets. A threshold set too low or high, slows training or collapses it.
Adam divides each coordinate of the gradient by a running estimate of its scale, making the step approximately scale independent. The running estimate averages over about 1000 steps, so a sudden change, such as the start of a collapse, makes the step unusually large. We therefore clip the Adam step instead of the gradient, like Adafactor [36 ] . We rescale the step Δ θ \Delta\theta Δ θ whenever it exceeds τ = 2 \tau= 2 τ = 2 times the median μ t \mu_t μ t of recent step sizes [35 ] ,
Δ θ ← Δ θ ⋅ min ( 1 , τ μ t ∥ Δ θ ∥ ) . (27) \Delta\theta\leftarrow\Delta\theta\cdot\min\left(1,\frac{\tau\mu_t}{\lVert\Delta\theta\rVert}\right). \tag*{(27)} Δ θ ← Δ θ ⋅ min ( 1 , ∥ Δ θ ∥ τ μ t ) . (27)
For our experiments, in standard training, the 99th percentile of ∥ Δ θ ∥ \lVert\Delta\theta\rVert ∥ Δ θ ∥ is 1.3–1.5 times its median, against 4.5–33 times for the gradient norm. During a collapse, for PolarReg-naive or SIGReg, the step size ∥ Δ θ ∥ \lVert\Delta\theta\rVert ∥ Δ θ ∥ reaches 12–20 times its median. Setting τ = 2 \tau= 2 τ = 2 prevented every collapse we observed. The threshold needs no tuning. It prevents collapse on both Tiny-ImageNet-200 and the ImageNet-100, whose tuned gradient clips differ by a factor of 10.
We note that PolarReg requires no such optimizer step bounds for stable training.
Training details
ImageNet-1k pretraining. We pretrain ViT-B/16 and ViT-L/14 encoders with the recipe of VISReg [45 ] . We do not do any hyperparameter search. Each batch holds 512 images, and we make 4 global views at 224 px and 6 local views at 96 px for each image. Every view is a random resized crop, with scale [ 0.3 , 1 ] [0.3,1] [ 0.3 , 1 ] for global views and [ 0.05 , 0.3 ] [0.05,0.3] [ 0.05 , 0.3 ] for local views. It is then color jittered with probability 0.8 (brightness 0.4, contrast 0.4, saturation 0.2, hue 0.1), converted to grayscale with probability 0.2, blurred with a Gaussian of standard deviation in [ 0.1 , 2 ] [0.1,2] [ 0.1 , 2 ] px with probability 0.5, solarized with probability 0.2, and flipped horizontally with probability 0.5. The encoder output is mapped to the embeddings v i v v_i^v v i v of Eq. (1) by a projector, an MLP with two hidden layers of width 2048, batch normalization and GELU activations. It takes the concatenated CLS tokens of the last two blocks, and outputs d = 256 d = 256 d = 256 dimensions for ViT-B and d = 384 d = 384 d = 384 for ViT-L. We use the AdamW optimizer at a peak learning rate of 9 × 10 − 4 9 \times10^{-4} 9 × 1 0 − 4 for ViT-B/16 and 8 × 10 − 4 8 \times10^{-4} 8 × 1 0 − 4 for ViT-L/14, with a linear warm-up over 5 epochs followed by a cosine decay to 1/1000 of the peak learning rate. PolarReg uses η ^ u = 2 \hat{\eta}_u = 2 η ^ u = 2 and η ρ = 3 \eta_\rho= 3 η ρ = 3 . The linear probes on ImageNet-1k follow VISReg [45 ] . Classifiers on the concatenated CLS tokens of last four blocks of the frozen encoder are trained for 100 epochs with batch size 256. We report accuracy on the 50,000 validation images. In Table 2 , all rows except ours are from VISReg [45 Table 5] .
Compute. For ImageNet-1k training, we use NVIDIA B200 GPUs to train our models. Pretraining for 400 epochs consumes 135 B200 GPU hours for ViT-B and 559 for ViT-L. VISReg reports about 1120 and 2060 H100 GPU hours for the same models and epochs. We use NVIDIA DALI for efficient data loading; bfloat16 and torch.compile for faster training.
Transfer to other datasets. For other datasets, we follow VISReg [45 ] . The features are the concatenated CLS tokens of the last four blocks of the frozen encoder, computed on images resized to 224 × 224 224 \times224 224 × 224 pixels without augmentation. They are standardized with batch statistics (BatchNorm without learnable parameters). A linear classifier trains on them for 10 epochs with batch size 32 at 13 learning rates. For ChestX-ray14, where an image can have several of the 14 findings, the classifier is trained with a binary cross-entropy loss, and we report the mean average precision at the learning rate with the best mean AUROC. Aircraft, Stanford Cars, CIFAR-10, CIFAR-100, Flowers-102, Food-101, Oxford-IIIT Pets and DTD use their standard train and test splits. ChestX-ray14, and RetinaMNIST and OrganAMNIST from MedMNIST+ at 224 pixels, use their official splits.
ImageNet-100 pretraining. For Table 1 , we train ViT-B/16 encoders on ImageNet-100 [40 ] for 100 epochs, each on one RTX 4090. Each batch holds 256 images, and each image creates 2 global views at 224 px and 6 local views at 96 px. The projector outputs d = 256 d = 256 d = 256 dimensional embeddings. We train with AdamW at a learning rate of 5 × 10 − 4 5 \times10^{-4} 5 × 1 0 − 4 , with one warm-up epoch and a cosine decay to 0. SIGReg uses λ = 0.05 \lambda= 0.05 λ = 0.05 and 4096 slices; PolarReg-naive uses λ ^ u = 14.3 \hat{\lambda}_u = 14.3 λ ^ u = 14.3 and λ ρ = 0.062 \lambda_\rho= 0.062 λ ρ = 0.062 . The augmentations differ from those on ImageNet-1k in three numbers only: global crop scale [0.08, 1], local crop scale [0.05, 0.4], and color jitter strengths (0.8, 0.8, 0.8, 0.2). The probe follows the same recipe as the ImageNet-1k probe, but trained for 10 epochs.
Galaxy10 pretraining. For Tab. D.5, we train on Galaxy10 DECals. It contains images of galaxies in 10 classes, at 256 px. We use the train and test splits of its Hugging Face release1 , with 15,962 and 1774 images. We train ViT-S/8 encoders from scratch at 128 pixels, with the augmentations of ImageNet-100. We train with a batch size of 256 images. Each image is used to produce 4 global views and no local views. The projector outputs d = 256 d = 256 d = 256 dimensional embeddings. We pretrain the encoders with AdamW at a learning rate of 10 − 3 10^{-3} 1 0 − 3 , with 10 warm-up epochs and a cosine decay to 0. As VISReg does, we report the best test accuracy of the online linear probe during training.
Supplementary results
The embedding magnitude can be used to detect unusual images
The embedding magnitude provides a test for images not resembling the training data. This test does not need any calibration data. For each image, we test the null hypothesis that its magnitude is a draw from χ d \chi_d χ d , with a one-sided test on the lower tail. The test rejects the null hypothesis, when its p-value is below α \alpha α . We choose only the lower tail because we expect unusual images to have larger view disagreement in their embeddings, and such images will attain smaller magnitudes (Proposition B.2).
We apply this test to the ViT-B encoder trained with PolarReg on ImageNet-1k for 400 epochs, with d = 256 d = 256 d = 256 . We term the 50,000 ImageNet-1k validation images as “in-domain”. The “out-of-domain” images are 5000 of ImageNet-1k validation images with different levels of corruptions, and images from datasets of other domains. For each out-of-domain set, we report the area under the curve of the fraction of out-of-domain images the test rejects against the fraction of in-domain images it rejects, as α \alpha α goes from 0 to 1. This area is simply the AUROC; 0.5 means the test detects out-of-domain images no better than chance, and 1 means some suitable α \alpha α detects all of them without flagging any in-domain image.
For corruptions in Tab. D.1, blur convolves the image with a Gaussian of standard deviation σ \sigma σ pixels. A contrast change maps each pixel value x ∈ [ 0 , 1 ] x \in[0,1] x ∈ [ 0 , 1 ] to 0.5 + c ( x − 0.5 ) 0.5+c(x-0.5) 0.5 + c ( x − 0.5 ) , for some contrast c c c . Block averaging replaces each f × f f \times f f × f block of pixels with its mean. The test detects significant corruptions to the ImageNet-1k validation images. It detects images averaged over 8 × 8 8 \times8 8 × 8 blocks with an AUROC of 0.99. Minor corruptions are not detected. Blur with σ = 1 \sigma= 1 σ = 1 pixel and halved contrast are detected with an AUROC of 0.50. This is perhaps because the encoder is trained to be invariant to such augmentations. Images from datasets of other domains are detected with high AUROC.
Table D.1. The lower-tail test of the embedding magnitude distinguishes corrupted images and out-of-domain data from in-domain data. AUROC of one-sided test of the embedding magnitude against χ 256 \chi_{256} χ 256 , with ImageNet-1k validation images as in-domain images, for a ViT-B/16 PolarReg encoder trained for 400 epochs with d = 256 d = 256 d = 256 .
The angular regularizer ℓ u ^ \ell_{\hat{u}} ℓ u ^ , in Eq. (5) , detects duplicated images in a batch
Large image datasets, whether crawled from the web or recorded in the real world for robotics, contain many near-duplicate images. For instance, DINOv2 [32 ] removed about 200 million of its 1.3 billion crawled images as near-duplicates. We test whether the angular regularizer and SIGReg flag duplicates, on synthetic batches and on trained encoders. We compute each criterion on 1000 control batches of 256 samples of N ( 0 , I d × d ) N(0,I_{d \times d}) N ( 0 , I d × d ) , and use the 95th percentile of these values as its threshold. A duplicated batch is a control batch in which the directions of p p p samples are replaced by the directions of p p p others; p p p pairs share a direction. We repeat this 5 times with fresh samples and report how many times the criterion exceeds its threshold. Even with p = 1 p = 1 p = 1 , the angular regularizer is 6.2 times its mean on control batches at d = 64 d = 64 d = 64 , and exceeds its threshold in all 5 repeats. SIGReg with 4096 slices stays within 8% of its mean up to 13 pairs, and exceeds its threshold in all constructions only at 32 pairs, a quarter of the batch. Its values follow 1 + 2 p / ℓ 1 + 2p/\ell 1 + 2 p / ℓ expectation derived in Remark B.2 within 6%.
For trained encoders, we duplicate an image by adding a second augmented view of it to the batch. On PolarReg-naive trained on Tiny-ImageNet-200 with d = 64 d = 64 d = 64 , duplicating 5% of each batch raises the angular regularizer above three standard deviations of its value on clean batches when averaged over 7 such duplicated batches. For a similar deviation with 10% duplication, it only needs one duplicated batch. SIGReg needs 22 batches to reach three standard deviations at 10%, and never reaches it at 5% or below.
PolarReg-naive needs its coefficients λ u ^ \lambda_{\hat{u}} λ u ^ and λ ρ \lambda_{\rho} λ ρ tuned for each setting, while PolarReg uses the same step sizes η u ^ = 2 \eta_{\hat{u}} = 2 η u ^ = 2 and η ρ = 3 \eta_{\rho} = 3 η ρ = 3 everywhere. As described in Sec. C.2, we tuned the PolarReg-naive coefficients on Tiny-ImageNet-200 with ℓ = 256 \ell= 256 ℓ = 256 and d = 64 d = 64 d = 64 , and rescaled them to other settings. In Tab. D.2, PolarReg outperforms PolarReg-naive in every setting.
Table D.2. PolarReg outperforms PolarReg-naive in every setting without any changes to η ^ u \hat{\eta}_u η ^ u or η ρ \eta_\rho η ρ . Linear-probe accuracy (%) at the final epoch. The coefficients of PolarReg-naive were tuned in the setting of the first row and rescaled for other rows.
PolarReg only needs η ^ u \hat{\eta}_u η ^ u to be large enough; η ^ u \hat{\eta}_u η ^ u sets how far along the target direction lies. With a very low η ^ u = 0.5 \hat{\eta}_u = 0.5 η ^ u = 0.5 , the target is too close to pull the directions apart, against the alignment term and training collapses. Above that, accuracy is stable. We choose η ρ = 3 \eta_\rho= 3 η ρ = 3 to calibrate the mean magnitude close to d \sqrt{d} d , which is about the mean of χ d \chi_d χ d .
PolarReg is robust across step sizes. On ImageNet-100, we train a ViT-B/16 for 100 epochs with d = 256 d = 256 d = 256 , and change one step size at a time while the other stays at its default, η ^ u = 2 \hat{\eta}_u = 2 η ^ u = 2 or η ρ = 3 \eta_\rho= 3 η ρ = 3 . We try η ^ u = 1 \hat{\eta}_u = 1 η ^ u = 1 , 1.5 and 3, and η ρ = 2 \eta_\rho= 2 η ρ = 2 and 4. In Tab. D.3, accuracy changes by at most 0.2 points when η ρ \eta_\rho η ρ changes, and by at most 1.6 points when η ^ u \hat{\eta}_u η ^ u changes. On ImageNet-1k, we train a ViT-B/16 for 400 epochs with both step sizes 1.5 times their defaults, η ^ u = 3 \hat{\eta}_u = 3 η ^ u = 3 and η ρ = 4.5 \eta_\rho= 4.5 η ρ = 4.5 . Its linear-probe accuracy is 76.55%, against 76.65% with the defaults.
Table D.3. PolarReg is robust across step sizes. Linear-probe accuracy (%) at the last epoch when one step size is changed and the other is kept at its default, η ^ u = 2 \hat{\eta}_u = 2 η ^ u = 2 or η ρ = 3 \eta_\rho= 3 η ρ = 3 .
PolarReg training generalizes to other modalities
To show that PolarReg can be applied to other data modalities, we train an encoder on depth images with the same objective and hyperparameters as on RGB images. We use the RGB and depth images of the easy trajectories (“Data_easy”) of TartanAir v2 [33 ] , in 18 scenes, at 64 × 64 64 \times64 64 × 64 pixels. We train on 126 trajectories and test on 30. We never train and test on the same trajectory, repeated at different times of day and seasons, since these render the sensors at same viewpoints. Five of these 18 scenes also have nighttime data. We train on the 38,487 daytime frames, and test on 5533 daytime and 1319 nighttime frames. Figure D.1a shows some examples. We train one ViT-S/8 encoder per modality from scratch for 100 epochs with PolarReg, η ^ u = 2 \hat{\eta}_u = 2 η ^ u = 2 and η ρ = 3 \eta_\rho= 3 η ρ = 3 , as in every other experiment. We take logarithm of distance as input for the depth encoder. A linear classifier on frozen features predicts the scene where the RGB or depth image is captured from. Therefore, there are 18 classes to predict from.
PolarReg trains a useful depth encoder with no change to the objective (Fig. D.1b). Its classifier is 79.3% accurate on daytime frames, against 95.9% for RGB. At night, the RGB classifier, trained only on daytime images, falls to 30.3%, while depth stays at 71.6%. Of course, this is expected given the depth sensor is invariant to lighting in TartanAir.
A classifier trained for one modality can work quite well for another, after an orthogonal map between their frozen features. We fit an orthogonal map from depth features to RGB features, trained independently as described above. We use only 8192 paired daytime frames to learn this map on the frozen features, standardized along each feature dimension. The frozen RGB classifier is applied to the transformed depth features, achieving an accuracy of 75.1% on daytime and 68.5% on nighttime depth images. Since the RGB and depth encoders are trained separately, nothing aligns their features, and transfer fails without the map. So even without any ground-goal Figure D.1. PolarReg featurizes depth images with the same objective as RGB images. (a) Example RGB and depth images from TartanAir. (b) Scene classification accuracy of linear classifiers on frozen features. Depth trails RGB on daytime data, but stays accurate at night, when RGB fails. An orthogonal map, fitted on unlabeled RGB and depth image pairs, aligns depth features with RGB features. Then, the RGB classifier is almost as accurate on depth images as the depth classifier, without any ground truth labels for depth.
Figure D.1. (a) Example RGB and depth images from TartanAir. Top row and bottom row show daytime and nighttime samples. Depth is gray, with closer objects brighter.
(b) Scene classification accuracy of a linear classifier trained on frozen encoders of daytime RGB and depth images on TartanAir; tested on daytime and nighttime data.
truth labels for one modality, we can classify its data with a classifier trained for another modality, using only a few unlabeled pairs.
A full multimodal training needs little beyond PolarReg. With many paired sensor data, one could apply PolarReg to the joint features of both modalities directly, essentially treating them as a single modality. We leave this, and sensors such as LiDAR, event cameras and radar, to future work.
PolarReg generalizes across domains, tasks and dataset scales
PolarReg frozen features transfer to out-of-domain datasets and segmentation tasks. We probe frozen features of encoders pretrained on ImageNet-1k on six datasets from other domains, and on semantic segmentation of ADE20K. The results are presented in Tab. D.4. The out-of-domain datasets contain textures (DTD), galaxies (Galaxy10), aerial scenes (AID), chest X-rays (ChestX-ray14), retina images (RetinaMNIST) and abdominal CT (OrganAMNIST). The classifiers are trained as in Sec. C.4. For ChestX-ray14, where an image can have several of the 14 findings, we report mean average precision (mAP). The segmentation head is a linear layer on frozen patch features. For these tasks, PolarReg features perform similar to most other SSL methods, including the sliced objectives.
PolarReg pretrains small models on small datasets better than other methods. We pretrain ViT-S/8 encoders from scratch on Galaxy10, images of galaxies in 10 classes, with the recipe of VISReg [45 ] . Training details are provided in Sec. C.4. In Tab. D.5, with half the epochs, PolarReg matches the performance of other methods. With a full training run of 400 epochs, it outperforms all methods.
PolarReg is more memory and compute efficient than sliced objectives
In Tab. D.6, we time one forward and backward pass of each objective, on Gaussian embeddings of ℓ \ell ℓ images with 10 views each and d = 256 d = 256 d = 256 , as in our ImageNet-1k runs. SIGReg and VISReg use 4096 slices. We report the median of 10,000 calls. PolarReg is overhead-bound. It is bound by GPU kernel launch overhead, not by the size of the intermediate tensors. The sliced objectives are memory-bound. They are bound by large tensor read-write operations that grow linearly with ℓ \ell ℓ . They project every embedding on 4096 slices. SIGReg also approximates the integral in Eq. (1) by evaluating the empirical characteristic function of each projection at several values of t t t . Reading and writing these numbers takes time proportional to ℓ \ell ℓ . PolarReg works with the b ν b\nu b ν magnitudes and the inner products between the ℓ \ell ℓ mean directions. At these batch sizes, each of its kernels runs faster than PyTorch can launch it, so its time does not grow with ℓ \ell ℓ . Its backward pass is one elementwise operation, since no gradient flows through the targets.
Table D.4. Features learned by PolarReg transfer to out-of-domain datasets and segmentation. Probing accuracy (%) on six out-of-domain datasets, and mean intersection over union (mIoU, %) of a linear segmentation head on ADE20K, from frozen features of encoders pretrained on ImageNet-1k. Rows except ours are reported by VISReg [45 Tables 6 and 8] .
Table D.5. Linear probing accuracy of ViT-S/8 encoders pretrained from scratch on Galaxy10. All encoders are trained for 400 epochs at 128 px, unless marked. Rows except PolarReg are from VISReg [45 Table 2] .
Table D.6. Computation time of the regularization objectives on a single RTX 4090.
We note that these computation times are for eager PyTorch, which launches each kernel separately. With torch.compile [2 ] based CUDA kernel fusion, computation time for the sliced objectives still grows with ℓ \ell ℓ ; they stay memory-bound. PolarReg stays overhead-bound, and is still significantly faster.
Memory overhead of the regularizers. In the forward pass, the sliced objectives compute b ν ℓ b\nu\ell b ν ℓ projections, and SIGReg evaluates each of them at the values of t t t used to approximate the integral in Eq. (1) . All of these are kept for the backward pass. PolarReg computes b ν b\nu b ν magnitudes and ∼ ℓ 2 \sim\ell^2 ∼ ℓ 2 inner products, and keeps only the b ν d b\nu d b ν d entries of its targets for the backward pass. Hence, PolarReg needs much less memory in Figure 5 .