Your data has a shape. A new wave of AI research is finally learning to read it.
Picture a debugging session that has gone sideways. An engineer has dumped the internal activations of a language model into a file, and what comes back is a cloud of points floating in a space with thousands of dimensions. There is no way to plot it, no obvious cluster to point at, no chart that fits on a screen. The data has structure, but it is structure no spreadsheet will ever show you. The question is not what the numbers say. It is what shape they make.
This is the problem persistent homology was built to solve. The method comes from topology, the branch of mathematics that studies properties of a shape that survive stretching, bending, and squashing, but not tearing or gluing. To a topologist, a coffee mug and a donut are the same object: each has exactly one hole. What matters is not distance or angle but connectivity: how many pieces a thing breaks into, how many loops run through it, how many enclosed voids it contains. Persistent homology turns that way of seeing into an algorithm you can run on raw data.
The mechanics are surprisingly visual. Grow a tiny ball around each data point and slowly inflate every ball at the same rate. When two balls touch, connect their points with an edge. When three mutually touch, fill in the triangle between them. As inflation continues, isolated points merge into clusters, loops appear and seal shut, voids open and collapse. Persistent homology records the entire movie: the exact scale at which each topological feature is born and the exact scale at which it dies. A feature that vanishes almost immediately is probably noise. A loop that holds across a wide range of scales is almost certainly real structure. That gap between birth and death, the persistence, is the whole point.
The reason this matters for machine learning runs deeper than visualization. Most useful datasets do not spread evenly through their high-dimensional containers. They concentrate on a thin, curved, lower-dimensional surface inside that container, an idea known as the manifold hypothesis. A 64-by-64 grayscale image technically lives in a space of more than four thousand dimensions, yet the set of images that look like anything recognizable occupies a vanishingly small, structured sliver of that space. Machine learning works at all because models can find and exploit that hidden surface instead of memorizing every point individually. The shape is the signal.
Persistent homology measures that shape directly, and it does so in a way that is provably stable: nudge the underlying data a little and the resulting summary moves only a little in response. This robustness is precisely the property you want when inputs are noisy, unevenly sampled, or riddled with outliers. Research from Stanford and Inria pushed this further, arguing that the path a training algorithm traces through a model's parameter space has a fractal-like complexity measurable by a topological quantity they call the persistent homology dimension. When measured across different architectures and training runs, this number predicted how well a model would generalize to new data. Not the size of the model. The shape of the path it took to learn.
Once you can measure shape, you can demand that a model preserve it. That is the move behind topological autoencoders. An ordinary autoencoder compresses data into a compact representation and is rewarded only for reconstructing the input. It can mangle global arrangement freely. Two clusters far apart in the original data might end up fused in the compressed version, and the model will never be penalized as long as reconstruction is good. A topological autoencoder adds a penalty term that measures the difference between the shape of the data before and after compression using persistent homology. The model is forced to learn encodings that preserve connectivity and loop structure across scales, not just local patterns. The same logic extends to measuring a network's own internal complexity: a method called Neural Persistence treats each layer's weights as a weighted graph, computes a topological score, and produces a training signal that mirrors hard-won intuitions about regularization, without requiring a separate validation set.
A vivid example of this comes from work applying persistent homology to the internal representations of large language models. Rather than examining a single layer in isolation, researchers used a technique called zigzag persistence to track how topological features in the cloud of token representations are born, travel through the architecture, and die as data passes from one transformer layer to the next. The method identified layers whose topological contributions closely mirrored those of their neighbors, flagging them as redundant, and used that finding to guide structured pruning. On standard benchmarks, the topologically pruned models matched the performance of models pruned by leading competing methods.
A researcher's working diagram on glass: raw data enters a topological filter, and three distinct applications emerge on the other side. The shape of data, it turns out, is also the shape of the argument. Daice Labs / 2026.
The most consequential frontier is where geometric thinking makes contact with symbolic structure. Standard graph neural networks model only pairwise connections: there is an edge between node A and node B, or there is not. This is a genuine mathematical limitation. Networks built on pairwise graphs cannot, by themselves, distinguish a single six-node cycle from two disconnected triangles, configurations with identical pairwise patterns but completely different topological identities. A 2024 research collaboration spanning Oxford, Stanford, Cambridge, and DeepMind made the case that structures from algebraic topology, specifically simplicial and cell complexes that represent three-way and higher-order interactions natively, are the natural next step for systems that need to reason over genuinely relational data.
That bridge is already structural in work on knowledge graphs, the symbolic substrates that underpin many neurosymbolic AI systems. A framework called Knowledge Sheaves, developed at the University of Minnesota, recasts knowledge graph reasoning in the language of cellular sheaf theory. Each node and edge in the graph is assigned a small vector space, and those spaces are linked by maps derived from the graph's own relational schema. When the model encounters a new query, it reasons over chains of relations through a process called harmonic extension, propagating information through the sheaf's structure rather than pattern-matching against training examples. The geometry and the logic are fused into a single object.
For software engineering the implications are less abstract than they might appear. Modularity is already a topological claim: certain parts of a system belong to the same connected component, others do not. Robustness is the stability property made precise: a well-designed system should not change its essential behavior when inputs shift slightly, which is exactly what topological summaries guarantee. A 2024 study applied persistent homology to the attention patterns a BERT-class model produces when reading source code, then trained lightweight classifiers on those topological summaries to detect security vulnerabilities. The results were competitive with fine-tuned code-specific language models, suggesting that the geometric structure of how a model attends to code carries genuine semantic signal about whether that code is safe.
The honest caveat is that most of this remains computationally heavy. The core algorithm involves a matrix reduction whose cost scales badly with the number of points, and frontier AI models operate at a scale that dwarfs most topological benchmarks. Ongoing parallelization work at the Alan Turing Institute points directly at this bottleneck. The mathematics is clean. The engineering to run it at production scale is still being assembled.
Still, the direction is clear, and it amounts to a shift in what the field chooses to measure. For the better part of a decade, progress in machine learning was narrated through scalar quantities: loss values, accuracy percentages, parameter counts. Topological thinking insists that the structure connecting those numbers carries information the numbers alone discard, and that this structure is often what survives noise, transfers across tasks, and explains why a model generalizes rather than memorizes. A 2025 study applying persistent homology to the reasoning traces of large language models found that topological features of those traces predicted reasoning quality substantially better than standard graph metrics did. Good reasoning, it appears, has a recognizable shape.
The practical takeaway is to start treating shape as a first-class property of any system you build or analyze. Track whether a learned representation preserves the connectivity structure of its training data. Watch the topology of a training trajectory as a signal of generalization, not just the loss curve. Reach for higher-order relational structures when pairwise graphs hit their expressive ceiling. The data has always had a shape. The tools to read it, and to design systems deliberately around it, are finally catching up.
Key references: Birdal, T. et al., "Intrinsic Dimension, Persistent Homology and Generalization in Neural Networks," NeurIPS 2021 (Stanford / Inria). Moor, M. et al., "Topological Autoencoders," ICML 2020 (ETH Zurich). Rieck, B. et al., "Neural Persistence: A Complexity Measure for Deep Neural Networks Using Algebraic Topology," ICLR 2019. Gebhart, T. and Schrater, P., "Adversary Detection in Neural Networks via Persistent Homology," arXiv 2017 (University of Minnesota). Persistent Topological Features in Large Language Models, arXiv 2024 (zigzag persistence / LLM pruning). Hajij, M. et al., "Topological Deep Learning: Going Beyond Graph Data," ICML 2024 position paper (Oxford, Stanford, Cambridge, DeepMind). Barbero, F. et al., "Knowledge Sheaves: A Sheaf-Theoretic Framework for Knowledge Graph Embedding," AISTATS 2023 (University of Minnesota). Vulnerability Detection via Topological Analysis of Attention Maps, arXiv 2024. The Shape of Reasoning: Topological Analysis of Reasoning Traces in Large Language Models, arXiv 2025. Scalable Topological Data Analysis, Alan Turing Institute research programme.
Daice Labs Inc.
Brookline, MA, USA
Roll the "daice"–exploration & programmable adaptation.