RIGEL: Real-time Optical Anomaly Diagnosis with Stateful In-Network Inference based on Distributed On-switch GNNs Zhen Wei, Yidong Wang, Yufan Zhu, Xuefeng Yan, Binjun Tang, Xiaoliang Chen, and Zuqing Zhu School of Information Science and Technology, University of Science and Technology of China, Hefei, China Email: [email protected]
arXiv:2607.29306v1 [cs.NI] 31 Jul 2026
Abstract The recent booming of data-intensive applications has complicated optical network management, making real-time optical anomaly diagnosis a must-have feature. However, existing approaches are mostly based on centralized data analytics and thus can hardly avoid the latency and overhead due to message exchanges between data and control planes. In this work, we propose and prototype RIGEL, which, to the best of our knowledge, is the first real-time optical anomaly diagnosis system that realizes stateful distributed in-network inference through collaborative graph neural networks (GNNs) on Tofino switches. The system is designed to be fully innetwork, and a software-hardware co-design is proposed to preprocess high-dimensional spectral data for being suitable for hardware-based in-network inference. Next, we first develop an effective model to combine an autoencoder with a GraphSAGE-based GNN, and then propose a generalizable method to adapt the model to Tofino switch. The effectiveness of RIGEL is showcased in a realistic packet-over-optical network testbed, verifying that it achieves highly accurate diagnosis to detect and locate optical anomalies timely and highlighting its benefits over the state-of-the-art methods.
1
Introduction
Nowadays, the rapid development of data-intensive applications, especially the rise of artificial intelligence (AI) and large language models (LLMs), has reshaped optical networks into dynamic and high-throughput underlay infrastructures with enhanced adaptability [2, 17, 20, 27]. Yet, this deep coupling with applications complicates the design of optical networks and pushes their operations to a fragile edge: minor and ephemeral anomalies can be amplified through cascaded processing, leading to unexpected service degradations [26, 53], while in a wavelength-division multiplexing (WDM) based optical network, a fiber link normally carries tens of Tbps or more traffic, and thus a short downtime of even 1 ms brings more than 1 GB data loss. Hence, precise
and real-time anomaly diagnosis becomes a critical feature for today’s optical networks [25, 52]. This diagnostic imperative, however, is not just about detecting the well-understood hard failures that will interrupt lightpaths immediately. The critical challenge lies in the proactive diagnosis of soft failures (i.e., the minor and subtle anomalies that might not tear down lightpaths right away but could lead to severe consequences over time), because they usually have complex and multi-variate rootcauses that can hardly be detected by traditional methods [15, 28, 40, 43]. Therefore, researchers have switched to more sophisticated diagnosis techniques that adopt machine learning (ML) [8, 9, 23, 36]. Despite their effectiveness, these techniques usually need to fuse telemetry data across multiple optical nodes, which can be realized in either a centralized or distributed manner. The centralized architecture (e.g., software-defined networking (SDN)) is prone to single-point failures (i.e., the anomaly diagnosis cannot operate without the centralized controller) and bears additional latency and overheads for data analytics (i.e., a WDM-based optical network usually has a diameter of hundreds or even thousands of kilometers, meaning that the round-trip time between the controller and an optical node can be in milliseconds, and as the controller needs to handle other network control and management tasks as well, streaming telemetry data to it consistently can saturate its control channel and computing capability). Recent approaches tried to address these issues by introducing distributed data analytics and offloading diagnosis tasks to servers placed close to optical nodes [18, 29, 32]. Nevertheless, the servers bring in additional capital expenses and operational complexity, and they still can hardly avoid the delay and overhead intrinsic in hardware/software context switching, deviating from the real-time and in-network diagnosis required to prevent anomalies from deteriorating. The limits of state-of-the-art methods call for a paradigm shift that can push data analytics for anomaly diagnosis closer to telemetry data sources and minimize remote computing. Although not originally designed for optical anomaly diagnosis,
Power (dBm)
Normal
Narrow-band noise
Wide-band noise
-20 -30 -40 -50
1557.16
1557.30 1557.43 Wavelength (nm)
1557.56
(a) In-band noise jamming Normal
Optical attenuation
Filter shift
-20 Power (dBm)
intelligent data plane (IDP) offers a promising platform for this vision by enabling line-rate ML inference directly on programmable hardware (SmartNICs [33, 38], FPGAs [41, 58], and P4-enabled switches based on Tofino ASICs [34, 59]). While the benefits of IDP have been predominantly studied in the packet domain (e.g., traffic classification [39, 46] and fault detection [3, 21]), the line-rate processing with low latency will be more beneficial for real-time optical anomaly diagnosis, but it is still under-explored. The implementation of ML inference in IDP began with the models naturally aligned with the capability of IDP. For example, those based on decision trees (DTs) were an early success for being directly realized with a pipeline of matchaction tables (MATs) [6, 7, 48, 49, 51, 61]. The transition to more sophisticated neural networks (NNs), however, encountered a major hurdle due to the mismatch between their complex arithmetic operations and the simple primitives of IDP. This challenge was first addressed by simplifying ML models, leading to binarized NNs (BNNs) [37, 47]. Then, recent breakthroughs considered more complex models, successfully offloading multi-bit convolutional NNs (CNNs) and recurrent NNs (RNNs) onto IDP [50, 56, 57]. However, these prior studies mainly focused on processing packet headers in isolated switches. Therefore, they can hardly provide network-awareness through multi-switch collaboration, which is critical for optical anomaly diagnosis [9, 29]. In this work, we bridge this critical gap by proposing and prototyping RIGEL (Real-time optical anomaly dIagnosis with distributed on-switch Graph nEuraL networks), which, to the best of our knowledge, is the first optical anomaly diagnosis system that achieves stateful distributed in-network inference with collaboration of graph neural networks (GNNs) on Tofino switches. RIGEL reuses the packet switch deployed aside each optical node (typical configuration of the packet-over-optical architecture) for cost saving, i.e., the cost of a Tofino switch is similar to that of a legacy one with the same throughput [1]. Although GNN is suitable for analyzing graph-structured telemetry data for optical anomaly diagnosis, offloading a GNN onto IDP is more challenging than other ML models due to its iterative logic, stateful neighbor aggregation, and the need to manage and aggregate high-dimensional feature embeddings within the data plane. RIGEL resolves these challenges with breakthroughs in: 1) a GNN-based real-time optical anomaly diagnosis framework that is distributed and designed to be fully in-network (§3), 2) a software-hardware co-design that reuses the computing capability of optical performance monitors (OPMs) to preprocess high-dimensional raw telemetry data through compressing and quantizing for being suitable for in-network inference in IDP (§3.1), 3) a co-designed IDP-friendly model that combines an autoencoder (AE) for feature compression and a GraphSAGE for distributed in-network inference (§3.2), and 4) a generalizable method that offloads IDP-incompatible
-30 -40 -50
-60 1557.16
1557.30 1557.43 Wavelength (nm)
1557.56
(b) Spectral distortions
Figure 1: Examples of spectral data of typical soft failures.
computations to IDP pipelines by leveraging the neighborhood scoping of GraphSAGE [12] (§5). The effectiveness of RIGEL is demonstrated through extensive experiments in a realistic network testbed built with optical components (wavelength-selective switches (WSS’), erbium-doped fiber amplifiers (EDFAs), and bandwidthvariable transponders (BVTs)) and IDP switches based on Tofino ASICs. The results show that RIGEL achieves highly accurate optical anomaly diagnosis, reducing data exchange overhead between data and control planes by more than three orders of magnitude and significantly accelerating diagnosis. This work does not raise any ethical issues.
2
Background and Motivations
2.1
Optical Anomaly Diagnosis
Optical networks suffer from both hard failures (e.g., fiber cuts) and soft failures (e.g., filter drifting) [15, 28, 40, 43]. Diagnosing such failures involves analyzing telemetry data collected with OPMs attached to optical nodes [8,10,30]. As a key category of telemetry data, spectral data stands out for its ability to embody optical-layer anomalies through analyzable patterns [22, 35], as exemplified in Figure 1, which shows the spectra of a 50-GHz wavelength channel under various anomalies. As spectral data is normally high-dimensional (characterizing the 50-GHz-channel with a resolution of 312.5 MHz produces 160-dimensional data), processing it remotely in an SDN controller or a server results in excessive latency and overheads [8, 9, 23, 36], thus pushing for the shift towards distributed in-network diagnosis.
2.2
In-Network Diagnosis with IDP
IDP offers the opportunity to directly embed ML models into the forwarding pipelines of programmable data plane (PDP). Nevertheless, the development of IDP has been consistently challenged by the increasing complexity of ML models. PDP operates on reconfigurable MATs [5], leveraging the P4-programmable protocol independent switch architecture (PISA) [4], which, by design, prioritizes packet processing throughput, introducing a few well-documented limitations. First, it is only optimized for header processing, lacking native support for general-purpose arithmetic operations. Second, its hardware resources are limited and physically partitioned over a number of stages (e.g., 12 stages in a switch based on Tofino 1 ASIC [1]), preventing it from storing lookup rules for high-dimensional data due to combinatorial explosion. Last but not least, its “run-to-completion” operation model is inherently non-iterative, and thus forces the iterative logic required by ML models to leverage multi-pass processing based on packet recirculation, incurring significant overhead in both bandwidth and latency [56, 60]. Despite the limitations above, there has been appealing progress on realizing in-network inference with IDP. Initial studies focused on DT models [6, 7, 48, 49, 51, 61]. Then, researchers also considered NNs [37, 50, 56]. The practical bottleneck in these existing NN-on-switch designs [37, 50, 56] and tool-chains (e.g., INQ-MLT [54]) is not only their degraded accuracies after quantization, but also the execution restrictions of PISA. Specifically, as PDP normally cannot operate on real numbers or support matrix multiplication natively, each NN layer can only be compiled as a long sequence of integer operations, where many dotproduct templates have to be assembled for the vector-matrix multiplication in it. This scenario is not suitable for directly realizing the NNs for optical anomaly diagnosis, because the input data (spectral samples) is high-dimensional, preventing a PDP pipeline from processing all the dimensions in parallel within one stage. Hence, a switch has to iterate over dimensions via stage chaining or packet recirculation, and the iteration repeats for each NN layer, amplifying latency and resource consumption as the input dimensionality and NN layer width/depth grow. Moreover, existing single-switch scenarios in this area can hardly provide the network-awareness that is critical for optical anomaly diagnosis, especially for detecting and locating complex soft failures [9, 23, 36]. A multiswitch scenario has been considered in [55], but it aims to mitigate per-switch resource limits by partitioning a model over multiple switches, which still can hardly gather the networkawareness for anomaly diagnosis.
2.3
Vector Quantization
Vector quantization (VQ) [11] is a well-known technique in signal processing for lossy data compression. It represents a
vast space of high-dimensional data with a small “codebook” of prototype vectors. The codebook can be designed with the classic Linde-Buzo-Gray algorithm [19]. This procedure allows VQ to be used for various data distributions, making it a powerful tool for discretization. VQ has a long history of success in low-bit-rate applications [11, 24], and has more recently been revived in ML through VQ-VAE [42], where discrete codebooks are used in NN training. Our work is inspired by this revival. Since VQ encodes a high-dimensional vector with a compact codebook (index), it avoids the bottleneck due to per-dimension handling in existing NN-on-switch designs and aligns naturally with MAT lookups. We adopt VQ to discretize neural representations and tailor it to fit in the hardware constraints of Tofino switch. Here, the key challenge is that practical VQ encoding needs to search for the nearest neighbor [45], which requires the computations and memory resources that are out of the capability of Tofino switch. We resolve this issue with a softwarehardware co-design that realizes VQ encoding to preprocess high-dimensional raw spectral data as integer codebook indices and architects in-network inference on Tofino switch to take the indices as inputs, thereby completely freeing the PDP hardware from complex search operations.
2.4
GNN-based Anomaly Diagnosis
Other than relying on a remote SDN controller, networkaware diagnosis can also be achieved with distributed GNNs. This family of NN models, including the graph convolutional network (GCN) [13], GraphSAGE [12], and graph attention network (GAT) [44], all use iterative message-passing, i.e., they need to repeatedly aggregate information from neighbors. This leads to an intrinsic mismatch with the single-pass and non-iterative pipelines in IDP switches, making on-switch GNN tremendously challenging. The fact that optical anomaly diagnosis needs to process high-dimensional spectral data further complicates the challenge. In other words, the limited hardware resources in each IDP switch rule out the possibility of leveraging the straightforward implementation in [14] for optical anomaly diagnosis, because it was designed to process scalar data (queue length) only. Among GCN, GAT and GraphSAGE, GraphSAGE is the most suitable one for realizing optical anomaly diagnosis due to its relatively good hardware compatibility. Specifically, GCN requires the full global graph topology for transductive inference, and GAT computes dynamic attention scores from pairwise neighbor features. However, offloading these dynamic computations to IDP switches will consume excessive hardware resources, while the resource burden leaves less room for processing the quantized features at sufficient precision, inevitably degrading diagnostic accuracy. In contrast, GraphSAGE learns an inductive neighborhood aggregation function and employs fixed-size neighbor sampling. This
Message Exchanges per Diagnosis
8
Control Plane
RIGEL w/ GraphSAGE SDN Controller w/ CNN SDN Controller w/ MLP SDN Controller w/ RNN SDN Controller w/ DT
7 6
Offline
Online Retraining
Full-Precision Training
Quantization
5
P4 Compile & Build
4 3
Data Plane
Packet Layer
2 1 0
2
3
4
5
6
Network-awareness in Nodes
7
8
Optical Layer
OPM WSS
Figure 2: Communication overheads per diagnosis. Optical Node
deterministic mechanism aligns better with the fixed-depth pipelines and restricted hardware resources in IDP switches. Therefore, our RIGEL realizes scalable and hardwareaware GraphSAGE execution on IDP switches to resolve the critical engineering challenges for optical anomaly diagnosis. Furthermore, as RIGEL confines the processing of high-dimensional spectral data entirely in IDP switches, the overheads due to message exchanges between the control and data planes are significantly reduced. We run simulations to quantitatively show this advantage, where the message exchanges per diagnosis are plotted in Figure 2, for realizing different scales of network-awareness (in network regions containing different numbers of nodes) and comparable diagnosis accuracy. We consider five types of ML models, i.e., GraphSAGE (in RIGEL), multi-layer perceptron (MLP), DT, CNN and RNN, and except for RIGEL, the optical anomaly diagnosis is all realized by on-switch ML models and an SDN controller. As RIGEL can detect and locate optical anomalies, it only needs to report diagnosis results, maintaining communication overhead as constant and minimal, regardless of the scale of network-awareness. In contrast, as the ML-based centralized benchmarks are not network-aware, their message exchanges per diagnosis generally increase with the scale of network-awareness (each message exchange actually reports a much larger volume of telemetry data). Meanwhile, the average diagnosis accuracies of RIGEL, MLP, DT, CNN and RNN are 97.64%, 96.93%, 93.07%, 96.97% and 97.14%, respectively.
2.5
Anomaly Handler
Motivations
Our motivations are threefold. First, the recent need for realtime and highly-efficient optical anomaly diagnosis pushes for a paradigm shift from centralized analysis to distributed in-network inference. Second, existing on-switch ML models can hardly provide the network-awareness for locating optical anomalies, and thus are not suitable for optical anomaly diagnosis. Third, while distributed on-switch GNNs are the ideal paradigm, their implementations are obstructed by the hardware restrictions that make processing high-dimensional spectral data infeasible. To this end, this work aims to de-
Spectrum
Faulty Node
P4-enabled Switch
Telemetry Packets from OPM
Control Messaging
Lightpath
Exchange of Feature Packets
Figure 3: System overview of RIGEL. sign a stateful distributed in-network inference system that efficiently enables GraphSAGE-based on-switch computation for data-driven diagnostic tasks across distributed IDP switches, transforming them into a collaborative inference fabric capable of network-aware diagnosis.
3
Design Overview
We design RIGEL as a real-time optical anomaly diagnosis system that adopts the well-known packet-over-optical architecture (Figure 3). The data plane consists of a packet layer on top of an optical layer, which interconnects optical nodes with fiber links that contain in-line EDFAs for setting up lightpaths through WDM. With built-in WSS’, each optical node demultiplexes lightpaths from input fibers, terminates those that mark it as their destinations to steer to the local switch in the packet layer, and optically grooms the remaining ones with locally-generated lightpaths to send to output fibers. There is also an OPM on each optical node, to tap optical signals from its input/output fibers and perform spectrum analysis on them. The OPM samples signals at a resolution of 312.5 MHz, and compresses and encodes the obtained spectral data as telemetry packets to the local switch. Note that, as optical layer characteristics normally do not change frequently, the monitoring frequency of each OPM can just be a few times per second. Hence, the data processing rate for telemetry packets will just be in Kbps at most, which is negligible on a multi-Tbps Tofino switch.
3.1 Preprocessing Raw Spectral Data in OPM To achieve accurate optical anomaly diagnosis, we let each OPM collect optical spectra at its optical node and organize the data samples as follows. First, for each wavelength chan-
Deparser
Parser F-M Pipe -1 NSM
Pipe -2
NSM
PCA
Data packets Telemetry packets
Embedded AE N-AGG Embedded GraphSAGE
UQ
ST-M
VQ
Feature packets
each OPM, it is not suitable to run our GraphSAGE model on the CPU too for the following reasons. First, the CPU is just the common light-weight one in the standard configuration of OPM for spectral data collection, and thus its computing capacity is limited for supporting the GraphSAGE model with low latency. Second, running the model on a CPU can hardly avoid the delay and overhead intrinsic in hardware/software context switching. Finally, to enable graph-based neighbor aggregation, each OPM needs to expose its IP address and run network maintenance to track the optical layer topology timely, which induces both additional operational complexity and security vulnerabilities.
3.2 Spectrum
Control Messaging
Figure 4: In-network optical diagnosis in RIGEL. nel, the OPM samples the spectra of its input and output at the optical node with a resolution of 312.5 MHz. Then, it organizes the collected data as raw spectral data samples, each of which contains the spectra of the input and output of two adjacent channels (i.e., each raw spectral data sample is in 640 dimensions, if we assume a channel width of 50 GHz). Apparently, the high-dimensional raw spectral data samples are not suitable for being directly processed in Tofino switch. Hence, we design the following preprocessing in the OPM to prepare the data (as shown in Figure 4). The OPM first uses a principal component analysis (PCA) module to compress raw spectral data samples into 20 dimensions, and then leverages a per-dimension uniform quantization (UQ) to discretize the compressed real data samples to integers. Finally, we send the UQ’s output to the VQ encoding module, which further maps each 20-dimensional sample to a VQ codebook index. The index is encapsulated in a telemetry packet to Tofino switch for distributed in-network inference. The preprocessing in OPM enables the software-hardware co-design that ensures efficient implementation of RIGEL, and provides two key benefits. First, it transforms the input to each Tofino switch from high-dimensional real samples to compact integer indices, thereby significantly reducing the complexity of our in-network inference model and making it ready to be offloaded to Tofino switch. Second, the UQ’s output (20-dimensional integer samples) actually serves a dual-purpose: in addition to being consumed by the VQ encoding module, it can also be requested on demand by the control plane (as exemplified in Figure 4) to provide a more detailed, yet still compressed, representation of raw spectral data, enabling robust verification to resolve diagnostic ambiguities. Note that, although the preprocessing runs on the CPU in
In-Network Inference in Data Plane
Each switch in the packet layer is a P4-enabled Tofino switch, and locally connects to an optical node. The switches communicate with each other through logical links, each of which is supported by a lightpath in the optical layer. In addition to the task of forwarding data packets, we realize a two-stage in-network inference model in each switch, which uses both of its pipelines for optical anomaly diagnosis (as shown in Figure 4). Note that, each of the physical pipelines manages a dedicated subset of ports (e.g., Ports 1-16 and 17-32 attach to Pipe-1 and Pipe-2, respectively). The OPM preprocesses high-dimensional raw spectral data samples and encodes telemetry packets to the embedded AE in each switch. The AE transforms the indices in telemetry packets into learned features, which are stored locally and encoded as feature packets to share with other switches. Meanwhile, the GraphSAGE pipeline takes in these features, which can be either locally-produced or from remote switches, to realize graph-based inference for optical anomaly diagnosis. The operation of the two pipelines is coordinated by neighbor state machines (NSMs), which push and aggregate features from neighbor switches according to the optical layer topology. Figure 4 explains RIGEL’s principle of networkaware optical anomaly diagnosis. In parallel with forwarding data packets (done with the forwarding module (F-M)), Pipe-1 processes telemetry packets from the local OPM via NSM and embedded AE to get compact feature vectors, which are stored in registers and disseminated as feature packets to neighbor switches. Meanwhile, upon receiving a feature packet, the NSM buffers the features in it, and when features from a preset neighbor set have been collected, they are aggregated by the neighbor aggregation module (N-AGG). The aggregated features are then processed by Pipe-2 for graph-based in-network inference. Specifically, the embedded GraphSAGE consumes the aggregated features (both local and remotely-generated ones) to detect and locate anomalies in the optical layer, and its results are fed to the self-test module (ST-M), which determines fault causality. If the ST-M finds that the local optical node encounters an anomaly, it reports the category and location of the anomaly to the control plane.
Hence, with the neighbor aggregation of GraphSAGE, we exploit the fact that an optical anomaly normally perturbs not only the optical spectra at the faulty node but also those at its downstream nodes. Then, by incorporating the features from both local and neighbor nodes into inference, RIGEL can detect and locate anomalies that might be hard to track down from a single point of view, confining the tasks of accurate optical diagnosis entirely to the data plane. To this end, the data plane only needs to report the root cause and location of each anomaly to the control plane, ensuring efficiency and scalability by minimizing control messaging.
…
Node Feature
Edge Index
…
……
…… ……
……
……
Binary Classification
FC Layers Input Vector
Multi-class Classification
Encoder
GraphSAGE
Figure 5: Architecture of full-precision AE-GraphSAGE.
3.3
Control Plane Design
To offload the entire graph-based in-network inference onto Tofino switch, we design offline and online components in the control plane (Figure 3). The offline component first trains a full-precision model on spectral data, then uses a multi-stage feature discretization pipeline to convert it into a resourceefficient, integer-based model, and finally compiles the model into P4 artifacts for being deployed, where the learned parameters are encoded as MAT entries. In runtime, the control plane first uses P4Runtime to instantiate the program and populates related MATs on target switches. The online component (i.e., the anomaly handler) is invoked when an anomaly is detected and located, and it applies proper adjustment(s) to address the anomaly. The anomaly handler can also realize collaborative diagnosis. Specifically, when the anomaly diagnosis encounters any ambiguity or a reported anomaly needs to be verified, it requests more detailed telemetry data (the 20-dimensional integer samples from UQ) from the related OPM(s) for a more precise diagnosis by leveraging its global network view.
3.4
vector typically falls outside the established decision boundaries, which will make the GraphSAGE model misclassify it and trigger diverging root-cause alerts across multiple optical nodes along the lightpath. Therefore, when the number of multi-root reportings exceeds a preset threshold, the control plane will instruct the related nodes to report raw spectral data, expand the training set, and perform offline retraining. After the retraining, it deploys the updated VQ codebooks and classifier weights to Tofino switches as new MAT entries via P4Runtime, without interrupting regular packet forwarding on the switches. We experimentally demonstrate this feature and evaluate its performance in §7.4. Regular Model Maintenance. In a real-world optical network, the operations of network elements can drift over time (in months or even longer). Hence, it is recommended to conduct regular model maintenance, which retrains the offline model with new spectral data and recalibrates the quantization pipelines, making the model up-to-date. The retraining is performed in parallel with normal network operations and does not take excessive time (∼50 minutes for a 6-node topology, and ∼1 hour for a larger topology with 14 nodes).
Model Adaptability and Maintenance
Finally, a practical issue to address for deploying RIGEL in real-world optical networks is how to perform maintenance to ensure model adaptivity. In the following, we discuss the schemes for realizing life-cycle maintenance of RIGEL. Topology Adaptation. As the GraphSAGE model in RIGEL learns optical anomaly propagation signatures rather than memorizing a specific optical layer topology, relatively good generalization over topologies can be achieved, meaning that the model can easily adapt to a new topology after routine network expansion or minor topology changes without requiring retraining. We will verify this feature in §7.4. Handling Unseen Anomalies. When previously unseen anomalies occur, misclassifications will happen according to the operation principle of the GraphSAGE model. Fortunately, the incidents can be easily detected by monitoring the cases of multiple root-cause reporting (multi-root reporting). This is because when an unseen anomaly occurs, its feature
4
Training of Full-Precision Model
The core innovation of RIGEL lies in the offline part of its control plane, which provides a hardware-aware compiling pipeline to transform the full-precision AE-GraphSAGE model (Figure 5) into a switch-deployable program. The fullprecision model is in 32-bit floating-point format (FP32), and combines an AE and a GraphSAGE. The AE uses a two-layer fully-connected (FC) encoder to encode high-dimensional spectral data (the input vector) into a compact latent representation (the initial node feature). This reduces data dimensionality while safeguarding critical anomaly signatures. The GraphSAGE then performs inductive learning, by taking the node feature and an edge index as inputs. Its two SAGEConv layers realize two-step aggregation. First, each node randomly samples a neighbor and uses its feature vector to create an updated representation. Second, it repeats this process, to sample another neighbor and aggregate its updated representation
with that from the first step. Through this process, each node’s final embedding effectively captures the information about its 2-hop neighborhood. The embedding is then fed into a final classifier to produce the output: either a binary classification for root-cause location or a multi-class classification for anomaly type identification. The distributed mechanism of RIGEL helps to theoretically decouple the complexity of in-network inference from the number of nodes in the optical layer topology (N). Specifically, the graph-based neighbor aggregation of the GraphSAGE model restricts the time complexity on each switch to O(S1 + S1 · S2 ), where Sk denotes the number of neighbors involved in the state aggregation at hop k. Note that, previous studies (e.g., those in [12, 13]) have already suggested that a shallow GNN with 2 layers is often sufficient for graph learning, while applying deeper aggregation could lead to “over-smoothing” [16] and thus degrade the performance of graph learning. Therefore, we restrict the depth of neighbor aggregation in the GraphSAGE model to 2 hops, to maintain short diagnosis latency and realize accurate diagnosis. We train the full-precision baseline model with labeled telemetry data collected in a real-world lab testbed (with the 6-node topology in Figure 3). Each sample contains 20-dimensional data that is compressed from the raw 640dimensional spectral data denoting the input and output of two 50-GHz wavelength channels, and an anomaly type. We consider 8 types of anomalies: filter drifting in 4 severities ({±12.5, ±25} GHz), abnormal power loss, broadband noise insertion, and 2 types of narrow-band noise insertion (12.5 GHz noise insertion at two channel edges). Then, including the normal case, each data sample is labeled as one of 9 types. We run automatic scripts in the testbed to collect ∼234, 000 samples. To reflect realistic network conditions, the dataset exhibits a natural class imbalance, including ∼192, 000 normal samples (85.19%) and ∼33, 000 anomalous samples (14.81%), with ∼4, 000 samples for each of the 8 anomaly types. We divide the dataset into training, validation, and testing sets according to a split of 0.6 : 0.2 : 0.2. The baseline model is trained for 500 epochs with a batch size of 128, and after training, its accuracies on anomaly detection and location both exceed 99% on the testing set.
5
Multi-Stage Feature Discretization
With the trained full-precision AE-GraphSAGE model, we design a multi-stage feature discretization pipeline to convert it into an integer-based, MAT-friendly model for on-switch implementation. The pipeline includes a UQ followed by a VQ. The UQ maps each dimension of an FP32 input vector to an integer on a grid with a calibrated step and zero point, obtaining an integer UQ vector (detailed procedure in Appendix §A.2). Then, VQ takes the integer vector and finds its closest match within a learned VQ codebook (see §A.1). The index of the best-matching entry (i.e., the VQ index) serves
Pipe -1
Pipe -2 NSM
NSM Neigh_reg
Local_reg
Neigh_reg
…
…
…
…
…
…
…
flag
f_id
flag
f_id
flag
f_id
flag
…
…
…
…
…
…
…
…
AE_table
FC_table
… v_idx
emb_feat
…
…
…
3
…
…
…
h_feat
s_feat
n_feat
…
…
…
1
1
3
1
2
Local_feature_reg
FC_table
Neigh_feature_reg
…
…
…
…
…
…
…
emb_feat
s_feat
n_feat
f_id
s_feat
f_id
n_feat
…
…
…
…
… 3
…
1
2 Neigh_feature_reg
Local_feature_reg …
…
…
…
f_id
s_feat
f_id
n_feat
…
… 3
…
…
1
…
…
…
s_feat
n_feat
h_feat
…
…
…
2
…
s_feat n_feat …
2
…
… 2
AGG_table
… 2
AGG_table 1
Local_reg
… f_id
… root
…
…
2
3
2
Struct digest{ bit<8> l_id; bit<4> sw_id; bit<4> cls; }
Multicast 1
… cls
2 3
3
Multicast 1
2
2
3
Neigh_flag
Local_flag
Telemetry packets
1
0
0
Local Feature packets
2
1
0
Neighbor Feature packets
3
0
1
Control Messaging
Figure 6: Data plane architecture of RIGEL. as the final compressed result fed to subsequent processing on Tofino switch. This VQ mechanism is applied both before the AE to compress its input and before each aggregation in GraphSAGE to compress input feature vectors for MATdriven fusion. Finally, the resulting artifacts of the discretized model, including the VQ codebooks (for AE and GraphSAGE) and small fusion/latent lookup tables, are compiled into P4 MATs and registers, forming an integer-only and table-driven datapath for optical anomaly diagnosis.
6
Data Plane Implementation
Figure 6 shows the implementation of RIGEL in Tofino switch, which uses both of its physical pipelines (Pipe-1 and Pipe-2). Each pipeline is coordinated by an NSM, which handles the asynchronous arrivals of local telemetry packets and feature packets from neighbors. Specifically, the NSM utilizes paired register arrays (Local_reg and Neigh_reg), in which each entry is indexed by a lightpath feature ID (f_id) and maintains a 1-bit flag, to record the state of the corresponding feature processing. Here, f_id is a global ID to index the spectral feature of a lightpath, i.e., it uses 16 bits to point to the unique combination of a lightpath and the network time of its spectrum measurement. As shown at the right corner of Figure 6, for each lightpath feature, its pair of Local_reg and Neigh_reg denotes three pending states, where 1 means the corresponding packet has been received, and 0 otherwise. Then, based on these states, an NSM coordinates its pipeline to process an incoming packet as follows:
State ① (Initial arrival & wait): If both Local_flag=0 and Neigh_flag=0, the packet is the first one for the specific lightpath feature. If the packet is local, Pipe-1 for a telemetry packet or Pipe-2 for a local feature packet respectively extracts the self-feature (s_feat) and neighbor-feature (n_feat) from it, via the corresponding tables (AE_table and FC_table in Pipe-1 or FC_table in Pipe-2). It caches s_feat in Local_feature_reg, multicasts n_feat to neighbors, updates Local_flag to 1, and terminates to wait. Otherwise, if the packet is from a neighbor, NSM directly caches its feature (n_feat) in Neigh_feature_reg, updates Neigh_flag to 1, and terminates to wait. State ② (Local-triggered aggregation): If NSM only detects Neigh_flag=1, the incoming packet is local and its corresponding neighbor feature packet has already come in. It gets s_feat and n_feat and multicasts n_feat as in State ①, and triggers feature aggregation with AGG_table. Then, Pipe-1 sends the intermediate feature (h_feat) from AGG_table to Pipe-2, where the AGG_table yields the anomaly class (cls) and location (root). If root=1, a digest is generated to alert the control plane, where l_id and sw_id index the lightpath and optical node, respectively (Figure 6). State ③ (Neighbor-triggered aggregation): If NSM only detects Local_flag=1, the new packet is a neighbor feature one and its corresponding local packet has been received. It retrieves the cached s_feat and triggers feature aggregation. Then, similar to the processing for State ②, Pipe-1 forwards its aggregated result to Pipe-2, while Pipe-2 performs the final diagnosis and conditionally uploads the digest if root=1. Drop: To protect the switch from resource exhaustion, any feature packet with an invalid f_id, an unmatched neighbor ID, or belonging to an expired diagnostic session is dropped. This essential fallback ensures the registers and MATs are not blocked by erroneous or delayed traffic.
7
Experimental Evaluations
7.1
Experimental Setup
Network Testbed. We prototype and test RIGEL in a realistic packet-over-optical network testbed. Each optical node is built on Finisar 1×9 bandwidth-variable WSS’ (BV-WSS’) (bandwidth granularity at 12.5 GHz), and the bandwidth-variable transponders (BVTs) on a Juniper BTI-7800 platform, where each BVT uses a channel width of 50 GHz to achieve the data-rate of 100 Gbps with QPSK modulation (31.2 Gbaud with forward-error correction). The optical nodes are interconnected by standard single-mode fiber links, each of which contains an in-line EDFA, according to a topology with [6, 14] nodes, where the 6-node topology is in Figure 3 while the 14-node one is NSFNET topology [62] (Except for those in §7.4, our experiments all use the 6-node topology). For simplicity, we emulate the transmission loss of each fiber link with a variable optical attenuator (VOA).
Each OPM is implemented with a Finisar high-resolution optical channel monitor (OCM) and a mini-PC board with Intel CPU, which are both easily-accessible off-the-shelf products. The OCM can scan the whole spectrum of C-band with a resolution of 312.5 MHz within two seconds and the mini-PC board realizes the pipelined process (PCA→UQ→VQ, shown in Figure 4) to compress and encode raw spectral data from the OCM as telemetry packets. Each packet switch in the testbed is a PDP switch based on Tofino 1 ASIC. Anomaly Scenarios. We consider 8 categories of soft failures: 1) drifting of the center frequency of a BV-WSS, whose severities are characterized as {±12.5, ±25} GHz, denoted as anomaly Classes 1-4, respectively, 2) abnormal power loss on a fiber link (Class 5), 3) broadband noise insertion (Class 6), realized by tuning an EDFA, and 4) two types of narrowband noise insertion (Classes 7-8), generated by filtering the amplified spontaneous emission (ASE) noise from an EDFA to 12.5 GHz and respectively inserting it at two edges of a wavelength channel. Note that, all the anomalies only induce mild degradation but will not interrupt any lightpath. Model and Metrics. The full-precision baseline model contains a 2-layer fully-connected AE (with a hidden width of 256) where the encoder’s output is 10-dimensional, followed by a 2-layer GraphSAGE whose sampled neighbors per aggregation are set to 1. All the quantized variants for being offloaded on Tofino switch strictly share this architecture and are trained with the multi-step procedure in Algorithm 1 (§A.2). The metrics considered by our evaluations are the accuracy of anomaly classification (AccCls) and its corresponding F1-score (F1Cls), as well as the accuracy of root-cause location (AccLoc) and its F1-score (F1Loc). Table 1: End-to-End Diagnostic Performance.
7.2
AccCls (%)
F1Cls (%)
AccLoc (%)
F1Loc (%)
99.47
98.11
99.54
98.41
End-to-End Performance
We first evaluate the end-to-end performance of RIGEL to verify its effectiveness for optical anomaly diagnosis. Diagnostic Accuracy. Table 1 summarizes RIGEL’s end-toend performance on the tasks of anomaly classification and root-cause location. We can see that all the accuracy metrics are above 98%, demonstrating exceptional diagnosis accuracy. Figure 7 shows the confusion matrices of the two tasks to provide a detailed per-class breakdown, confirming the stable diagnosis achieved by RIGEL for each class. In-Switch Inference Latency. Beyond high accuracy, a more important benefit of the in-switch processing in RIGEL is that it can effectively accelerate optical anomaly diagnosis. To explicitly quantify this latency advantage, we conduct a
100%
91.7
No
99.6
3 4 0.8 5 8.2
3.4
60% 95.8 40%
91.8 100.0
6
100.0
7 8 0
1
2
3
4
5
6
100.0 7 8
AccLoc
100
20% 0%
Obtained Anomaly Class
(a) Anomaly classification
80%
100.0
60% 40% Yes
3.0
97.0
No
Yes
Accuracy (%)
2 8.1
AccCls
100%
80%
True Location
True Anomaly Class
0 100.0 1 6.8 93.2
20%
98 96 94 92 90
7
0%
Obtained Location
8
9
10
11
Codebook Bit-width (bvq)
12
(a) Accuracy versus codebook bit-width
(b) Root-cause location F1Cls
F1Loc
Figure 7: Confusion matrices by RIGEL for diagnosis tasks. microbenchmark experiment to compare the running time of data processing in one GraphSAGE aggregation layer, on a Tofino switch and a CPU server with dual Intel Xeon Silver 4210 CPUs at 2.20 GHz and 128 GB memory. To ensure the comparison focuses solely on per-node processing in each system, we deliberately exclude the latency due to inter-node communication. The results indicate that processing a spectral data sample takes ∼10 ms on the CPU server, while the same data processing can be accomplished in ∼800 ns with exact MATs on the Tofino switch. Hardware Resource Utilization. Table 2 lists the hardware footprint of RIGEL on Tofino 1 ASIC (compiled by Intel P4 Studio SDE). We can see that by explicitly decoupling feature computation and avoiding packet recirculation, RIGEL utilizes the hardware resources efficiently. Specifically, it only uses 6 of the 12 physical stages in both pipelines, and its memory footprint is also modest, using only 3.8% and 2.7% of the SRAM in Pipe-1 and Pipe-2, respectively. As it does not rely on ternary rules, RIGEL does not use any TCAM. Beyond storage, RIGEL imposes low pressure on the internal lookup datapath: the exact-match search/result buses are below 9% in both pipelines, and the action data bus is at most 2.6%. In all, these results verify that RIGEL only takes a small portion of the hardware resources in Tofino ASIC, ensuring hitless co-existence with other in-switch functions. Table 2: Hardware Resource Utilization of RIGEL.
7.3
Resource Type
Pipe-1
Pipe-2
Stages SRAM TCAM Logical Tables Exact Match Search Bus Exact Match Result Bus Action Data Bus Bytes
6/12 3.8% 0.0% 17.2% 8.9% 8.9% 2.6%
6/12 2.7% 0.0% 14.6% 7.8% 8.3% 1.4%
Impact of Quantization Bit-width
We then try to understand the contribution and trade-off of each component in RIGEL. Specifically, we test the components incrementally, starting from the initial VQ-only system
F1-score (%)
100
90
80
70
7
8
9
10
11
Codebook Bit-width (bvq)
12
(b) F1-score versus codebook bit-width
Figure 8: Impact of VQ codebook bit-width (bvq ).
(only applying VQ before AE) to the full implementation of RIGEL. For benchmarking, we have verified that the accuracies (AccCls and AccLoc) and F1-scores (F1Cls and F1Loc) of the full-precision baseline are all above 99%. Impact of bvq on VQ-only System. We first evaluate the impact of the VQ with a “VQ-only” configuration, where the floating-point latent vectors from the PCA in an OPM are directly mapped to their nearest codewords in codebook Cin by a VQ before being passed to the AE+GraphSAGE. Note that, as we would like to focus exclusively on the impact of the VQ before AE, the VQ applied before each aggregation in GraphSAGE (Cagg ) is not used in the experiments. Figure 8 indicates that increasing the bit-width of VQ codebook (bvq ) can obtain significant gains in both accuracies and F1-scores, while the gain becomes marginal after bvq reaches 11. As the MAT size of VQ codebook scales exponentially with bvq , to strike a proper balance between performance and memory efficiency, we will select bvq ∈ [9, 11] in subsequent experiments. Figure 8 also indicates that the system does not work well when the bit-width is bvq = 7, as the relatively low F1-scores indicate that the VQ-only configuration fails to distinguish between certain anomaly classes. The analysis above can be confirmed by the confusion matrix in Figure 9(a), where noticeable confusions happen among anomaly Classes 1, 2 and 5, which correspond to relatively small spectral changes by a BV-WSS drifting of ±12.5 GHz (Classes 1 and 2) and abnormal power loss (Class 5). Therefore, with a relatively small codebook (Kin = 2bvq = 128), the quantization is too coarse to distinguish small spectral changes, leading to low F1-scores. In contrast, after we increase the bit-width to bvq = 12, the codebook provides enough granularity to distinguish the anomaly classes, and
28.3
4 8.3 5 85.6
6.2
80%
6.5 92.2
60% 85.5 40%
14.1 100.0
6 7 0.6
3.3
96.1
3
99.5 7 8
8 0
1
2
4
5
6
20%
True Anomaly Class
True Anomaly Class
2 65.1 3 7.5
100%
0 100.0 1 4.0 96.0 2 3.2
80%
96.5 99.8
3
60% 99.8
4
40%
99.8
5
100.0
6
100.0
7 8
0%
0
Obtained Anomaly Class
(a) bvq = 7
1
2
3
4
5
6
100.0 7 8
20% 0%
Obtained Anomaly Class
(b) bvq = 12
Figure 9: Confusion matrices for anomaly classification. 100% 80%
99.7
60% 40% Yes
31.9
No
68.1
Yes
Obtained Location
(a) bvq = 7
20% 0%
No
True Location
True Location
No
100%
Table 3: Performance of Full Implementation of RIGEL. Hyper-parameters
Cls
Loc
bvq
buq
bagg
Acc (%)
F1 (%)
Acc (%)
F1 (%)
10 10 10 11 11 11
4 5 6 4 5 6
6 6 6 6 6 6
97.07 96.57 97.25 98.63 96.29 97.17
88.32 85.30 88.14 94.46 79.92 87.32
97.50 97.37 98.10 98.90 97.18 98.26
91.04 90.62 93.31 96.18 89.63 93.87
10 10 10 11 11 11
4 5 6 4 5 6
7 7 7 7 7 7
97.56 97.89 96.77 98.78 99.18 99.45
89.74 92.89 86.30 94.30 96.83 98.06
98.16 98.24 97.19 99.33 99.37 99.52
93.55 93.86 89.83 97.68 97.83 98.35
bvq = 10
bvq = 11
80%
100.0
60%
Yes
1.0
No
99.0
Yes
bvq = 9
100.0
40%
97.5
20% 0%
Obtained Location
AccCls (%)
100%
0 99.7 1 89.4 10.6
95.0 92.5 90.0 87.5
(b) bvq = 12
85.0
Figure 10: Confusion matrices for root-cause location.
3
4
UQ Bit-width (buq)
5
6
(a) AccCls for anomaly classification
bvq = 9
100.0
bvq = 10
bvq = 11
97.5
F1Cls (%)
thus the confusion matrix in Figure 9(b) is almost diagonal. Similarly, for the task of root cause location, using a small codebook with bvq = 7 also leads to a high rate of missing the true location of an anomaly (31.9%), as shown in Figure 10(a), while the large codebook with bvq = 12 effectively eliminates the confusion (Figure 10(b)). Impact of buq on UQ+VQ System. Next, we add a UQ before the VQ-only system, where the whole pipelined process of PCA→UQ→VQ gets implemented on each OPM to encode inputs for AE, and the VQ applied before each aggregation in GraphSAGE is still not used. To quantify the information loss incurred by the quantization on OPM, we select the bitwidth of VQ codebook within (bvq ∈ [9, 11]) while varying the bit-width of UQ (buq ). Figures 11 and 12 illustrate the UQ+VQ system’s performance on anomaly classification and root-cause location, respectively. The performance on accuracies and F1-scores consistently improves with the increase of the UQ bit-width (buq ). The improvements mainly occur when buq increases from 2 to 4, and saturate beyond buq = 4 bits. This suggests that a 4-bit quantization in the UQ can strike a balance between preserving essential feature information and effective data compression. Therefore, we select buq ∈ [4, 6] below. Impact of bagg on Full Implementation. Finally, on top of the UQ+VQ system, we add a VQ before each aggregation in GraphSAGE to fully implement RIGEL. The experiments use buq ∈ [4, 6] and bvq ∈ [10, 11], and vary the codebook bit-width of the VQ before each aggregation in Graph-
2
95.0 92.5 90.0 87.5 85.0
2
3
4
UQ Bit-width (buq)
5
6
(b) F1Cls for anomaly classification
Figure 11: Impact of UQ codebook bit-width (buq ) on Cls. SAGE (bagg ) within [6, 7], i.e., the size of the corresponding codebook (Cagg ) are 64 and 128, respectively. This choice is made based on the memory usage of the corresponding MAT. Specifically, as each key of the MAT contains an index pair from Cagg (for the node and its neighbor, respectively), the MAT’s size scales with |Cagg |2 . Hence, bagg = 7 becomes the maximum value that is feasible for our implementation. Table 3 details the performance of the full implementation of RIGEL. We notice that bagg acts as the main performance bottleneck, i.e., when the combination of bvq and buq is fixed, increasing bagg from 6 to 7 leads to significant gains across all the metrics. For instance, this one-bit increase boosts F1Cls by up to 16.91% (from 79.92% to 96.83% when bvq = 11 and buq = 5), and improves F1Loc by up to 8.20% (from 89.63% to 97.83% under the same setting). Meanwhile, it is interesting to see that when the combina-
bvq = 9
100.0
bvq = 10
bvq = 11
AccLoc (%)
97.5 95.0 92.5 90.0 87.5 85.0
2
3
4
UQ Bit-width (buq)
5
6
(a) AccLoc for root-cause location
bvq = 9
100.0
bvq = 10
bvq = 11
F1Loc (%)
97.5 95.0 92.5 90.0 87.5 85.0
2
3
4
UQ Bit-width (buq)
5
6
(b) F1Loc for root-cause location
Figure 12: Impact of UQ codebook bit-width (buq ) on Loc. tion of bvq and bagg is fixed, increasing buq does not always improve performance, especially when bagg = 6, e.g., with bvq = 11 and bagg = 6, increasing buq from 4 to 5 causes F1Cls to drop from 94.46% to 79.92%. This suggests that there is a complex interplay between UQ and VQ, which can make excessive input precision not beneficial when the VQ before each aggregation in GraphSAGE is the major information bottleneck. Finally, Table 3 suggests an optimal configuration of the bit-widths as (bvq = 11, buq = 6, and bagg = 7). In all, the results above suggest that in practical deployments, the accuracy-efficiency tradeoff of RIGEL should be adjusted as follows. To improve diagnosis accuracy, an operator should first try to increase the VQ/UQ bit-widths, while adding more neighbors in each neighbor aggregation should always be the second choice. This is because feature exchange among more neighbors not only increases diagnosis latency but also necessitates reduction of the quantization bit-width allocated to each neighbor under the per-packet metadata budget of Tofino switch, degrading feature quality.
7.4
Generalization of GraphSAGE Model
An important feature of ML-based anomaly diagnosis is the generalization of its model, i.e., whether the model can be applied to various networks and detect unseen anomalies, without requiring excessive retraining. In the following, we evaluate RIGEL’s generalization over these two dimensions. Generalization over Topologies. We first test the crosstopology generalization capability of the GraphSAGE model in RIGEL, by considering two topologies (i.e., the original 6-node topology in Figure 3 and the 14-node NSFNET topol-
ogy [62]) and conducting bi-directional transferability evaluations. First, we train the model in the 6-node topology and evaluate it in various topologies by adding two nodes each time until reaching the 14-node topology. Conversely, we train the model in the 14-node topology and evaluate it in smaller topologies down to the 6-node one. In all the scenarios, we directly deploy the GraphSAGE model with quantized weights without any fine-tuning. Table 4 shows the results. When the topologies used in training and testing are the same, all the performance metrics exceed 92%, confirming that RIGEL can easily adapt to various topologies without performance degradation. The results from the cases in which the training and testing topologies are different verify that exceptional cross-topology generalization can be achieved. For example, when we apply the model trained in the 6-node topology to the 14-node one, AccCls and F1Loc reach 98.94% and 90.73%, respectively. It is interesting to see that applying the model trained in the 14-node topology to a smaller topology can even achieve metrics higher than those obtained in the 14-node one. This is because training the model in a larger topology makes it observe a more diverse set of fault propagation paths and deeper cascading effects, yielding superior backward compatibility. Generalization for Unseen Anomalies. While RIGEL can achieve high accuracy on detecting known anomalies, we evaluate how well it performs when there are unseen anomalies (a practical challenge in real-world optical networks). Specifically, we expose the deployed GraphSAGE model to two unseen anomalies: Class 9 (a BV-WSS center frequency drifting of 37.5 GHz) and Class 10 (a fault that combines spectrum narrowing and narrow-band noise insertion). Table 5 summarizes the results, where each model is originally trained on a topology with [6, 14] nodes and anomalies in Classes 0-8. We can see that when the unseen anomalies occur, the ratio of multi-root reporting is always 98.9% or higher, except for the cases with the 6-node topology, where the ratio can drop to 89.6%. The noticeable ratio drop in the 6-node topology is caused by its small topology size, i.e., the percentage of short lightpaths in it is much larger than that in other larger topologies, which hides certain cases of multiroot reporting. On the other hand, when there is no unseen anomaly, the ratio of multi-root reporting is always 0.6% or smaller. The significant difference in the ratio of multi-root reporting verifies that it can be used as a good indicator of unseen anomalies to the control plane, i.e., RIGEL can reliably detect the occurrences of unseen anomalies and trigger timely retraining, effectively closing the autonomous diagnostic loop without much human intervention.
7.5
Comparisons with Centralized Diagnosis
Finally, we compare RIGEL with the conventional optical anomaly diagnosis schemes that use centralized data analytics in the control plane (based on centralized GraphSAGE-
Table 4: Cross-Topology Generalization Capability of RIGEL. Training Setup
Metrics (%)
6-Node Topology
8-Node Topology
10-Node Topology
12-Node Topology
14-Node Topology
6-Node Topology
AccCls / F1Cls AccLoc / F1Loc
99.44 / 98.04 99.51 / 98.32
99.08 / 95.36 99.24 / 96.46
99.13 / 94.99 99.19 / 95.21
99.08 / 93.34 99.19 / 94.22
98.94 / 90.73 99.03 / 91.78
14-Node Topology
AccCls / F1Cls AccLoc / F1Loc
99.55 / 98.43 99.60 / 98.65
99.37 / 96.93 99.47 / 97.54
99.30 / 95.85 99.36 / 96.28
99.29 / 94.86 99.37 / 95.57
99.12 / 92.48 99.20 / 93.27
Table 5: Detection of Unseen Anomalies via Multi-Root Reporting in Various Topologies. Metrics (%)
6-Node Topology
8-Node Topology
10-Node Topology
12-Node Topology
14-Node Topology
93.0 / 89.6 0.08
99.3 / 98.9 0.00
100.0 / 100.0 0.20
100.0 / 100.0 0.60
99.8 / 99.7 0.48
Multi-Root Reporting (Class 9 / Class 10) Multi-Root Reporting (Known Anomalies)
Table 6: Comparisons of Model Performance and Bandwidth Overhead. Model C-GNN C-GNN-UQ RIGEL
AccCls (%)
AccLoc (%)
F1Cls (%)
F1Loc (%)
Interactions
Bandwidth Overhead (bits)
99.99 99.65 99.42
99.99 99.65 99.55
99.99 98.86 98.08
99.99 98.82 98.34
66,950 66,950 6,490
266,728,800 57,844,800 103,840
based GNNs). The optimal configuration (bvq = 11, buq = 6, and bagg = 7) is used for RIGEL. The schemes using a centralized GNN (C-GNN) and a centralized GNN with UQ (C-GNN-UQ) (buq = 6) are the baselines, and they both use the full-precision model for anomaly diagnosis since an SDN controller usually does not have computation restrictions. CGNN makes each optical node report the 20-dimensional real data compressed by the PCA in each OPM, which contributes 20 × 32 = 640 bits to each payload of a telemetry packet. CGNN-UQ lets each node report the 20-dimensional integer vectors at the UQ’s output, occupying 20 × 6 = 120 bits in each payload. The experiments use the 6-node topology and focus on two metrics: the interactions with the control plane and the total bandwidth overhead. For the centralized baselines, each reporting cycle involves every optical node sending a telemetry packet to the control plane. In contrast, the reporting in RIGEL is event-driven, and thus only one control message, whose payload only occupies 16 bits on encoding the diagnosis result (i.e., the impacted lightpath, the class of its anomaly and location), is sent to the control plane, after detecting an anomaly. Table 6 lists the results when we run experiments over all the ∼400, 000 testing samples. The interactions made by the two baselines are the same, while RIGEL reduces the interactions by 10.3×. The bandwidth overhead reductions by RIGEL are more significant, which are ∼2, 568× and ∼557× relative to C-GNN and C-GNN-UQ, respectively. Meanwhile, we notice that the accuracies and F1-scores of RIGEL are slightly lower than those of the benchmarks (the reductions are all within 2%). This is because it adopts the quantized AE+GraphSAGE. The minor performance degradation is acceptable, since the accuracies and F1-scores of RIGEL are all above 98% for effective
optical anomaly diagnosis.
8
Discussions and Related Work
Methodological Advancement over Prior Art. Previous NN-on-switch systems, notably Quark [56] and Brain-onSwitch [50], made significant progress by adapting NNs to switch hardware. However, they were primarily based on UQ, leading to costly per-dimension iterative processing in PDP pipeline. In contrast, our software-hardware co-design of UQ+VQ maps each sample of high-dimensional telemetry data to a single VQ index for MAT lookup. This bypasses the bottleneck due to per-dimension processing, unlocking a collaborative inference capability that is absent in both DTbased approaches [7, 49] and software-based GNNs [9, 36]. A Unified Solution to Hardware Challenges. The core innovation of our work lies in how we use VQ index in RIGEL, which simultaneously resolves the two major hardware challenges of realizing on-switch GNNs, i.e., in-switch processing and inter-switch communication. As for the first one, the VQ index realizes an efficient key for MAT lookups, solving the memory explosion problem [31]. As for the second one, the VQ index enables low-overhead neighbor aggregation, effectively reducing inter-switch communication overheads. To the best of our knowledge, this unified solution is the first to enable a distributed in-network diagnosis system.
9
Conclusion
In this paper, we presented RIGEL, a distributed GNN-based framework for fully in-network optical anomaly diagnosis.
Our key contribution is a VQ-based quantization mechanism to transform a complex GNN for optical anomaly diagnosis into a series of MATs that can be easily offloaded on Tofino switch. We prototyped RIGEL and evaluated it thoroughly in a realistic packet-over-optical network testbed for real-time anomaly classification and location in the optical layer. The results demonstrated that RIGEL realizes accurate anomaly diagnosis, and achieves more than three orders of magnitude reduction in communication overheads between data and control planes, over the conventional schemes with centralized data analytics.
References [1] Tofino switch. https://www.barefootnetworks. com/products/brief-tofino/. [2] Daniel Amir, Nitika Saran, Tegan Wilson, Robert Kleinberg, Vishal Shrivastav, and Hakim Weatherspoon. Shale: A practical, scalable oblivious reconfigurable network. In Annual Conference of the ACM Special Interest Group on Data Communication (SIGCOMM), pages 449–464, 2024.
[8] Xiaoliang Chen, Che-Yu Liu, Roberto Proietti, Zhaohui Li, and Ben Yoo. Automating optical network fault management with machine learning. IEEE Communications Magazine, 60(12):88–94, 2022. [9] Xiaoliang Chen, Che-Yu Liu, Roberto Proietti, Jie Yin, Zhaohui Li, and Ben Yoo. On cooperative fault management in multi-domain optical networks using hybrid learning. IEEE Journal of Selected Topics in Quantum Electronics, 28(4):1–9, 2022. [10] I. Fernandez De Jauregui Ruiz, Amirhossein Ghazisaeidi, Thierry Zami, Sabine Louis, and Bruno Lavigne. An accurate model for system performance analysis of optical fibre networks with in-line filtering. In European Conference on Optical Communication (ECOC), pages 1–4, 2019. [11] Robert Gray. Vector quantization. IEEE Assp Magazine, 1(2):4–29, 1984. [12] Will Hamilton, Zhitao Ying, and Jure Leskovec. Inductive representation learning on large graphs. In Advances in Neural Information Processing Systems (NeurIPS), volume 30, 2017.
[3] Diogo Barradas, Nuno Santos, Luís Rodrigues, Salvatore Signorello, Fernando Ramos, and André Madeira. FlowLens: Enabling efficient flow classification for MLbased network security applications. In Network and Distributed System Security (NDSS), 2021.
[13] Thomas Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. In International Conference on Learning Representations (ICLR), 2017.
[4] Pat Bosshart, Dan Daly, Glen Gibb, Martin Izzard, Nick McKeown, Jennifer Rexford, Cole Schlesinger, Dan Talayco, Amin Vahdat, George Varghese, et al. P4: Programming protocol-independent packet processors. ACM SIGCOMM Computer Communication Review, 44(3):87–95, 2014.
[14] Ivan Lamb, Pedro Arthur Duarte, Jonatas Marques, Marcelo Luizelli, Luciano Gaspary, Anderson Tavares, Ronaldo Ferreira, Ítalo Cunha, José Rodrigo Azambuja, and Weverton Cordeiro. Distributed graph neural networks in programmable data planes. In IEEE Network Operations and Management Symposium (NOMS), pages 01–09, 2025.
[5] Pat Bosshart, Glen Gibb, Hun-Seok Kim, George Varghese, Nick McKeown, Martin Izzard, Fernando Mujica, and Mark Horowitz. Forwarding metamorphosis: Fast programmable match-action processing in hardware for SDN. ACM SIGCOMM Computer Communication Review, 43(4):99–110, 2013.
[15] Piotr Lechowicz, Carlos Natalino, Filippo Cugini, Francesco Paolucci, and Paolo Monti. Optimizing telemetry forwarding for distributed failure recovery in packet-optical networks. Journal of Optical Communications and Networking, 17(2):152–162, 2025.
[6] Coralie Busse-Grawitz, Roland Meier, Alexander Dietmüller, Tobias Bühler, and Laurent Vanbever. pforest: In-network inference with random forests. arXiv preprint arXiv:1909.05680, 2019. [7] Beyza Bütün, David De Andres Hernandez, Michele Gucciardo, and Marco Fiore. Dune: Distributed inference in the user plane. In IEEE International Conference on Computer Communications (INFOCOM), pages 1–10, 2025.
[16] Qimai Li, Zhichao Han, and Xiao-Ming Wu. Deeper insights into graph convolutional networks for semisupervised learning. In Association for the Advancement of Artificial Intelligence (AAAI), volume 32, 2018. [17] Siyuan Li, Xi Lin, Yaju Liu, Gaolei Li, and Jianhua Li. OpticGAI: Generative AI-aided deep reinforcement learning for optical networks optimization. In SIGCOMM Workshop on Hot Topics in Optical Technologies and Applications in Networking (Hot-Optics), pages 1–6, 2024.
[18] Qunzhi Lin, Xiaokang Chen, Zhenlin Ouyang, Hanyu Gao, Xiaoliang Chen, and Zhaohui Li. Scaling optical network fault management with decentralized graph learning. In Optical Fiber Communications Conference and Exhibition (OFC), pages 1–3, 2024. [19] Yoseph Linde, Andres Buzo, and Robert Gray. An algorithm for vector quantizer design. IEEE Transactions on communications, 28(1):84–95, 1980. [20] Hong Liu, Ryohei Urata, Kevin Yasumura, Xiang Zhou, Roy Bannon, Jill Berger, Pedram Dashti, Norm Jouppi, Cedric Lam, Sheng Li, et al. Lightwave fabrics: Atscale optical circuit switching for datacenter and machine learning systems. In Annual Conference of the ACM Special Interest Group on Data Communication (SIGCOMM), pages 499–515, 2023. [21] Zaoxing Liu, Hun Namkung, Georgios Nikolaidis, Jeongkeun Lee, Changhoon Kim, Xin Jin, Vladimir Braverman, Minlan Yu, and Vyas Sekar. Jaqen: A highperformance switch-native approach for detecting and mitigating volumetric DDoS attacks with programmable switches. In USENIX Security Symposium (USENIX Security), pages 3829–3846, 2021. [22] Huazhi Lun, Mengfan Fu, Xiaomin Liu, Yiwen Wu, Lilin Yi, Weisheng Hu, and Qunbi Zhuge. Soft failure identification for long-haul optical communication systems based on one-dimensional convolutional neural network. Journal of Lightwave Technology, 38(11):2992– 2999, 2020.
[27] Congcong Miao, Zhizhen Zhong, Ying Zhang, Kunling He, Fangchao Li, Minggang Chen, Yiren Zhao, Xiang Li, Zekun He, Xianneng Zou, et al. FlexWAN: Software hardware co-design for cost-effective and resilient optical backbones. In Annual Conference of the ACM Special Interest Group on Data Communication (SIGCOMM), pages 319–332, 2023. [28] Francesco Musumeci, Cristina Rottondi, Giorgio Corani, Shahin Shahkarami, Filippo Cugini, and Massimo Tornatore. A tutorial on machine learning for failure management in optical networks. Journal of Lightwave Technology, 37(16):4125–4139, 2019. [29] Francesco Musumeci and Massimo Tornatore. Failure management in optical networks with ML: a tutorial on applications, challenges, and pitfalls. Journal of Optical Communications and Networking, 17(8):C144–C155, 2025. [30] Pierluigi Poggiolini, Gabriella Bosco, Andrea Carena, Vittorio Curri, Yanchao Jiang, and F. Forghieri. The GNmodel of fiber non-linear propagation and its applications. Journal of Lightwave Technology, 32(4):694–721, 2014. [31] Kun Qian, Sai Ma, Mao Miao, Jianyuan Lu, Tong Zhang, Peilong Wang, Chenghao Sun, and Fengyuan Ren. Flexgate: High-performance heterogeneous gateway in data centers. In Asia-Pacific Workshop on Networking (APNet), pages 36–42, 2019.
[23] Huazhi Lun, Mengfan Fu, Yihao Zhang, Hexun Jiang, Lilin Yi, Weisheng Hu, and Qunbi Zhuge. A GAN based soft failure detection and identification framework for long-haul coherent optical communication systems. Journal of Lightwave Technology, 41(8):2312– 2322, 2023.
[32] R. Sales, A. Ribeiro, M. Silva, F. Lobato, A. Sgambelluri, L. Valcarenghi, and J. Costa. Disaggregated confidentiality-preserving scheme for fault detection in optical networks. In Optical Fiber Communications Conference and Exhibition (OFC), pages 1–3, 2024.
[24] John Makhoul, Salim Roucos, and Herbert Gish. Vector quantization in speech coding. Proceedings of the IEEE, 73(11):1551–1588, 1985.
[33] Davide Sanvito, Giuseppe Siracusano, and Roberto Bifulco. Can the network be the AI accelerator? In ACM SIGCOMM Workshop on In-Network Computing (NetCompute), pages 20–25, 2018.
[25] William Mellette, Alex Forencich, Rukshani Athapathu, Alex Snoeren, George Papen, and George Porter. Realizing rotorNet: Toward practical microsecond scale optical networking. In Annual Conference of the ACM Special Interest Group on Data Communication (SIGCOMM), pages 392–414, 2024. [26] Congcong Miao, Minggang Chen, Arpit Gupta, Zili Meng, Lianjin Ye, Jingyu Xiao, Jie Chen, Zekun He, Xulong Luo, Jilong Wang, et al. Detecting ephemeral optical events with OpTel. In USENIX Symposium on Networked Systems Design and Implementation (NSDI), pages 339–353, 2022.
[34] Amedeo Sapio, Marco Canini, Chen-Yu Ho, Jacob Nelson, Panos Kalnis, Changhoon Kim, Arvind Krishnamurthy, Masoud Moshref, Dan Ports, and Peter Richtárik. Scaling distributed machine learning with in-network aggregation. In USENIX Symposium on Networked Systems Design and Implementation (NSDI), pages 785–808, 2021. [35] Behnam Shariati, Marc Ruiz, Jaume Comellas, and Luis Velasco. Learning from the optical spectrum: failure detection and identification. Journal of Lightwave Technology, 37(2):433–440, 2019.
[36] Moises Felipe Silva, Andrea Sgambelluri, Alessandro Pacini, Francesco Paolucci, Andre Green, David Mascarenas, and Luca Valcarenghi. Confidentialitypreserving machine learning algorithms for soft-failure detection in optical communication networks. Journal of Optical Communications and Networking, 15(8):C212– C222, 2023. [37] Giuseppe Siracusano, Salvator Galea, Davide Sanvito, Mohammad Malekzadeh, Gianni Antichi, Paolo Costa, Hamed Haddadi, and Roberto Bifulco. Re-architecting traffic analysis with neural network interface cards. In USENIX Symposium on Networked Systems Design and Implementation (NSDI), pages 513–533, 2022. [38] Giuseppe Siracusano, Salvator Galea, Davide Sanvito, Mohammad Malekzadeh, Hamed Haddadi, Gianni Antichi, and Roberto Bifulco. Running neural networks on the NIC. arXiv preprint arXiv:2009.02353, 2020. [39] Giuseppe Siracusano, Davide Sanvito, Salvator Galea, and Roberto Bifulco. Deep learning inference on commodity network interface cards. In Workshop on Systems for Machine Learning at NeurIPS (MLSys), pages 1–8, 2018. [40] Kaixuan Sun, Zhenming Yu, Liang Shu, Zhiquan Wan, Hongyu Huang, Yi Lei, and Kun Xu. Digital residual spectrum-based generalized soft failure detection and identification in optical networks. IEEE Transactions on Communications, 71(1):324–338, 2022. [41] Tushar Swamy, Alexander Rucker, Muhammad Shahbaz, Ishan Gaur, and Kunle Olukotun. Taurus: A data plane architecture for per-packet ML. In ACM International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS), pages 1099–1114, 2022. [42] Aaron Van Den Oord, Oriol Vinyals, et al. Neural discrete representation learning. Advances in neural information processing systems (NeurIPS), 30, 2017. [43] Alba Vela, Marc Ruiz, Francesco Fresi, Nicola Sambo, Filippo Cugini, Gianluca Meloni, Luca Potì, Luis Velasco, and Piero Castoldi. BER degradation detection and failure identification in elastic optical networks. Journal of Lightwave Technology, 35(21):4595–4604, 2017. [44] Petar Veličković, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Lio, and Yoshua Bengio. Graph attention networks. In International Conference on Learning Representations (ICLR), 2018.
[45] Li-Yi Wei and Marc Levoy. Fast texture synthesis using tree-structured vector quantization. In Annual conference on Computer graphics and interactive techniques (SIGGRAPH), pages 479–488, 2000. [46] Bruno Missi Xavier, Rafael Silva Guimarães, Giovanni Comarela, and Magnos Martinello. Programmable switches for in-networking classification. In IEEE International Conference on Computer Communications (INFOCOM), pages 1–10, 2021. [47] Guorui Xie, Qing Li, Yutao Dong, Guanglin Duan, Yong Jiang, and Jingpu Duan. Mousika: Enable general in-network intelligence in programmable switches by knowledge distillation. In IEEE International Conference on Computer Communications (INFOCOM), pages 1938–1947, 2022. [48] Guorui Xie, Qing Li, Guanglin Duan, Jiaye Lin, Yutao Dong, Yong Jiang, Dan Zhao, and Yuan Yang. Empowering in-network classification in programmable switches by binary decision tree and knowledge distillation. IEEE/ACM Transactions on Networking, 32(1):382–395, 2024. [49] Zhaoqi Xiong and Noa Zilberman. Do switches dream of machine learning? Toward in-network classification. In ACM Workshop on Hot Topics in Networks (HotNets), pages 25–33, 2019. [50] Jinzhu Yan, Haotian Xu, Zhuotao Liu, Qi Li, Ke Xu, Mingwei Xu, and Jianping Wu. Brain-on-Switch: Towards advanced intelligent network data plane via NNdriven traffic analysis at line-speed. In USENIX Symposium on Networked Systems Design and Implementation (NSDI), pages 419–440, 2024. [51] Mingyuan Zang, Changgang Zheng, Radostin Stoyanov, Lars Dittmann, and Noa Zilberman. P4pir: In-network analysis for smart iot gateways. In SIGCOMM Poster and Demo Sessions, pages 46–48. 2022. [52] Lareb Zar Khan, João Pedro, Omran Ayoub, Nelson Costa, Andrea Sgambelluri, Lorenzo De Marinis, Antonio Napoli, and Nicola Sambo. Toward low-complexity neural networks for failure management in optical networks. Journal of Optical Communications and Networking, 17(7):555–563, 2025. [53] Chunyu Zhang, Zhiming Sun, Weijie Yang, Bing Ye, Min Zhang, and Danshi Wang. Expertise-enhanced machine learning for failure detection on field-deployed optical modules. Journal of Lightwave Technology, 43(1):137–154, 2025. [54] Kaiyi Zhang, Nancy Samaan, and Ahmed Karmouch. A Machine Learning-Based Toolbox for P4 Programmable
Data-Planes. IEEE Transactions on Network and Service Management, 21(4):4450–4465, 2024. [55] Kaiyi Zhang, Changgang Zheng, Nancy Samaan, Ahmed Karmouch, and Noa Zilberman. MUTA: Enabling Multi-Task Neural Network Inference in Programmable Data-Planes. In International Conference on High Performance Switching and Routing (HPSR), pages 1–6, 2025. [56] Mai Zhang, Lin Cui, Xiaoquan Zhang, Fung Po Tso, Zhang Zhen, Yuhui Deng, and Zhetao Li. Quark: Implementing convolutional neural networks entirely on programmable data plane. In IEEE International Conference on Computer Communications (INFOCOM), pages 1–10, 2025. [57] Yinchao Zhang, Su Yao, Yong Feng, Kang Chen, Tong Li, Zhuotao Liu, Yi Zhao, Lexuan Zhang, Xiangyu Gao, Feng Xiong, et al. Pegasus: A universal framework for scalable deep learning inference on the dataplane. In Annual Conference of the ACM Special Interest Group on Data Communication (SIGCOMM), pages 692–706, 2025. [58] Changgang Zheng, Zhaoqi Xiong, Thanh T. Bui, Siim Kaupmees, Riyad Bensoussane, Antoine Bernabeu, Shay Vargaftik, Yaniv Ben-Itzhak, and Noa Zilberman. IIsy: Hybrid In-Network Classification Using Programmable Switches. IEEE/ACM Transactions on Networking, 32(3):2555–2570, 2024. [59] Changgang Zheng, Mingyuan Zang, Xinpeng Hong, Liam Perreault, Riyad Bensoussane, Shay Vargaftik, Yaniv Ben-Itzhak, and Noa Zilberman. Planter: Rapid Prototyping of In-Network Machine Learning Inference. ACM SIGCOMM Computer Communication Review (SIGCOMM CCR), 54(1):2–21, 2024. [60] Hao Zheng, Xin Yan, Wenbo Li, Jiaqi Zheng, Xiaoliang Wang, Qingqing Zhao, Luyou He, Xiaofei Lai, Feng Gao, Fuguang Huang, et al. When P4 meets run-tocompletion architecture. In USENIX Symposium on Networked Systems Design and Implementation (NSDI), pages 1487–1505, 2025. [61] Guangmeng Zhou, Zhuotao Liu, Chuanpu Fu, Qi Li, and Ke Xu. An efficient design of intelligent network data plane. In USENIX Security Symposium (USENIX Security), pages 6203–6220, 2023. [62] Zuqing Zhu, Wei Lu, Liang Zhang, and Nirwan Ansari. Dynamic service provisioning in elastic optical networks with hybrid single-/multi-path routing. Journal of Lightwave Technology, 31(1):15–22, 2013.
A A.1
Appendix Codebook-based Discretization
0.256
1101
15.58
1001
56.54
0010
VQ index
AE Encoder
11011011
Although VQ follows UQ in the pipeline in Figure 13, the design and training of the UQ are actually based on the trained VQ codebook. Hence, we first explain the design of the VQ. We discretize features with a learned codebook at the following places: before the encoder in AE and before each aggregation for neighborhood fusion in GraphSAGE. Then, the discretized processing in AE and GraphSAGE is unified around VQ-codebook indices, which are MAT-friendly, saving the effort in modifying the AE and GraphSAGE to adapt to non-unified inputs. Specifically, as we encode each input (a VQ codebook index) with a fixed bvq -bit format and do not modify its encoder architecture when offloading the AE, every intermediate layer in the encoder becomes a deterministic mapping from finite inputs to finite outputs, which can be easily realized with MAT lookups. This explains the rationale for placing a VQ before the encoder in AE, i.e., each sample of spectral data is first mapped to a learned codeword (a VQ codebook index) and then passed through the encoder, stabilizing the input distribution seen by each layer in the encoder and eliminating per-dimension loops. On the other hand, for the GraphSAGE, we also apply a VQ before each aggregation, where the self-feature and neighbor-feature are separately transformed into VQ codebook indices before being combined, to control the numeric dispersion induced by neighborhood propagation. This enables MAT-driven fusion over codewords, which reduces arithmetic operations and thus aligns with the capability of PDP. Based on the design above, the codebooks for AE are first trained by aligning to the full-precision encoder. Let E be the full-precision encoder, which is fixed during the training. For an input x (high-dimensional spectral data), we define z⋆ = E(x) as its encoding result from E, and denote the VQ codebook as Cin . The input x is mapped to its nearest codeword cin ∈ Cin by first finding the corresponding index: 2
kin (x) = arg min x −Cin [k] .
(1)
k
Thus, the codeword is cin = Cin [kin (x)], and by putting cin in E, we get z = E(cin ). The loss between z⋆ and z consists of a feature-alignment term with two lightweight regularizers:
5.541
1110
…
…
15.54
1010
Input Vector
UQ Vector
…
Tofino Switch
…
VQ codebook
1 2 3 K-1 K
Figure 13: UQ-VQ feature discretization process. where λz, µz , λu , and λs are the non-negative hyper-parameters that balance the contribution of each term and are tuned on a validation set, ε is a small constant (e.g., 10−8 ) added to prevent division by zero in the NMSE calculation, and the regularizer Rusage discourages codeword collapse by promoting uniform codebook utilization:
Rusage (Cin ) = [log (Kin ) − H(pin )]2 , Kin
H(pin ) = − ∑ pin (k) · log [pin (k)] ,
(3)
k=1
where pin (k) is the empirical usage frequency of codeword k within a batch, and Kin is the size of the codebook Cin . The stability term in Eq. (2) enforces a robust mapping by penalizing sensitivity to small input perturbations. It compares (noise) two softly-reconstructed inputs, xsoft and xsoft . The soft reconstruction is a differentiable proxy for the quantization process, i.e., xsoft is calculated as a weighted average of all the codewords, where the weights are derived by applying a softmax function to the distances between the input x and (noise) each codeword in Cin . xsoft is calculated similarly, but with a slightly perturbed input (x + noise). To obtain the codebooks for GraphSAGE, we still leverage a trained full-precision model of GraphSAGE. Let ℓ⋆ be the logits from the full-precision model, and ℓ be the logits from the discretized GraphSAGE (i.e., that whose internal features are quantized). Here, logits are the scores from a GNN’s final layer. Then, the loss used in our implementation becomes
LGNN-VQ = CE(ℓcls , ycls ) + γ · BCE(ℓloc , yloc ) | ∥z − z⋆ ∥2 LAE-VQ = λz ·[1 − cos(z, z⋆ )] + µz ⋆ 2 2 ∥z ∥2 + ε |
{z
feature alignment (cosine + NMSE)
+ λu · Rusage (Cin ) {z } |
{z
stability
}
logits alignment (cosine + NMSE)
+
λu · Rusage | {z }
,
codebook usage regularization
(noise) + λs · ∥xsoft − xsoft ∥22 ,
|
}
h i + η α · NMSE(ℓ, ℓ⋆ ) + (1 − α) 1 − cos(ℓ, ℓ⋆ ) {z } (4) | (2)
codeword usage
{z
task supervision
}
where α is the mixing coefficient inside the cosine-NMSE alignment, γ balances the classification and location heads,
and η controls the relative weight of the logits alignment term (set to 0.1 in our implementation, but treated as a tunable hyperparameter). The task supervision term employs crossentropy (CE) for the multi-class fault classification head (ℓcls ) and binary cross-entropy (BCE) for the location head (ℓloc ). The logits alignment term distills knowledge from the fullprecision GraphSAGE. Finally, the codebook usage regularizer Rusage prevents codebook collapse. Algorithm 1 outlines our multi-step training pipeline for VQ to get the codebooks for AE and GraphSAGE. Its inputs are the sets of spectral data (X) and corresponding labels (Y ), sizes of VQ codebooks for AE (Kin ) and GraphSAGE (Kagg ), and related hyperparameters, and it outputs the full-precision models for AE (E) and GraphSAGE (G), discretized GraphSAGE (Gvq ), and the codebooks for AE (Cin ) and GraphSAGE (Cagg ). Step 0 (Lines 1-3) trains the full-precision models of AE and GraphSAGE. Step 1 (Lines 4-7) learns the codebook of AE (Cin ). Specifically, in each iteration, we refine the codebook by minimizing LAE-VQ to align latent vectors z and z⋆ , and also update Cin via exponential moving average (EMA). Step 2 (Lines 8-11) learns the discretized GraphSAGE Gvq and the pre-aggregation codebook Cagg . Specifically, after the initialization with K-Means (Line 8), Cagg is updated via EMA while minimizing LGNN-VQ , which enforces task supervision and logits-level distillation (ℓ versus ℓ⋆ ). Line 12 returns E, G, Gvq , Cin , and Cagg .
A.2
Input Quantization with UQ
d
d
d
/* Step0: Train full-precision models of AE and GraphSAGE */ 1 for each epoch do 2 train an AE on X via MSE reconstruction loss to get full-precision encoder E; 3 use {z} as inputs to train a GraphSAGE G, with loss as the task supervision term in Eq. (4); /* Step1: VQ distillation of AE */ initialize Cin by taking a random subset from the first batch of N samples from X to form Kin initial indices (or repeating copies if N < Kin ); 5 for each epoch do 6 update Cin by minimizing LAE-VQ in Eq. (2); 7 update Cin with EMA; 4
/* Step2: VQ distillation of GraphSAGE */ initialize Cagg via K-Means on internal layer before each aggregation in G; 9 for each epoch do 10 train Gvq and Cagg with X and Y to minimize composite loss LGNN-VQ in Eq. (4); 11 update Cagg with EMA; 8
12
return E, G, Gvq ,Cin ,Cagg
space VQ structure and the latent-space geometry.
We leverage per-dimension UQ to discretize the spectral data in X, where each sample is x ∈ RD (a D-dimensional vector). For each x, we specify a bit-width buq , yielding a codeword length of K = 2buq . This scheme is parameterized by a learnable step size ∆d and an offset (zero-point) σd for each dimension d. The mapping of UQ involves two steps, where the parameters ∆d and σd are initialized from a small batch in X by mapping each dimension’s empirical range to the integer interval [0, K − 1]. Then, the two steps works as: h i q = clip round xd −σd , 0, K − 1 (Step 1), d ∆d x̂ = ∆ · q + σ (Step 2).
Algorithm 1: Multi-Step Training with VQ Input: X, Y , Kin , Kagg .
(5)
d
First, the floating-point value of dimension d in x (xd ) is mapped to an integer qd ∈ [0, K − 1]. This involves rounding the scaled and shifted value of xd , followed by a clipping operation to ensure that qd stays within the valid range. Second, the obtained integer qd is used to compute the de-quantized value x̂d . After getting x̂d for each xd , we obtain the reconstructed vector x̂, which will be passed to the AE’s encoder. The training of the UQ is essentially to update its parameters {∆d , σd } under the guidance of a composite loss function, LUQ , which aligns the UQ reconstruction with both the input-
LUQ =
x̂ − cin | {z
2 }2
UQ-VQ Alignment
h + λfeat α · NMSE E(x̂), E(x) i + (1 − α) · 1 − cos E(x̂), E(x) ,
(6)
where λfeat > 0 is the weight of the latent alignment term. The training procedure optimizes {∆d , σd } to create a stable mapping from xd (a real number) to qd (an integer), ensuring the quantized results to align with the subsequent processing.