Canonical Tropical Segment State
Implementation & benchmark of arXiv:2608.25034 — On the Representational Geometry of Dynamic Programs
Source paper: On the Representational Geometry of Dynamic Programs arXiv:2608.25034 ⓘ · analyzed Aug 29, 2026
AI-generated research hypothesis, automatically tested. Not peer-reviewed.
Idea description
Build a sequence or graph module whose state is a canonical set of affine tropical pieces rather than an opaque hidden vector. Compose consecutive segments by Minkowski addition of their lifted supports, merge alternatives by union followed by lower-hull reduction, and evaluate the resulting piecewise-linear function with a minimum.
Formulas
Mathematical statement
For a two-terminal DAG \(G\), the path polynomial is \(f_G(x)=\min_{\pi:s\to z}\sum_{e\in\pi}w_e(x)\), where \(s\) and \(z\) are the source and sink and each path contributes an affine or parameterized edge-weight sum. In lifted coordinates, each path is represented by \((\alpha_\pi,c_\pi)\), and \(f(x)=\min_{(\alpha,c)\in S'}(c+\langle\alpha,x\rangle)\). Series composition identifies terminals and satisfies \(f_{A;B}=f_A+f_B\); its lifted support is the Minkowski sum \(S'_{A;B}=S'_A+S'_B=\{(\alpha_A+\alpha_B,c_A+c_B)\}\). Parallel composition satisfies \(f_{A\|B}=\min(f_A,f_B)\); its support is the union \(S'_A\cup S'_B\), followed by removal of points that are not lower-hull relevant. The canonical extended Newton polyhedron is \(\Gamma(f)=\operatorname{conv}(S')+\mathbb{R}_{\geq0}e_{d+1}\), and equal polyhedra represent equal computed functions. The decision boundary is the tropical hypersurface \(\mathcal{T}(f)=\{x:\text{the minimum is attained by at least two pieces}\}\).
Implementation notes
Implement a compact tropical segment state containing a support tensor of pairs (alpha, c), with alpha in R^d and c in R. A token or local graph edge emits a small state, such as one to four affine pieces from an MLP. For each new sequence position, perform series composition by forming pairwise sums: alpha_new[p,q] = alpha_old[p] + alpha_token[q] and c_new[p,q] = c_old[p] + c_token[q]. For branching alternatives, concatenate supports from the branches, which implements parallel composition. Canonicalize after every composition: merge duplicate alpha vectors by retaining the smallest c, then remove candidates failing the lower-hull feasibility test from the first idea. Evaluate the state on features x as output = min_p(c_p + dot(alpha_p,x)). During early training, optionally replace min with softmin at temperature tau and anneal tau toward zero; use subgradients or a straight-through rule at ties. The paper determines the composition laws and canonical geometric representation; support-size thresholds, LP tolerances, and temperature schedules are empirical. First test on subset-sum and DAG shortest-path tasks, training on lengths 8-16 and evaluating at lengths 32-64. Compare an LSTM, Transformer, ordinary min-plus recurrence, and the proposed state at equal parameter budgets. Track extrapolation accuracy, decision-boundary disagreement on sampled x, support size, and runtime. The target signal is slower error growth when sequence length doubles, with bounded support size and improved length-64 accuracy.
Verification
Stage 1 · Toy mechanism gate: Failed ✗
Stage 2 · Mechanism transferred to benchmark: Not tested
Stage 2 · Practical benchmark result: Not run
Methodology: Toy-system gate first; the benchmark stage runs only after a pass. How verification works
Stage 1 — Mechanism check agent confidence 9/10
Built a readable TropicalState module implementing Minkowski-sum series composition, union/parallel composition, duplicate merging, lower-hull feasibility reduction, and min evaluation. Random numerical checks showed zero sampled envelope error and series-identity error below 1e-14; support fell from 256/4096/65536 to 37/79/137 for lengths 8/12/16. The effect is real as a representation-size reduction, but the MVP's LP canonicalization took 0.54/1.86/5.22 seconds versus 0.00023/0.00094/0.0093 seconds for naive enumeration, so it does not yet demonstrate an end-to-end win.
- Agent confidence
- 9/10
- Baseline
- Lengths 8/12/16: final supports 256/4096/65536; runtimes 0.00023/0.00094/0.0093 s.
- Idea
- Lengths 8/12/16: canonical supports 37/79/137; runtimes 0.539/1.858/5.222 s; maximum sampled envelope error 0.0. Math checks: series identity error 7.1e-15, canonicalization errors 0.0.
Limitations: No learned sequence model, LSTM/Transformer baseline, GPU implementation, training experiment, or lengths beyond 16 were tested. Envelope equivalence was sampled numerically, and the LP reducer uses scipy rather than an optimized hull algorithm.
How to run: python3 verify_and_benchmark.py
Verdict computed by deterministic test code from paired-seed statistics — not by the language model.
Artifacts
- report.md 1.4 KB View
- results.json 1.0 KB View Raw
- tropical_state.py 3.6 KB View Raw
- verify_and_benchmark.py 2.4 KB View Raw