Skip to main content
QUICK REVIEW

[Paper Review] Optical Transformers

Maxwell G. Anderson, Shi-Yuan Ma|arXiv (Cornell University)|Feb 20, 2023
Neural Networks and Reservoir ComputingComputer Science6 citations
TL;DR

This paper proposes optical transformers—neural network accelerators using optical matrix-vector multiplication to achieve dramatically higher energy efficiency than digital systems. By demonstrating accurate inference on a prototype optical hardware system and simulating large-scale models, the authors show that optical systems scale with a 1/d energy-per-MAC advantage, enabling up to 8,000× better efficiency than state-of-the-art digital processors for trillion-parameter models.

ABSTRACT

The rapidly increasing size of deep-learning models has caused renewed and growing interest in alternatives to digital computers to dramatically reduce the energy cost of running state-of-the-art neural networks. Optical matrix-vector multipliers are best suited to performing computations with very large operands, which suggests that large Transformer models could be a good target for optical computing. To test this idea, we performed small-scale optical experiments with a prototype accelerator to demonstrate that Transformer operations can run on optical hardware despite noise and errors. Using simulations, validated by our experiments, we then explored the energy efficiency of optical implementations of Transformers and identified scaling laws for model performance with respect to optical energy usage. We found that the optical energy per multiply-accumulate (MAC) scales as $\frac{1}{d}$ where $d$ is the Transformer width, an asymptotic advantage over digital systems. We conclude that with well-engineered, large-scale optical hardware, it may be possible to achieve a $100 imes$ energy-efficiency advantage for running some of the largest current Transformer models, and that if both the models and the optical hardware are scaled to the quadrillion-parameter regime, optical computers could have a $>8,000 imes$ energy-efficiency advantage over state-of-the-art digital-electronic processors that achieve 300 fJ/MAC. We analyzed how these results motivate and inform the construction of future optical accelerators along with optics-amenable deep-learning approaches. With assumptions about future improvements to electronics and Transformer quantization techniques (5$ imes$ cheaper memory access, double the digital--analog conversion efficiency, and 4-bit precision), we estimated that optical computers' advantage against current 300-fJ/MAC digital processors could grow to $>100,000 imes$.

Motivation & Objective

  • Address the growing energy cost of training and inferring large-scale deep learning models, especially Transformers.
  • Explore whether optical computing can provide a scalable, energy-efficient alternative to digital electronic processors for large Transformer models.
  • Demonstrate that optical hardware can perform Transformer operations accurately despite noise and errors.
  • Establish scaling laws for optical energy efficiency and model performance across different model sizes and optical energy budgets.
  • Inform the design of future optical accelerators and optics-amenable deep learning architectures based on empirical and simulated results.

Proposed method

  • Conducted small-scale optical experiments using a spatial light modulator (SLM)-based prototype to perform matrix-vector multiplication operations representative of Transformer inference.
  • Collected real-world noise, error, and imprecision data from the optical hardware to calibrate a high-fidelity simulation of a full optical Transformer.
  • Simulated optical Transformer inference with systematic errors, noise, and weight/input imprecisions derived from experimental measurements.
  • Modeled the total energy consumption of an optical neural network (ONN) accelerator, including optical energy per MAC, memory access, and digital-to-analog conversion overhead.
  • Evaluated scaling laws for energy efficiency as a function of model width (d) and total optical energy usage, showing 1/d scaling of optical energy per MAC.
  • Projected performance and energy advantages under various assumptions, including improved electronics, memory access, and 4-bit quantization.
Figure 1: General scheme of an optical neural network (ONN) accelerator. Data is encoded and fed into the network, and the output is subject to shot noise. There are many experimental realizations of ONN accelerators such as Mach-Zehnder Interferometer meshes (Shen et al., 2017 ; Bogaerts et al., 20
Figure 1: General scheme of an optical neural network (ONN) accelerator. Data is encoded and fed into the network, and the output is subject to shot noise. There are many experimental realizations of ONN accelerators such as Mach-Zehnder Interferometer meshes (Shen et al., 2017 ; Bogaerts et al., 20

Experimental results

Research questions

  • RQ1Can optical hardware accurately perform the linear operations required by Transformers despite inherent noise and errors?
  • RQ2How does the energy efficiency of optical Transformers scale with model size and optical energy usage?
  • RQ3What is the theoretical and practical energy efficiency advantage of optical over digital processors for large-scale Transformer inference?
  • RQ4How do training and quantization schemes affect photon usage and performance in optical Transformers?
  • RQ5What are the key design trade-offs and scaling limits for future optical accelerators targeting trillion-parameter models?

Key findings

  • Optical matrix-vector multiplication can be performed with high accuracy on real hardware, even in the presence of noise and errors, as validated by experiments and simulations.
  • The optical energy per multiply-accumulate (MAC) operation scales as 1/d, where d is the model width, providing an asymptotic energy advantage over digital systems with constant per-MAC energy.
  • For current large-scale Transformers (e.g., 175B parameter models), optical systems could achieve a 100× energy-efficiency advantage over state-of-the-art digital processors (300 fJ/MAC).
  • With both models and optical hardware scaled to the quadrillion-parameter regime, optical systems could achieve over 8,000× energy-efficiency advantage over digital processors.
  • Under optimistic assumptions (5× cheaper memory access, doubled digital-analog conversion efficiency, 4-bit quantization), the energy advantage could exceed 100,000×.
  • Photon usage for maintaining 8-bit digital model performance scales sub-linearly with model size, but efficiency is highly sensitive to weight and activation statistics, which are influenced by quantization and training schemes.
Figure 2: Optical Transformer evaluation: prototype hardware; simulator model; Transformer architecture. Bottom: typical Transformer architecture, but with ReLU6 activation. Top Left: experimental spatial light modulator (SLM)-based accelerator setup. From some layers—marked with a laser icon—we sam
Figure 2: Optical Transformer evaluation: prototype hardware; simulator model; Transformer architecture. Bottom: typical Transformer architecture, but with ReLU6 activation. Top Left: experimental spatial light modulator (SLM)-based accelerator setup. From some layers—marked with a laser icon—we sam

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.