Activations Are Bad for Geometry
#ml#geometry#kernels#interpretability#deep-learning#neural-networks#activation-functions#jacobian#relu
Part 1 of 8Geometry of Representations
- 1Activations Are Bad for Geometryyou are here
- 2Opposite Is Not Different: The Cosine-Similarity Bug in CLIP and Contrastive Learning
- 3Not All Infinities Are Equal: The Cross-Entropy Asymmetry Behind Hallucination
- 4Untangling the Moons: A Visual History of Contrastive Learning
- 5What Makes a Good Latent Space? The Welch Bound and the Simplex
- 6Latent on the Spectrum: Why Cats Sit Closer to Dogs Than to Cars
- 7The Three States of Information
- 8Distillation Is a Geometry, Not an Answer Key
Somewhere today, someone is computing cosine similarities between embeddings, running -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 data was similar; angles measure relationships; distance is information. So here is the uncomfortable question this post exists to press: how much of that geometry is a property of your data, and how much is an artifact of what the network’s activation functions destroyed 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 , with input , layer width , and applied coordinatewise, the Jacobian factors as
where . Read the factorization as a division of labour. does all the rotating and mixing; the activation contributes only , a diagonal matrix that can do nothing but rescale coordinates, by whatever values happens to take at the 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: it is exactly what gives the activation its selectivity. 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? The singular values of are the singular values of scaled coordinatewise by the entries of , so the answer turns entirely on what looks like at the pre-activations the layer actually sees.
identity
ReLU
leaky ReLU
sigmoid
tanh
GELU
The picture is uniform. ReLU gives , a hard gate that zeroes rows of on the negative half-plane. Sigmoid and tanh never zero exactly but saturate at both ends; small singular values multiply, and the Jacobian becomes ill-conditioned the moment any coordinate is far from zero. Leaky ReLU keeps strictly positive but pins it into with , taking a factor-of- hit to the condition number in expectation. GELU and softplus are smooth and everywhere; their conditioning cost is mild, gradual, and never zero.
These differences are not stylistic. They are the difference between a layer that can collapse, a layer that can degenerate, and a layer that mostly behaves.
Rank collapse, made concrete
What does the hard gate actually cost? For ReLU the answer is exact. With active set ,
the rank of restricted to its surviving rows. If the rows of no longer span , the Jacobian loses column rank and a neighborhood of is crushed onto a lower-dimensional subset of output space. Information that lived along the killed directions is gone in the strong sense, the next layer receives the same image regardless of where you were inside .
Surely width saves you here. Make the layer wide, , 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,
and ranks of products can only shrink: rank lost at any layer, at any depth, is lost end-to-end, because no later layer can resurrect a direction that has already been crushed to a point. Width buys you a good chance of surviving each round; depth makes you play the round again and again, and every loss is permanent. Even short of exact collapse, the near-losses compound too, each layer’s small singular values multiply into the next layer’s, and the end-to-end Jacobian drifts toward effective rank one. Residual connections bias each layer toward plus a small perturbation and mitigate the compounding, but they do not guarantee against it.
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 is strictly monotone and has full column rank, then restricted to any compact data manifold is a homeomorphism onto its image, distinct points stay distinct, topology is preserved, no rank collapse anywhere. If is also smooth, the pullback metric is a well-defined Riemannian metric (possibly ill-conditioned, but never singular).
The test sorts the standard activations cleanly. Sigmoid, tanh, GELU, softplus, and the identity are all strictly monotone; under a full-rank they preserve topology, and their only sin is condition number. ReLU is not strictly monotone, it has a flat half-line, and that flat half-line is the source of every pathology above. Leaky ReLU with scrapes by: it is strictly monotone, so is well-defined, but has a jump at zero, so is only piecewise smooth.
The corollary is that the activation question is largely the question of strict monotonicity. Lose it, and you lose homeomorphism on a measurable region of input space. Keep it, and the only thing left to manage is conditioning.
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.
The correspondence is exact, not decorative:
| geometric object | on the sheet |
|---|---|
| the layer | the hand deforming the sheet |
| Jacobian | how the grid square at deforms |
| singular values of | the square’s stretch factors along its principal directions |
| pullback metric | the local grid spacing after deformation |
| small (saturation) | the grid crushed along one direction |
| (ReLU’s flat half-line) | a fold: one direction pressed completely flat |
| how many directions of the sheet survive at |
And the picture predicts before the algebra confirms: a fold cannot be undone by any further stretching, which is exactly the rank-lost-is-lost-end-to-end rule you just watched compound across depth.
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 ,
This is the metric the network thinks the data lives in. enters twice, squared, with two consequences worth naming.
Directional rescaling. Each row of is weighted by in . Sigmoid and tanh saturation, the leaky-ReLU slope, every situation in which a 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 exactly, the row drops from entirely. The metric becomes singular along directions in : 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 .
input space
output space φ(Wx)
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, with each independent and symmetric, the probability that at least one coordinate is zeroed is
By this is . In a transformer hidden layer of width , every forward pass has approximately half its coordinates zeroed at every point. Whether this turns into rank collapse depends on the structure of , 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.
The point is not that ReLU is bad in high dimensions. It is that high dimensions are exactly where the geometric pathologies of pointwise activations live, and that handwaving about width does not make them go away.
The expressivity–geometry tradeoff
Why have an activation at all? Without one, a stack of layers is the single linear map , no nonlinear class boundary, no useful expressivity. The activation buys selectivity: when a neuron’s prototype matches the input and the projection passes through, when it doesn’t. Selectivity is what the activation is for.
But selectivity is exactly what damages geometry. Sharper activations, derivatives closer to , separate classes better and lose more geometry. Smoother, never-zero activations preserve more geometry but suppress selectivity, leaving the layer near its linear part. The choice of activation is the choice of where to sit on this axis. ReLU is a corner solution: maximum selectivity, maximum geometric damage. GELU and softplus are middle solutions. Identity is the other corner, perfect geometry, no expressivity gain over a single linear layer.
There is no escape from this tradeoff as long as the nonlinearity is pointwise. Every dimension spent on selectivity is taken from the metric.
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 away from rank collapse and saturation.
Residual connections turn each layer into , whose Jacobian is instead of . The identity term gives the Jacobian a floor, full rank by construction, well-conditioned as long as stays modest. The cumulative rank decay that plagues stacked ReLU layers becomes a perturbation around instead of a multiplicative product of degenerate matrices.
Batch and layer normalization rescale the pre-activation to roughly zero mean and unit variance. This is exactly the regime in which sigmoid/tanh/GELU have their largest and ReLU has its highest active fraction. Without normalization, drifts during training; the saturation set grows; shrinks. Normalization holds the input distribution in the activation’s live zone, stays away from zero.
Weight and spectral normalization bound the singular values of . They have no direct effect on , but by keeping ‘s spectrum tight they prevent the linear factor from compounding whatever damage has already inflicted.
These are not activation replacements. They are stabilizers, they keep the architecture in the regime where is least bad. The fact that the same analysis explains three different “tricks” is the content: each one holds a different piece of the Jacobian away from a different failure mode.
Why this matters for evaluation
This is where the question from the top comes due. Cosine similarity, -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
The tradeoff exists because the architecture has separated geometry (carried by ) from selectivity (provided by ), and each piece can do its job only at the other’s expense. A kernel-machine layer dissolves the separation. A symmetric positive-definite kernel provides selectivity (sharper kernels are more selective) and geometry (a Gram matrix is a metric) at the same time. The function the layer computes is a finite expansion in kernel sections,
with a closed-form RKHS norm . There is no sitting in the middle to collapse rank or saturate the metric. The primitive is the geometry; selectivity is implemented as geometry; kernel similarity is the score.
The pointwise activation is not the price of expressivity. It is the price of refusing to make the primitive a kernel. Pick activations with the same care you pick a loss. They are not there for nonlinearity, and they are not free.
Cite as
Bouhsine, T. (). Activations Are Bad for Geometry. Records of the !mmortal Data Scientist. https://tahabouhsine.com/blog/activations-are-bad-for-geometry/
BibTeX
@misc{bouhsine2026activationsarebadforgeometry,
author = {Bouhsine, Taha},
title = {Activations Are Bad for 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
- (2010). Rectified Linear Units Improve Restricted Boltzmann Machines (ReLU). ICML 2010.
- (2015). Batch Normalization: Accelerating Deep Network Training by Reducing Internal Covariate Shift. ICML 2015.arXiv:1502.03167
- (2016). Deep Residual Learning for Image Recognition (ResNet). CVPR 2016.arXiv:1512.03385
- (2016). Gaussian Error Linear Units (GELUs). arXiv:1606.08415
- (2016). Weight Normalization: A Simple Reparameterization to Accelerate Training of Deep Neural Networks. NeurIPS 2016.arXiv:1602.07868
- (2016). Layer Normalization. arXiv:1607.06450
- (2018). Spectral Normalization for Generative Adversarial Networks. ICLR 2018.arXiv:1802.05957