Magnitude-Euler Path Signature Regularizer
Implementation & benchmark of arXiv:2607.23357 — Magnitude homology and Euler characteristics of directed acyclic graphs
Source paper: Magnitude homology and Euler characteristics of directed acyclic graphs arXiv:2607.23357 ⓘ · analyzed Aug 30, 2026
AI-generated research hypothesis, automatically tested. Not peer-reviewed.
Idea description
Represent the computation graph of an MLP as a directed acyclic Lawvere metric space and compute a truncated, length-resolved Euler signature of its active paths. Add a penalty that separates signatures between classes while suppressing signatures that are insensitive to labels, thereby encouraging globally distinct computation routes without changing layer widths or degree statistics.
Formulas
Mathematical statement
The paper defines an extended quasi-pseudometric d:X×X→[0,∞], where asymmetry and d(x,x)≠0 are allowed, and a k-simplex x^(k)=(x_0,…,x_k) with adjacent points distinct and length λ(x^(k))=Σ_{j=1}^k d(x_{j-1},x_j). The magnitude chain group at length L is MC_{k,L}(X)=R{x^(k): λ(x^(k))=L}, with differential ∂_k=Σ_{j=1}^{k-1}(-1)^j∂^(j). The jth face is retained only when the middle point is metrically redundant: ∂^(j)(x^(k))=∇_j x^(k) if d(x_{j-1},x_{j+1})=d(x_{j-1},x_j)+d(x_j,x_{j+1}), and is zero otherwise. For a finite graph, the truncated length-L Euler characteristic is χ_L(X)=Σ_{k=0}^{K}(-1)^k rank(MC_{k,L}(X)); this alternating chain count is the decategorified quantity used here. For implementation, X is the set of neurons and input/output terminals, d(u,v) is the shortest directed path cost, R=R, and only lengths L≤L_max and simplex orders k≤K are retained. With unit edge cost, L is an integer hop length; with positive edge costs c_uv, d(u,v)=min_{p:u↝v}Σ_{(a,b)∈p}c_ab.
Implementation notes
1. Integration point: apply this during training to a small auxiliary computation graph extracted from each MLP block. Create one node for every neuron in the selected hidden layers, plus source and class-output nodes. For a dense layer from neuron u to v, use an edge cost c_uv=1 for the first experiment; optionally use c_uv=1/(|w_uv|+epsilon) or c_uv=softplus(-|w_uv|) after the unit-cost baseline. Remove edges whose gated activation contribution |w_uv h_u| is below a percentile threshold, producing a sample-dependent active DAG. 2. Pseudocode: build active edges; compute shortest directed distances d[u,v] by dynamic programming in topological order; for each L≤L_max, enumerate or sample ordered tuples (x_0,…,x_k) with adjacent finite distances and sum d[x_{j-1},x_j]=L; accumulate n[k,L]. Set chi[L]=sum_k (-1)^k n[k,L], directly implementing the paper’s Euler decategorification. Add the loss above, where chi(X|y) is the minibatch mean for class y, bar_chi is an exponential moving-average target, beta is small, and rho optionally stabilizes the global signature. 3. Mathematics versus estimates: shortest distances and chain lengths are exact for the chosen graph; chi is estimated by uniform chain sampling when enumeration exceeds a budget. Use K=3, L_max=4, 256 sampled chains per k and class. Since hard thresholding is nondifferentiable, update this statistic every N steps and treat it as a detached monitoring or reinforcement-style regularizer initially; a differentiable surrogate can replace edge inclusion with sigmoid gates and soft chain weights. 4. First experiment: train a 3-layer width-256 MLP on MNIST or CIFAR-10 embeddings, comparing cross-entropy, weight decay, and the Euler-signature penalty at matched FLOPs. Report test accuracy, calibration, classwise signature separation, and robustness to neuron permutation or random pruning. A positive result is higher accuracy or corruption robustness at equal parameter count, with classwise chi vectors separating before accuracy improves and no more than 10% training-time overhead.
Verification
This idea has not been verified yet.
Verification happens in two stages: Stage 1 — a mechanism check on a toy system confirms the claimed mathematical phenomenon reproduces; Stage 2 — a benchmark implements the idea on a real (small) neural network task and compares it against a tuned baseline over 8 paired seeds with a permutation test.
Artifacts
Artifacts unavailable.