Tropical Attention: Neural Algorithmic Reasoning for Combinatorial Algorithms

Baran Hashemi, Kurt Pasque, Chris Teska, Ruriko Yoshida
5/22/2025
cs.LGmath.AGmath.CO

No official code found. Best implementation: Baran-phys/Tropical-Attention (34 stars, MIT, last commit 2025-10-23).

Abstract

Can algebraic geometry enhance the sharpness, robustness, and interpretability of modern neural reasoning models by equipping them with a mathematically grounded inductive bias? To answer this, we introduce Tropical Attention, an attention mechanism grounded in tropical geometry that lifts the attention kernel into tropical projective space, where reasoning is piecewise-linear and 1-Lipschitz, thus preserving the polyhedral decision structure inherent to combinatorial reasoning. We prove that Multi-Head Tropical Attention (MHTA) stacks universally approximate tropical circuits and realize tropical transitive closure through composition, achieving polynomial resource bounds without invoking recurrent mechanisms. These guarantees explain why the induced polyhedral decision boundaries remain sharp and scale-invariant, rather than smoothed by Softmax. Empirically, we show that Tropical Attention delivers stronger out-of-distribution generalization in both length and value, with high robustness against perturbative noise, and substantially faster inference with fewer parameters compared to Softmax-based and recurrent attention baselines. For the first time, we extend neural algorithmic reasoning beyond PTIME problems to NP-hard and NP-complete problems, paving the way toward sharper and more expressive Large Reasoning Models (LRMs) capable of tackling complex combinatorial challenges in phylogenetics, cryptography, particle physics, and mathematical discovery.

View on arXivView PDF

Code Implementations(1)

MIT

[NeurIPS 2025] Official code for "Tropical Attention: Neural Algorithmic Reasoning for Combinatorial Algorithms"

345PythonJun 20, 202512 months agoMIT
amoebaattention-mechanismdynamic-programminglength-generalizationneural-algorithmic-reasoning+7 more

Similar Papers

Cite this paper

@article{hashemi2025tropical,
  title  = {Tropical Attention: Neural Algorithmic Reasoning for Combinatorial Algorithms},
  author = {Baran Hashemi and Kurt Pasque and Chris Teska and Ruriko Yoshida},
  year   = {2025},
  eprint = {2505.17190},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2505.17190v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2505.17190.svg)](https://codeofpaper.com/paper/2505.17190)

Discussion