# Layerwise linking-number topology probe

- ID: 288
- Canonical URL: https://synthcore.org/idea/288/layerwise-linking-number-topology-probe
- API JSON: https://synthcore.org/api/idea/288.json
- API Markdown: https://synthcore.org/api/idea/288.md
- Verification status: unverified
- Source: [arXiv:2606.31856](https://arxiv.org/abs/2606.31856)
- Category: geometry
- Solves: accuracy, stability
- ML areas: mlp, training-dynamics, loss, architecture
- Math tags: topology, geometry, metric-geometry
- Ratings: usefulness 5/10; difficulty 7/10; novelty 8/10

## Idea description

Use linking number as a diagnostic and optional regularizer for representations of paired closed data manifolds. The probe identifies layers that collapse or separate class geometry through collisions and folds, giving an architecture-selection signal beyond loss and Jacobian singular values.

## Mathematical statement

For disjoint closed oriented manifolds $M^{m},N^{n}\subset\mathbb{R}^{d}$ satisfying $d=m+n+1$, the paper defines the higher-dimensional linking number by the degree of the Gauss map $G:M\times N\to\mathbb{S}^{d-1}$, $G(x,y)=(x-y)/|x-y|$: $\operatorname{lk}(M,N)=\deg(G)$. In the practical case $m=n=1,d=3$, $M$ and $N$ are oriented closed curves and the degree is an integer measuring how many times the pairwise displacement directions wrap around the sphere. For a network prefix $F_j$, evaluate $G_j(s,t)=\big(F_j(M(s))-F_j(N(t))\big)/\|F_j(M(s))-F_j(N(t))\|$ whenever the two image curves remain separated. A discrete estimate is obtained by triangulating the parameter torus $M\times N$ and summing signed spherical triangle areas divided by $4\pi$: $\widehat{\operatorname{lk}}_j=(4\pi)^{-1}\sum_{\tau}\operatorname{Area}_{S^2}(G_j(\tau))$. The invariant is integer-valued and non-smooth at collisions, so use it primarily as a layerwise probe; for training, add a margin penalty on minimum cross-curve distance or a soft squared error against a desired linking pattern.

## Key formulas

- $$\operatorname{lk}(M,N)=\deg(G),\qquad G:M\times N\to\mathbb{S}^{d-1},\quad G(x,y)=\frac{x-y}{|x-y|}$$
- $$\operatorname{lk}(F_j(M),F_j(N))=\deg\!\left((s,t)\mapsto\frac{F_j(M(s))-F_j(N(t))}{\left\|F_j(M(s))-F_j(N(t))\right\|}\right)$$
- $$\widehat{\operatorname{lk}}_j=\frac{1}{4\pi}\sum_{\tau\subset M\times N}\operatorname{Area}_{\mathbb{S}^{2}}\!\left(G_j(\tau)\right)$$
- $$\mathcal{L}_{\mathrm{top}}=\lambda_{\mathrm{lk}}\big(\widehat{\operatorname{lk}}_j-k_{ab}\big)^2+\lambda_{\mathrm{sep}}\,\frac{1}{|M||N|}\sum_{s,t}\operatorname{softplus}\!\left(\delta-\|F_j(M(s))-F_j(N(t))\|\right)$$

## Implementation notes

Use this as a layerwise representation probe first, and only then as an auxiliary loss. Construct two oriented closed polygonal curves from minibatch embeddings: for a toy benchmark, sample known linked and unlinked circles in $\mathbb{R}^{3}$; for real data, fit each class or subgroup with a closed principal curve and resample it at $K$ evenly spaced points. At selected layers $j$, obtain $P=F_j(M)\in\mathbb{R}^{K\times d}$ and $Q=F_j(N)\in\mathbb{R}^{K\times d}$, project to three coordinates with a fixed random orthogonal projection if $d>3$, and form the $K\times K$ Gauss-map grid $G_{ab}=(P_a-Q_b)/(\|P_a-Q_b\|+\epsilon)$. Split each parameter-grid cell into two triangles. Compute the signed spherical area of a triangle with unit vertices $u,v,w$ using $2\operatorname{atan2}(u\cdot(v\times w),1+u\cdot v+v\cdot w+w\cdot u)$, then sum areas and divide by $4\pi$. Use the rounded value only for logging; gradients should use the smooth separation term in $\mathcal{L}_{\mathrm{top}}$, because the integer degree changes discontinuously at collisions. Set $k_{ab}$ to the known toy link number or to a teacher-network measurement, and apply the loss only to selected class pairs. Estimate numerical reliability by doubling $K$ and checking that the rounded linking number is unchanged. First compare a width-3 plain MLP, explicit-fold ResNet, and invertible flow on linked/unlinked curve classification. Success is higher class accuracy or fewer layers at fixed accuracy, while the probe should reveal intentional changes in $\widehat{\operatorname{lk}}_j$ without frequent spurious changes caused by near-collisions.

## Disclaimer

AI-generated research hypothesis, automatically tested. Not peer-reviewed.
