What Activations Do to Geometry

· 15 min read

#ml#geometry#kernels#interpretability#deep-learning#neural-networks#activation-functions#jacobian#relu

Part 1 of 6Geometry of Representations
  1. 1What Activations Do to Geometryyou are here
  2. 2Untangling the Moons: A Visual History of Contrastive Learning
  3. 3What Makes a Good Latent Space? The Welch Bound and the Simplex
  4. 4Latent on the Spectrum: Why Cats Sit Closer to Dogs Than to Cars
  5. 5The Three States of Information
  6. 6Distillation Is a Geometry, Not an Answer Key

Somewhere today, someone is computing cosine similarities between embeddings, running kk-nearest-neighbors in a representation space, clustering the activations of a hidden layer, and trusting what comes back. The trust rests on an assumption so default that it is rarely said out loud: the geometry of the representation space means something. Nearby points are near because the model found them similar; angles measure relationships; distance is information. So here is the uncomfortable question this post exists to press: how much of that geometry came from the data, and how much was rewritten by the activation functions on the way up?

The destruction has a specific and inspectable mechanism. A neural network layer is a map, and whether that map preserves the geometry of the data manifold, distances, angles, volumes, is decided by its Jacobian. For the standard form F(x)=ϕ(Wx+b)F(\mathbf{x}) = \phi(\mathbf{W}\mathbf{x} + \mathbf{b}), with input xRd\mathbf{x} \in \mathbb{R}^d, layer width nn, and ϕ\phi applied coordinatewise, the Jacobian factors as

JF(x)=Dϕ(z)W,z=Wx+b,\mathbf{J}_F(\mathbf{x}) = \mathbf{D}_\phi(\mathbf{z}) \, \mathbf{W}, \qquad \mathbf{z} = \mathbf{W}\mathbf{x} + \mathbf{b},

where Dϕ(z)=diag(ϕ(z1),,ϕ(zn))\mathbf{D}_\phi(\mathbf{z}) = \mathrm{diag}(\phi'(z_1), \ldots, \phi'(z_n)). Read the factorization as a division of labour. W\mathbf{W} does all the rotating and mixing; the activation contributes only Dϕ\mathbf{D}_\phi, a diagonal matrix that can do nothing but rescale coordinates, by whatever values ϕ\phi' happens to take at the nn pre-activations the input produces. Under almost every activation in current use those values are zero, small, or bounded, and none of that is accidental: that squeezing is where the activation’s selectivity comes from. It is also, as we are about to see, what lets it quietly vandalise the geometry your cosine similarities assume is real.

The Jacobian, activation by activation

How much damage can one diagonal matrix really do? Left multiplication by Dϕ\mathbf D_\phi rescales the rows of W\mathbf W, but it does not rescale the singular values one by one. The singular directions rotate as the row weights change. What survives are bounds: when all derivatives are nonzero,

σmin(Dϕ)σj(W)    σj(DϕW)    σmax(Dϕ)σj(W).\sigma_{\min}(\mathbf D_\phi)\,\sigma_j(\mathbf W) \;\le\; \sigma_j(\mathbf D_\phi\mathbf W) \;\le\; \sigma_{\max}(\mathbf D_\phi)\,\sigma_j(\mathbf W).

A zero derivative can delete a row entirely. The derivative profile controls how much conditioning can deteriorate, while the orientation of W\mathbf W decides whether that deterioration becomes a lost tangent direction.

— φ(z)   ‒ ‒ φ′(z)

identity

ReLU

leaky ReLU

sigmoid

tanh

GELU

Six common activations and their derivatives. The accent line is φ(z); the dashed line is φ′(z), what the local geometry depends on. ReLU has φ′ ∈ {0, 1}, a hard gate. Leaky ReLU avoids the exact zero but jumps between α and 1. Sigmoid and tanh have φ′ tending to zero at both ends. Softplus stays positive; GELU is smooth but has a small non-monotone region where its derivative is negative.

The picture has three regimes. ReLU gives ϕ(z){0,1}\phi'(z) \in \{0, 1\}, a hard gate that zeroes rows of JF\mathbf{J}_F on the negative half-plane. Sigmoid and tanh never zero at a finite input but saturate at both ends, so their smallest row scales can become tiny. Leaky ReLU keeps the magnitude of its derivative between α\alpha and 11, which limits the damage from this factor alone to at most a factor 1/α1/\alpha. Softplus stays strictly increasing and smooth. GELU is smooth but not monotone everywhere, so it belongs neither to the hard-gate case nor to the globally invertible case.

Rank collapse, made concrete

What does the hard gate actually cost? For ReLU the answer is exact. With active set S(x)={i:zi>0}S(\mathbf{x}) = \{ i : z_i > 0 \},

rank(JF(x))=rank(WS(x),:),\mathrm{rank}\big(\mathbf{J}_F(\mathbf{x})\big) = \mathrm{rank}\big(\mathbf{W}_{S(\mathbf{x}),\,:}\big),

the rank of W\mathbf{W} restricted to its surviving rows. If the rows of WS\mathbf{W}_S no longer span Rd\mathbb{R}^d, the Jacobian loses column rank. Motion along a vector in kerJF\ker \mathbf J_F becomes invisible to first order at that input. That is a local statement; proving that two finite, separated inputs collide requires an additional argument about the whole map.

Surely width saves you here. Make the layer wide, ndn \gg d, and even with half the rows gated off, the surviving submatrix is almost certainly still full column rank; the gate fires, and nothing is lost. That reasoning is correct, and it is exactly the reasoning that fails, because it is correct for one layer. A network is a product of layers,

JF(x)==L1Dϕ(z())W,\mathbf{J}_F(\mathbf{x}) = \prod_{\ell = L}^{1} \mathbf{D}_\phi(\mathbf{z}^{(\ell)})\, \mathbf{W}_\ell,

and the rank of a matrix product cannot exceed the rank of any factor: a direction annihilated by one layer cannot be reconstructed by later multiplication. Near-collapse is subtler. Singular values of a product are not obtained by multiplying corresponding singular values unless their singular directions align, so depth can amplify, rotate, or partly redistribute distortion. In the random ReLU experiment below the weaker directions decay repeatedly and the effective rank falls; that behavior is measured for this ensemble, not forced for every trained deep network. Residual connections bias each layer toward I\mathbf I plus a perturbation and improve the observed rank floor.

You do not have to take the multiplication argument on faith; you can watch it happen.

Play with it for a minute and the depth story stops being abstract. At depth one the ellipse is a healthy ellipse almost everywhere. By depth six or eight, whole regions of the input plane have gone needle-shaped: the effective rank hovers near one, and every input in such a region is being told about through a single surviving direction. Nothing pathological was chosen here, the weights are ordinary random matrices, which is the point: this is what stacked pointwise gating does by default.

When activations don’t break things

The negative result has a positive sibling. If ϕ\phi is continuous and strictly monotone in every coordinate and W\mathbf W has full column rank, then FF is injective; restricted to a compact data manifold, it is a homeomorphism onto its image. A nonsingular pullback metric needs more. The derivative must stay nonzero on the attained pre-activations, and DϕW\mathbf D_\phi\mathbf W must remain injective on every tangent space TxMT_xM.

The test sorts most standard activations cleanly. Sigmoid, tanh, softplus, leaky ReLU with α>0\alpha>0, and the identity are strictly monotone. ReLU is not, because it has a flat half-line. GELU is the useful exception to any tidy slogan: its derivative becomes negative on part of the left tail, so global monotonicity is not available even though the map is smooth.

The diagnostic is therefore two-part. Global injectivity asks about monotonicity and the rank of W\mathbf W; local geometric stability asks about the tangent-restricted singular values of DϕW\mathbf D_\phi\mathbf W. Neither question can replace the other.

What the activation does to the metric

The trouble with everything so far is that you cannot picture it. Rank, kernels, the singular values of a Jacobian in hundreds of dimensions: none of that is an image your intuition can hold. But there is a physical picture that carries all of it. Think of the data manifold as a printed sheet of graph paper and the layer as a hand that deforms it. A smooth, strictly monotone activation stretches the sheet, unevenly, but without tearing or creasing: grid lines stay grid lines. Saturation crushes whole regions of the grid toward a point. And ReLU folds the sheet, pressing everything on the wrong side of the crease flat onto the crease itself. Once folded, two different points of the sheet lie on top of each other, and no later hand can pull them apart again; it can only carry the folded stack along.

Every object in the algebra has a counterpart on the sheet:

geometric objecton the sheet
the layer FFthe hand deforming the sheet
Jacobian JF(x)\mathbf{J}_F(\mathbf{x})how the grid square at x\mathbf{x} deforms
singular values of JF\mathbf{J}_Fthe square’s stretch factors along its principal directions
pullback metric gMg_Mthe local grid spacing after deformation
small ϕ(zi)\phi'(z_i) (saturation)the grid crushed along one direction
ϕ(zi)=0\phi'(z_i) = 0 (ReLU’s flat half-line)a fold: one direction pressed completely flat
rankJF(x)\mathrm{rank}\,\mathbf{J}_F(\mathbf{x})how many directions of the sheet survive at x\mathbf{x}

And the picture predicts before the algebra confirms: once a direction lies in a layer Jacobian’s null space, later multiplication cannot recover it. The animation then measures how often that exact loss—and the softer decay around it—occurs in the chosen random stack.

With the picture in hand, the equation can name it. The grid spacing the deformed sheet carries is the pullback metric induced by the layer on a submanifold MRdM \subset \mathbb{R}^d,

gM(u,v)=u(WDϕ2W)v.g_M(\mathbf{u}, \mathbf{v}) = \mathbf{u}^\top \big(\mathbf{W}^\top \mathbf{D}_\phi^2 \mathbf{W}\big) \mathbf{v}.

This is the metric the network thinks the data lives in. Dϕ\mathbf{D}_\phi enters twice, squared, and it does two distinguishable kinds of damage.

Directional rescaling. Each row of W\mathbf{W} is weighted by ϕ(zi)2\phi'(z_i)^2 in gMg_M. Sigmoid and tanh saturation, the leaky-ReLU α\alpha slope, every situation in which a ϕ(zi)\phi'(z_i) goes small: all push the corresponding row’s contribution toward zero. The “learned distance” the layer imposes is dominated by the rows whose neurons haven’t saturated; the rest contribute almost nothing to perceived similarity.

Directional erasure. When ϕ(zi)=0\phi'(z_i) = 0 exactly, the row drops from gMg_M entirely. The metric becomes singular along directions in kerJFTxM\ker \mathbf{J}_F \cap T_\mathbf{x} M: distances collapse to zero. This is the manifold-side picture of rank collapse, the geometric statement that the layer has stopped being a homeomorphism at x\mathbf{x}.

2D: grid + unit disk · drag with cursor disabled

input space

output space φ(Wx)

A regular grid and unit disk in input space, transformed by φ(Wx). The buttons select the activation; the slider rotates the linear part W (W is just a 2D rotation, for visual clarity). Identity warps nothing. GELU stretches the disk gently. Sigmoid and tanh compress everything toward the origin without folding. ReLU folds the negative half-planes onto the axes, exact rank collapse on a measurable region. Rotate W to see how the dead zone moves through input space: it is the learned W that decides which directions are at the mercy of the activation's zeros.

The sheet metaphor turns literal in the panel. Identity and GELU stretch the disk; sigmoid and tanh compress it without folding; ReLU folds the negative half-planes onto the axes and crushes entire wedges of the disk onto a 1D set. There is no separate metric tensor the network keeps somewhere, the post-activation grid spacing is the metric.

High dimensions make this worse, not better

The intuition that “with a wide enough layer, ReLU sparsification is fine” survives in width but not in pressure. Under the simplest model, zRn\mathbf{z} \in \mathbb{R}^n with each ziz_i independent and symmetric, the probability that at least one coordinate is zeroed is

P(i:zi0)=12n.P\big(\exists\, i : z_i \le 0\big) = 1 - 2^{-n}.

By n=10n = 10 this is 99.9%99.9\%. In a transformer hidden layer of width 768768, every forward pass has approximately half its coordinates zeroed at every point. Whether this turns into rank collapse depends on the structure of WS(x),:\mathbf{W}_{S(\mathbf{x}), :}, but the pressure toward sparsification does not disappear in the limit, it becomes the operating regime, and the analysis above stops being worst-case and becomes typical.

P(at least one ReLU-zeroed coordinate) = 1 − 2⁻ⁿ as a function of layer width n, under the iid symmetric pre-activation model. The expected active fraction stays at ½; the probability that at least one coordinate is dead approaches 1 exponentially. By n = 10 it is already 99.9%; by transformer widths it is indistinguishable from 1.

High dimensions guarantee that ReLU gating is the operating regime, not that rank collapse is. In a wide layer, half the rows can vanish while the survivors still span every input direction. The quantity to measure is the smallest tangent singular value of the surviving Jacobian, not whether at least one coordinate is zero.

The expressivity–geometry tradeoff

Why have an activation at all? Without one, a stack of LL layers is the single linear map WLW1\mathbf{W}_L \cdots \mathbf{W}_1, no nonlinear class boundary, no useful expressivity. The activation buys selectivity: ϕ(zi)1\phi'(z_i) \approx 1 when a neuron’s prototype matches the input and the projection passes through, ϕ(zi)0\phi'(z_i) \approx 0 when it doesn’t. Selectivity is what the activation is for.

Selectivity can damage geometry, but there is no universal one-dimensional tradeoff between the two. A pointwise nonlinearity can be expressive while remaining locally injective, and training can orient W\mathbf W so that heavily rescaled rows are redundant. The measurable question is how the task’s tangent directions align with the Jacobian’s singular directions after training.

Reading common tricks as Jacobian regularization

If pointwise activations really are a standing threat to the Jacobian, you would expect the field to have been fighting them all along, without necessarily saying so. It has. Several standard practices, usually treated as separate phenomena, are all variations on a single intervention: keep JF\mathbf{J}_F away from rank collapse and saturation.

Residual connections turn each layer into x+F(x)\mathbf{x} + F(\mathbf{x}), whose Jacobian is I+DϕW\mathbf{I} + \mathbf{D}_\phi \mathbf{W} instead of DϕW\mathbf{D}_\phi \mathbf{W}. The identity term does not guarantee full rank: an eigenvalue of the residual branch can still land at 1-1. It does give a clean sufficient condition. If DϕW2<1\|\mathbf D_\phi\mathbf W\|_2<1, then every singular value of the residual Jacobian is at least 1DϕW21-\|\mathbf D_\phi\mathbf W\|_2.

Batch and layer normalization control the scale of the pre-activation z\mathbf z. For saturating activations this can keep more samples near the high-derivative region; for ReLU, centering a symmetric distribution keeps the active fraction near one half. Neither operation certifies a Jacobian rank or condition number, but both make the derivative distribution easier to control.

Weight and spectral normalization bound the singular values of W\mathbf{W}. They have no direct effect on Dϕ\mathbf{D}_\phi, but by keeping W\mathbf{W}‘s spectrum tight they prevent the linear factor from compounding whatever damage Dϕ\mathbf{D}_\phi has already inflicted.

None of the three replaces the activation. Each controls a different factor in the Jacobian, but only a measurement of the composed, tangent-restricted Jacobian can say whether the representation preserved the geometry a downstream metric will read.

Why this matters for evaluation

This is where the question from the top comes due. Cosine similarity, kk-nearest neighbors, clustering, retrieval: every downstream operation on representations assumes the space carries the geometry it is reading. If the layer has collapsed rank, cosine similarity compares vectors whose angles are artifacts of the surviving directions rather than properties of the data manifold. If the layer has saturated, small distances in representation space correspond to entirely different scales of input distance depending on which coordinates were saturated where. The metric you evaluate with is not the metric the network actually exposed.

The conclusion is not “don’t use cosine similarity.” It is that cosine similarity (and every other downstream metric) is only meaningful when the network has preserved the geometric structure the metric is reading. Choose activations that preserve Jacobian rank where the task requires it. Control input magnitudes via normalization so the activation does not saturate. Match the evaluation metric to the geometry the architecture actually preserves. None of this is optional if the goal is to compare representations rather than collateral.

The kernel alternative

A kernel offers a different primitive. A symmetric positive-semidefinite kernel K(z,z)K(\mathbf z,\mathbf z') provides a feature-space inner product and therefore the induced pseudometric

dK(z,z)2=K(z,z)+K(z,z)2K(z,z).d_K(z,z')^2=K(z,z)+K(z',z')-2K(z,z').

It becomes a true metric only when the feature map separates points. A finite kernel layer then computes an expansion in kernel sections,

f()=jαjK(,zj),f(\cdot) = \sum_j \alpha_j \, K(\cdot, \mathbf{z}_j),

with a closed-form RKHS norm fHK2=αKα\|f\|^2_{\mathcal{H}_K} = \boldsymbol{\alpha}^\top \mathbf{K} \boldsymbol{\alpha}. This does not guarantee that a finite sampled feature map is injective or well conditioned, but it states the comparison geometry explicitly enough to test both properties.

Expressivity never required a pointwise nonlinearity. It required a nonlinearity, and the pointwise form is one choice among several, the one that inserts a diagonal matrix between your data and its geometry and then asks that matrix to do the discriminating. Until you swap the primitive, the diagonal is there on every layer of every forward pass, and it is the thing deciding what your cosine similarities are allowed to mean. So choose ϕ\phi with the care you would give a loss function, and check the Jacobian of what you built before you trust a distance computed on top of it.

Cite as

Bouhsine, T. (). What Activations Do to Geometry. Records of the !mmortal Data Scientist. https://tahabouhsine.com/blog/activations-are-bad-for-geometry/

BibTeX
@misc{bouhsine2026activationsarebadforgeometry,
  author       = {Bouhsine, Taha},
  title        = {What Activations Do to Geometry},
  year         = {2026},
  month        = {feb},
  howpublished = {\url{https://tahabouhsine.com/blog/activations-are-bad-for-geometry/}},
  note         = {Blog post, Records of the !mmortal Data Scientist}
}

For the underlying paper

Bouhsine, T. (2026). Manifolds, Activations, and Lost Geometry: How Pointwise Nonlinearities Break the Map. Unpublished manuscript. [PDF]

BibTeX
@unpublished{bouhsine2026manifoldsactivations,
  author = {Bouhsine, T.},
  title  = {Manifolds, Activations, and Lost Geometry: How Pointwise Nonlinearities Break the Map},
  year   = {2026},
  note   = {Unpublished manuscript}
}

References

  1. Nair, V., Hinton, G. E. (2010). Rectified Linear Units Improve Restricted Boltzmann Machines (ReLU). ICML 2010.
  2. Ioffe, S., Szegedy, C. (2015). Batch Normalization: Accelerating Deep Network Training by Reducing Internal Covariate Shift. ICML 2015.arXiv:1502.03167
  3. He, K., Zhang, X., Ren, S., Sun, J. (2016). Deep Residual Learning for Image Recognition (ResNet). CVPR 2016.arXiv:1512.03385
  4. Hendrycks, D., Gimpel, K. (2016). Gaussian Error Linear Units (GELUs). arXiv:1606.08415
  5. Salimans, T., Kingma, D. P. (2016). Weight Normalization: A Simple Reparameterization to Accelerate Training of Deep Neural Networks. NeurIPS 2016.arXiv:1602.07868
  6. Ba, J. L., Kiros, J. R., Hinton, G. E. (2016). Layer Normalization. arXiv:1607.06450
  7. Miyato, T., Kataoka, T., Koyama, M., Yoshida, Y. (2018). Spectral Normalization for Generative Adversarial Networks. ICLR 2018.arXiv:1802.05957