Transformers as Generic Deep Neural Networks: Exact Compilation, the Cost of Removing Activation-Activation Products, and Multi-Agent Attention Clustering
Neural processing units (NPU) add dedicated operators for attention and normalization, and quantization relies on Transformer-specific algorithms.
ProofPaper ↗
Key points
- Transformers are deployed as a special model class.
- Every Transformer block, with attention, LayerNorm and a GELU MLP, compiles exactly into a generic deep neural network built from fixed affine maps, routing and the square, sigmoid and inverse square root, plus GELU or its sigmoid approximation.
- Without activation-activation products, every transform-wise compilation adds at least $N^2$ scalar nonlinear evaluations per head for dense scores.
- For top-$k$ attention with exchangeable tail scores, we prove that exact or conditional-mean tail mass gives an unbiased, minimum-mean-square-error estimate of the attention distribution, while tail drop is conditionally biased.
Sources (1)
- [1]Transformers as Generic Deep Neural Networks: Exact Compilation, the Cost of Removing Activation-Activation Products, and Multi-Agent Attention ClusteringarXiv (AI, ML, NLP, CV, robotics, multi-agent) · Oct 20, 10:16 PM
Neural processing units (NPU) add dedicated operators for attention and normalization, and quantization relies on Transformer-specific algorithms.
Transformers are deployed as a special model class.
Extractive summary: sentences quoted from the sources.
Before this
- Oct 20, 2026Is 2:4 Sparsity Still Worth It? Semi-Structured Sparsity versus Quantization in LLM Inference
- Oct 20, 2026Beyond the KV cache: Training and serving i14’s Laplace 3B linear attention model on AWS Trainium2 with native PyTorch
- Oct 20, 2026Do Diffusion LLMs Scale? Testing Mercury 3 + Decide
- Oct 20, 2026Meet Drex Max: Nace AI’s Multimodal Decision Model for Computer-Use Agents with a Score 67.59
- Oct 20, 2026Cache Engineering for Agents
- Oct 19, 2026jax-ml/jax jax-v0.12.0: JAX v0.12.0