Abstract 1 Introduction 2 Notation 3 Main result: The hierarchy of strata 4 Prebases, fundamental subspaces, and barcodes 5 Moves on (and off) the fiber and the stratum 6 Barcode moves: Walking the hierarchy of strata 7 Revealing the hierarchy of strata 8 Final thoughts References

The Hierarchy of Manifolds in a Stratification of the Set of Equivalent Linear Neural Networks

Jonathan Richard Shewchuk ORCID University of California, Berkeley, CA, USA    Sagnik Bhattacharya ORCID University of California, Berkeley, CA, USA
Abstract

A linear neural network computes a linear transformation of its input vector. Given a fully-connected linear network, the set of all weight vectors for which the network computes the same linear transformation is an algebraic variety in weight space, called a fiber under the matrix multiplication map. Sometimes this variety is a manifold, but usually not. The rank stratification of a fiber is a natural partition of the fiber into manifolds of various dimensions called strata. We characterize how these strata are connected to each other. They satisfy the frontier condition: if a stratum intersects the closure of another stratum, then the former stratum is a subset of the closure of the latter stratum. This subset relationship can be expressed as a partial order with a single minimal element. Our main result describes the relationship between this partial order and the ranks of certain matrices in the network. Each stratum represents a different pattern of information flow through the network, expressed as a barcode. Connections among the strata are best understood through simple transformations of the barcodes called barcode moves.

Keywords and phrases:
Linear neural network, real algebraic variety, stratification, multilinear algebra, product of matrices, persistence barcode, real algebraic geometry, discrete geometry
Copyright and License:
[Uncaptioned image] © Jonathan Richard Shewchuk and Sagnik Bhattacharya; licensed under Creative Commons License CC-BY 4.0
2012 ACM Subject Classification:
Computing methodologies Neural networks
; Mathematics of computing Nonlinear equations ; Theory of computation Computational geometry
Related Version:
Full Version: https://arxiv.org/abs/2404.14855 [20]
Acknowledgements:
We thank Marc Khoury for initiating this research collaboration, and we thank Herbert Edelsbrunner, Jeff Erickson, Marc Glisse, and Ling Zhou for conversations helping us to understand the relationship between this work and persistence modules.
Funding:
Supported in part by the National Science Foundation under Award CCF-1909204.
Editors:
Hee-Kap Ahn, Michael Hoffmann, and Amir Nayyeri

1 Introduction

In its simplest form, a linear neural network is a sequence of matrices whose product is a matrix.111To a practitioner, a linear neural network is a neural network in which all the activation functions are the identity function. In this paper’s neural networks, every layer of edges is fully-connected. The network takes an input vector x and produces an output vector y=WLWL1W2W1x. We number the matrices in the order they are applied. The matrix W1 linearly transforms x, producing a vector that W2 linearly transforms, and so on. The composition of those transformations is also a linear transformation, represented by

W=μ(WL,WL1,,W2,W1)=WLWL1W2W1,

where μ is called the matrix multiplication map. Each matrix Wj is interpreted as a layer of edges (connections) in the network, edge layer number j, and each component of Wj is interpreted as the weight of an edge. For brevity, we omit added terms, which do not appreciably affect our results (but we address them in the full-length manuscript [20]).

We wish to study μ1(W), the set of all factorizations of a matrix W into a product of matrices of specified sizes. Said differently, we study the set of all choices of linear neural network weights such that the network computes the linear transformation W. This set is infinite (unless L=1) and it is a real algebraic variety – the set of all real-valued solutions of a system of polynomial equations (specifically, multilinear equations). Trager, Kohn, and Bruna [23], whose paper inspired ours, call μ1(W) the fiber of W under the map μ. Understanding the fiber has applications in understanding gradient descent algorithms for training neural networks – but it is also a beautiful mathematical problem in its own right.

Figure 1: The fiber μ1([1]) for the network W3W2W1=[θ3][θ2][θ1]=[1]=W.
Figure 2: At left is the fiber μ1([0 0]) for the network W2W1=[θ2][θ1θ1]=[0 0]=W, partitioned into three strata: S00 is the origin; S10 (blue) is the θ2-axis with the origin removed; and S01 (pink) is the plane spanned by the θ1- and θ1-axes with the origin removed. At right, the strata are arranged in a stratum dag, organized as a table indexed by the ranks of W1 and W2. Each dag vertex specifies the dimension of the stratum (dim), the number of degrees of freedom of motion on the fiber (dof = dim + rdof), and the number of rank-increasing degrees of freedom (rdof), which stay on the fiber but move off the stratum and onto a higher-dimensional stratum. A directed path from one stratum to another implies that the former is a subset of the closure of the latter.

Sometimes the fiber is a manifold – see Figure 1 for an example – but usually not. Always it can be partitioned into smooth manifolds of various dimensions, called strata. The set of strata is called a stratification of the fiber. Figure 2 graphs the solutions of [θ2][θ1θ1]=[0 0] (an instantiation of W2W1=W). The set of solutions can be partitioned into three strata: S00 is the origin, S10 is the θ2-axis with the origin removed, and S01 is the θ1-θ1 plane with the origin removed. The two subscripts of S are the ranks of W2 and W1, respectively. The stratum S00 lies in the closures of both S10 and S01; S00 serves to connect S10 to S01.

Figure 2 illustrates what we call a rank stratification of the fiber μ1(W), which has one stratum for each rank list defined in Section 2; it is the most natural way to stratify a fiber of the matrix multiplication map. In the full-length manuscript [20], we show that the strata in a rank stratification are analytic manifolds (hence of class C), derive their dimensions, and derive the tangent and normal spaces at each point of each stratum.

This paper characterizes how the strata are connected to each other. The strata satisfy the frontier condition: if a stratum intersects the closure of another stratum, then the former stratum is a subset of the closure of the latter stratum. This subset relationship induces a partial order with a single minimal element, a stratum that is included in the closure of every other stratum (in Figure 2, S00). Our main result describes the relationship between this partial order and the ranks of certain matrices in the network. What makes it interesting is that each stratum represents a different pattern of information flow through the network.

In 1957, Hassler Whitney [24, 25, 26] proved that every real algebraic variety can be partitioned into a finite set of analytic manifolds. Łojasiewicz [16] generalized the result to semi-algebraic and semi-analytic sets. Mather [18] showed that Whitney’s stratifications satisfy the frontier condition (but there exist stratifications that do not, hence we prove that rank stratifications do). Thom [22] introduced the terms stratum and stratification.

Linear neural networks compute only linear transformations; they are far less powerful than networks with nonlinear activation functions such as rectified linear units (ReLUs, also called ramp functions) and sigmoid functions (also called logistic functions). Yet linear networks have become a popular object of study [1, 2, 4, 5, 11, 12, 13, 14, 17, 19, 23, 27]. Why? We cannot fully understand the training of ReLU-based networks – or probably any neural networks – if we do not understand linear networks. Researchers have studied linear neural networks to understand phenomena observed in ReLU networks such as implicit regularization in optimizing the training algorithm’s cost function [10, 2, 5], implicit acceleration of training by gradient descent [1], and the success of residual networks [11]. Close to our hearts, Trager, Kohn, and Bruna [23] show that the fiber μ1(W) is crucial for understanding the critical points of the cost functions minimized by neural network training algorithms. We aspire to build a related theory for ReLU networks, and we hope insights in this paper will help.

2 Notation

Let L be the number of matrices – that is, the number of layers of edges (connections) in the network. Alternating with the edge layers are L+1 layers of units, numbered from 0 to L, in which layer j has dj real-valued units that represent a vector in dj. Unit layer 0 is the input layer, unit layer L is the output layer, and between them are L1 hidden layers. The layers of edges are numbered from 1 to L, and the edge weights in edge layer j are represented by a real-valued dj×dj1 matrix Wj.

We collect all the network’s weights in a weight vector θ=(WL,WL1,,W1)dθ, where dθ=dLdL1+dL1dL2++d1d0 is the number of real-valued weights in the network (i.e., the number of connections). Recall the matrix multiplication map μ(WL,WL1,,W2,W1); we can abbreviate it to μ(θ)=WLWL1W2W1. Given a fixed weight vector θ, the linear neural network takes an input vector xd0 and returns an output vector y=WLWL1W2W1x, with ydL. Hence, the network implicitly applies a linear transformation specified by the dL×d0 matrix W=μ(θ), yielding y=Wx.

The map μ is not bijective (unless L=1), so it has a preimage set, not an inverse. Given WdL×d0, let

μ1(W)={θ:μ(θ)=W}

be the set of all factorizations of W for some fixed dL,dL1,,d0. Call μ1(W) the fiber of W under μ; it is a real algebraic variety in the weight space dθ. With respect to dθ, μ1(W) is a closed point set. Note that μ1(W) is empty if and only if rkW>minj=1L1dj.

Given a weight vector θ=(WL,WL1,,W1), its subsequence matrices are all the matrices of the form Wki=WkWk1Wi+1. The notation Wki indicates that this matrix transforms a vector at unit layer i to produce a vector at unit layer k. Note that W=WL0 and Wj=Wjj1. We use the convention that Wkk=Idk×dk, the dk×dk identity matrix. Assume that every Wki in this paper is a function of θ. We call each Wj a factor matrix.

The rank list r¯ for a weight vector θdθ is a sequence that lists the rank of every subsequence matrix Wki such that Lki0. The list includes the unit layer sizes rkWkk=dk. For example, for a network with L=3 layers of edges, the rank list of θ is

r¯=d3,d2,d1,d0,rkW3,rkW2,rkW1,rkW3W2,rkW2W1,rkW.

We will use rank lists to partition a fiber into strata. Sometimes we do not want to specify a particular θ, but rather we wish to specify some target ranks. In that case, we let rki denote the target value of rkWki and we write r¯=rkiLki0. For example, if we set r31=2, we select weight vectors for which rkW3W2=2. If L=2 and we set r¯=9,8,7,2,3,1, we select weight vectors for which W2 is a 9×8 matrix of rank 2, W1 is an 8×7 matrix of rank 3, and W=W2W1 has rank 1.

Let Sr¯W denote the set of points in W’s fiber having rank list r¯. That is,

Sr¯W={θμ1(W):the rank list of θ is r¯}.

If it is nonempty, we call Sr¯W a stratum in the rank stratification of W’s fiber. When W is clear from context, we just write Sr¯. Each Sr¯ is an analytic manifold [20] (but not necessarily closed nor connected nor bounded). The rank stratification of μ1(W) is

𝕊={Sr¯:r¯ is the rank list of some weight vector in μ1(W)}.

The members of 𝕊 are disjoint and μ1(W)=S𝕊S – that is, 𝕊 is a partition of μ1(W).

A rank list r¯ is valid if there exists some weight vector θdθ that has rank list r¯. We show in the full-length manuscript [20] that if WdL×d0 and r¯ is a valid rank list with rL0=rkW, then there exists some θμ1(W) that has rank list r¯, so Sr¯ is nonempty.

Given two rank lists r¯ and z¯, we write r¯z¯ to mean that rkizki for all Lki0. We write r¯<z¯ to mean that r¯z¯ and r¯z¯ (at least one of the inequalities holds strictly).

Given a set Sdθ, let S¯ denote the closure of S (with respect to the weight space dθ).

3 Main result: The hierarchy of strata

Theorem 1.

Let r¯ and z¯ be two valid rank lists for the same linear neural network (i.e., rjj=zjj=dj for all j[0,L]). Let μ1(W) be the fiber of a matrix WdL×d0 whose rank satisfies rkW=rL0=zL0. Let Sr¯ and Sz¯ be the strata with rank lists r¯ and z¯ in the rank stratification 𝕊 of μ1(W), and recall that validity implies that Sr¯ and Sz¯. Then the following statements are equivalent (imply each other).

  1. A.

    Sr¯S¯z¯.

  2. B.

    Sr¯S¯z¯.

  3. C.

    r¯z¯.

  4. D.

    There exists a sequence of rank-one abstract barcode moves that proceed from r¯ to z¯, with all the intermediate rank lists being valid.

We have not yet defined the terminology in statement D. A stratum dag is a directed acyclic graph (dag) with one vertex for each stratum in 𝕊 and one directed edge for each rank-one abstract barcode move; see Figure 2, right. For now, just know that these moves are the central new concept in this paper, which organize the strata in 𝕊 in a natural hierarchy. Read statement D as “there is a directed path in the stratum dag from Sr¯ to Sz¯.” The stratum dag encodes the partial order of the strata induced by , but it is not necessarily the simplest dag that does so (sometimes called a Hasse diagram or transitive reduction), for reasons we explain in the full-length manuscript [20].

Figures 3 and 4 depict two more examples of stratum dags. Notable in Figure 3 is that we arrange the stratum dag in a three-dimensional table, indexed by rkW3, rkW2, and rkW1. Ordinarily, three-matrix fibers (L=3) require five indices to index the strata, as rkW3W2 and rkW2W1 can vary as well; but in this example every matrix is 1×1, so those two ranks are uniquely determined by the first three. Notable in Figure 4 is that the fiber has dimension as high as 35 at some points, and it is embedded in a 54-dimensional weight space. Unfortunately, we cannot visualize the fiber, but its strata are curved, like in Figure 1. In both dags, there is a unique minimal stratum – S000 and S11, respectively – that is a subset of the closure of every other stratum. In all rank stratifications, the minimal stratum is the one in which every subsequence matrix’s rank is rkW, except the layer sizes rkWjj=dj. (In the full-length manuscript [20], we give an algorithm for computing stratum dags.)

Figure 3: At left is the variety of solutions to W3W2W1=[θ3][θ2][θ1]=[0]=W, partitioned into seven strata: S000 is the origin; S001, S010, and S100 are the three coordinate axes with the origin removed; and S011, S101, and S110 are the three coordinate planes with the coordinate axes removed. At right is the stratum dag, organized as a table indexed by the ranks of W3, W2, and W1.
rkW2 dim: 31 dof: 34 dim: 34 dof: 34
=5 S51 rdof:   3 S52 rdof:   0
rkW2 dim: 29 dof: 37 dim: 33 dof: 36 dim: 35 dof: 35
=4 S41 rdof:   8 S42 rdof:   3 S43 rdof:   0
rkW2 dim: 25 dof: 40 dim: 30 dof: 38 dim: 33 dof: 36 dim: 34 dof: 34
=3 S31 rdof: 15 S32 rdof:   8 S33 rdof:   3 S34 rdof:   0
rkW2 dim: 19 dof: 43 dim: 25 dof: 40 dim: 29 dof: 37 dim: 31 dof: 34
=2 S21 rdof: 24 S22 rdof: 15 S23 rdof:   8 S24 rdof:   3
rkW2 dim: 11 dof: 46 dim: 18 dof: 42 dim: 23 dof: 38 dim: 26 dof: 34
=1 S11 rdof: 35 S12 rdof: 24 S13 rdof: 15 S14 rdof:   8
rkW1=1 rkW1=2 rkW1=3 rkW1=4
Figure 4: Stratum dag representing the stratification of μ1(W) for W=W2W1, W25×6, W16×4, and rkW=1. For every pair of strata Sts and Sts with tt and ss, StsS¯ts.

Most important in Theorem 1 is the equivalence of statements A and C: Sr¯S¯z¯ if and only if r¯z¯. The rank lists tell you which strata’s closures include (or intersect) which strata.

The fact that B implies A means that rank stratifications satisfy the frontier condition defined in the Introduction: for every pair of strata S,T𝕊, either ST¯= or ST¯. (The two possibilities are mutually exclusive, because S.) That is, the inclusion of points of S in T¯ is all or nothing, which helps us to understand how strata are connected to each other. For example, if ST¯ and ST, then dimS<dimT and from any point on S there is an infinitesimal perturbation that takes us onto T.

As the fiber is a closed point set, Theorem 1 implies that S¯z¯=r¯z¯Sr¯. In Figure 3, S¯011=S011S010S001S000, whereas S100S¯011= and S011S¯100=.

Our proof of Theorem 1 shows the four implications A B C D A. Clearly A implies B, as we assume Sr¯. To see that B implies C, observe that an infinitesimal perturbation of a weight vector θSr¯ may increase the ranks of some subsequence matrices but it cannot decrease any of their ranks, so a stratum Sz¯ can have θ in its closure only if r¯z¯. Showing that D implies A is not difficult (an abstract move implies arbitrarily small geometric moves). The fact that C implies D was by far the hardest of the four implications to prove; for many months we did not know if C implies any of the other statements.

While statements A and B are statements about geometry, statements C and D are purely combinatorial. Our proof that C implies D is also purely combinatorial. Space is limited, so we give only part of that proof, including an algorithm that finds a suitable sequence of barcode moves (thereby showing one exists). The rest of this paper relates the geometry to the combinatorics, introduces barcode moves, and constructs the sequence of moves.

4 Prebases, fundamental subspaces, and barcodes

In this section, we show how to decompose each unit layer’s space dj into a prebasis of subspaces of dj; then decompose each edge layer’s space dj×dj1 into a prebasis of subspaces of dj×dj1; then decompose the weight space dθ into a prebasis of subspaces of dθ, which will illuminate the connections among strata. We assume the reader is familiar with the standard idea from linear algebra of a basis for d, comprising d linearly independent basis vectors. A prebasis is like a basis, but it is made up of subspaces rather than vectors.

Given two subspaces P,Qd, their vector sum is P+Q={p+q:pP and qQ}. If P and Q are linearly independent – that is, if PQ={𝟎} – then P+Q is called a direct sum, sometimes written222The notation PQ is unconventional, because as an operator it produces P+Q, but it also implies a constraint on the subspaces P and Q: that PQ={𝟎}. If PQ{𝟎}, then PQ is undefined. PQ. Likewise, given a set of subspaces 𝒫={P1,P2,,Pm}, the direct sum notation P1P2Pm implies that the subspaces in 𝒫 are linearly independent – meaning that for every i[1,m], PijiPj={𝟎}.

If d=P1P2Pm, then 𝒫={P1,P2,,Pm} is known as a direct sum decomposition of d. For brevity, we call 𝒫 a prebasis for d, and we say that 𝒫 spans d. We call each Pi a prebasis subspace – a multidimensional analogue of a basis vector. The linear independence of the prebasis subspaces implies that for every vector vd, there is one and only one way to express v as a sum of vectors v=i=1mvi such that viPi. It also implies that d=i=1mdimPi. If desired, it is conceptually easy to convert a prebasis into a traditional vector basis: just choose a basis for each Pi, then pool the d vectors together to form a basis for d – hence the name “prebasis.” Why don’t we do that here? Because details like the choice of basis for each prebasis subspace and the length of each basis vector are irrelevant and would make our presentation more complicated.

The following theorem identifies “fundamental” subspaces in a linear neural network’s hidden layers analogous to the four fundamental subspaces [21] of a matrix M: the rowspace (denoted rowM), the nullspace (nullM), the columnspace (colM), and the left nullspace (nullM). The theorem originates in the study of persistent homology [8, 7] (for entirely different reasons) where it is used to analyze persistence modules [28, 29, 9, 3, 15], which are essentially linear neural networks – but usually over the field /2, in contrast to our real-valued weights. Given a matrix M and a subspace Pd, define MP={Mv:vP}.

Theorem 2 (Fundamental Theorem of Linear Neural Networks).

Let θ=(WL,WL1,,W1) be a weight vector representing a linear neural network with L layers of edges and unit layer sizes dL,dL1,,d0. For all indices k and i satisfying Lki0, let

ωki=rkWkirkWki1rkWk+1i+rkWk+1i1, (1)

using the conventions that rkWjj=dj, rkWL+1i=0, and rkWk1=0.

Then there exist subspaces akjidj and bkjidj of dimension ωki for all indices satisfying Lkji0, such that for all j[0,L],

  • 𝒜j={akji{𝟎}:k[j,L],i[0,j]} is a direct sum decomposition of dj and

  • j={bkji{𝟎}:k[j,L],i[0,j]} is also a direct sum decomposition of dj;

and the subspaces satisfy the flow relationships

Wjak,j1,i ={akji,kj,{𝟎},k=j1,j[1,L],k[j1,L],i[0,j1],and
Wjbkji ={bk,j1,i,j>i,{𝟎},j=i,j[1,L],k[j,L],i[0,j].

This decomposition into subspaces akji (or bkji) is not necessarily unique, but the dimensions dimakji=dimbkji=ωki are the same for all such decompositions. Moreover,

dj=t=jLs=0jωts,j[0,L],andrkWki=t=kLs=0iωts,Lki0. (2)

The prebases 𝒜j describe information flow through the network. As illustrated in Figure 5 (top), we interpret akii as an ωki-dimensional subspace that appears at unit layer i (its birth layer), being linearly independent of (but not necessarily orthogonal to) colWi, then flows through the weight layers Wi+1,Wi+2,,Wk being linearly transformed into a sequence of subspaces ak,i+1,i,ak,i+2,i,, all of dimension ωki, reaches layer k (its death layer) in the form akki, still having ωki dimensions, and proceeds no farther – because either akkinullWk+1 or layer k is the output layer. These subspaces carry information from the input layer only if i=0 and reach the output layer only if k=L; otherwise, they represent unused potential.

Figure 5: The top half is an annotated barcode that illustrates the flow of the prebasis subspaces akji through the network. Double boxes represent subspaces of dimension 2 and triple boxes represent subspaces of dimension 3. The bottom half relates the interval counts, the layer sizes, and the subsequence matrix ranks. The number of units dj in unit layer j is the sum of the counts ωts of the intervals that touch layer j (i.e., the dimensions of the subspaces atjs). Each subsequence matrix rank rkWki is the sum of the counts of the intervals that touch both layers k and i.

Symmetrically, the prebases j govern the transpose network W=W1W2WL1WL. We interpret bkki as an ωki-dimensional subspace that appears at layer k, being linearly independent of rowWk+1, then flows through the weight layers Wk,Wk1,,Wi+1 being linearly transformed into a sequence of ωki-dimensional subspaces bk,k1,i,bk,k2,i,, and stops at layer i in the form bkii – either because bkiinullWi or because i=0.

We call each ωki an interval count. An interval is a set of consecutive integers [i,k]={i,i+1,,k1,k} that signifies consecutive unit layers, with i being the birth layer and k being the death layer for the information that the interval represents. The barcode for θ – an idea originating in persistent homology [9] – is a multiset of intervals that contains ωki copies of [i,k] for all 0ikL. The top half of Figure 5 depicts a barcode annotated with prebasis subspaces. Barcodes show visually how information flows in linear networks.

The identities (1) and (2) express a bijection between rank lists and barcodes. The bottom half of Figure 5 depicts those identities visually.

We will see in Section 6 that we can understand the hierarchy of strata in terms of simple transformations of the barcode. (We can also understand it in terms of transformations of the rank list, but those transformations are not as simple.)

Now, we construct prebases for the factor matrix spaces dj×dj1 and the weight space dθ. Like the akji’s and bkji’s, these prebases are defined at a specific weight vector θ. For indices satisfying Llji0 and Lkj1h0, define the prebasis subspace

olkjih=aljibk,j1,h={Mdj×dj1:colMalji and rowMbk,j1,h}.

Then dimolkjih=dimaljidimbk,j1,h=ωliωkh. For each j[1,L], define the prebasis

𝒪j={olkjih{0}:l[j,L],k[j1,L],i[0,j],h[0,j1]}.

𝒪j is a prebasis for the weight layer dj×dj1, as it pairs every subspace in the prebasis 𝒜j (spanning dj) with every subspace in the prebasis j1 (spanning dj1).

Now we construct a prebasis ΘO for the weight space dθ that we call the one-matrix prebasis. The subspaces in ΘO are called the one-matrix subspaces and have the form

ϕlkjih={(0,,0,M,0,,0):Molkjih}

with M in position j from the right (the position of Wj in θ). The one-matrix prebasis is

ΘO={ϕlkjih{𝟎}:Llji0 and Lkj1h0}.

5 Moves on (and off) the fiber and the stratum

Imagine you are standing at a point θ on a fiber μ1(W). A move (θ,θ) is a step you take from θ to another point θ, which may or may not be on the fiber. Let Δθ=θθ be the displacement of the move. We write

θ=(WL,WL1,,W1)dθandΔθ=(ΔWL,ΔWL1,,ΔW1)dθ.

We use analogous notation for the product W=μ(θ), its displacement ΔW=WW, the modified subsequence matrices Wts=WtWt1Ws+1, and their displacements ΔWts=WtsWts. All prebasis subspaces below are defined at θ. (They are different at θ!)

Moves on the fiber replace a linear neural network with another that computes the same function. Here, we are interested in basic one-matrix moves, for which Δθϕlkjih for some ϕlkjihΘO. (“Basic” means “from the prebasis,” not “simple.”) Equivalently, a basic move replaces Wj with Wj=Wj+ΔWj, where ΔWjolkjih and olkjih𝒪j. Once we understand basic moves, other moves can be understood as sequences of basic moves. We are particularly interested in basic moves that change the rank list and move from one stratum to another.

For each subspace olkjih𝒪j, we ask: does a move with displacement ΔWjolkjih change W? Which subsequence matrices change? Which subsequence matrices change rank? Which subsequence matrices undergo a change in rowspace or columnspace? The three lemmas below answer these questions, and Figure 6 summarizes the answers. (Figure 6 assumes the displacement ΔWj is nonzero; the lemmas do not.) These answers explain why we chose subspaces of the form olkjih=aljibk,j1,h.

Figure 6: The influence of a basic move in which a factor matrix Wj undergoes a nonzero displacement ΔWjolkjih. The effects on the subsequence matrix Wts are listed for every t and s with Lts0. These tables are triangular, though it’s not obvious at first: the hatched regions represent unused zones where t<s. A yellow rectangle indicates which subsequence matrices increase in rank, constituting a barcode move if no rank decreases. The black font indicates where WtsWts. The red font indicates where Wts=Wts because the matrix Wj is not a factor in Wts. The blue font indicates where Wts=Wts by properties of the flow relationships. (a) Table for the case where L>l>kj>i>h>0. An example of a swapping move. (b) The third row disappears if k+1=j, and the third column disappears if i=j. When k+1=j=i, the move is a connecting move. (c) The second row disappears if kl, and the second column disappears if ih. If either inequality holds, no subsequence matrix rank increases; the move is not a barcode move. The first column disappears if h=0. (The first row disappears if l=L, though we don’t depict that case here. If h=0 and l=L, then WW and we move off the fiber.)
Lemma 3.

Given Lts0, Wts=Wts if and only if ΔWj=0 or j[s+1,t] or t>l or s<h. Moreover, if none of those four conditions holds, then rkΔWts=rkΔWj.

Lemma 4.

Given Lts0, colΔWtscolWts (equivalently, colWtscolWts) if and only if ΔWj=0 or j[s+1,t] or t>l or s<h or si. Moreover, if none of those five conditions holds, then colΔWtscolWts={𝟎}.

Symmetrically, rowΔWtsrowWts (equivalently, rowWtsrowWts) if and only if ΔWj=0 or j[s+1,t] or t>l or s<h or tk. Moreover, if none of those five conditions holds, then rowΔWtsrowWts={𝟎}.

Lemma 5.

Given Lts0, if t[j,k] and s[i,j1], then rkWtsrkWts and if ΔWj is sufficiently small (in any matrix norm), rkWts=rkWts.

If ΔWj0 and t[k+1,l] and s[h,i1], then rkWts=rkWts+rkΔWj.

In all other cases, rkWts=rkWts.

As W=WL0, Lemma 3 tells us that a basic move moves off the fiber μ1(W) if and only if Δθ is a nonzero displacement from a subspace ϕlkjih with l=L and h=0. This motivates us to define a set of one-matrix subspaces that signify basic moves that stay on the fiber.

ΘOfiber={ϕlkjihΘO:L>l or h>0}.

A discrete move is a move that changes the ranks of one or more subsequence matrices. If a discrete move stays on the fiber, it moves from one stratum to a different stratum. Lemma 5 tells us two ways a basic move can be discrete. Every subsequence matrix Wts with t[k+1,l] and s[h,i1] increases in rank, and their ranks all increase by the same amount: the rank of ΔWj. A subsequence matrix Wts with t[j,k] and s[i,j1] might decrease in rank, but not if ΔWj is sufficiently small.

A small move is a move that does not decrease the rank of any subsequence matrix. (Rather than fuss over “is ΔWj small enough?”, we define “small move” to meet our needs.) If a small, discrete move stays on the fiber, it moves to a stratum of higher dimension.

By Lemma 5, a small, basic move with displacement Δθϕlkjih is discrete if and only if Δθ𝟎, l>k, and i>h (so [k+1,l] and [h,i1]). We define a set of one-matrix subspaces that signify basic moves that increase the rank of some subsequence matrix.

ΘObarc ={ϕlkjihΘO:l>k and i>h}={ϕlkjih{𝟎}:Llk+1ji>h0}.

6 Barcode moves: Walking the hierarchy of strata

To understand how the strata are connected to each other in the rank stratification of a fiber, it suffices to study small moves with displacements from subspaces in ΘOfiberΘObarc. Given a subspace ϕlkjihΘOfiberΘObarc, let θ+ϕlkjih denote the affine subspace produced by translating ϕlkjih to pass through θ. By Lemma 3, θ+ϕlkjihμ1(W), but by Lemma 5, no point in θ+ϕlkjih except θ lies on the stratum S that contains θ. Whereas given a subspace ϕlkjihΘOfiberΘObarc, θ+ϕlkjihS¯. These facts give us some hints about the connections among the strata and the shape of the stratification (albeit without addressing its curvature).

Interestingly, although a small, basic move may change the ranks of many subsequence matrices, at most four interval counts change. Recall the identity (1): ωts=rkWtsrkWts1rkWt+1s+rkWt+1s1. If all four ranks increase by rkΔWj, or exactly two ranks with opposite signs do, then ωts does not change.

For a small displacement ΔθϕlkjihΘObarc, it is straightforward to check that ωkh and ωli decrease by rkΔWj, ωlh and ωki increase by rkΔWj, and no other interval count changes. The barcode encodes the changes made by small, basic, discrete moves more elegantly than the rank list does. (The rank list is a summed-area table [6] of the interval counts.)

A barcode move is a small, basic, discrete move. There are two types of barcode moves: connecting moves and swapping moves. Every subspace ϕlkjihΘO has indices satisfying k+1ji. A connecting move is a small move with a nonzero displacement ΔθϕlkjihΘObarc in the case where k+1=j=i. In a connecting move, ωki does not exist (as k<i) and only three interval counts change. Figure 7 illustrates two examples of connecting moves and offers an interpretation in terms of a changing barcode: a connecting move deletes rkΔWj copies of the interval [h,k] and rkΔWj copies of the interval [i,l], and replaces them with rkΔWj copies of the interval [h,l]. We think of this as connecting the intervals [h,k] and [i,l] together with an added link [j1,j]=[k,i] to create an interval [h,l]; hence the name “connecting move.” (There is much intuition that can be gleaned from a careful study of the figure that is hard to explain in words.) The rank of a connecting move is rkΔWj.

Figure 7: Two examples of connecting moves. The top example is the simplest example possible: W1 has been perturbed to increase its rank from zero to one. In the bottom example, W2 has been perturbed. In both examples, the perturbation of Wj replaces two intervals [h,j1] and [j,l] with a single interval [h,l]. Three interval counts change, at three of the four corners of the red rectangle: ωlj and ωj1,h decrease by one, and ωlh increases by one. The ranks of the subsequence matrices Wts increase by one for all t[j,l] and s[h,j1] (the ranks inside the red rectangle, including rkWj). Outside the red rectangle, all interval counts and matrix ranks are unchanged.

A swapping move is a small move with a nonzero displacement ΔθϕlkjihΘObarc in the case where ki. A swapping move changes four interval counts. Figure 8 illustrates two examples. A swapping move splices rkΔWj copies of the interval [h,k] with rkΔWj copies of the interval [i,l], replacing them with rkΔWj copies of the interval [h,l] (which is longer than both of the replaced intervals) and rkΔWj copies of the interval [i,k] (which is shorter than both). In effect, the interval endpoints are swapped. (Again, careful study of the figure is rewarding.) The rank of a swapping move is rkΔWj.

Figure 8: Two examples of swapping moves. In the top example – the simplest example possible – either W1 or W2 may be perturbed to cause the move. In the bottom example, any of W2, W3, or W4 may be perturbed. The intervals [h,k] and [i,l] are replaced by an interval [h,l], longer than both original intervals, and an interval [i,k], shorter than both. Four interval counts change, at the four corners of the red rectangle: ωkh and ωli decrease, and ωlh and ωki increase. The ranks of the subsequence matrices Wts increase for all t[k+1,l] and s[h,i1] (the ranks inside the red rectangle). Outside the red rectangle, all interval counts and matrix ranks are unchanged.

Each barcode move has an effect on the rank list (and the barcode) that depends solely on the indices h, i, k, and l and the rank of ΔWj. This motivates the idea of an abstract move that maps one rank list to another rank list, and one barcode to another barcode, divorced entirely from any geometry. A rank-c abstract barcode move takes a valid rank list r¯ and an index tuple (l,k,i,h) satisfying Llk+1i>h0, and yields the modified rank list z¯ produced by setting zts=rts+c for t[k+1,l],s[h,i1]; for the other ranks, zts=rts. Equivalently, it takes the barcode for r¯, decreases ωli and ωkh by c, and increases ωlh and ωki by c – except that if k+1=i, then ωki does not exist and only three interval counts change (an abstract connecting move). An abstract barcode move produces a valid rank list if and only if ωlic and ωkhc prior to the move.

We think the most interesting aspect of this paper is that the hierarchy of strata is captured by these simple discrete operations on barcodes – barcodes that indicate the flow of information through the neural network. Barcode moves create farther-reaching flows and may offer network training algorithms more opportunities to succeed.

7 Revealing the hierarchy of strata

We return to the hard part of Theorem 1, the claim that statement C implies statement D: if r¯z¯, there exists a sequence of rank-one abstract barcode moves that takes us from r¯ to z¯. This claim is a bridge to showing that Sr¯S¯z¯ if and only if r¯z¯.

Figure 9: Algorithm to find a sequence of rank-1 abstract barcode moves that proceed from a rank list r¯ to a rank list z¯, assuming that r¯z¯. FindDAGPath operates recursively, repeatedly invoking FindLastMove to identify the last move in the sequence.

Given rank lists r¯ and z¯ with r¯<z¯, finding a sequence of abstract moves that takes us from r¯ to z¯ is a puzzle that took us three months to solve. The full proof does not fit here, but we include the constructive part of the proof: the algorithm FindLastMove in Figure 9 finds a rank list u¯ such that r¯u¯<z¯ and a single rank-one abstract barcode move takes us from u¯ to z¯. Building on this step, a simple recursive algorithm, FindDAGPath in Figure 9, finds a sequence of abstract barcode moves that take us from r¯ to z¯ (computing the sequence in reverse order, from z¯ to r¯). The proof of correctness of FindDAGPath, and thus the proof that C implies D, follows by induction.

FindLastMove and our proofs use differences between the rank lists r¯ and z¯. Let the interval counts associated with r¯ be ωtsr and the interval counts associated with z¯ be ωtsz. Let

Δrts=ztsrtsandΔωts=ωtszωtsrfor all t and s satisfying Lts0.

As we assume that r¯z¯, no Δrts is negative. (No such constraint applies to Δωts.)

Figure 10 depicts examples of reverse moves found by FindLastMove, and thereby sheds light on Lines 7–13, the core of the algorithm. In each example, a red rectangle shows which reverse move the algorithm finds – specifically, the index tuple (l,k,i,h) of the move. Line 7 selects l and h so that the bottom corner of the red rectangle, Δωlh, is a bottommost positive Δω. (Equivalently, the bottommost rank inside the rectangle, Δrlh, is a bottommost positive Δr.) Lines 8–13 search for values of k and i such that every Δr inside the rectangle is positive and the rectangle’s top corner is either at a positive Δωki or between two Δd’s (k=i1) – these constraints guarantee that a reverse move yields a valid rank list. The hard part of our proof is showing that there always exists a rectangle satisfying these constraints.

Figure 10: Four examples of reverse barcode moves found by the algorithm FindLastMove (shown prior to performing the reverse move). In each example, the algorithm finds a red rectangle such that its bottom corner lies at a bottommost positive Δωlh, its top corner lies at a positive Δωki or between two Δd’s, and every Δr inside the rectangle is positive. In (b) and (c) the algorithm finds a reverse connecting move (k=i1), whereas in (a) and (d) it finds a reverse swapping move (ki). In (a) and (b), Line 10 of FindLastMove determines the top corner of the rectangle (hence k=l1), whereas in (c) and (d), Lines 12 and 13 do (hence kl2).

Lines 8–9 check whether such a rectangle exists with k=l1. If so, Line 10 sets i to indicate the smallest such rectangle; see Figures 10(a) and (b) for examples. If not, the obstacle is some Δrli equal to zero. In that case, Lines 12–13 find values of k and i that satisfy the constraints; see Figures 10(c) and (d) for examples. Showing that Lines 12–13 always succeed is the part of the proof we must omit here. (It takes about two pages.)

We conclude with the hard part of Theorem 1.

Lemma 6.

Let r¯ and z¯ be two valid rank lists for the same linear neural network (i.e., rjj=zjj=dj for all j[0,L]) such that r¯z¯. Then there exists a sequence of valid rank lists that starts with r¯ and ends with z¯ such that each rank list after r¯ can be obtained from the previous rank list in the sequence by a single rank-1 abstract barcode move. Moreover, the algorithm FindDAGPath in Figure 9 finds such a sequence.

8 Final thoughts

Small moves are our tool for understanding stratum connections. But we speculate that longer moves on the fiber might be useful in practice to replace a neural network with an equivalent network more amenable to training by gradient descent algorithms, because barcode moves create farther-reaching flows, and longer moves make those flows stronger. A related idea is to modify gradient descent so it tends to move away from “bad” strata.

Given a smooth function (W), Trager, Kohn, and Bruna [23] call θ a spurious critical point if θ is a critical point of (μ(θ)) but μ(θ) is not a critical point of (where the domain of is restricted to matrices of rank minj=0Ldj or less). They show that there is no spurious critical point on μ1(W) if rkW=minj=0Ldj; also that there is no spurious critical point on any stratum Sr¯ that satisfies, for some j[1,L], both rLj=dL and rj10=d0.

We anticipate that geometric interpretations of cost functions in neural networks have the potential to become a thriving area, especially if we can incorporate ReLU activations.

References

  • [1] Sanjeev Arora, Nadav Cohen, and Elad Hazan. On the Optimization of Deep Networks: Implicit Acceleration by Overparameterization. In Proceedings of the 35th International Conference on Machine Learning, volume 80 of Proceedings of Machine Learning Research, pages 244–253, Stockholm, Sweden, July 2018. URL: https://proceedings.mlr.press/v80/arora18a.html.
  • [2] Sanjeev Arora, Nadav Cohen, Wei Hu, and Yuping Luo. Implicit Regularization in Deep Matrix Factorization. In Advances in Neural Information Processing Systems, volume 32, pages 7411–7422, 2019. URL: https://proceedings.neurips.cc/paper/2019/hash/c0c783b5fc0d7d808f1d14a6e9c8280d-Abstract.html.
  • [3] Frédéric Chazal, Vin de Silva, Marc Glisse, and Steve Oudot. The Structure and Stability of Persistence Modules. Springer, 2016. doi:10.1007/978-3-319-42545-0.
  • [4] Anna Choromanska, Mikael Henaff, Michaël Mathieu, Gérard Ben Arous, and Yann LeCun. The Loss Surfaces of Multilayer Networks. In Proceedings of the Eighteenth International Conference on Artificial Intelligence and Statistics, volume 38 of Proceedings of Machine Learning Research, pages 192–204, San Diego, California, USA, May 2015. URL: https://proceedings.mlr.press/v38/choromanska15.html.
  • [5] Hung-Hsu Chou, Carsten Gieshoff, Johannes Maly, and Holger Rauhut. Gradient Descent for Deep Matrix Factorization: Dynamics and Implicit Bias towards Low Rank. Applied and Computational Harmonic Analysis, 68:101595, 2024. doi:10.1016/j.acha.2023.101595.
  • [6] Franklin C. Crow. Summed-Area Tables for Texture Mapping. In Proceedings of the 11th Annual Conference on Computer Graphics and Interactive Techniques (SIGGRAPH ’84), pages 207–212, Minneapolis, Minnesota, July 1984. doi:10.1145/800031.808600.
  • [7] Herbert Edelsbrunner and John Harer. Computational Topology: An Introduction. American Mathematical Society, 2010. URL: http://www.ams.org/bookstore-getitem/item=MBK-69.
  • [8] Herbert Edelsbrunner, David Letscher, and Afra Zomorodian. Topological Persistence and Simplification. Discrete & Computational Geometry, 28(4):511–533, November 2002. doi:10.1007/s00454-002-2885-2.
  • [9] Robert Ghrist. Barcodes: The Persistent Topology of Data. Bulletin of the American Mathematical Society, 45(1):61–75, 2008. doi:10.1090/S0273-0979-07-01191-3.
  • [10] Suriya Gunasekar, Blake E. Woodworth, Srinadh Bhojanapalli, Behnam Neyshabur, and Nathan Srebro. Implicit Regularization in Matrix Factorization. In Proceedings of the 31st International Conference on Neural Information Processing Systems, pages 6152–6160, 2017. doi:10.1109/ITA.2018.8503198.
  • [11] Moritz Hardt and Tengyu Ma. Identity Matters in Deep Learning, July 2018. arXiv:1611.04231.
  • [12] Ziwei Ji and Matus Telgarsky. Gradient Descent Aligns the Layers of Deep Linear Networks. In 7th International Conference on Learning Representations, New Orleans, Louisiana, May 2019. URL: https://openreview.net/forum?id=HJflg30qKX.
  • [13] Kenji Kawaguchi. Deep Learning without Poor Local Minima. In Proceedings of the 30th International Conference on Neural Information Processing Systems, volume 29, pages 586–594, 2016. URL: https://proceedings.neurips.cc/paper/2016/hash/f2fc990265c712c49d51a18a32b39f0c-Abstract.html.
  • [14] Qianyi Li and Haim Sompolinsky. Statistical Mechanics of Deep Linear Neural Networks: The Backpropagating Kernel Renormalization. Physical Review X, 11:031059, September 2021. doi:10.1103/PhysRevX.11.031059.
  • [15] Clara Löh. A Comment on the Structure of Graded Modules over Graded Principal Ideal Domains in the Context of Persistent Homology, February 2023. arXiv:2301.11756.
  • [16] Stanisław Łojasiewicz. Ensembles Semi-Analytiques. Unpublished manuscript. A version typeset by Michel Coste is available at https://perso.univ-rennes1.fr/michel.coste/Lojasiewicz.pdf, July 1970.
  • [17] Haihao Lu and Kenji Kawaguchi. Depth Creates No Bad Local Minima, May 2017. arXiv:1702.08580.
  • [18] John Mather. Notes on Topological Stability. Lecture Notes. Reprinted in Bulletin of the American Mathematical Society 49(4):475–506, October 2012, 1970. doi:10.1090/S0273-0979-2012-01383-6.
  • [19] Adityanarayanan Radhakrishnan, Eshaan Nichani, Daniel Irving Bernstein, and Caroline Uhler. On Alignment in Deep Linear Neural Networks, June 2020. arXiv:2003.06340v2.
  • [20] Jonathan Richard Shewchuk and Sagnik Bhattacharya. The Geometry of the Set of Equivalent Linear Neural Networks, April 2024. doi:10.48550/arXiv.2404.14855.
  • [21] Gilbert Strang. The Fundamental Theorem of Linear Algebra. The American Mathematical Monthly, 100(9):848–855, November 1993. doi:10.1080/00029890.1993.11990500.
  • [22] René Thom. La Stabilité Topologique des Applications Polynomiales. L’Enseignement Mathématique, 8(1–2):24–33, 1962.
  • [23] Matthew Trager, Kathlén Kohn, and Joan Bruna. Pure and Spurious Critical Points: A Geometric Study of Linear Networks. In Eighth International Conference on Learning Representations, Addis Ababa, Ethiopia, April 2020. URL: https://openreview.net/forum?id=rkgOlCVYvB.
  • [24] Hassler Whitney. Elementary Structure of Real Analytic Varieties. Annals of Mathematics, 66(2):545–556, 1957. doi:10.2307/1969908.
  • [25] Hassler Whitney. Local Properties of Analytic Varieties. In Stewart Scott Cairns, editor, Differential and Combinatorial Topology, pages 205–244. Princeton University Press, 1965. doi:10.1515/9781400874842-014.
  • [26] Hassler Whitney. Tangents to an Analytic Variety. Annals of Mathematics, 81(2):496–549, 1965. doi:10.2307/1970400.
  • [27] Li Zhang. Depth Creates No More Spurious Local Minima, January 2020. arXiv:1901.09827.
  • [28] Afra Zomorodian and Gunnar E. Carlsson. Computing Persistent Homology. In Proceedings of the Twentieth Annual Symposium on Computational Geometry, pages 347–356, Brooklyn, New York, June 2004. doi:10.1145/997817.997870.
  • [29] Afra Zomorodian and Gunnar E. Carlsson. Computing Persistent Homology. Discrete & Computational Geometry, 33(2):249–274, February 2005. doi:10.1007/s00454-004-1146-y.