Learning Topological Invariance

James Halverson, Fabian RuehlearXiv 2025 · DOI

Abstract

Two geometric spaces are in the same topological class if they are related by certain geometric deformations. We propose machine learning methods that automate learning of topological invariance and apply it in the context of knot theory, where two knots are equivalent if they are related by ambient space isotopy. Specifically, given only the knot and no information about its topological invariants, we employ contrastive and generative machine learning techniques to map different representatives of the same knot class to the same point in an embedding vector space. An auto-regressive decoder Transformer network can then generate new representatives from the same knot class. We also describe a student-teacher setup that we use to interpret which known knot invariants are learned by the neural networks to compute the embeddings, and observe a strong correlation with the Goeritz matrix in all setups that we tested. We also develop an approach to resolving the Jones Unknot Conjecture by exploring the vicinity of the embedding space of the Jones polynomial near the locus where the unknots cluster, which we use to generate braid words with simple Jones polynomials.

Introduction

In the field of topology, two geometric objects are considered equivalent if one can be continuously deformed into the other without tearing or gluing—a concept known as topological invariance. In knot theory, this challenge manifests as determining whether two complex loops of string are fundamentally the same (related by ambient isotopy). Traditionally, mathematicians rely on "invariants"—mathematical properties such as polynomials or matrices that remain constant regardless of how a knot is twisted or stretched. However, calculating these invariants or proving equivalence for complex knots is computationally intensive and theoretically difficult.

This research explores whether machine learning (ML) can learn to recognize topological equivalence purely from data, without being explicitly programmed with mathematical theorems. By utilizing contrastive and generative architectures, the study demonstrates that neural networks can not only identify equivalent knots but also implicitly "discover" existing mathematical invariants and provide a new framework for exploring open mathematical conjectures.

Methodology

Data Representation

Knots are represented as braid words, which are sequences of integers describing how strands cross over and under one another. This discrete representation allows the use of sequence-based ML architectures.

Learning Paradigms

The authors implemented two primary machine learning strategies:

  1. Contrastive Learning: Multi-Layer Perceptrons (MLPs) and Convolutional Neural Networks (CNNs) were trained to map different variations of the same knot to identical points in a latent embedding space. This was achieved using a novel centroid loss function, which forces equivalent knots into tight, distinct clusters.
  2. Generative Learning: An auto-regressive encoder-decoder Transformer was trained to take a scrambled knot as input and generate a canonical representative of that knot’s equivalence class.

Interpretability: The Student-Teacher Framework

To understand the "black box" of the learned embeddings, the researchers employed a student-teacher setup. A large "teacher" network generated embeddings for various knots. A smaller "student" network was then tasked with predicting those embeddings using only known mathematical invariants (e.g., Alexander polynomial, hyperbolic volume, Seifert genus). If the student could successfully replicate the teacher's embeddings using a specific invariant, it indicated that the teacher network had implicitly learned that mathematical property.

Conjecture Exploration

The generative model was used to probe the Jones Unknot Conjecture, which suggests that only the trivial "unknot" has a Jones polynomial equal to 1. By mapping Jones polynomials to the latent space and performing a beam search or injecting Gaussian noise near the "unknot" locus, the authors attempted to generate a non-trivial knot with a Jones polynomial of 1—a potential counterexample to the conjecture.

Experimental Results

Performance and Robustness

The generative Transformer achieved a remarkable 98.8% accuracy in producing topologically equivalent knots, verified by comparing the hyperbolic volumes of the input and output. Furthermore, the models demonstrated strong transfer learning capabilities; a model trained on knots scrambled with five random moves maintained approximately 90% accuracy when tested on knots distorted by up to twenty moves.

Discovery of Invariants

The student-teacher analysis yielded a significant insight: the neural networks primarily relied on the Goeritz matrix and Knot Floer Homology to distinguish knots. Interestingly, the models largely ignored other famous invariants, such as the Alexander polynomial, suggesting that the Goeritz matrix provides a more efficient internal representation for topological equivalence in the tested datasets.

Dimensional Compression

Despite being provided with a 16-dimensional embedding space, the contrastive models naturally compressed the identity of knots into just two or three intrinsic dimensions. This suggests that the underlying "space" of knot equivalence is lower-dimensional than previously assumed.

The Jones Unknot Conjecture

During the search for counterexamples, the authors generated over 400,000 candidate knots by sampling the latent space around the unknot. Every generated knot that possessed a Jones polynomial of 1 was found to simplify back to the unknot. While this does not prove the conjecture, it provides significant empirical support for its validity.

Discussion and Future Work

While the results are promising, the authors noted limitations such as overtraining—where accuracy decreased despite lower training loss—and occasional "hallucinations" in the generative model when the latent space was sampled too far from the training distribution.

Future research could involve combining contrastive and generative methods to pre-condition embeddings or extending the framework to classify 3-manifolds. Perhaps most significantly, the authors propose using symbolic regression to analyze the "residual" information in the embeddings—data that the AI uses to distinguish knots that cannot be explained by known invariants. This could lead to the discovery of entirely new mathematical invariants.

Summary updated

BibTeX
@misc{halverson2025learning,
  author = {James Halverson and Fabian Ruehle},
  title = {{Learning Topological Invariance}},
  year = {2025},
  eprint = {2504.12390},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2504.12390},
  howpublished = {arXiv},
}
Figure