Skip to main content

Idempotent-Tropical: Zero-Multiplication Tropical Semiring Attention

Zero-Multiplication Self-Attention Engine Powered by Max-Plus Idempotent Semiring Algebra for FPGA, Edge AI, and Neuromorphic Silicon.
Author: Dr. A. Emre ÇETİN (aemre.cetin@gmail.com)
Patent Base: U.S. Patent Application No. 64/148,668 ("Patent Pending", Confirmation No. 5890)


1. Mathematical Foundations

In standard linear algebra over the field $(\mathbb{R}, +, \times)$, computing self-attention requires billions of floating-point multiplications: $$\text{Attention}(Q, K, V) = \text{Softmax}\left(\frac{Q K^T}{\sqrt{d}}\right) V$$ For a standard sequence length ($T = 512, d = 64, H = 12, B = 4$), this entails 1,610,612,736 (1.61 Billion) floating-point multiplications per layer.

idempotent-tropical maps the attention computation onto the Tropical / Max-Plus Idempotent Semiring $(\mathbb{R}_{\max}, \oplus, \otimes)$:

  • Set: $\mathbb{R}_{\max} = \mathbb{R} \cup {-\infty}$
  • Tropical Addition ($\oplus$): $a \oplus b = \max(a, b)$
    • Inherent Idempotence: $a \oplus a = \max(a, a) = a$
  • Tropical Multiplication ($\otimes$): $a \otimes b = a + b$ (Classical addition acts as tropical multiplication!)
  • Tropical Matrix Product: $$(A \odot_{\text{trop}} B){i, j} = \bigoplus{k=1}^K (A_{i, k} \otimes B_{k, j}) = \max_{k=1}^K (A_{i, k} + B_{k, j})$$

100.00% Multiplication Reduction

Because classical multiplication is entirely replaced by addition ($+$) and classical addition is replaced by maximum ($\max$), the core attention scoring and value routing stages require EXACTLY ZERO MULTIPLICATIONS.

On silicon (ASICs, FPGAs, Neuromorphic chips), a floating-point multiplier requires $4\times - 8\times$ more silicon area and $3\times - 5\times$ more energy than an adder.


2. Installation

cd packages/idempotent-tropical
pip install -e .

3. Quickstart

import torch
from idempotent_tropical import TropicalAttention

# Initialize zero-multiplication attention layer
attn = TropicalAttention(d_model=768, n_heads=12)
x = torch.randn(4, 256, 768)

# Differentiable training mode (Tropical soft-relaxation)
out_train, _ = attn(x, inference_mode=False)

# Pure zero-multiplication discrete inference mode (Max-Plus Algebra)
out_infer, _ = attn(x, inference_mode=True)

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

idempotent_tropical-0.1.0-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file idempotent_tropical-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for idempotent_tropical-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 89f973ba9ce7b73f627672b33081d2b8d4fa87e44d127813aceee7968fa089c4
MD5 cb34070641c1097c1f19be8f852bfe55
BLAKE2b-256 5d84ba108a1cc60ba995230cf4944a5b221682aa8e1bf0f004be5608e0bcd4e5

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.0 This release

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page