Title: On Affine Homotopy between Language Encoders
Venue: NeurIPS 2024
Accepted: yes
Keywords: language encoders

neural network similarity

metric spaces

homotopy
Abstract: Pre-trained language encoders---functions that represent text as vectors---are an integral component of many NLP tasks.
    We tackle a natural question in language encoder analysis: What does it mean for two encoders to be similar?
    We contend that a faithful measure of similarity needs to be \emph{intrinsic}, that is, task-independent, yet still be informative of \emph{extrinsic} similarity---the performance on downstream tasks.
    It is common to consider two encoders similar if they are \emph{homotopic}, i.e., if they can be aligned through some transformation.
    In this spirit, we study the properties of \emph{affine} alignment of language encoders and its implications on extrinsic similarity.
    We find that while affine alignment is fundamentally an asymmetric notion of similarity, it is still informative of extrinsic similarity.
    We confirm this on datasets of natural language representations.
    Beyond providing useful bounds on extrinsic similarity, affine intrinsic similarity also allows us to begin uncovering the structure of the space of pre-trained encoders by defining an order over them.

On Affine Homotopy between Language Encoders

Abstract

Pre-trained language encoders-functions that represent text as vectors-are an integral component of many NLP tasks. We tackle a natural question in language encoder analysis: What does it mean for two encoders to be similar? We contend that a faithful measure of similarity needs to be intrinsic , that is, task-independent, yet still be informative of extrinsic similarity-the performance on downstream tasks. It is common to consider two encoders similar if they are homotopic , i.e., if they can be aligned through some transformation. 1 In this spirit, we study the properties of affine alignment of language encoders and its implications on extrinsic similarity. We find that while affine alignment is fundamentally an asymmetric notion of similarity, it is still informative of extrinsic similarity. We confirm this on datasets of natural language representations. Beyond providing useful bounds on extrinsic similarity, affine intrinsic similarity also allows us to begin uncovering the structure of the space of pre-trained encoders by defining an order over them.

https://github.com/chanr0/affine-homotopy

1 Introduction

Acommon paradigm in modern natural language processing (NLP) is to pre-train a language encoder on a large swathe of natural language text. Then, a task-specific model is fit ( fine-tuned ) using the language encoder as the representation function of the text. More formally, a language encoder is a function h : Σ ˚ Ñ R D , i.e., a function that maps a string over an alphabet Σ to a finite-dimensional vector. Now, consider sentiment analysis as an informative example of a task. Suppose our goal is to classify a string y P Σ ˚ as one of three polarities Π ' t , , u . Then, the probability of y exhibiting a specific polarity is often given by a log-linear model, e.g., the probability of is

where E P R 3 ˆ D , b P R 3 and softmax: R N Ñ ∆ N ´ 1 . Empirically, using a pre-trained encoder h leads to significantly better classifier performance than training a log-linear model from scratch.

In the context of the widespread deployment of language encoders, this paper tackles a natural question: Given two language encoders h and g , how can we judge to what extent they are similar? This question is of practical importance-recent studies have shown that even small variations in the random seed used for training can result in significant performance differences on downstream tasks between models with the same architecture [13, 35] In this case, we say that two such language encoders exhibit an extrinsic difference, i.e., the difference between two encoders manifests itself when considering their performance on a downstream task. However, we also seek an intrinsic notion

of similarity between two language encoders, i.e., a notion of similarity that is independent of any particular downstream task. Moreover, we may hope that a good notion of intrinsic similarity would allow us to construct a notion of extrinsic similarity that holds for all downstream tasks.

Existing work studies language encoder similarity by evaluating whether two encoders produce similar representations for a finite dataset of strings [3, 20, 22, 42, inter alia ], often by analyzing whether the representation sets can be approximately linearly aligned [22, 27]. More formally, two encoders are considered similar if there exists a matrix A such that h p y q « A g p y q holds for strings y in some finite set D Ă Σ ˚ . 2 This assumes that examining finitely many outputs provides sufficient insight into encoder behavior. In contrast, we set out to study the relationships between language encoders, i.e., functions, themselves. This decision, rather than being just a technicality, allows us to derive a richer understanding of encoder relationships, revealing properties and insights that remain obscured under conventional finite-set analysis. Concretely, we ask what notions of similarity between encoders one could consider and what they imply for their relationships.

The main contributions of the paper are of a theoretical nature. We first define an (extended) metric space on language encoders. We then extend this notion to account for transformations in a broad framework of S -homotopy for a set of transformations S , where g is S -homotopic to h if g can be transformed into h through some transformation in S . As a concrete application of the framework, we study affine homotopy-the similarity of h and ψ ˝ g for affine transformations ψ . The notion of intrinsic similarity induced by such one-sided alignment is not symmetric and can be seen as the cost of transforming g into h . Nevertheless, we show it is informative of extrinsic similarity: If one encoder can be affinely mapped to another, we can guarantee that it also performs similarly on downstream tasks. We confirm this empirically by studying the intrinsic and extrinsic similarities of various pretrained encoders, where we observe a positive correlation between intrinsic and extrinsic similarity. Beyond measuring similarity, homotopy also allows us to define a form of hierarchy on the space of encoders, elucidating a structure in which some encoders are more informative than others. Such an order is also suggested by our experiments, where we find that certain encoders are easier to map to than others which shows in the rank of the learned representations and affects their transfer learning ability.

2 Language Encoders

Let Σ be an alphabet-a finite, non-empty set of symbols y -and EOS R Σ a distinguished end-ofstring symbol. With Σ ˚ def ' Ť 8 n ' 0 Σ n we denote the Kleene closure of Σ , the set of all strings y . A language encoder is a function h : Σ ˚ Ñ V def ' R D that maps strings to real vectors. 3 We write E V def ' V Σ ˚ for the R -vector space of language encoders, and E b def ' t h P E V | h p Σ ˚ q is bounded u Ă E V for its sub-vector space of bounded encoders .

There are two common ways that language encoders are created [7]. The first is through autoregressive language modeling. A language model (LM) is a probability distribution over Σ ˚ . 4 Autoregressive LMs are defined through the multiplication of conditional probability distributions p h p y t | y ă t q as

where each p h p¨ | y ă t q is a distribution over Σ Yt EOS u parametrized by a language encoder h :

where E P R p| Σ |` 1 qˆ D . An autoregressive LM provides a simple manner to learn a language encoder from a dataset of strings D ' t y p n q u N n ' 1 by minimizing D 's negative log-likelihood. We may also learn a language encoder through masked language modeling (MLM), which defines the conditional probabilities based on both sides of the masked symbol's context

Maximizing the log-likelihood of a corpus under a language model derived from a language encoder h with a gradient-based algorithm only requires h to be a differentiable function of its parameters. Once a language encoder has been trained on a (large) corpus, its representations can be used on more fine-grained NLP tasks such as classification. The rationale for such transfer learning is that representations h p y q stemming from a performant language model also contain information useful for other downstream tasks on natural language. An NLP practitioner might then implement a task-specific transformation of h p y q . To tackle the problem that the tasks of interest are often less resource-abundant and to keep the training costs low, task-specific transformations are usually simple, often in the form of linear transformations of h p y q , as in Eq. (1).

3 Measuring the Alignment of Langauge Encoders

We begin by introducing measures of affine alignment and hemi-metrics on E V .

3.1 Preliminaries on Hemi-Metric Spaces

Language encoders compute representations for the infinitely many strings in Σ ˚ . In general, these representations might diverge towards 8 , making it necessary to talk about unbounded encoders, where it is convenient to allow distances and norms to take extended real numbers as values. 5

Definition 3.1. An extended metric on a set X is a map d : X Ñ R ` such that

Similarly, an extended norm is a map } ¨ } : X Ñ R ` that satisfies the norm axioms. Moreover, we will consider maps d that do not satisfy the symmetry axiom. Lawvere [25] notes that symmetry is artificial and unnecessary for many of the main theorems involving metric spaces. In such situations, the quantity d p x, y q can be interpreted as the cost of going from x to y . Occasionally, we want d to capture that it costs more to go from x to y than to return, making asymmetry desirable.

Definition 3.2. A hemi-metric 6 or Lawvere-metric on a set X is a map d : X Ñ R ` such that

One of our main contributions is a formalization of measuring how far a language encoder h is from the set of all possible transformations of another encoder g -for example, from all affine transformations of g . For this, we lift a hemi-metric over elements x P X to subsets of X , a crucial for the rest of the paper.

Definition 3.3. Let p X,d q be a hemi-metric space. For non-empty E,E 1 Ă X , we define

The map d H is called the Hausdorff-Hoare map and is a hemi-metric on P p X qztHu , the power set of X . When E is a singleton set t x u , we will, with a slight abuse of notation, write d H p x, E 1 q to mean d H pt x u , E 1 q , defined as ' inf y P E 1 d p x, y q . 7

We next introduce the hemi-metric recipe . It tells us how one can define a hemi-metric on a set X by embedding X into the power set of another space Y where a hemi-metric already exists. After X is embedded, one can use the Hausdorff-Hoare map based on the hemi-metric from Y to define a hemi-metric on X through the images of x P X .

Remark 3.1 (Hemi-Metric Recipe) . Let X be a set, p Y, d q a hemi-metric space, and S : X Ñ P p Y qztHu , x ÞÑ E x a function that assigns an x P X a subset E x P P p Y qztHu . Using Lem. D.1, we can construct a hemi-metric on X with d H S p x, y q def ' d H p E x , E y q ' d H p S p x q , S p y qq , and an extended pseudo-metric (a symmetric hemi-metric) with d H , sym S p x, y q ' max p d H S p x, y q , d H S p y, x qq .

Remark 3.1 introduces a general recipe for defining hemi-metric spaces on function spacestopological spaces whose elements are functions from a set to subsets of an extended-metric space. This naturally applies to the study of encoders and their transformations, which we call S -homotopy , i.e., two encoders are S -homotopic if one can be S -deformed into the other. In this case, the set E h for h P E V corresponds to the set of encoders that h can be transformed into with mappings in S . We could, for example, take S as the set of all continuous maps, smooth maps, or multi-layer perceptrons. Our following discussion of affine maps, i.e., where S ' Aff p V q , is extrinsically motivated but can be understood as a specific instance of the more general framework of S -homotopy.

3.2 A Norm and a Distance on E V

The hemi-metric recipe first requires us to define a (hemi-)metric on the individual elements. Given that all norms on the R -vector space V are equivalent [24, Proposition 2.2, §XII], we fix in this paper a norm | ¨ | V on V . We introduce the maps } ¨ } 8 : E V Ñ R ` and d 8 p¨ , ¨q : E V ˆ E V Ñ R ` :

where } ¨ } 8 is an extended norm on E V and p E V , d 8 q is a complete 8 extended metric space. 9

Let GL p V q be the set of invertible D ˆ D matrices. We write }¨} V : GL p V q Ñ R ` for the subordinate matrix norm, i.e., } A } V ' sup v P V zt 0 u | Av | V | v | V . By abuse of language, we can view V as an affine space 10 and set Aff p V q for the group of affine transformations of V . An affine transformation ψ on V is a map v ÞÑ Av ` b , for some invertible A P GL p V q and b P V . We call ψ lin def ' A the linear part of ψ and t ψ : v ÞÑ v ` b its translation part. We denote with T Ă Aff p V q the subgroup of translations. Note that there is a natural left action of Aff p V q on E V , i.e., Aff p V q ˆ E V Ñ E V , h ÞÑ ψ ˝ h . 11

3.3 Affine Alignment of Language Encoders

We now use the general recipe from Remark 3.1 for affine alignment of language encoders-affinely mapping from one encoder to another. For a subset S Ă Aff p V q we can define

where S p h q def ' t s ˝ h | s P S u . In the notation of the hemi-metric recipe from Remark 3.1, we set X ' Y ' E V (we align an encoder with another encoder) and d ' d 8 , the uniform convergence distance (cf. §3.2). Further, we take S Ď Aff p V q Ă V V and define S : E V Ñ P p E V q , h ÞÑ S p h q def ' t s ˝ h | s P S u . In words, d S p h , g q captures the notion of how well the encoder g can be S -transformed into h . This is commonly called the alignment of g with h . d S p h , g q does not, however, necessarily tell us anything about how well h can be S -transformed into g , resulting in asymmetry.

Remark 3.2. d Aff p V q defined in Eq. (8a) is not a metric on E V . 12 Further, when S ' Aff p V q , the map inf ψ,ψ 1 P Aff p V q } ψ ˝ h ´ ψ 1 ˝ g } 8 is trivially zero by Cor. D.1.

In the case of affine isometries Iso p V q ' t ψ P Aff p V q | ψ lin P O p V qu we show that the pair p E V , d Iso p V q q constitutes an extended pseudo-metric space.

Proposition 3.1. The pair p E V , d Iso p V q q is an extended pseudo-metric space.

4 Intrinsic Affine Homotopy

The notion of affine alignment allows us to introduce homotopic relations on E V . We first derive the affine intrinsic preorder Á Aff on the space of encoders. 13

Lemma 4.1. Let p X,d q be a hemi-metric space. The relation p x Á d y iff d p x, y q ' 0 q is a preorder 14 and it will be called the specialization ordering of d .

Definition 4.1 (Intrinsic Affine Preorder) . For two encoders h , g P E V , we define the relation

■

Lemma 4.2. The relation Á Aff is a preorder on E V .

Proof. Follows from d Aff p V q p ψ ˝ h , g q ď } ψ lin } V ¨ d Aff p V q p h , g q , see App. D.3.

■

Intuitively, Á Aff captures the order of encoders such that higher-positioned encoders in the order can be S -transformed to the lower-positioned ones. To derive the implications of Á Aff we introduce the notion of an encoder rank.

Definition 4.2 (Encoder Rank) . For any h P E V let the encoder rank be rank p h q def ' dim R p V h q , where V h is the subvector space generated by the image of h . When rank p h q ' dim R p V q , h is a full rank encoder, else it is rank deficient .

Theorem 4.1. For h , g P E V , we have

where, π h is the orthogonal projection of V onto V h . In particular, if d Aff p V q p h , g q ' 0 then rank p h q ď rank p g q . If in addtion, we know rank p g q ' rank p h q , then g must by an affine transformation of g , i.e., h ' ψ ˝ g for some ψ P Aff p V q .

This allows us to state our first notion of language encoder similarity: intrinsic affine homotopy.

Definition 4.3 (Exact Intrinsic Affine Homotopy) . We say that two encoders h , g P E V are exactly intrinsically affinely homotopic and write h » Aff g if

For any h , g P E V , one can easily show that

which implies that » Aff is an equivalence relation on the set of language encoders E V . Intuitively, two encoders h and g are exactly intrinsically affinely homotopic, this means that both g can be affinely mapped to h , as well as the other way around.

5 Extrinsic Homotopy

In §4, we explore methods for assessing how similar two language encoders are without reference to any downstream tasks. Here, we extend our discussion to the extrinsic homotopy of language encoders. Since language encoders are primarily used to generate representations for downstream tasks-such as in transfer learning, illustrated by the sentiment analysis example in §1-we argue that the key criterion in the similarity of two encoders lies in how closely we can align predictions stemming from their representations. 15

Principle 5.1 (Extrinsic Homotopy) . Two language encoders h and g are extrinsically homotopic if we can guarantee a similar performance on any downstream task h and g might be used for.

The rest of the section formalizes this intuitive notion and describes its relationship with intrinsic affine homotopy. Let W be the vector space R N and set Aff p V, W q as the set of affine maps from V to W . 16 We define E ∆ def ' Map p Σ ˚ , ∆ N ´ 1 q and E W ' Map p Σ ˚ , W q . Lastly, we formalize the notion of a transfer learning task as constructing a classifier that uses a language encoder's string representations. Particularly, we set V N to be the family of log-linear models as follows

where Aff V,W is the map

and softmax λ : R N Ñ ∆ N ´ 1 is defined for λ P R ` , x P R N , and n P r N s as

Remark 5.1. Each p ψ ' softmax λ ˝ ψ p h p y qq can be seen as a 'probability distribution' over r N s

Through our standard recipe from Remark 3.1, we can define the following hemi-metrics on E V .

Definition 5.1. For any two encoders h , g P E V , we define 17

Notice that we use d H rather than d in Def. 5.1 since we are interested in how closely we can bring h and g when we affinely transform both of them-this corresponds to independently affinely transforming the encoders for the same transfer learning task. In particular, Eq. (17b) measures how different two encoders are on any transfer learning task, formalizing the notion of extrinsic homotopy (cf. Principle 5.1), captured by the following definition.

Definition 5.2 (Extrinsic Affine Preorder) . An encoder h P E V is exactly extrinsically homotopic to 18 g P E V if d H V p V, ∆ q p h , g q ' 0 .

Analogously to Def. 4.1, we use d H V p V, ∆ q p h , g q to define a preorder.

Definition 5.3 (Extrinsic Affine Preorder) . For two encoders h , g P E V , we define the relation

Lemma 5.1. The relation h Á Ext g is a preorder on E V .

We now relate d H Aff p V,W q p h , g q and d H V p V, ∆ q p h , g q from Def. 5.1, and d Aff p V q p h , g q from §4.

Lemma 5.2. Let h , g P E V . We have

There exists a constant c p λ q ą 0 such that for any ψ P Aff p V, W q

d H V p V, ∆ q p h , g q ď c p λ q d H Aff p V,W q p h , g q .

Lem. 5.2 shows that Á Ext is finer than Á Aff . This means that the affine intrinsic preorder is contained in the extrinsic preorder, i.e., h Á Aff g ñ h Á Ext g . Lastly, we can show that d H V p V, ∆ q p h , g q is upper bounded by the intrinsic hemi-metric d H Aff p V q .

Theorem 5.1 ( ϵ -Intrinsic ñ O p ϵ q -Extrinsic) . Let h , g P E V be two encoders. Then,

6 Linear Alignment Methods for Finite Representation Sets

§§ 4 and 5 introduce ways of comparing language encoders as functions, which holistically characterizes relationships between them. We now address a more practical concern: Given two language encoders h and g , how can we approximate their similarity in practice? Rather than comparing h p y q : Σ ˚ Ñ R D with g p y q : Σ ˚ Ñ R D over the entire Σ ˚ , 19 we compare them over a finite set of strings Y ' t y p n q u N n ' 1 . We combine Y 's representations given by h and g into matrices H , G P R N ˆ D , where we denote H y , ¨ ' h p y q and G y , ¨ ' g p y q . We can approximate the notions of similarity from §3 by optimizing over the affine maps Aff p V q (for example, using gradient descent). Particularly, we approximate intrinsic similarity as

and extrinsic similarity for some task-specific fixed ψ 1 as

Unfortunately, the max over Y makes the optimization in Eqs. (19) and (20) difficult. For simplicity, we turn to commonly used linear alignment methods, which we review for completeness.

Orthogonal Procrustes Problem. Rather than optimizing the infinity norm over Y as Eqs. (19) and (20), the orthogonal Procrustes problem finds the orthogonal transformation minimizing the Frobenius norm [34] by solving argmin A P O p V q } H ´ AG } F . Given the singular-value decomposition H J G ' UΣV J , the optimum is achieved by UV J . 20 Since the argmin is over O p V q , this defines an extended pseudo-metric space by Prop. 3.1.

Canonical Correlation Analysis (CCA). CCA [20] is a linear alignment method that finds the matrices A , B that project H and G into subspaces maximizing their canonical correlation. Let A ¨ ,j and B ¨ ,j be the j th column vectors of A and B , respectively. The formulation is as follows

The representation similarity is measured in terms of the goodness of CCA fit, e.g., the mean squared CCA correlation R 2 CCA ' ř D i ' 1 ρ 2 i { D . We can reformulate the CCA objective in Eq. (21) as

Given the singular-value decomposition H J G ' UΣV J , the solution of Eq. (22) is p ˆ A , ˆ B q ' pp HH J q ´ 1 2 U , p GG J q ´ 1 2 V q , where p HH J q ´ 1 2 and p GG J q ´ 1 2 are whitening transforms of U and V . Assuming the data is whitened during pre-processing, CCA corresponds to linear alignment under an orthogonality constraint, equivalent to the orthogonal Procrustes problem; see also App. E.

CCA Extensions. Projection-weighted CCA (PWCCA) [30] also finds alignment matrices with CCA but applies weighting to correlation values ρ i to report the goodness of fit. Given the canonical vectors ˆ A , PWCCA reports ¯ ρ PW ' ř D i ' 1 α i ρ i { ř i α i , where α i ' ř j |x ˆ A ¨ ,i , H ¨ ,j y| . 21

ER

M5

M10

M15

M20

M25

E

R

M5

M10

M15

M20

M25

M →

SST-2

Layer 1

ER

M5

M10

M15

M20

M25

E

R

M5

M10

M15

M20

M25

Layer 4

ER

M5

M10

M15

M20

M25

E

R

M5

M10

M15

M20

M25

Layer 8

ER

M5

M10

M15

M20

M25

E

R

M5

M10

M15

M20

M25

Layer 12

ER

M5

M10

M15

M20

M25

E

R

M5

M10

M15

M20

M25

M →

CoLA

ER

M5

M10

M15

M20

M25

E

R

M5

M10

M15

M20

M25

ER

M5

M10

M15

M20

M25

E

R

M5

M10

M15

M20

M25

ER

M5

M10

M15

M20

M25

E

R

M5

M10

M15

M20

M25

ER

M5

M10

M15

M20

M25

E

R

M5

M10

M15

M20

M25

M →

MNLI

ER

M5

M10

M15

M20

M25

E

R

M5

M10

M15

M20

M25

ER

M5

M10

M15

M20

M25

E

R

M5

M10

M15

M20

M25

ER

M5

M10

M15

M20

M25

E

R

M5

M10

M15

M20

M25

0

2

4

6

8

10

↓

→ M

→ M

→ M

→ M

Non-Alignment Methods. While not explicitly (linearly) aligning representations, CKA [22] evaluates the kernel similarity between representations. CKA computes the normalized Hilbert-Schmidt independence [18] between centered kernel matrices K H and K G where K H ij ' k p H i, ¨ , H j, ¨ q , and K G ij ' k p G i, ¨ , G j, ¨ q for a kernel function k , i.e., tr p K H K G q{ a p tr p K H J K H q tr p K G J K G qq . Linear CKA, where k p H i, ¨ , H j, ¨ q ' H J i, ¨ H j, ¨ , is commonly used.

7 Experiments

We now explore the practical implications of our theoretical results. We conduct experiments on ELECTRA [6], ROBERTA [28], and the 25 MULTIBERT [35] encoders, which are architecturally identical to BERT-BASE [11] models pre-trained with different seeds. We report results on the training sets of two GLUE benchmark classification tasks: SST-2 [38] and MRPC [14]. When reporting d and ˆ d ψ 1 from Eq. (19) and Eq. (20), we use the L 2 norm for simplicity and approximate d H V p V, ∆ q as

The experimental setup and compute resources are further described in App. F.

The Intrinsic 'Preorder' of Encoders. We first investigate whether the asymmetry of d Aff p V q is measurable in the finite alphabet encoder representations. Figure 1 shows distinct vertical lines for both tasks indicating that there are encoders that are consistently easier to affinely map to p Ñ M q . This seems to be rather independent of which encoder we map from p M Ñ q . We further see that this trend is task-independent for early layers but diverges for later layers.

The Influence of Encoder Rank Deficiency. As discussed in §4, the encoder rank plays a pivotal role in affine mappability; exact affine homotopy is only achievable between equal-rank encoders. 22 With this in mind, we return to our findings from Figure 1 to evaluate whether the observed differences

0.20

0.40

ˆ

d

Aff(

V

)

0.24

0.26

0.28

0.30

0.32

0.34

0.36

ˆ

dψ

′

ρ

: 0.080

SST-2

E

R

M1

M4M2M3 M5

M7 M6

M8

M9

M10

M14

M15

M16

M18

M19

M20

M21

M2

M23

0.04

0.06

ˆ

d

Aff(

V

)

0.15

0.17

0.20

0.23

0.25

0.28

ρ

: 0.309

MRPC

E

R

M1

M2

M3

M4

M5

M6

M7

M8

M9

M10

M11

M12

M14

M15

M16

M18

M19

M20

M21

M22

M23

0.10

0.20

ˆ

d

Aff(

V

)

0.00

0.10

0.20

0.30

ρ

: 0.283

CoLA

E

R

M1

M2

M3

M4

M5

M6

M7

M8 9

M10

M11

M12

M14

M15

M16

M18

M19

M20

M21

M22

M23

0.03

0.05

ˆ

d

Aff(

V

)

0.01

0.02

0.03

0.04

0.05

0.06

ρ

: 0.524

RTE

E

R

M1

M2

M3

M4

M5

M6

M7

M8

M9

M10

M11

M12

M14

M15

M16

M18

M19

M20

M21

M22

M23

0.05

0.10

0.15

ˆ

d

Aff(

V

)

0.05

0.10

0.15

0.20

0.25

ρ

: 0.396

MNLI

E

R

M1

M2

M3

M4

M5

M6

M7

M8

M9 M10

M11

M12

M14

M15

M16

M18

M19

M20

M21

M22

M23

0.05

0.10

ˆ

d

Aff(

V

)

0.15

0.20

0.25

0.30

ρ

: 0.489

QQP

E

R

M1

M2

M3

M4

M5

M6

M7

M8

M9

M10

M13 4

M15

M16

M18

M19

M20

M21

M22

M23

between encoders can be attributed to a difference in measurable rank. Due to the inaccuracies of computing the rank numerically, we approximate the encoder rank using the rank to precision ϵ as the number of representation matrix singular values larger than some ϵ P R . 23 We find statistically significant ( p -value < 0.05) rank correlation with the median intrinsic distance ˆ d Aff p V q when mapping to the corresponding encoder for RTE ( ρ ' 0 . 312 ), MRPC ( ρ ' 0 . 609 ), and QQP ( ρ ' 0 . 389 ). We find no statistically significant correlations with the median distance when mapping from the corresponding encoder. This difference in encoder ranks could, therefore, partially explain the previously observed differences in affine mappability as some encoders seem to learn lower-rank representations.

A Linear Bound on Extrinsic Similarity. Lem. 5.2 derives a relationship between affine intrinsic and extrinsic similarity. To evaluate its strength in practice, we measure Spearman's Rank Correlation ( ρ ) and Pearson Correlation (PCC) between intrinsic measures introduced in §6 and the extrinsic measures ˆ d ψ 1 and ˆ d H V p V, ∆ q . PCC measures the strength and direction of a linear relationship between two random variables, whereas Spearman's ρ additionally evaluates the variables' monotonic association. ˆ d ψ 1 is computed by training a linear classifier ψ 1 P Aff p V q on the final MULTIBERT layer for each task. Further, we report ˆ d H V p V, ∆ q as the maximum L 2 loss for a large number of randomly generated 24 classifiers ψ 1 on the final layer of each MULTIBERT encoder. We generate 100 such classifiers for a range of GLUE datasets. 25 Table 1 show significant, large linear correlation prevalent in all linear alignment methods, whereas CKA-a linear, non-alignment method-does not capture extrinsic behavior as faithfully. Further, Figure 2 visualizes the linear relationship explicitly for all considered GLUE datasets.

8 Discussion

We set out to explore homotopic relationships between language encoders, augmenting existing work on the similarity of finite representation sets by holistically studying encoder functions . In particular, the general framework of S -homotopy allows us to study any functional relationship between encoders, enabling the exploration of many types of encoder relationships. As a first step in this direction and a concrete example, §4 explores affine homotopy, discussing what it means to be able to align two models with affine transformations. Here, Hausdorff-Hoare maps prove useful, as they allow us to measure a notion of (asymmetric) distance between a point-an encoder-and the set of all affine transformations of another encoder. Lem. 5.2 in §5 then connects the intrinsic,

task-independent, similarly to extrinsic similarity-the similarity of performance on downstream tasks. Concretely, it derives a linear relationship between the intrinsic and extrinsic dissimilarity for any fixed affine transformation ψ 1 (i.e., a fixed downstream task). Thm. 5.1 discusses a stronger bound, namely on the worst-case extrinsic dissimilarity among all downstream linear classifiers, i.e., among all possible tasks. Further, by accounting for the asymmetries of encoder relationships, we augment the work on similarity in proper metric spaces [3, 36, 42].

Although encoders may not be affinely related in practice, empirical evidence in §7 suggests that notions of affine order still surface (cf. Tab. 1, Fig. 2), particularly as differently initialized BERTs exhibit variations in downstream task performance [29]. While other similarity measures, such as those used in seed specificity tests [12], are designed to remain invariant to initialization changes, our results indicate that intrinsic affine homotopy is appropriately sensitive to them. This sensitivity raises new questions about the landscape of pre-trained encoders; as seen in Fig. 1, asymmetry in intrinsic affine similarity among similarly pre-trained encoders impacts downstream performance, as corroborated by Lem. 5.2 and empirical results in Tab. 1. Differences in representation ranks may partly explain this asymmetry-mapping between artificially generated rank-deficient encoders yields mostly symmetric affine distances (cf. Fig. 3). Another explanation might be that easy-to-learn encoders might be approximately linear combinations of others, making them easy to map to but not necessarily from . Overall, our findings highlight the need to account for directionality in encoder similarity measures to address the asymmetry inherent in this problem.

9 Conclusion

We discuss the structure of the space of language encoder in the framework of S -homotopy-the notion of aligning encoders with a chosen set of functions. We formalize affine alignment between encoders and show that it provides upper bounds on the differences in performance on downstream tasks. Experiments show our notion of intrinsic affine homotopy to be consistently predictive of downstream task behavior while revealing an asymmetric order in the space of encoders.

Broader Impact

This paper presents foundational research about the similarity of language encoders. To the best of our knowledge, there are no ethical or negative societal implications to this work.

References

Yamini Bansal, Preetum Nakkiran, and Boaz Barak. 2021. Revisiting model stitching to compare neural representations. In Advances in Neural Information Processing Systems , volume 34, pages 225-236. Curran Associates, Inc.

Saaid Baraty, Dan A. Simovici, and Catalin Zara. 2011. The impact of triangular inequality violations on medoid-based clustering. In Foundations of Intelligent Systems , pages 280-289, Berlin, Heidelberg. Springer Berlin Heidelberg.

Enric Boix-Adsera, Hannah Lawrence, George Stepaniants, and Philippe Rigollet. 2022. Gulp: a prediction-based metric between representations. In Advances in Neural Information Processing Systems , volume 35, pages 7115-7127. Curran Associates, Inc.

Dmitri Burago, Yuri Burago, and Sergei Ivanov. 2001. A Course in Metric Geometry . American Mathematical Society, Providence, RI.

C. Chang, W. Liao, Y. Chen, and L. Liou. 2016. A mathematical theory for clustering in metric spaces. IEEE Transactions on Network Science and Engineering , 3(01):2-16.

Kevin Clark, Minh-Thang Luong, Quoc V. Le, and Christopher D. Manning. 2020. ELECTRA: Pre-training text encoders as discriminators rather than generators. In International Conference on Learning Representations .

Ryan Cotterell, Anej Svete, Clara Meister, Tianyu Liu, and Li Du. 2023. Formal aspects of language modeling. arXiv preprint arXiv:2311.04329 .

Adrián Csiszárik, Péter K˝ orösi-Szabó, Ákos Matszangosz, Gergely Papp, and Dániel Varga. 2021. Similarity and matching of neural network representations. In Advances in Neural Information Processing Systems , volume 34, pages 5656-5668. Curran Associates, Inc.

Alexander D'Amour, Katherine A. Heller, Dan I. Moldovan, Ben Adlam, Babak Alipanahi, Alex Beutel, Christina Chen, Jonathan Deaton, Jacob Eisenstein, Matthew D. Hoffman, Farhad Hormozdiari, Neil Houlsby, Shaobo Hou, Ghassen Jerfel, Alan Karthikesalingam, Mario Lucic, Yi-An Ma, Cory Y. McLean, Diana Mincu, Akinori Mitani, Andrea Montanari, Zachary Nado, Vivek Natarajan, Christopher Nielson, Thomas F. Osborne, Rajiv Raman, Kim Ramasamy, Rory Sayres, Jessica Schrouff, Martin G. Seneviratne, Shannon Sequeira, Harini Suresh, Victor Veitch, Max Vladymyrov, Xuezhi Wang, Kellie Webster, Steve Yadlowsky, Taedong Yun, Xiaohua Zhai, and D. Sculley. 2020. Underspecification presents challenges for credibility in modern machine learning. Journal of Machine Learning Research , 23:226:1-226:61.

Sanjoy Dasgupta and Philip M. Long. 2005. Performance guarantees for hierarchical clustering. Journal of Computer and System Sciences , 70(4):555-569. Special Issue on COLT 2002.

Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2019. BERT: Pretraining of deep bidirectional transformers for language understanding. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers) , pages 41714186, Minneapolis, Minnesota. Association for Computational Linguistics.

Frances Ding, Jean-Stanislas Denain, and Jacob Steinhardt. 2021. Grounding representation similarity through statistical testing. In Advances in Neural Information Processing Systems , volume 34, pages 1556-1568. Curran Associates, Inc.

Jesse Dodge, Gabriel Ilharco, Roy Schwartz, Ali Farhadi, Hannaneh Hajishirzi, and Noah Smith. 2020. Fine-tuning pretrained language models: Weight initializations, data orders, and early stopping. arXiv preprint arXiv:2002.06305 .

William B. Dolan and Chris Brockett. 2005. Automatically constructing a corpus of sentential paraphrases. In Proceedings of the Third International Workshop on Paraphrasing (IWP2005) .

Li Du, Lucas Torroba Hennigen, Tiago Pimentel, Clara Meister, Jason Eisner, and Ryan Cotterell. 2023. A measure-theoretic characterization of tight language models. In Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers) , pages 9744-9770, Toronto, Canada. Association for Computational Linguistics.

Bolin Gao and Lacra Pavel. 2017. On the properties of the softmax function with application in game theory and reinforcement learning. arXiv preprint arXiv:1704.00805 , 1704.00805.

Jean Goubault-Larrecq. 2013. Non-Hausdorff Topology and Domain Theory: Selected Topics in Point-Set Topology . New Mathematical Monographs. Cambridge University Press.

Arthur Gretton, Olivier Bousquet, Alex Smola, and Bernhard Schölkopf. 2005. Measuring statistical dependence with Hilbert-Schmidt norms. In Algorithmic Learning Theory , pages 63-77, Berlin, Heidelberg. Springer Berlin Heidelberg.

William L. Hamilton, Jure Leskovec, and Dan Jurafsky. 2016. Diachronic word embeddings reveal statistical laws of semantic change. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers) , pages 1489-1501, Berlin, Germany. Association for Computational Linguistics.

David Roi Hardoon, Sándor Szedmák, and John Shawe-Taylor. 2004. Canonical correlation analysis: An overview with application to learning methods. Neural Computation , 16:26392664.

Max Klabunde, Tobias Schumacher, Markus Strohmaier, and Florian Lemmerich. 2023. Similarity of neural network models: A survey of functional and representational measures. arXiv preprint arXiv:2305.06329 .

Simon Kornblith, Mohammad Norouzi, Honglak Lee, and Geoffrey Hinton. 2019. Similarity of neural network representations revisited. In Proceedings of the 36th International Conference on Machine Learning , volume 97 of Proceedings of Machine Learning Research , pages 3519-3529. PMLR.

Nikolaus Kriegeskorte, Marieke Mur, and Peter Bandettini. 2008. Representational similarity analysis - connecting the branches of systems neuroscience. Frontiers in Systems Neuroscience , 2.

Serge Lang. 2002. Algebra . Springer New York.

F. W. Lawvere. 2002. Metric spaces, generalized logic, and closed categories. Theory and Applications of Categories No. 1 (2002) pp 1-37 .

Karel Lenc and Andrea Vedaldi. 2019. Understanding image representations by measuring their equivariance and equivalence. International Journal of Computer Vision , 127(5):456-476.

Li, Yixuan and Yosinski, Jason and Clune, Jeff and Lipson, Hod and Hopcroft, John. 2015. Convergent learning: Do different neural networks learn the same representations? In Proceedings of the 1st International Workshop on Feature Extraction: Modern Questions and Challenges at NIPS 2015 , volume 44 of Proceedings of Machine Learning Research , pages 196-212, Montreal, Canada. PMLR.

Yinhan Liu, Myle Ott, Naman Goyal, Jingfei Du, Mandar Joshi, Danqi Chen, Omer Levy, Mike Lewis, Luke Zettlemoyer, and Veselin Stoyanov. 2019. RoBERTa: A robustly optimized BERT pretraining approach. ArXiv , abs/1907.11692.

R. Thomas McCoy, Junghyun Min, and Tal Linzen. 2020. BERTs of a feather do not generalize together: Large variability in generalization across models with similar test set performance. In Proceedings of the Third BlackboxNLP Workshop on Analyzing and Interpreting Neural Networks for NLP , pages 217-227, Online. Association for Computational Linguistics.

Ari Morcos, Maithra Raghu, and Samy Bengio. 2018. Insights on representational similarity in neural networks with canonical correlation. In Advances in Neural Information Processing Systems , volume 31. Curran Associates, Inc.

William H. Press, Saul A. Teukolsky, William T. Vetterling, and Brian P. Flannery. 2007. Numerical Recipes: The Art of Scientific Computing , 3rd edition. Cambridge University Press.

Maithra Raghu, Justin Gilmer, Jason Yosinski, and Jascha Sohl-Dickstein. 2017. Svcca: Singular vector canonical correlation analysis for deep learning dynamics and interpretability. In Advances in Neural Information Processing Systems , volume 30. Curran Associates, Inc.

Yuxin Ren, Qipeng Guo, Zhijing Jin, Shauli Ravfogel, Mrinmaya Sachan, Bernhard Schölkopf, and Ryan Cotterell. 2023. All roads lead to Rome? Exploring the invariance of transformers' representations. arXiv preprint arXiv:2305.14555 .

Peter H. Schönemann. 1966. A generalized solution of the orthogonal procrustes problem. Psychometrika , 31(1):1-10.

Thibault Sellam, Steve Yadlowsky, Jason Wei, Naomi Saphra, Alexander D'Amour, Tal Linzen, Jasmijn Bastings, Iulia Turc, Jacob Eisenstein, Dipanjan Das, et al. 2022. The MultiBERTs: BERT reproductions for robustness analysis. In International Conference on Learning Representations . OpenReview.net.

Mahdiyar Shahbazi, Ali Shirali, Hamid Aghajan, and Hamed Nili. 2021. Using distance on the Riemannian manifold to compare representations in brain and in models. NeuroImage , 239:118271.

C.G. Small. 2012. The Statistical Theory of Shape . Springer Series in Statistics. Springer New York.

Richard Socher, Alex Perelygin, Jean Wu, Jason Chuang, Christopher D. Manning, Andrew Ng, and Christopher Potts. 2013. Recursive deep models for semantic compositionality over a sentiment treebank. In Proceedings of the 2013 Conference on Empirical Methods in Natural Language Processing , pages 1631-1642, Seattle, Washington, USA. Association for Computational Linguistics.

Hrishikesh D. Vinod. 1976. Canonical ridge and econometrics of joint production. Journal of Econometrics , 4:147-166.

Alex Wang, Amanpreet Singh, Julian Michael, Felix Hill, Omer Levy, and Samuel R. Bowman. 2019. GLUE: A multi-task benchmark and analysis platform for natural language understanding. In International Conference on Learning Representations .

Fei Wang and Jimeng Sun. 2015. Survey on distance metric learning and dimensionality reduction in data mining. Data Mining and Knowledge Discovery , 29(2):534-564.

Alex H. Williams, Erin Kunz, Simon Kornblith, and Scott Linderman. 2021. Generalized shape metrics on neural representations. In Advances in Neural Information Processing Systems , volume 34, pages 4738-4750. Curran Associates, Inc.

Peter N. Yianilos. 1993. Data structures and algorithms for nearest neighbor search in general metric spaces. In Proceedings of the Fourth Annual ACM-SIAM Symposium on Discrete Algorithms , SODA '93, page 311-321, USA. Society for Industrial and Applied Mathematics.

Ruiqi Zhong, Dhruba Ghosh, Dan Klein, and Jacob Steinhardt. 2021. Are larger pretrained language models uniformly better? Comparing performance at the instance level. In Findings of the Association for Computational Linguistics: ACL-IJCNLP 2021 , pages 3813-3827, Online. Association for Computational Linguistics.

A Notation

B Limitations

In this section, we address some of our work's limitations.

Non-Linear Encoder Relationships. This work focuses on affine similarity between encoders. As we find and discuss in §4 with the example of MULTIBERTs, language encoder representations may generally not be exactly affinely related. Nevertheless, understanding the affine-homotopy relationships on E V still helps us to make conclusions about practical findings as in §7.

Linear Classifiers. Our work provides precise theoretical guarantees on the performance of linear classifiers applied to affinely-related encoders. In practice, task fine-tuning can take the form of more complex models, such as re-training entire pre-trained models. This work does not cover such more complex fine-tuning techniques.

Numerical Approximations. To bridge our theoretical findings on affine homotopy relationships in E V with their practical implementations in §7, we concede several approximations. For instance, while d H V p V, ∆ q is valuable in analysis, optimizing Eq. (23) directly is computationally challenging and requires costly approximations. Similarly, in computing intrinsic distances across all representation layers in Fig. 1, we optimize for mean squared error (MSE) and evaluate the maximum loss instead of optimizing for it directly, which serves as an approximation of d that results in more stable optimization given computational constraints. Finally, we address numerical inaccuracies encountered during singular value decomposition (SVD) computations in §7, which we mitigate by tuning the rank according to precision ϵ .

C Additional Related Work

In this section, we complement our discussion in §6 and §8 with additional related work.

Representational and Functional Similarity. Our work is related to the ongoing efforts to quantify the similarity between neural networks. Much related work discusses similarity measures in terms of the invariance properties of neural networks [12, 22, inter alia ]; see Klabunde et al. [21] for a recent comprehensive survey. Notably, Klabunde et al. [21] compile various representational [19, 23, 27, 32, 39, inter alia ] and functional ways to measure similarity, which are related to our notions of intrinsic and extrinsic homotopy, respectively. Whereas our notion of intrinsic affine homotopy fits into the class of linear alignment-based measures [12, 27, 42, inter alia ] as described in §6, the notion of extrinsic similarity fits into the broader category of performance-based functional measures [1, 8, 26]. Most relevantly, Boix-Adsera et al. [3] propose the GULP metric that provides a bound on the expected prediction dissimilarity for norm-one-bounded ridge regression.

Similarity Measures as Metrics. A line of work draws from statistical shape analysis [37] to motivate the development of similarity measures that are that conform to axioms of valid metrics [3, 36, 42]. Learning within proper metric spaces provides certain theoretical guarantees [2, 5, 10, 41, 43]. For example, Williams et al. [42] derive two families of generalized shape metrics , modifying existing dissimilarity measures to ensure they meet metric criteria. Notably, one of these generalized shape metrics is based on linear regression over the group of linear isometries, similar to the approach derived for encoder maps in Prop. 3.1.

Understanding Similarity of Language Encoders. Finally, several previous works characterize the landscape of language encoders and their sensitivity to slight changes to the pre-training or fine-tuning procedure [9, 13, 44]. This prompted multi-seed releases of encoders such as BERT [35, 44] that are frequently used for robustness or sensitivity analysis [12, 33], similar to the one presented in this work.

D Addenda on Affine Homotopy

In this section, we provide additional derivations and proofs complementing the discussion in §3-§5.

D.1 Preliminaries on Hemi-Metric Spaces

Definition D.1. Let p X,d q be a hemi-metric space. The open ball B p x, ϵ q of center x and radius ϵ ą 0 , is the set t y P X | d p x, y q ă ϵ u . The open balls form a base for the open ball topology. 26

Lemma 4.1. Let p X,d q be a hemi-metric space. The relation p x Á d y iff d p x, y q ' 0 q is a preorder 27 and it will be called the specialization ordering of d .

Example D.1. An example of a specialization ordering is the prefix ordering of strings ď prefix 28 . More precisely, for any y , y 1 P Σ ˚ , we define d Σ ˚ p y , y 1 q to be zero if y is a prefix of y 1 and 2 ´ n otherwise, where n is the length of the longest prefix of y that is also a prefix of y 1 . Then p Σ ˚ , d Σ ˚ q is a hemi-metric space whose specialization ordering is ď prefix . //

Lemma D.1. Let p X,d q be a hemi-metric space.

The set t x P X | d H p x, E q ' 0 u is exactly the closure of E in the open ball topology.

For any x, x 1 P X , we have the inequality d H p x, E q ď d p x, x 1 q ` d H p x 1 , E q . If d is a metric, then d H p¨ , E q is 1 -Lipschitz from p X,d q to R ` .

Let Z Ă P p X q be any space of non-empty subsets of X . The Hausdorff-Hoare map d H is hemi-metric on Z . Its specialization ordering Á d H is given by E Á d H E 1 iff 29 E Ă cl p E 1 q , iff cl p E q Ă cl p E 1 q .

Proof. See Goubault-Larrecq [17, Lemma 6.1.11, Proposition 6.2.16 & Lemma 7.5.1].

■

D.2 Additional Derivations: Affine Alignment Measures

Remark 3.2. d Aff p V q defined in Eq. (8a) is not a metric on E V . 30 Further, when S ' Aff p V q , the map inf ψ,ψ 1 P Aff p V q } ψ ˝ h ´ ψ 1 ˝ g } 8 is trivially zero by Cor. D.1.

Proof. To see that d Aff p V q is not a metric, consider the following two encoders: g p y q ' | y | ¨ e , where e P V is any fixed vector, and h be any map from Σ ˚ to the ball B p 0 V , 1 q of radius one. In such a case, we have d Aff p V q p h , g q ' 8 . Even on the space of bounded encoders 31 d Aff p V q is not a metric. We provide the following counter-example: Let h be any rank R encoder, e.g., h can be any map that sends the first R strings to the basis of V . Let A be a non-invertible linear map of V and set g ' A p h q . Then clearly d Aff p V q p h , g q ' 0 , but d Aff p V q p g , h q can not be zero for dimensionality reasons (see Thm. 4.1). ■

Lemma D.2 (Hausdorff Distance) . Let E,E 1 Ă E V . The map

is an extended pseudo-metric on P p E V qztHu .

Proof. It follows readily from Lem. D.1. See also Burago et al. [4, §7.3.1].

■

For any affine subgroup S Ă Aff p V q , let S p h q def ' t ψ p h q | ψ P S u . It then follows immediately from Lem. D.2 that the map d H , sym S p h , g q def ' d H , sym 8 p S p h q , S p g qq is an extended pseudo-metric on E V .

Lemma D.3. For any h , g P E V , any ψ P Iso p V q and any non-empty S Ă E V , we have

In particular, d Iso p V q p ψ ˝ h , g q ' d Iso p V q p h , g q .

Proof. Lem. D.3 follows by definition d 8 p ψ ˝ h , ψ ˝ g q ' d 8 p h , ψ ´ 1 ˝ ψ ˝ g q .

■

Proposition 3.1. The pair p E V , d Iso p V q q is an extended pseudo-metric space.

Proof. Using Lem. D.3, one can show that d Iso p V q p h , g q ' d H , sym 8 p Iso p h q , Iso p g qq , where Iso p h q def ' t ψ ˝ h : ψ P Iso p V qu . The proposition follows then from Lem. D.2. ■

For any ψ P Aff p V q and any h P E V , we then have

Lemma D.4.

If h P

where r h denotes the radius of h , which we define as the radius of the minimum enclosing ball of the set h p Σ ˚ q , and the } ¨ } norm is defined as in Eq. (8) .

For any ψ P Aff p V q and a subset S Ă Aff p V q normalized 32 by ψ and containing T } ψ ˝ h } S ď } ψ lin } V ¨ } h } S ,

where the } ¨ } S norm is defined as in Eq. (8) .

. Then

Proof.

Let t P T be the translation moving the center of the ball enclosing h p Σ ˚ q to the center 0 V . Hence

Now observe that for any other isometry ψ ‰ t , then r ψ ˝ h ' r h . The ball B p 0 V , } ψ ˝ h } 8 q clearly contains all points in ψ ˝ h p Σ ˚ q , hence by definition of the radius r ψ ˝ h we must have } ψ ˝ h } 8 ď r h , which finishes the proof of 1.

Write ψ ' ϕ lin ˝ t , with t P T . We then have

Note that ϕ ÞÑ ψ ´ 1 lin ˝ ϕ ˝ ψ lin ˝ t is by definition a bijection of S , hence

Corollary D.1. Let S Ą T such that inf ψ P S } ψ lin } V . 33 Then, d S p h , g q def ' inf ψ,ψ 1 P S } ψ ˝ h ´ ψ 1 ˝ g } 8 ' 0 for all h , g P E b .

Proof. Note that d S p ψ ˝ h , g q ď } ψ lin } V ¨ d S p h , g q , which follows from Lem. D.4. Hence

D.3 Proofs: Intrinsic Affine Homotopy

Lemma 4.2. The relation Á Aff is a preorder on E V .

Proof. Since d Aff p V q p ψ ˝ h , g q ď } ψ lin } V ¨ d Aff p V q p h , g q (see Lem. D.4),

Therefore, the relation Á Aff is the specialization ordering of the hemi-metric d H Aff p V q . ■

Theorem 4.1. For h , g P E V , we have

where, π h is the orthogonal projection of V onto V h . In particular, if d Aff p V q p h , g q ' 0 then rank p h q ď rank p g q . If in addtion, we know rank p g q ' rank p h q , then g must by an affine transformation of g , i.e., h ' ψ ˝ g for some ψ P Aff p V q .

Proof.

Recall from §3.2 that E V is complete with respect to the metric d 8 . The condition d p h , g q Aff p V q ' 0 simply means that there exists ϕ n P Aff p V q such that lim n Ñ8 ϕ n ˝ g ' h in E V , in other words h P Aff p g q , i.e., h lies in the closure of Aff p g q in E V .

Let B h Ă Σ ˚ such that h p B h q is a basis for V h . Therefore, there exists ϵ ą 0 such that any family 34

has rank dim R p V h q . This shows that there exists N ě 1 such that for any n ě N one has } h ´ ϕ n ˝ g } 8 ă ϵ , and

Which implies in particular

If rank p g q ' rank p h q ' D , then lim n Ñ8 ϕ n ' ϕ , where ϕ is the affine map given by g p y q ÞÑ h p y q for y P B h . Indeed, for any v ' ř b P B h λ b b P V , we have

for some constant c ą 0 , since all norms on V are equivalent. Hence, lim n Ñ8 } ϕ ´ ϕ n } V ' 0 , which shows the claim. Accordingly, we must have ϕ ˝ g ' h .

Now we can prove Eq. (10):

3 ñ . Given that } h ´ π h ˝ ϕ n ˝ g } 8 ď } h ´ ϕ n ˝ g } 8 , we also have lim n Ñ8 π h ˝ ϕ n ˝ g ' h Write π K for the orthogonal projection on V K and set π h ,n ' π h ' 1 n } ϕ n } π K h . Note that lim n Ñ8 π h ,n ' π h . Accordingly,

where ψ n ' π h ,n ϕ n π ´ 1 h ,n . From this, we deduce that

Now applying 2. yields h ' ϕ p π h ˝ g q for some ϕ h P Aff p V h q , or h ' ϕ p π h ˝ g q where ϕ ' ϕ h ' π K h P Aff p V q .

3 ð . Assume now that h ' ϕ p π h ˝ g q for some ϕ P Aff p V q . Then h ' lim n Ñ8 ϕ ˝ π h ,n p g q , where π h ,n ' π h ' 1 n π K h , which shows the desired implication. ■

D.4 Proofs: Extrinsic Homotopy

Lemma 5.2. Let h , g P E V . We have

There exists a constant c λ such that for any ψ V, W

Proof.

Clearly,

where, the first inequality follows from the fact that softmax λ is c p λ q -Lipschitz for some constant that depends on λ [16, Proposition 4].

2. & 3. are are immediate consequences of 1.

Theorem 5.1 ( ϵ -Intrinsic ñ O p ϵ q -Extrinsic) . Let h , g P E V be two encoders. Then,

Proof. Let ψ P Aff p V, W q . There exists a linear map A : V Ñ W and a ϕ V P GL p V q , such that ψ ' A ˝ ϕ and } A } ' 1 . Accordingly, Lem. 5.2 yields

Therefore d H V p V, ∆ q p h , g q ď c p λ q d H Aff p V q p h , g q .

■

E Addenda on Linear Alignment Methods for Finite Representation Sets

Linear Regression A common way to evaluate the similarity of two representation matrices H P R N ˆ D and G P R N ˆ D is through linear regression. Linear regression finds the matrix ˆ A P R D ˆ D that minimizes the least squares error:

Let H ' Q H R H and G ' Q G R G be the QR-decomposition of H and G , respectively. The goodness of fit is commonly evaluated through the R-squared value R 2 LR , i.e., as the proportion of variance in G explained by the fit:

To derive Eq. (30), consider the fitted value ˆ G

The residuals are therefore

With this, we can compute the coefficient of determination as

■

Orthogonal Procrustes Problem. Let G P R N ˆ D and H P R N ˆ D representation matrices. In the orthogonal Procrustes problem, we seek to find the orthogonal matrix A that best maps H to G :

Since

an equivalent objective to Eq. (34) is such that

Therefore, we can derive

which is equivalent to solving the Orthogonal Procrustes problem (Eq. (34)) on the whitened matrices W H H and W G G .

Let UΣV J be the singular-value decomposition of H J G , then

where U J AV is a product of orthogonal matrices, and, therefore, orthogonal. Since Σ is diagonal, Eq. (35d) is maximized by U J ˆ AV ' I , which means that ˆ A ' UV J .

Canonical Correlation Analysis. We can rewrite the CCA objective from Eq. (21) as

which, by definition of the Frobenius norm, is equivalent to Eq. (22). Let M HG ' HG J , M HH ' HH J , M GG ' GG J , and let UΣV J ' M HG be the singular-value decomposition of M HG . One can show that the optimum of Eq. (22) is found at p ˆ A , ˆ B q ' p M ´ 1 2 HH U , M ´ 1 2 GG V q . Because A J H , B J G , U , and V are by definition orthogonal, we see that CCA first whitens the representations p H , G q through p M ´ 1 2 HH , M ´ 1 2 GG q and then orthogonally transforms them. This provides the intuition behind a close relationship between CCA and the Orthogonal Procrustes problem: For pre-whitened representation matrices, CCA (Eq. (22)) is equivalent to solving the Orthogonal Procrustes problem (Eq. (34)). To see this, let W H and W G be whitening transforms for H and G , respectively. Then, Eq. (22) is equivalent to

F Experimental Setup

In this section, we provide additional details about the setup and compute resources of the experiments in §7. To generate embeddings, we used the open-sourced code by Ren et al. [33]. Further, for Orthogonal Procrustes, CCA, PWCCA, and Linear CKA, we use the open source implementation by Ding et al. [12]. Our complete code is added as supplementary material.

Models and Datasets. We first extract the D ' 768 dimensional training set representations for SST-2, MRPC, RTE, CoLA, MNLI, and QQP across all 12 layers of ELECTRA [6], ROBERTA [28], and the 25 MULTIBERT [35] models from HuggingFace. 35 The models and the MRPC dataset are licensed under Apache License 2.0 . The SST-2 dataset is licensed under the Creative Commons CC0: Public Domain license. The RTE dataset is licensed under the CC BY 3.0 license. The CoLA dataset is licensed under the CC BY-SA 4.0 license. The MNLI dataset is licensed under the General Public License (GPL) . THE QQP dataset is licensed under a custom non-commercial license. 36 The dataset statistics are shown in Tab. 3. We note that for all experiments, MNLI and QQP were shortened to the first 10K training samples due to computational limitations.

Hyperparameters. Each experiment was run using RiemannSGD 37 as an optimizer as it initially produced the best convergence when computing our affine similarity measures. Further, to account for convergence artifacts, we ran the intrinsic similarity computation optimizations in each experiment for learning rates r 1 E4 , 1 E3 , 1 E2 , 1 E1 s and extrinsic computations for r 1 E3 , 1 E2 , 2 E2 s and report the best result. When training the task-specific linear probing classifier ψ 1 for ˆ d ψ 1 , we use the crossentropy loss, RiemannSGD and optimize over the learning rates r 1 E2 , 1 E1 , 2 E1 , 4 E1 s . For the computation of Hausdorff-Hoare map d H , we fixed a lr of 1 E3 to save compute resources, as this lr generally leads to the best convergence in previous experiments. We used a batch size 64 and let optimization run for 20 epochs, keeping other parameters at default. For reproducibility, we set the initial seed to 42 during training.

Generating Random Affine Maps. For the last experiment, we generate random affine maps. To approximate d H we sample the matrix entries of the affine map from N p 0 , 1 q . We then additionally normalize the transformed representation matrix as this leads to better convergence. To approximate ˆ d H V p V, ∆ q , we fit a linear probe on H to 100 sets of randomly generated class labels, for the embeddings of each task. The predictions of that probe then become what G affinely maps to. In both cases, the seeds are set ascendingly from 0.

Compute Resources. We compute the embeddings on a single A100-40GB GPU, which took around two hours. All other experiments were run on 8-32 CPU cores, each with 8 GB of memory. Computing extrinsic distances between 600 model combinations across both datasets usually takes 2-3 hours on 8 cores, whereas intrinsic computation is more costly, and can run up to 4 hours. Note our approximation of Hausdorff-Hoare maps (cf. Eq. (23)) across all models is significantly more costly due to our sampling approach and can take up to 72 hours to compute on 32 cores for large datasets such as SST-2, and up to 12 hours for MRPC. The resources needed for initially failed experiments do not significantly exceed the reported compute.

0.0100

0.0125

0.0150

768

(full)

614

(80%)

461

(60%)

307

(40%)

154

(20%)

768

(full)

614

(80%)

461

(60%)

307

(40%)

154

(20%)

MRPC

768

(full)

614

(80%)

461

(60%)

307

(40%)

154

(20%)

768

(full)

614

(80%)

461

(60%)

307

(40%)

154

(20%)

SST-2

G Additional Experimental Results

The Influence of Encoder Rank Deficiency. In Thm. 4.1 we discuss how the relative rank of encoders influences their affine alignment and derive the equivalence relation » Aff conditioned on equal rank between encoders. To test the effect of unequal rank on affine alignment in an isolated setup, we artificially construct reduced-rank encoders through singular value decomposition (SVD) truncation. In Figure 3 we expectedly find a trend in how the encoder rank influences affine mappability. We additionally highlight that the computed distances are rather symmetric, with no clear differences when mapping to ( Ñ M ), rather than from ( M Ñ ) an encoder. Finally, we note the trend in the diagonal indicating that mapping between encoders of the same rank becomes easier between lower-rank encoders.

ER

M5

M10

M15

M20

M25

E

R

M5

M10

M15

M20

M25

M →

SST-2

Layer 1

ER

M5

M10

M15

M20

M25

E

R

M5

M10

M15

M20

M25

Layer 4

ER

M5

M10

M15

M20

M25

E

R

M5

M10

M15

M20

M25

Layer 8

ER

M5

M10

M15

M20

M25

E

R

M5

M10

M15

M20

M25

Layer 12

ER

M5

M10

M15

M20

M25

E

R

M5

M10

M15

M20

M25

M →

CoLA

ER

M5

M10

M15

M20

M25

E

R

M5

M10

M15

M20

M25

ER

M5

M10

M15

M20

M25

E

R

M5

M10

M15

M20

M25

ER

M5

M10

M15

M20

M25

E

R

M5

M10

M15

M20

M25

ER

M5

M10

M15

M20

M25

E

R

M5

M10

M15

M20

M25

M →

MNLI

ER

M5

M10

M15

M20

M25

E

R

M5

M10

M15

M20

M25

ER

M5

M10

M15

M20

M25

E

R

M5

M10

M15

M20

M25

ER

M5

M10

M15

M20

M25

E

R

M5

M10

M15

M20

M25

ER

M5

M10

M15

M20

M25

E

R

M5

M10

M15

M20

M25

M →

QQP

ER

M5

M10

M15

M20

M25

E

R

M5

M10

M15

M20

M25

ER

M5

M10

M15

M20

M25

E

R

M5

M10

M15

M20

M25

ER

M5

M10

M15

M20

M25

E

R

M5

M10

M15

M20

M25

ER

M5

M10

M15

M20

M25

E

R

M5

M10

M15

M20

M25

M →

RTE

ER

M5

M10

M15

M20

M25

E

R

M5

M10

M15

M20

M25

ER

M5

M10

M15

M20

M25

E

R

M5

M10

M15

M20

M25

ER

M5

M10

M15

M20

M25

E

R

M5

M10

M15

M20

M25

ER

M5

M10

M15

M20

M25

E

R

M5

M10

M15

M20

M25

M →

MRPC

ER

M5

M10

M15

M20

M25

E

R

M5

M10

M15

M20

M25

ER

M5

M10

M15

M20

M25

E

R

M5

M10

M15

M20

M25

ER

M5

M10

M15

M20

M25

E

R

M5

M10

M15

M20

M25

0

1

2

3

4

5

↓

→ M

→ M

→ M

→ M

NeurIPS Paper Checklist

1. Claims

Question: Do the main claims made in the abstract and introduction accurately reflect the paper's contributions and scope?

Answer: [Yes]

Justification: The abstract and introduction clearly state the claims and contributions. The claims match the theoretical and experimental results.

Guidelines:

The answer NA means that the abstract and introduction do not include the claims made in the paper.

The abstract and/or introduction should clearly state the claims made, including the contributions made in the paper and important assumptions and limitations. A No or NA answer to this question will not be perceived well by the reviewers.

The claims made should match theoretical and experimental results, and reflect how much the results can be expected to generalize to other settings.

It is fine to include aspirational goals as motivation as long as it is clear that these goals are not attained by the paper.

2. Limitations

Question: Does the paper discuss the limitations of the work performed by the authors?

Answer: [Yes]

Justification: We highlight limitations in the main text and add more general points in App. B.

Guidelines:

The answer NA means that the paper has no limitation while the answer No means that the paper has limitations, but those are not discussed in the paper.

The authors are encouraged to create a separate "Limitations" section in their paper.

The paper should point out any strong assumptions and how robust the results are to violations of these assumptions (e.g., independence assumptions, noiseless settings, model well-specification, asymptotic approximations only holding locally). The authors should reflect on how these assumptions might be violated in practice and what the implications would be.

The authors should reflect on the scope of the claims made, e.g., if the approach was only tested on a few datasets or with a few runs. In general, empirical results often depend on implicit assumptions, which should be articulated.

The authors should reflect on the factors that influence the performance of the approach. For example, a facial recognition algorithm may perform poorly when image resolution is low or images are taken in low lighting. Or a speech-to-text system might not be used reliably to provide closed captions for online lectures because it fails to handle technical jargon.

The authors should discuss the computational efficiency of the proposed algorithms and how they scale with dataset size.

If applicable, the authors should discuss possible limitations of their approach to address problems of privacy and fairness.

While the authors might fear that complete honesty about limitations might be used by reviewers as grounds for rejection, a worse outcome might be that reviewers discover limitations that aren't acknowledged in the paper. The authors should use their best judgment and recognize that individual actions in favor of transparency play an important role in developing norms that preserve the integrity of the community. Reviewers will be specifically instructed to not penalize honesty concerning limitations.

3. Theory Assumptions and Proofs

Question: For each theoretical result, does the paper provide the full set of assumptions and a complete (and correct) proof?

Answer: [Yes]

Justification: If not in the main text, all proofs along with their assumptions are in App. D and App. E. We additionally provide short proof sketches in the main text.

Guidelines:

The answer NA means that the paper does not include theoretical results.

All the theorems, formulas, and proofs in the paper should be numbered and crossreferenced.

All assumptions should be clearly stated or referenced in the statement of any theorems.

The proofs can either appear in the main paper or the supplemental material, but if they appear in the supplemental material, the authors are encouraged to provide a short proof sketch to provide intuition.

Inversely, any informal proof provided in the core of the paper should be complemented by formal proofs provided in appendix or supplemental material.

Theorems and Lemmas that the proof relies upon should be properly referenced.

4. Experimental Result Reproducibility

Question: Does the paper fully disclose all the information needed to reproduce the main experimental results of the paper to the extent that it affects the main claims and/or conclusions of the paper (regardless of whether the code and data are provided or not)?

Answer: [Yes]

Justification: We describe all used models, procedures as well as parameters, seeds, and required compute resources either in the main text or in App. F.

Guidelines:

The answer NA means that the paper does not include experiments.

If the paper includes experiments, a No answer to this question will not be perceived well by the reviewers: Making the paper reproducible is important, regardless of whether the code and data are provided or not.

If the contribution is a dataset and/or model, the authors should describe the steps taken to make their results reproducible or verifiable.

Depending on the contribution, reproducibility can be accomplished in various ways. For example, if the contribution is a novel architecture, describing the architecture fully might suffice, or if the contribution is a specific model and empirical evaluation, it may be necessary to either make it possible for others to replicate the model with the same dataset, or provide access to the model. In general. releasing code and data is often one good way to accomplish this, but reproducibility can also be provided via detailed instructions for how to replicate the results, access to a hosted model (e.g., in the case of a large language model), releasing of a model checkpoint, or other means that are appropriate to the research performed.

While NeurIPS does not require releasing code, the conference does require all submissions to provide some reasonable avenue for reproducibility, which may depend on the nature of the contribution. For example

(a) If the contribution is primarily a new algorithm, the paper should make it clear how to reproduce that algorithm.

(b) If the contribution is primarily a new model architecture, the paper should describe the architecture clearly and fully.

(c) If the contribution is a new model (e.g., a large language model), then there should either be a way to access this model for reproducing the results or a way to reproduce the model (e.g., with an open-source dataset or instructions for how to construct the dataset).

(d) We recognize that reproducibility may be tricky in some cases, in which case authors are welcome to describe the particular way they provide for reproducibility. In the case of closed-source models, it may be that access to the model is limited in some way (e.g., to registered users), but it should be possible for other researchers to have some path to reproducing or verifying the results.

5. Open access to data and code

Question: Does the paper provide open access to the data and code, with sufficient instructions to faithfully reproduce the main experimental results, as described in supplemental material?

Answer: [Yes]

Justification: Code pulls data from GLUE, is runnable, and is submitted as supplementary material.

Guidelines:

The answer NA means that paper does not include experiments requiring code.

Please see the NeurIPS code and data submission guidelines ( https://nips.cc/ public/guides/CodeSubmissionPolicy ) for more details.

While we encourage the release of code and data, we understand that this might not be possible, so 'No' is an acceptable answer. Papers cannot be rejected simply for not including code, unless this is central to the contribution (e.g., for a new open-source benchmark).

The instructions should contain the exact command and environment needed to run to reproduce the results. See the NeurIPS code and data submission guidelines ( https: //nips.cc/public/guides/CodeSubmissionPolicy ) for more details.

The authors should provide instructions on data access and preparation, including how to access the raw data, preprocessed data, intermediate data, and generated data, etc.

The authors should provide scripts to reproduce all experimental results for the new proposed method and baselines. If only a subset of experiments are reproducible, they should state which ones are omitted from the script and why.

At submission time, to preserve anonymity, the authors should release anonymized versions (if applicable).

Providing as much information as possible in supplemental material (appended to the paper) is recommended, but including URLs to data and code is permitted.

6. Experimental Setting/Details

Question: Does the paper specify all the training and test details (e.g., data splits, hyperparameters, how they were chosen, type of optimizer, etc.) necessary to understand the results?

Answer: [Yes]

Justification: Again, if not listed in the main text, it is listed in App. F.

Guidelines:

The answer NA means that the paper does not include experiments.

The experimental setting should be presented in the core of the paper to a level of detail that is necessary to appreciate the results and make sense of them.

The full details can be provided either with the code, in appendix, or as supplemental material.

7. Experiment Statistical Significance

Question: Does the paper report error bars suitably and correctly defined or other appropriate information about the statistical significance of the experiments?

Answer: [Yes]

Justification: We provide significance indications in the form of p-values to all correlation computations and fitted regressions.

Guidelines:

The answer NA means that the paper does not include experiments.

The authors should answer "Yes" if the results are accompanied by error bars, confidence intervals, or statistical significance tests, at least for the experiments that support the main claims of the paper.

The factors of variability that the error bars are capturing should be clearly stated (for example, train/test split, initialization, random drawing of some parameter, or overall run with given experimental conditions).

The method for calculating the error bars should be explained (closed form formula, call to a library function, bootstrap, etc.)

The assumptions made should be given (e.g., Normally distributed errors).

It should be clear whether the error bar is the standard deviation or the standard error of the mean.

It is OK to report 1-sigma error bars, but one should state it. The authors should preferably report a 2-sigma error bar than state that they have a 96% CI, if the hypothesis of Normality of errors is not verified.

For asymmetric distributions, the authors should be careful not to show in tables or figures symmetric error bars that would yield results that are out of range (e.g. negative error rates).

If error bars are reported in tables or plots, The authors should explain in the text how they were calculated and reference the corresponding figures or tables in the text.

8. Experiments Compute Resources

Question: For each experiment, does the paper provide sufficient information on the computer resources (type of compute workers, memory, time of execution) needed to reproduce the experiments?

Answer: [Yes]

Justification: Listed in App. F.

Guidelines:

The answer NA means that the paper does not include experiments.

The paper should indicate the type of compute workers CPU or GPU, internal cluster, or cloud provider, including relevant memory and storage.

The paper should provide the amount of compute required for each of the individual experimental runs as well as estimate the total compute.

The paper should disclose whether the full research project required more compute than the experiments reported in the paper (e.g., preliminary or failed experiments that didn't make it into the paper).

9. Code Of Ethics

Question: Does the research conducted in the paper conform, in every respect, with the NeurIPS Code of Ethics https://neurips.cc/public/EthicsGuidelines ?

Answer: [Yes]

Justification: The authors do not foresee any ethical implications to this work.

Guidelines:

The answer NA means that the authors have not reviewed the NeurIPS Code of Ethics.

If the authors answer No, they should explain the special circumstances that require a deviation from the Code of Ethics.

The authors should make sure to preserve anonymity (e.g., if there is a special consideration due to laws or regulations in their jurisdiction).

10. Broader Impacts

Question: Does the paper discuss both potential positive societal impacts and negative societal impacts of the work performed?

Answer: [Yes]

Justification: Discussed in the final, "Broader Impact", section in the main body.

Guidelines:

The answer NA means that there is no societal impact of the work performed.

If the authors answer NA or No, they should explain why their work has no societal impact or why the paper does not address societal impact.

Examples of negative societal impacts include potential malicious or unintended uses (e.g., disinformation, generating fake profiles, surveillance), fairness considerations (e.g., deployment of technologies that could make decisions that unfairly impact specific groups), privacy considerations, and security considerations.

The conference expects that many papers will be foundational research and not tied to particular applications, let alone deployments. However, if there is a direct path to any negative applications, the authors should point it out. For example, it is legitimate to point out that an improvement in the quality of generative models could be used to generate deepfakes for disinformation. On the other hand, it is not needed to point out that a generic algorithm for optimizing neural networks could enable people to train models that generate Deepfakes faster.

The authors should consider possible harms that could arise when the technology is being used as intended and functioning correctly, harms that could arise when the technology is being used as intended but gives incorrect results, and harms following from (intentional or unintentional) misuse of the technology.

If there are negative societal impacts, the authors could also discuss possible mitigation strategies (e.g., gated release of models, providing defenses in addition to attacks, mechanisms for monitoring misuse, mechanisms to monitor how a system learns from feedback over time, improving the efficiency and accessibility of ML).

11. Safeguards

Question: Does the paper describe safeguards that have been put in place for responsible release of data or models that have a high risk for misuse (e.g., pretrained language models, image generators, or scraped datasets)?

Answer: [NA]

Justification: The paper poses no such risks.

Guidelines:

The answer NA means that the paper poses no such risks.

Released models that have a high risk for misuse or dual-use should be released with necessary safeguards to allow for controlled use of the model, for example by requiring that users adhere to usage guidelines or restrictions to access the model or implementing safety filters.

Datasets that have been scraped from the Internet could pose safety risks. The authors should describe how they avoided releasing unsafe images.

We recognize that providing effective safeguards is challenging, and many papers do not require this, but we encourage authors to take this into account and make a best faith effort.

12. Licenses for existing assets

Question: Are the creators or original owners of assets (e.g., code, data, models), used in the paper, properly credited and are the license and terms of use explicitly mentioned and properly respected?

Answer: [Yes]

Justification: We cite the original paper that produced each re-used code snippet and dataset. We provide licenses for all models and datasets used in App. F.

Guidelines:

The answer NA means that the paper does not use existing assets.

The authors should cite the original paper that produced the code package or dataset.

The authors should state which version of the asset is used and, if possible, include a URL.

The name of the license (e.g., CC-BY 4.0) should be included for each asset.

For scraped data from a particular source (e.g., website), the copyright and terms of service of that source should be provided.

If assets are released, the license, copyright information, and terms of use in the package should be provided. For popular datasets, paperswithcode.com/datasets has curated licenses for some datasets. Their licensing guide can help determine the license of a dataset.

For existing datasets that are re-packaged, both the original license and the license of the derived asset (if it has changed) should be provided.

If this information is not available online, the authors are encouraged to reach out to the asset's creators.

13. New Assets

Question: Are new assets introduced in the paper well documented and is the documentation provided alongside the assets?

Answer: [NA]

Justification: We do not release new assets.

Guidelines:

The answer NA means that the paper does not release new assets.

Researchers should communicate the details of the dataset/code/model as part of their submissions via structured templates. This includes details about training, license, limitations, etc.

The paper should discuss whether and how consent was obtained from people whose asset is used.

At submission time, remember to anonymize your assets (if applicable). You can either create an anonymized URL or include an anonymized zip file.

14. Crowdsourcing and Research with Human Subjects

Question: For crowdsourcing experiments and research with human subjects, does the paper include the full text of instructions given to participants and screenshots, if applicable, as well as details about compensation (if any)?

Answer: [NA]

Justification: We do not do crowdsourcing nor research with human subjects.

Guidelines:

The answer NA means that the paper does not involve crowdsourcing nor research with human subjects.

Including this information in the supplemental material is fine, but if the main contribution of the paper involves human subjects, then as much detail as possible should be included in the main paper.

According to the NeurIPS Code of Ethics, workers involved in data collection, curation, or other labor should be paid at least the minimum wage in the country of the data collector.

15. Institutional Review Board (IRB) Approvals or Equivalent for Research with Human Subjects

Question: Does the paper describe potential risks incurred by study participants, whether such risks were disclosed to the subjects, and whether Institutional Review Board (IRB) approvals (or an equivalent approval/review based on the requirements of your country or institution) were obtained?

Answer: [NA]

Justification: We do not do crowdsourcing nor research with human subjects.

Guidelines:

The answer NA means that the paper does not involve crowdsourcing nor research with human subjects.

Depending on the country in which research is conducted, IRB approval (or equivalent) may be required for any human subjects research. If you obtained IRB approval, you should clearly state this in the paper.

We recognize that the procedures for this may vary significantly between institutions and locations, and we expect authors to adhere to the NeurIPS Code of Ethics and the guidelines for their institution.

For initial submissions, do not include any information that would break anonymity (if applicable), such as the institution conducting the review.

Peer reviews:
{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThe paper introduces formal mathematical concepts of intrinsic and extrinsic homotopy between language encoders. The first concept compares the behavior of two encoders on a concrete dataset, while the second concept compares them independently from the concrete dataset. The paper also demonstrates how to apply these concepts to measure the difference between different versions of the pre-trained BERT model.\n\nIn more detail, chapter by chapter:\n\n- The 1st chapter introduces the problem of comparison of text encoders.\n- The 2nd chapter is devoted to the discussion of the formal definition of a language encoder. The authors define a language encoder $\\mathbf{h}$ very generally: as a function from all possible strings of some alphabet $\\Sigma$ to a $d$-dimensional vector space $V$. They mention some ways to train an encoder in practice; however, for the rest of the theoretical part of the paper, $\\mathbf{h}$ remains general enough and is not required to be implemented through a neural network.\n- The 3rd chapter discusses the formalism of hemi-metrics and introduces uniform convergence norms on the space of language encoders. The uniform convergence norm allows the authors to introduce an affine alignment measure that shows how aligned two encoders are with each other.\n- The 4th and 5th chapters introduce the notion of Intrinsic and Extrinsic Affine Homotopy on encoders. It is based on notions of affine alignment measure from the previous chapter, and encoder rank.\n- The 6th chapter is devoted to adapting the notions above to the real-life scenario, where we can't check the encoder performance on all possible strings of our alphabet. Finally, asymmetric extrinsic and intrinsic similarity measures, that are usable in practice, are derived.\n- In the 7th chapter the authors measure an extrinsic and intrinsic similarity between pre-trained BERT models, all trained with similar hyper-parameters but differing in random weight initialization and shuffling of training data (see \"The MultiBERTs: BERT Reproductions for Robustness Analysis\" paper). They show that these pre-trained BERT models can be differentiated from each other by the methods, introduced in the paper. They also provide a table of the correlations between their notions of similarity and some previously introduced notions of similarity between encoders. All experiments were performed using SST-2 and MRPC datasets.\n- Finally, in the 8th chapter they discuss relations between extrinsic and intrinsic dissimilarities, their asymmetry, and the finding that some BERTs are more similar to other BERTs by affine similarity in one direction, but not necessarily in another.\n\nSTRENGTHS:\n- The paper introduces a novel way to compare the language encoders;\n- An interesting and non-trivial mathematical tools are utilized.\n\nWEAKNESSES:\nFirst of all, it looks like this paper is not a good fit for this venue by its very nature: \n- It is unclear what is the contribution of this work to the field of Neural Information Processing Systems. The paper introduced many novel concepts, but most of these concepts, starting from the definition of the language encoder itself, are very general, so their connection with neural networks looks far-fetched. The usefulness and purpose of the experiments are also unclear (see \"Questions\" section).\n- 9-page format is too small for this type of scientific work; authors had to overuse the Appendices to fit their work into limited space. When I was reading the paper, I had to constantly go around in circles, moving between Appendix D (\"Addenda on Affine Homotopy\") and the main part of the paper.\n\nSecond, there are some general problems with the research and text:\n- The experimental section in general is very limited. Only various versions of the BERT models are compared with each other, and only two datasets are considered. In line 235 there is a note that experiments show some task-independency, but how can we say anything about task-independency when we have only two tasks on hands?\n- The conclusion and findings of the paper are also unclear (see \"Questions\" section).\n- The paper is generally hard to read and understand. As was told above, this problem is partially connected with the unsuitable format; however, it is also connected with typos (see below) and lack of needed definitions (see \"Questions\" section).\n\nQUESTIONS:\nQuestions:\n\n- Why is your mathematical tool of checking, whether two encoders are similar to each other (line 153), called \"Affine homotopy\"? What is the connection to the notion of homotopy that we know from algebraic geometry?\n- You found that some BERTs are more similar to other BERTs by affine similarity in one direction, but not in another, and that this fact says something about the \"universality\" of BERTs, that are easier to map \"from\". Can you please elaborate on this conclusion about their universality?\n- By which machine learning algorithm is $\\mathbf{Ð}$ approximated and how?\n- What was the point of defining a dataset-independent way to measure the difference between encoders, if, starting from section 6, everything, in essence, became dataset-dependent again? (and of course, all experiments were dataset-depended as well)\n- What is the purpose of the Figure 2? What can it tell about MULTIBERT encoders number $1, ... , 25$?\n- In general, your paper doesn't explain what is the exact difference between, let's say, MULTIBERT encoder number $1$ and number $2$ (except that they are both BERTs with different weights init, etc). So what's the point of caring about their comparison in the first place? What useful conclusion can we make from such a comparison?\n- What is the purpose of Table 1? If I understand correctly, it shows a correlation between different similarity measures, but what conclusion should we make from it?\n- The most torturing question: what are $E_x$ and $E_y$, introduced in line 103, but never explained? I had to assume that they were just some neighborhoods of $x$ and $y$ to somehow get through the rest of the paper, but I'm not sure it's true.\n\nSuggestions:\n- I would suggest experimentally measuring the similarity of BERT with encoders of different natures, e.g. AlBERT, ELECTRA, and maybe even some LSTM-based encoders. Maybe the encoders of similar architecture (or trained on similar data) will be more similar by your similarity measures, than the encoders of very different architecture (or trained on very different data)? Or maybe not?\n- I would suggest using more datasets for any further experiments.\n- You heavily cite the \"Metrics, quasi-metrics, hemi-metrics\" chapter from the book called \"Non-Hausdorff Topology and Domain Theory\". However, this book is not well-known outside of the professional mathematical community. So, I would suggest explaining the conceptions from the book in more detail and providing some examples of hemi-metrics that would show why one wants to use hemi-metric instead of symmetric metric.\n- Finally, I would suggest turning this work into a **journal paper** (after a revision) and merging Appendices D and B (\"Additional Related Work\") with the main part of the paper to make it more readable.\n\n---\n\nTypos and presentation issues:\n\n- In 1st page, footnote №4, typo: \n> In principle, one could relax the replace R^d with any finite-dimensional vector space\n- In line 63, you wrote: \n> There are two common ways that language encoders are created. The first is through autoregressive language modeling.\n\nAnd the second one? Did you mean Masked Language Modelling?\n- In line 119: typo: \n> Let GL(V) We write\n- In line 119, you introduced GL(V) without definition. I've supposed it's a General Linear Group for the rest of the paper.\n\nLIMITATIONS:\nThe authors addressed the limitations of the theoretical part of their paper. I'd suggest adding the limitations of the experimental section (one architecture, a few datasets) as well (see above).", "TITLE": "Official Review", "RECOMMENDATION": 3, "REVIEWER_CONFIDENCE": 3, "SOUNDNESS_CORRECTNESS": 2, "DATE": "2024-07-06"}

{"IS_META_REVIEW": false, "comments": "SUMMARY:\nIn this paper, the authors study a nature question \"What does it mean for two encoders to be similar\" and proposed an intrinsic measure of similarity that aligns with extrinsic performance on downstream tasks. It introduces the concept of affine alignment and explores its properties and implications for understanding encoder relationships.\nThe main contributions are as follows:\n1. The authors first define an metric space on encoders.\n2. The authors extend the definition to account for transformations in a broad framework of $S$-homotopy for a set of transformations $S$.\n3. As a concrete application of the framework, the authors study affine homotopy—the similarity for affine transformations.\n\nSTRENGTHS:\n1. The idea of the paper is quite novelty. Homotopy is a very important tool in algebraic topology. The application of homotopy theory in machine learning is very attractive.\n2. The authors first define an (extended) metric space on encoders and then extend this definition to account for transformations in a broad  framework of $S$-homotopy for a set of transformations $S$.\n\nWEAKNESSES:\n1. The motivation for introducing affine Hemi-Metrics to measure the similarity of two encoders is not so clear to me.\n2. The definition of Extrinsic Homotopy seems not like a mathematical definition since authors does not claim that how to quantify the performance.\n3. More experiments are needed for supporting the claim in the paper.\n4. Such method seems not practical.\n\nQUESTIONS:\n1. Please explain clearly the motivation why we need Hemi-metrics, I think maybe from both sides of topological view and machine learning view.\n2. Please explain the connection between intrinsic homotopy and extrinsic homotopy. I think it can help us understand theorem 5.1 better.\n\nLIMITATIONS:\nSee the weaknesses.", "TITLE": "Official Review", "RECOMMENDATION": 7, "REVIEWER_CONFIDENCE": 4, "SOUNDNESS_CORRECTNESS": 4, "DATE": "2024-07-09"}

{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThe paper aims to formally define, derive and then analyse similarity between pretrained language encoders, focusing on aspects of intrinsic (task-independent) similarity and extrinsic (task performance-oriented) similarity. The paper is mostly of theoretical nature, aiming to properly and formally define the studied aspects of similarity and then aiming to propose the idea of transformations in an (affine) homotopic framework. The work makes a step towards more formal studies of representation similarity within language encoders (and probably decoder-style LLMs in future work).\n\nThe main non-theoretical finding, based on experiments with MultiBERT models (i.e., BERT models trained from different random seeds) is that there exists (as expected) a correlation between the defined intrinsic and extrinsic notions of similarity.\n\nSTRENGTHS:\n- The paper provides a fresh perspective on the question of similarity between language encoders (and language models) in general, aiming to rigorously formalise and derive different properties associated with intrinsic and extrinsic similarity.\n\n- The paper is quite dense but admirably well-written given its largely formal and 'math-heavy' content. I see it also as a potentially very didactic piece of work which could inspire additional work in this space.\n\n- Related work, limitations, implications of the key results (both from the theoretical as well as from the more practical perspectives) are all very comprehensive and nicely structured.\n\nWEAKNESSES:\n- The work is heavily focused on theory and theoretical contributions; this means that its more practical findings are the weaker part of the work and the experimental setup and results are a bit underwhelming:\na) The only studied architecture is the BERT architecture, and the work just aims to quantify correlation between intrinsic and extrinsic similarity for MultiBERT models (which just use different random seeds). As far as I am concerned, a positive correlation between intrinsic and extrinsic similarity is very much expected for this group of models.\nb) The work should ideally study other encoder architectures and aim to establish how the notion of similarity changes over the spectrum of 'expected model distance' and what implications it might have. Speaking of the 'expected model distance', what one could/should study here is:\n-- models of the same architecture starting from the same seed where different checkpoints were taken\n-- models of the same architecture with different random seeds (this is the only thing studied in the paper atm)\n-- models of similar architecture but not completely the same (e.g., BERT vs RoBERTa)\n-- completely different architectures (e.g., BERT vs tELECTRA)\nc) The work also focuses on very basic GLUE tasks which also limits the generalisability of the main findings, and additional experiments over tasks of different complexity are required here to fully trust the core ideas (which would also increase the impact of the work substantially imo).\n\n- While mathematical rigor in the paper is very useful, the paper would contribute from a short (sub)section aiming to properly 'distill' the key take-home messages in a plain(er) language so that it also becomes more obvious how future work could contribute from the more theoretical insights (e.g., can the derived measures be used for computing representation similarity in general)? That would be a very useful addition to the work.\n\nQUESTIONS:\n- Beyond page limit, is there any other reason why only two tasks (and very simple ones) are targeted for the main experiments? \n\n- Have the authors considered running the similarity analyses also with BERT models having different hyper-parameters? Can we expect the affine homotopy properties to hold for such models? What implications might this finding have?\n\n- I am missing the reason why certain encoders end up being more informative than others. How do you define 'being informative' in this context? Why is it important?\n\n- Would it be possible to derive similar measures for decoder-only LMs in the future?\n\nLIMITATIONS:\nLimitations are (to most part) properly discussed in Appendix A. Some additional reflection on the current limitations of experiments (and practical aspects of the work) might be necessary and useful.", "TITLE": "Official Review", "RECOMMENDATION": 6, "REVIEWER_CONFIDENCE": 3, "SOUNDNESS_CORRECTNESS": 3, "DATE": "2024-07-12"}

{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThis paper presents theoretical analysis on \"intrinsic alignment\" of two or more pretrained language encoders (e.g. BERT trained with various seeds). The work proposes computing the intrinsic alignment between two encoders by first defining a algebraic metric space in which these two encoders exist, and then looking at the affine homotopic transformations that are possible in the given space. The primary motivation of the work is to set theoretical bounds on the similarity of two given encoders, and for the intrinsic alignment to have a strong (positive) correlation to extrinsic alignment (in simple terms, whether two encoders produce similar outputs for similar inputs). The work claims that this is important to have an \"elementary understanding\" of these encoders, and that having these theoretical guarantees can help derive a richer set of properties of the relationship between encoders.\n\nThe work first proposes the methodology to compute these alignments, and then conducts experiments on 25 multiBERT encoders, which are BERT models trained with varying seeds. Two GLUE classification tasks are used, SST-2 and MRPC. The results show that that such an alignment can indeed be computed, and that there is a positive correlation between the intrinsic and extrinsic alignments.\n\nSTRENGTHS:\n- The work shown in the paper approaches some of the nuances of modern LM training (randomization, seeds etc) from a theoretical perspective, which can not only help solidify our understanding but also give us concrete bounds and limitations when these models are trained\n- The results and discussion emerging from the analysis seems sound, and something that can potentially advance our understanding of these encoders further\n\nWEAKNESSES:\n- While the paper makes some effort to depict the practical value of the underlying method, it falls short of giving actual examples. For instance, the paper mentions that deriving intrinsic alignment can help discover \"richer\" properties - but for a reader (that does not necessarily have theoretically expertise), it is difficult to see what these richer properties look like\n- There is also very little discussion of practical aspects of running this analysis; The appendix mentions that intrinsic alignment is more expensive to compute than extrinsic alignment; given that the aim of the work is to set upper bounds, why not just compute the extrinsic scores? I was also unable to find any discussion on whether different kinds of encoders can be compared (which is easy to do for downstream tasks).\n\nQUESTIONS:\n- What are some of these \"richer\" properties that intrinsic alignment can help discover?\n- Can these be run across encoders with different architectures?\n- The paper mentions that one advantage of intrinsic alignment is the possibility to define an order over the encoders. What does this imply?\n- I am wondering if these alignment measures can somehow be used to improve pre-training; lets say if we can compute the similarity between a well trained model and one that is in the training loop, and make training decisions based on how close/far the alignment is. Do you envision any such use of the proposed metric?\n- Is there a way to convert the alignment metric into a measure of \"badness\" for a given encoder? I envision it would be useful to weed out \"bad\" models than to just compare \"good\" ones.\n\nLIMITATIONS:\nAuthors have addressed limitations adequately.", "TITLE": "Official Review", "RECOMMENDATION": 6, "REVIEWER_CONFIDENCE": 1, "SOUNDNESS_CORRECTNESS": 3, "DATE": "2024-07-14"}