cs.LGApr 10, 2026

Integrated electro-optic attention nonlinearities for transformers

Authors: Luis Mickeler, Kai Lion, Alfonso Nardi, Jost Kellner, Pierre Didier, Bhavin J. Shastri, Niao He, Rachel Grange

Organizations: Optical Nanomaterial Group, Department of Physics, ETH Zurich, Zurich, Switzerland · Optimization & Decision Intelligence Group, Department of Computer Science, ETH Zurich, Zurich, Switzerland · Department of Physics, Politecnico di Milano, Milan, Italy · Centre for Nanophotonics, Department of Physics, Engineering Physics & Astronomy, Queen’s University, Kingston, Canada

Abstract

Transformers achieve state-of-the-art performance in language processing and computer vision. Their computation increasingly depends on hardware that can keep pace not only with large matrix multiplications, but also with nonlinear operations like Softmax within the core attention mechanism. On digital accelerators, Softmax accounts for only a small fraction of total operations, yet it can disproportionately impact overall inference latency. Here, we use thin-film lithium niobate Mach-Zehnder modulators (MZM) as analog computing elements for low-latency Transformer attention. Our high-speed nonlinearities based on the intrinsic sinusoidal MZM response achieve performance close to digital baselines in Vision Transformers and GPT-2, even under 4-bit input and output quantization. We experimentally characterize the electro-optic response at symbol rates up to 10 GBaud and assess model robustness under corresponding noise conditions. Accounting for the full signal chain, our analysis indicates more than an order of magnitude lower latency relative to previous custom electronic and photonic Softmax implementations. These results establish analog electro-optic devices as nonlinear function units well suited for integration into emerging co-packaged electronic-photonic hardware, offering a path toward high-speed Transformer inference.

Figures & tables

Appendix figures & tables13 assets

Supplementary material from the paper’s appendix.

Appendix

Explore similar work

CardsList
  1. Compute-in-Memory Attention: A Time-Domain Analog Softmax Circuit with RC-Tunable Temperature

    Sep 2, 2026Ankur Singh, Ashish Gautam, Shruti R. Kulkarni +1Softmax AttentionAnalog Computing

  2. LEAF: LUT-aware Efficient Attention on FPGAs

    Oct 19, 2026Arianna Cox, Chang Sun, Lauri Laatu +7Efficient Transformer InferenceFPGA-Based Neural Network Acceleration

  3. MDTransformer: A Hardware-Software Co-Design of Mode-Division Photonic Transformer Accelerator with Inverse-Designed Coherent Crossbar

    Jul 28, 2026Solomon Micheal Serunjogi, Rachmad Vidya Wicaksana Putra, Ayat Taha +2Efficient Transformer InferencePhotonic Computing