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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file idempotent_tropical-0.1.0-py3-none-any.whl.
File metadata
- Download URL: idempotent_tropical-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
89f973ba9ce7b73f627672b33081d2b8d4fa87e44d127813aceee7968fa089c4
|
|
| MD5 |
cb34070641c1097c1f19be8f852bfe55
|
|
| BLAKE2b-256 |
5d84ba108a1cc60ba995230cf4944a5b221682aa8e1bf0f004be5608e0bcd4e5
|