Photonic Mixture-of-Experts for scalable multi-task on-chip optical neural networks Authors: Wencan Liu, Zhenghang Zhang, Peng Meng Chan, Run Sun, Yutong He, Yuhao Wang, Caihua Zhang, Sigang Yang, Tingzhao Fu, Yuyao Huang, Chaoran Huang, Hongwei Chen Published: 2026 ABSTRACT Photonic computing offers an energy-efficient, high-bandwidth platform for artificial intelligence (AI) but currently faces scalability bottlenecks stemming from depth-dependent designs, linear optical structures, and intrinsic optical losses, along with high hardware and reconfiguration costs for multi-task processing. Here, we present a scaling paradigm that circumvents these limitations by expanding network width rather than depth, leveraging the intrinsic parallelism of photonics. We implement a scalable Photonic Mixture-of-Experts (PMoE) architecture, where parallel photonic cores function as expert networks. By dynamically routing inputs to these experts, the PMoE efficiently executes multi-task workloads without altering the physical optical weights. We fabricated a PMoE chip integrating three collaborative diffraction-based expert networks, featuring 18 parallel kernels within a compact intrinsic computational-core footprint of 0.067 mm2. Experimentally, the PMoE chip achieves multi-domain image classification with an average accuracy of 97.1%. While offering further scalability, this approach outperforms conventional optical networks and reduces digital parameter overhead by 67%. Our work underscores the scalability and efficiency of the PMoE architecture for next-generation large-scale photonic AI processors. Introduction With the rapid advancement of artificial intelligence (AI), an increasing number of fields have undergone significant transformations due to the application of neural networks. In areas such as machine vision1, autonomous driving2, and natural language processing3, a large portion of information processing is now performed automatically by neural networks. The emergence of deep neural networks (DNNs)4,5 has led to a proliferation of network architectures tailored to various tasks, with their structures and scales continuously evolving. The advent of large-scale models further marks a significant leap in the capabilities of DNNs. In the evolution of neural networks, researchers have sought to expand models both in depth and width, resulting in a variety of specialized architectures such as Convolutional Neural Networks (CNNs)6, Recurrent Neural Networks (RNNs)7, Residual Network (ResNet)8, Transformer architecture9 and so on. To further enhance the scalability and efficiency of DNNs, the Mixture-of-Experts (MoE) architecture10–12 has emerged as a promising solution. By partitioning the system into multiple independent sub-networks that collaboratively process multi-task inputs, MoE significantly expands parameter capacity and adaptability through network width rather than depth. This go wider instead of deeper strategy has garnered widespread attention, and the MoE architecture has become a mainstream choice in the development of large language models13,14. However, traditional electronic computing platforms, which rely on the von Neumann architecture15,16, are increasingly facing bottlenecks in meeting the growing demands of AI computation. The fading of Moore’s Law, coupled with the inherent energy and bandwidth constraints of electronic processing, presents substantial obstacles to achieving the high parallelism and throughput required for modern AI. Optical computing architectures17–19 based on analog computing and neuromorphic photonics, particularly Optical Neural Networks (ONNs), have garnered increasing attention for their high-speed modulation exceeding 100 Gbaud, femtojoule-per-bit (fJ/bit) energy efficiency, and massive parallelism at the speed of light20–23. From free-space ONNs24,25 to integrated optical processors, optical computing is emerging as a compelling alternative to conventional electronic architectures. Notable innovations include interference-based techniques using Mach-Zehnder interferometers (MZIs)26–28, wavelength multiplexing with microrings29–31, and diffractive computing using subwavelength elements32–35. Despite the remarkable computational capabilities of optical computing platforms, photonic networks currently face significant scalability constraints, particularly when addressing various complex tasks. A primary challenge arises from depth-scaling bottlenecks: the linearity of optical structures, the escalating complexity of active component control, and the accumulation of transmission-induced errors and losses36–40. To circumvent these limitations while capitalizing on the intrinsic efficiency and parallelism of photonics, we introduce a parameter scaling and multi-task processing method. Drawing inspiration from the digital MoE, we propose a width-over-depth paradigm that adapts this architecture to the optical domain. Related efforts have also explored the combination of MoE with analog processors41. By routing diverse inputs into multiple photonic experts, this approach offers a robust pathway to circumvent the depth-scaling bottleneck and efficiently execute diverse multi-task workloads without reconfiguring physical weights. Although recent works have explored the synergy between optics and the MoE concept, ranging from free-space optical classifier ensembles42 and theoretical simulations of hybrid systems43 to deploying optical interconnects for electronic GPUs44, an experimentally validated on-chip photonic MoE computing architecture remains lacking. In this work, we propose a diffraction-based Photonic Mixture-of-Experts (PMoE) architecture. Distinct from other on-chip optical frameworks, passive diffractive neural networks leverage the spatial expansion of light to enable superior parallelism and computational density, rendering them intrinsically suited for wide architectural topologies45–48. Capitalizing on this advantage, we introduce a monolithic integration strategy that consolidates multiple parallel computing cores onto a single chip. By employing a task-specific routing mechanism, this architecture orchestrates the collaborative processing of photonic expert networks (PENs), where expert contributions are dynamically modulated based on the input task. Supported by a backend multi-task shared digital network (SDN), this hybrid approach enables high-efficiency parallel processing and synergistic expert coordination without incurring additional parameter overhead. To validate the PMoE architecture in handling complex multi-task workflows, we fabricated a PMoE processor on a silicon-on-insulator (SOI) platform, integrating three parallel multi-channel optical convolutional cores. Occupying a compact intrinsic computational-core footprint of 0.067 mm2, the chip features 18 parallel convolutional kernels allocated across three distinct image classification tasks. We experimentally evaluated the performance on the MNIST49, Fashion-MNIST50 and Extended-MNIST51 datasets. The PMoE chip achieved an average classification accuracy of 97.1%, surpassing conventional optical computing architectures, while reducing parameter overhead by 67%. Facilitating substantial width-wise scalability, the PMoE experimentally demonstrates efficient multi-task optical processing, while reaching a projected computational density of 45.7 TOPS/mm² under 10 GHz electro-optic modulation. This parallel on-chip framework paves the way for large-scale optical neural networks and next-generation photonic AI processors. Results Scalable multi-task processing with PMoE A fundamental MoE block is shown in Fig. 1a, where inputs are dynamically routed across multiple experts and shared processing modules. Adapting this paradigm, we designed the PMoE architecture to facilitate efficient parallel processing in the optical domain. It uses a small number of task-specific routing weights to coordinate multiple passive, pre-programmed optical expert networks. This decoupling between dynamic routing and static optical feature extraction increases the effective parameter capacity for multi-task processing without requiring active programming of optical weights during operation. The core of this architecture consists of multiple parallel, diffraction-based optical processing units integrated onto a single chip, each corresponding to a distinct and optimized PEN (Supplementary Note 1). The backend network comprises an SDN capable of supporting multiple tasks. Taking multi-domain image classification as an exemplar, the overall PMoE architecture is illustrated in Fig. 1b. During operation, light from an external laser is split into multiple paths and coupled into different PENs on the chip. The optical signals then propagate in parallel through the diffractive cores, and the resulting outputs are aggregated and processed by the unified backend network to generate the final computational results, as shown in Fig. 1c.Fig. 1Concept and architecture of the Photonic Mixture-of-Experts (PMoE).a Schematic of a standard Mixture-of-Experts (MoE) block, where inputs are dynamically routed to specific experts and shared processing units to scale network capacity. b Conceptual rendering of the proposed on-chip PMoE architecture. The diffraction-based experts process optical signals in parallel, with outputs aggregated and processed by a backend network. SOI, silicon-on-insulator. c Detailed data processing workflow of the PMoE system. Multi-domain datasets are flattened, mapped, and encoded via amplitude modulation into the optical domain. The signals are processed by task-specific photonic expert networks (PENs). The resulting features are subsequently processed by a shared digital network (SDN) to achieve multi-domain classification. LD laser diode, PC polarization controller. Concept and architecture of the Photonic Mixture-of-Experts (PMoE). a Schematic of a standard Mixture-of-Experts (MoE) block, where inputs are dynamically routed to specific experts and shared processing units to scale network capacity. b Conceptual rendering of the proposed on-chip PMoE architecture. The diffraction-based experts process optical signals in parallel, with outputs aggregated and processed by a backend network. SOI, silicon-on-insulator. c Detailed data processing workflow of the PMoE system. Multi-domain datasets are flattened, mapped, and encoded via amplitude modulation into the optical domain. The signals are processed by task-specific photonic expert networks (PENs). The resulting features are subsequently processed by a shared digital network (SDN) to achieve multi-domain classification. LD laser diode, PC polarization controller. As a hybrid opto-electronic architecture designed for efficient parallel processing. The PMoE comprises a passive photonic front-end composed of diffractive experts and a digital backend. The overall framework adheres to the MoE principle11,12, where the system’s output for a given input x is determined by a combination of expert outputs, expressed as Eq. (1):1\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${{\mbox{PMoE}}}(x)={\sum }_{i=1}^{E}g(x)_{i}\cdot {e}_{i}(x)$$\end{document}PMoE(x)=∑i=1Eg(x)i⋅ei(x)where \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$E$$\end{document}E is the number of PENs, \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${e}_{i}(x)$$\end{document}ei(x) represents the outputs of the i-th PEN, and \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$g(x)_{i}$$\end{document}g(x)i is the pretrained task-specific routing weight for the i-th PEN (hard-routing if \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$g(x)_{i}$$\end{document}g(x)i = 0 or 1). To facilitate subsequent processing, outputs from the different PENs of the PMoE are merged and fed into an unified backend SDN. The SDN includes a shared convolutional block and a shared fully connected (FC) layer, which are optimized for multi-task processing while minimizing the digital parameter count and maintaining high classification accuracy. The final classification stage uses multiple output layers, each tasked with outputting predictions for the respective input. The training methodology employs an end-to-end approach. The total loss is the balanced average of the individual task losses. Each individual task loss is defined by the standard cross-entropy criterion. The total loss \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${L}_{{\mbox{total}}}$$\end{document}Ltotal for a training step is given by Eq. (2):2\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${L}_{{\mbox{total}}}=\frac{1}{{N}_{{\mbox{tasks}}}}{\sum }_{i=1}^{{N}_{{\mbox{tasks}}}}-{w}_{i}\cdot {\log \left(\frac{{e}^{{z}_{c}}}{{\sum }_{j=1}^{C}{e}^{{z}_{j}}}\right)}_{i}$$\end{document}Ltotal=1Ntasks∑i=1Ntasks−wi⋅logezc∑j=1Cezjiwhere \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${z}_{c}$$\end{document}zc is the model’s raw output score for the correct class \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$c$$\end{document}c, and \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$C$$\end{document}C is the total number of classes for the task. \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${N}_{{\mbox{tasks}}}$$\end{document}Ntasks is the number of tasks, and \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${w}_{i}$$\end{document}wi is the coefficient for the i-th task, which is a compensation parameter for imbalanced datasets. In this way, the PMoE architecture combines task-adaptive routing, parallel on-chip diffractive processing, and unified backend inference within a single computational framework. This width-expanded design increases the effective network capacity without relying on task-specific physical reconfiguration, offering a scalable and parameter-efficient strategy for multi-task on-chip optical computing. PMoE chip with diffraction-based multi-core integration To validate the proposed architecture, we fabricated a fully integrated PMoE chip with three diffractive PENs. As shown in the micrograph and scanning electron microscopy images in Fig. 2a, 2b, the device monolithically integrates three parallel PENs designed for multi-task processing. A 1550 nm continuous-wave laser serves as the optical source. Within each PEN, light is distributed evenly across 9 input waveguides via a two-stage 1 × 3 multimode interference (MMI) splitter. The core computation is performed by two consecutive layers of diffractive neurons, implemented as sub-wavelength SiO2 metalines optimized for phase modulation. To accommodate diverse task requirements, the three integrated PENs are configured with 4, 6, and 8 output ports, respectively.Fig. 2Fabrication and experimental validation of the on-chip Photonic Mixture-of-Experts (PMoE).a Microscope image of the fabricated PMoE chip and key integrated components. PEN, photonic expert network; MMI, multimode interferometer. b Scanning electron microscopy images of the diffractive core and metalines. c Characterization of the on-chip thermo-optic modulator. d Transmittance variation of incident plane light as a function of slot length and width. e Transmittance and the phase shift of the input light vary with the slot length. f Photograph of the packaged PMoE chip. PCB, printed circuit board; FA, fiber array. g Comparison between the experimental and the simulated feature maps. SSIM, structural similarity index measure; PSNR, peak signal-to-noise ratio; MSE, mean squared error. h Scatter plot comparing the simulated and experimental results. The inset is the error distribution histogram. RMSE, root mean squared error. Fabrication and experimental validation of the on-chip Photonic Mixture-of-Experts (PMoE). a Microscope image of the fabricated PMoE chip and key integrated components. PEN, photonic expert network; MMI, multimode interferometer. b Scanning electron microscopy images of the diffractive core and metalines. c Characterization of the on-chip thermo-optic modulator. d Transmittance variation of incident plane light as a function of slot length and width. e Transmittance and the phase shift of the input light vary with the slot length. f Photograph of the packaged PMoE chip. PCB, printed circuit board; FA, fiber array. g Comparison between the experimental and the simulated feature maps. SSIM, structural similarity index measure; PSNR, peak signal-to-noise ratio; MSE, mean squared error. h Scatter plot comparing the simulated and experimental results. The inset is the error distribution histogram. RMSE, root mean squared error. Data encoding is achieved via on-chip thermo-optic modulation. Input image patches (3×3 pixels) are flattened into 1×9 vectors and mapped to optical amplitudes according to the calibrated response curve of the MZIs (Fig. 2c). The modulated signals propagate through the diffractive hidden layers, and the computational results are read out in parallel from spatially distinct ports on the output facet. The fundamental design of the diffractive neurons was optimized to ensure full phase control. Figure 2d illustrates the simulated transmittance variation of incident plane waves as a function of metaline slot dimensions. By fixing the slot width at 200 nm, we observed a smooth dependency of transmittance and phase shift on slot length (Fig. 2e). A slot length of 1.788 μm was identified to achieve full 0–2π phase modulation with high transmission efficiency, serving as the design basis for the diffractive layers. For experimental validation, we performed optoelectronic packaging of the PMoE chip for multi-task processing, as shown in Fig. 2f. To quantify the hardware fidelity, we evaluated the discrepancy between experimental measurements and numerical simulations using the Set12 image-processing dataset. Figure 2g presents a comparative analysis for the 8-channel PEN of the fabricated PMoE, revealing a high degree of consistency between the experimental feature maps (FMs) and simulated outputs. The system achieved an average Structural Similarity Index (SSIM) of 0.923 and a Mean Squared Error (MSE) of 0.0018, indicating a high degree of similarity (Supplementary Note 4). Furthermore, the scatter plot in Fig. 2h confirms the linear correlation between simulated and measured values, with a Root Mean Square Error (RMSE) of 0.042. Although minor errors exist, the structural features are well preserved, and the final classification performance remains stable. Experiment on the multi-task datasets with hard routing Based on the processing of different image inputs by the PENs within the PMoE architecture, we connected an SDN at the backend of the PMoE chip to conduct classification experiments on the multi-domain image datasets including MNIST, Fashion-MNIST and Extended-MNIST. We began by characterizing the fundamental performance of the sparse PMoE architecture using a hard-routing strategy. In this configuration, each specific task is deterministically assigned to a single corresponding PEN to maximize routing efficiency52. Through this task-specific routing, different PENs were enabled during the experiment according to the target domain, and the corresponding optical outputs were directed to the backend digital network for further processing. A simplified diagram of the overall sparse PMoE system is shown in Fig. 3a, which consists of three parallel PENs and a backend SDN. This sparse configuration enables efficient and scalable multi-domain data processing. Figure 3b shows the experimentally measured optical output waveforms and reconstructed FMs from the three parallel PENs processing respective multi-domain images.Fig. 3Experimental validation of sparse Photonic Mixture-of-Experts (PMoE) with hard-routing strategy.a Simplified diagram of the overall PMoE experimental system. FC, fully-connected; PEN, photonic expert network; SDN, shared digital network. b Optical power and reconstructed results of the first output channel of each PEN over-sampling. c Curve of the number of output channels in the PEN and multi-domain dataset classification accuracy. The shaded regions indicate the accuracy ranges. d Curve of the number of neurons in the FC layer with average accuracy of multi-domain classification and digital parameters. The shaded region indicates the accuracy range. e Experimental performance benchmarking comparison between the PMoE architecture and a baseline digital convolutional neural network (CNN). f–h Experimental confusion matrices for the three domains on the test set. The diagonal entries are above 0.9 for Extended-MNIST; the off-diagonal entries are below 0.1 for MNIST and Extended-MNIST, 0.15 for Fashion-MNIST. Experimental validation of sparse Photonic Mixture-of-Experts (PMoE) with hard-routing strategy. a Simplified diagram of the overall PMoE experimental system. FC, fully-connected; PEN, photonic expert network; SDN, shared digital network. b Optical power and reconstructed results of the first output channel of each PEN over-sampling. c Curve of the number of output channels in the PEN and multi-domain dataset classification accuracy. The shaded regions indicate the accuracy ranges. d Curve of the number of neurons in the FC layer with average accuracy of multi-domain classification and digital parameters. The shaded region indicates the accuracy range. e Experimental performance benchmarking comparison between the PMoE architecture and a baseline digital convolutional neural network (CNN). f–h Experimental confusion matrices for the three domains on the test set. The diagonal entries are above 0.9 for Extended-MNIST; the off-diagonal entries are below 0.1 for MNIST and Extended-MNIST, 0.15 for Fashion-MNIST. In selecting parameters for the PMoE network, we adopted a 3 × 3 patch size (commonly used in classical image processing) as the input for each PEN, as described in the previous section. Another critical parameter involves determining the number of output channels (each equal to a convolutional kernel) required by PENs to handle different domains. As shown in Fig. 3c, we used the classification accuracy achieved when each domain was processed by a single network independently as a criterion for selecting the number of channels. The results indicate that as the number of output channels in the diffraction-based processing core increases, the classification accuracy improves and eventually plateaus beyond a certain threshold. Taking into account hardware cost, power consumption, and classification performance, we selected 4, 6 and 8 output channels for the three PENs, respectively, to best match the demands of the multi-domain image workload. In addition, for the backend digital network, we optimized the FC layer parameters to enhance performance. As shown in Fig. 3d, increasing the number of neurons in the FC layer leads to a linear growth in the total number of parameters, while also improving overall classification accuracy. Following the same selection principle as above, we chose 128 neurons for the FC hidden layer as a balanced configuration. After finalizing the overall architecture of the PMoE network, we conducted experimental validation of the sparse multi-task processing capability. The selected datasets were used to validate the PMoE architecture in a controlled multi-domain hardware setting, where distinct domains with different data distributions can be processed within a unified chip framework. During the experiment, the PMoE performed data loading and processing across domains. Figure 3e shows the performance benchmarking comparison between the hard-routing PMoE architecture and a baseline digital CNN with the same backend network structure. Under this controlled setting, this sparse PMoE experimentally achieved a superior average accuracy of 94.8%, compared with 79.1% for the auxiliary digital counterpart. Figure 3f–h present the confusion matrices and accuracy for each domain on the test set. These experimental results highlight the proposed PMoE’s capability for efficient multi-task processing and its scalability potential for optical parallel computing. Experiment on collaborative processing with weighted routing Building upon the hard-routing baseline, we extended our experiment to a weighted-routing paradigm to further demonstrate the dense PMoE processing. We utilized the identical multi-domain datasets employed in the previous phase. In contrast to the exclusive assignment in hard routing, this weighted strategy simultaneously recruits multiple PENs to process a single computational task. The signal of each image sample is modulated and routed in parallel to the multiple PENs under the weighted-routing strategy. During the signal modulation, distinct task-specific pretrained weight coefficients are applied across the experts. This task-specific weighted routing is implemented by adjusting the input optical power levels with a parallel voltage divider. This configuration directly scales the driving voltages of the on-chip thermo-optic modulators, thereby adjusting the input optical power delivered to each expert. Notably, switching between distinct tasks requires only the reconfiguration of task-specific input routing weights, while the diffraction-based PENs and the backend SDN remain unchanged. In this way, the PMoE chip can dynamically allocate parallel optical experts to different tasks, enabling flexible multi-task processing, as illustrated in Fig. 4a.Fig. 4Experimental validation of dense Photonic Mixture-of-Experts (PMoE) with weighted-routing strategy.a Schematic framework of the weighted-routing strategy. b The weighted inputs and output feature maps with different photonic expert networks (PENs) for multi-domain datasets. FM, feature map. c The experimental FMs for the three tasks after weighted aggregation. d-f, Experimental confusion matrices for the three domains on the test set. The diagonal entries are above 0.9 for Extended-MNIST; the off-diagonal entries are below 0.1 for the three datasets. g Experimental training curves for accuracy and loss across the three domains, with an average accuracy of 97.1%. h Performance benchmarking comparing conventional separate optical neural networks (ONNs), hard-routing sparse PMoE, and weighted-routing dense PMoE. i Comparison of PMoE with different routing strategies and conventional ONNs. The PMoE architecture maintains superior accuracy while reducing the required digital parameters by approximately 67%. Experimental validation of dense Photonic Mixture-of-Experts (PMoE) with weighted-routing strategy. a Schematic framework of the weighted-routing strategy. b The weighted inputs and output feature maps with different photonic expert networks (PENs) for multi-domain datasets. FM, feature map. c The experimental FMs for the three tasks after weighted aggregation. d-f, Experimental confusion matrices for the three domains on the test set. The diagonal entries are above 0.9 for Extended-MNIST; the off-diagonal entries are below 0.1 for the three datasets. g Experimental training curves for accuracy and loss across the three domains, with an average accuracy of 97.1%. h Performance benchmarking comparing conventional separate optical neural networks (ONNs), hard-routing sparse PMoE, and weighted-routing dense PMoE. i Comparison of PMoE with different routing strategies and conventional ONNs. The PMoE architecture maintains superior accuracy while reducing the required digital parameters by approximately 67%. Figure 4b illustrates the experimental outputs from distinct PENs processing the three multi-domain datasets, governed by task-specific routing weights. Before entering the SDN, these optical outputs undergo summation and normalization, followed by channel unification to a fixed 8-channel format via a static 1×1 convolutional layer. Figure 4c presents representative normalized FMs obtained after this weighted multi-expert channel-wise aggregation (Supplementary Note 5), exemplifying the fused processing outcomes across diverse task scenarios. Quantitative evaluations are detailed in Fig. 4d–f, which display the confusion matrices and corresponding testing accuracies for MNIST, Fashion-MNIST, and Extended-MNIST under the weighted-routing strategy. The training dynamics, including accuracy and loss trajectories, are depicted in Fig. 4g. As highlighted in Fig. 4h, the weighted-routing dense PMoE architecture yields significant accuracy improvements across all datasets compared to conventional ONNs designed for discrete processing. By engaging multiple experts through weighted fusion, this strategy further expands the effective network scale and parallelism for each task, outperforming the hard-routing sparse PMoE baseline. Furthermore, by increasing the number of simultaneously activated experts from a single PEN (hard-routing) to multiple PENs (weighted-routing), the performance can be improved through collaborative expert processing without increasing the digital parameter overhead, as shown in Fig. 4i. Notably, this performance gain with increasing expert number is also supported by an additional numerical study on the more complex CIFAR-10 dataset, where the classification accuracy improves as more experts are introduced (Supplementary Note 7). These experimental results further support that PMoE offers a scalable and efficient paradigm for multi-task on-chip optical neural networks. Discussion For a rigorous ablation, we compared the PMoE against multiple optical and electronic baselines under the same multi-domain image classification settings, with comparable network scale and similar architectural constraints (Supplementary Note 8). Figure 5a shows the controlled comparison curves between PMoE and other platforms in terms of average classification accuracy and the number of parameters in the electronic network. Compared with separate electronic or optical task-specific networks on the same multi-domain datasets, PMoE achieved higher accuracy while reducing the number of network parameters by ~67%. Compared to an electronic CNN-based MoE counterpart with the same overall design principle, the PMoE achieves a ~ 6% improvement in average accuracy. These ablation results further support that the proposed PMoE architecture effectively leverages optical parallelism while maintaining strong multi-domain accuracy and parameter efficiency.Fig. 5Comparison of multi-task and on-chip computing platforms.a Experimental comparison between Photonic Mixture-of-Experts (PMoE) and other multi-task platforms. PMoE reduces the digital parameter count by ~67% compared with conventional separate optical neural networks (ONNs) and improves the average accuracy by ~6% compared with an electronic convolutional neural network (CNN)-based MoE with similar architecture design. b Comparison of PMoE with other on-chip computing platforms in terms of integration density (number of computational cores integrated per unit area) and equivalent parallel kernels53–59. The NVIDIA H100 estimation is based on a single streaming multiprocessor with 128 equivalent kernels. MMI multimode interferometer, PS phase shifter, MRR microring resonator, DL delay line, TWI time-wavelength interleaving, WDM wavelength-division multiplexing, PCM phase-change material. Comparison of multi-task and on-chip computing platforms. a Experimental comparison between Photonic Mixture-of-Experts (PMoE) and other multi-task platforms. PMoE reduces the digital parameter count by ~67% compared with conventional separate optical neural networks (ONNs) and improves the average accuracy by ~6% compared with an electronic convolutional neural network (CNN)-based MoE with similar architecture design. b Comparison of PMoE with other on-chip computing platforms in terms of integration density (number of computational cores integrated per unit area) and equivalent parallel kernels53–59. The NVIDIA H100 estimation is based on a single streaming multiprocessor with 128 equivalent kernels. MMI multimode interferometer, PS phase shifter, MRR microring resonator, DL delay line, TWI time-wavelength interleaving, WDM wavelength-division multiplexing, PCM phase-change material. To provide a normalized architectural comparison across different optical computing platforms, we evaluate the compared computing cores under a common matrix-vector multiplication (MVM) abstraction. At the input-output port level, these linear computing cores can be represented as an equivalent weight matrix. Under this abstraction, the integration density (/mm²) and the number of parallel kernels serve as crucial metrics for evaluating the physical parameter density and parameter scalability. As shown in Fig. 5b, these on-chip parallel kernels are derived through the equivalent mathematical decomposition of the global optical weight matrix into localized spatial convolutions. These results support the feasibility of the MoE-based width-scaling strategy for improving structural parameter capacity and network scalability in optical systems. Crucially, this MoE-driven width-over-depth strategy is compatible with passive diffractive experts, which provide high-density pre-programmed optical weights without requiring individual active control during inference. Although these diffractive weights are not dynamically reprogrammable after fabrication, coordinating multiple fixed experts through lightweight routing provides a practical route to increase the effective parameter capacity for multi-task optical inference. With advanced routing and weighting mechanisms, this broader width-over-depth design and scaling principle may also inform other optical computing architectures beyond diffractive systems. While the width-over-depth scaling paradigm offers significant advantages in mitigating the limitations of deep optical neural networks, width scaling via optical splitting faces its own physical constraints. Assuming a typical on-chip laser input power of 15 dBm, a photodetector sensitivity threshold of −20 dBm, and an estimated total loss of 15 dB per expert subnetwork, the remaining optical power budget available for splitting is 20 dB. Under an equal-power splitting condition, the allowable number of concurrently active optical experts is on the order of 100. Because the MoE architecture relies on sparse task-specific routing rather than activating all subnetworks simultaneously, the total number of physical experts integrated on the chip can exceed this concurrent-activation estimate. Future implementations can further extend this scaling range by adopting advanced dynamic optical routing mechanisms, such as modulate-then-split configurations using tunable optical splitters or the integration of highly efficient optical switch arrays. These routing schemes, coupled with sparsity-aware network algorithms, can further improve the scalability of the PMoE architecture. In the experimental demonstration, we utilized on-chip thermo-optic modulation for signal loading at up to 10 kHz, corresponding to an experimental computational capacity of 3.06 MOPS and a unit computational capacity of 45.7 MOPS/mm2 based on the 0.067 mm2 computational-core area. For high-speed implementation, the projected computational capacity of PMoE would reach 3.06 TOPS, with a unit computational capacity of 45.7 TOPS/mm2 under 10 GHz electro-optic modulation (Supplementary Note 9). Including the full transmit/receive chain in the system model, the power consumption for PMoE can be estimated as 4.94 W, resulting in 9.27 TOPS/W/mm2 under the same computational-core area (Supplementary Table 1). We further evaluated the PMoE architecture under high-speed degradation conditions. The average classification accuracy decreases only slightly from 97.1% to 96.8% under the 10 GHz matched condition (Supplementary Fig. 5), providing preliminary support for high-speed electro-optic implementations. We compare the computational density and energy efficiency of PMoE with that of other state-of-the-art on-chip computing architectures in Supplementary Table 2, emphasizing the significant enhancement in computational capacity achieved through the width expansion of PMoE. In conclusion, we present a multi-core monolithic PMoE architecture designed to enable scalable optical multi-task processing. By expanding parallelism in width rather than depth, PMoE significantly enhances the scalability of on-chip optical systems. Through efficient routing algorithm, this architecture enables multiple tasks to be processed within a unified optical chip while avoiding multiple separate task-specific processors and reducing backend digital parameter overhead. Leveraging the high computational density of diffractive optical computing, we successfully integrated 18 parallel optical convolutional kernels within a compact 0.067 mm² footprint, demonstrating the potential of the architecture for efficient heterogeneous task processing. Experimental results show that the PMoE system supports distinct image classification tasks within a single chip framework, achieving an average accuracy of 97.1%. Under the controlled multi-task benchmark, the PMoE achieves higher accuracy than independent electronic or conventional photonic baselines while reducing the backend digital parameter count by 67%. The PMoE architecture provides a scalable width-expansion strategy for on-chip optical computing, offering a practical route toward multi-task and massively parallel photonic AI processors. Methods Modeling and fabrication of the PMoE chip The modeling of the diffractive core of the PMoE chip comprises two main components46,53: the diffractive propagation matrices in a slab waveguide and the phase-only modulation in metalines. First, when the light enters the slab waveguide, the diffractive propagation process between adjacent layers of the diffractive core can be described by Eq. (3):3\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$a(m,n)=\frac{1}{j\lambda }\cdot \left(\frac{1+\cos \theta }{2r}\right)\cdot \exp \left(\,\,j\frac{2\pi r{n}_{{{\rm{slab}}}}}{\lambda }\right)\cdot \gamma \exp (\,\,j\Delta \phi )$$\end{document}a(m,n)=1jλ⋅1+cosθ2r⋅expj2πrnslabλ⋅γexp(jΔϕ)where \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$m$$\end{document}m represents the point on the chip located at \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$({x}_{m},{y}_{m})$$\end{document}(xm,ym), \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$n$$\end{document}n represents the point on the chip located at \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$({x}_{n},{y}_{n})$$\end{document}(xn,yn), \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\lambda$$\end{document}λ is the working wavelength, \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${n}_{{slab}}$$\end{document}nslab is the effective refractive index (ERI) of the slab waveguide, \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\cos \theta=({x}_{n}-{x}_{m})/r$$\end{document}cosθ=(xn−xm)/r, \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$r=\sqrt{{({x}_{n}-{x}_{m})}^{2}+{(\,{y}_{n}-{y}_{m})}^{2}}$$\end{document}r=(xn−xm)2+(yn−ym)2 is the distance between point \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$m$$\end{document}m and point \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$n$$\end{document}n on the chip, \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\gamma$$\end{document}γ is a specific coefficient of the amplitude and \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\Delta \phi$$\end{document}Δϕ is a fixed phase delay for the classical Huygens-Fresnel principle when light propagates a certain distance in a slab waveguide. Second, the main part of the modulation of each diffractive core in the PMoE can be expressed as a diagonal matrix \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${{{\bf{T}}}}^{(l)}$$\end{document}T(l), where \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\Delta {\phi }_{v}^{(l)}$$\end{document}Δϕv(l) is the phase shift induced by the v-th photonic neuron of the l-th metaline layer, as shown in Eq. (4):4\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${{{\bf{T}}}}^{(1)}=\left[\begin{array}{cccc}\exp (j\Delta {\phi }_{1}^{(l)}) & 0 & \cdots & 0\\ 0 & \exp (j\Delta {\phi }_{2}^{(l)}) & \cdots & 0\\ \vdots & \vdots & \ddots & \vdots \\ 0 & 0 & \cdots & \exp (j\Delta {\phi }_{n}^{(l)})\end{array}\right]$$\end{document}T(1)=exp(jΔϕ1(l))0⋯00exp(jΔϕ2(l))⋯0⋮⋮⋱⋮00⋯exp(jΔϕn(l)) With \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${n}_{1}$$\end{document}n1 and \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${n}_{2}$$\end{document}n2 representing the refractive index of silicon (Si) slab and silica (SiO2) slots, the phase shift is introduced by varying the length \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$w$$\end{document}w of each photonic neuron (while keeping its width and height fixed), described by Eq. (5):5\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\Delta {\phi }_{n}^{(l)}=\frac{2\pi }{\lambda }\cdot ({n}_{1}-{n}_{2})\cdot {w}_{n}^{(l)}$$\end{document}Δϕn(l)=2πλ⋅(n1−n2)⋅wn(l) The PMoE chip is fabricated on a SOI platform with a 220 nm top Silayer and a 3 μm dioxide layer, using electron beam lithography (EBL). The subwavelength metalines are created by etching the Si film, followed by the deposition of a 2 μm thick SiO2 upper cladding. A thin layer of titanium nitride (TiN) is deposited as heaters, while aluminum (Al) metal lines are patterned to electrically connect the electrodes and heaters. Grating couplers (GCs) with a 127 μm pitch are employed to fan-in and fan-out optical signals between the PMoE chip and the fiber array (FA). Finally, the electrode pads on the PMoE chip are wire-bonded to a double-layered PCB board for data loading. In the diffractive core, two consecutive sub-wavelength SiO2 metalines, spaced 100 μm apart, modulate the phase response of the light in the slab Si waveguide, serving as the optical information processing unit. Each metaline consists of 50 photonic neurons, with each neuron made up of three identical SiO2 slots. The slot width is 200 nm, the center-to-center spacing between adjacent slots is 500 nm, and the neuron period is 1.5 μm, resulting in a total metal line length of 74.7 μm. PMoE training and simulation The training of the PMoE system follows a standard iterative optimization paradigm performed offline on a digital workstation. During this phase, both the optical diffraction parameters and the electronic backend weights are jointly optimized via backpropagation using the full dataset. To ensure that the optimization process was not biased by the different dataset sizes across domains, we constructed a balanced multi-task training protocol. Specifically, 2000 images were selected from each of the MNIST and Fashion-MNIST datasets, while 5200 images were selected from the Extended-MNIST dataset. Each dataset was split into training and testing subsets with a 4:1 ratio. During training, weighted batch sizes (10: 10: 26) were used to equalize the number of iterations contributed by each domain within one epoch. The standard cameraman test image from the Set12 image-processing dataset was used only for the feature map comparison. For the back-end shared network, outputs from different PENs are standardized to a uniform 8-channel dimension before shared feature extraction. Specifically, the hard-routing PMoE uses task-specific normalization followed by zero-padding to 8 channels, whereas the weighted-routing PMoE uses a 1 × 1 convolution to project the unified multi-PEN representation to 8 channels. The standardized feature maps are then fed into a shared convolutional block, which includes Dropout (p = 0.2), a Conv2d layer expanding features to 16 channels, BatchNorm2d, a ReLU activation, and MaxPool2d for downsampling. Post-convolution, a shared FC layer with a 128-dimensional latent space, selected through ablation studies, performs higher-level feature extraction using ReLU activation and Dropout (p = 0.5). The final classification stage uses three task-specific linear layers. The PMoE training follows a standard iterative optimization paradigm. During this phase, the network weights are optimized via backpropagation algorithm. Both hard-routing and weighted-routing PMoE models are trained for 300 epochs using the AdamW optimizer with a learning rate of 8 × 10−5 and a weight decay of 1 × 10−4. To ensure stable convergence, a Cosine Annealing learning rate scheduler is employed. Model weights are initialized using the Kaiming Normal and Xavier Uniform methods for convolutional and linear layers, respectively, while gradient clipping is applied during the backward pass to maintain training stability. This computationally intensive training is a one-off process. Once the network is converged and the chip is fabricated, the intrinsic parameters of the core diffractive optical and backend digital network are fixed during inference. The deployed PMoE chip subsequently executes inference tasks without incurring further training energy costs or delays. The training of the on-chip PMoE and backend SDN are facilitated with PyTorch 1.8.0, CUDA 11.2 and Keras 2.0 deep learning frameworks. The pretrained structures of the PENs are further evaluated using the Lumerical Finite-Difference Time-Domain (FDTD) algorithm with a mesh accuracy of 4. After fabrication, experimentally measured PEN outputs can be used to calibrate or fine-tune the digital backend to compensate for hardware nonidealities, while the optical parameters remain fixed. All training and simulations are performed on an Intel Core 7-265 K CPU and an NVIDIA GeForce RTX 4090 GPU. Experimental setup Based on the packaged PMoE chip, we calibrated its performance and conducted experimental verification for multi-task processing. A tunable laser (IDPhotonics Cobrite) generates a 1550 nm wavelength laser with a power of 15 dBm, which is equally split to three channels and grating-coupled into the PMoE chip through three polarization controllers (PCs) and a fiber array (FA). A custom-made multi-channel programmable arbitrary waveform generator (AWG) produces synchronous square wave signals. The task-specific weighted routing is implemented by adjusting the input optical power levels with a parallel voltage divider, which are applied to one arm of the MZI modulator in the PMoE chip via metal wire leads. After the computation, the optical signal is grating-coupled out of the chip via the FA and is received by a programmable multi-channel photodetector (MCPD, Keysight N7745C). A thermoelectric cooler (TEC, Arroyo Instruments 5305TECSource) provides feedback by monitoring changes in the thermistor resistance in the PMoE module, applying the corresponding power to the temperature control chip in the PMoE module to stabilize the temperature of the PMoE chip at 24.00 °C. A custom Python-based control program is used to control the PMoE and all other external devices. The basic setup and photograph of the experimental system are shown in Supplementary Fig. 9. Supplementary information Supplementary Information Transparent Peer Review file Supplementary Information Transparent Peer Review file