GLASS: Graph-Language Alignment with Spherical Scoring for Transferable Graph-Level Anomaly Detection
Organizations: School of Data Science, The Chinese University of Hong Kong, Shenzhen (CUHK-Shenzhen), China
Abstract
We introduce GLASS, a framework for graph-level anomaly detection (GLAD) that achieves robust cross-domain transferability through graph-language alignment on the unit hypersphere. GLASS builds a unified representation space by aligning a structure-aware graph encoder with an instruction-aware text embedding via a multi-slice soft cosine objective. Our framework serializes local, global, and semantic graph properties into a compact Graph Descriptor Prompt (GraphDP), creating a text bridge that enables domain-agnostic anomaly scoring. By enforcing multi-scale consistency through Matryoshka representation slices, the model captures anomalous deviations at multiple levels of granularity. We formulate anomaly detection as density estimation on the aligned hypersphere and introduce Spherical Multi-Modal Scoring (SMS), which instantiates von Mises-Fisher kernel density estimators in both graph and text embedding spaces. This probabilistic formulation recovers angular 1-nearest-neighbor scoring in the high-concentration limit, motivates the practical mean k-nearest-neighbor scorer, and provides a principled fusion of structural and semantic anomaly signals. The shared text embedding space further serves as a cross-domain bridge: by encoding a target domain's GraphDP without target-domain training data, GLASS performs zero-shot anomaly detection, and with only a handful of normal examples, few-shot adaptation via reference-set calibration. For privacy-sensitive deployment, we extend reference-set calibration with a bounded joint graph-text kernel summary that provides graph-record differential privacy while keeping the encoders fixed independently of the private target references. Across twelve benchmarks and three meta-domains, GLASS obtains the best average AUROC and rank compared with recent advanced GLAD baselines and enables effective cross-domain transfer.
Figures & tables
| Method | MUTAG | PROTEINS | D&D | ENZYMES | DHFR | BZR | COX2 | AIDS | IMDB-B | NCI1 | COLLAB | REDDIT-B | Avg. AUROC | Avg. Rank |
| Graph Kernel + Detector | ||||||||||||||
| PK-SVM | 49.58 | 12.42 | ||||||||||||
| PK-iF | 54.28 | 11.25 | ||||||||||||
| WL-SVM | 53.03 | 10.67 | ||||||||||||
| WL-iF | 55.90 | 11.00 | ||||||||||||
| GNN-based Deep Learning Methods | ||||||||||||||
| Dataset | 0.6B | 4B | 8B |
|---|---|---|---|
| MUTAG | 91.42 0.87 | 90.98 1.35 | 90.96 1.06 |
| PROTEINS | 80.63 0.42 | 80.10 0.76 | 79.46 0.81 |
| D&D | 79.41 0.49 | 80.22 1.25 | 78.62 1.28 |
| ENZYMES | 66.20 0.46 | 70.51 0.25 | 68.42 0.27 |
| DHFR | 69.38 0.37 | 69.03 0.30 | 68.25 0.27 |
| BZR | 80.93 0.38 | 79.77 0.10 | 80.23 0.18 |
| Source Target | Dataset | Transfer | Single | |
| Mol Social | IMDB-B † | 2.6 | ||
| REDDIT-B † | 19.5 | |||
| Social Mol | MUTAG † | 0.5 | ||
| AIDS † | +0.06 | |||
| Mol Protein | PROTEINS † | +2.9 | ||
| D&D † | +4.6 |
| MUTAG † | PROTEINS † | IMDB-B † | |
| 0 | 74.35 3.68 | 65.59 3.56 | 63.47 3.68 |
| 1 | 68.15 3.03 | 73.33 3.04 | 58.97 2.93 |
| 4 | 68.96 1.88 | 74.95 2.01 | 62.09 2.47 |
| 8 | 77.12 1.47 | 78.24 1.37 | 62.82 1.60 |
| 16 | 80.05 1.39 | 79.69 1.11 | 63.50 1.61 |
| 32 | 84.54 1.18 | 79.81 0.93 | 63.99 1.34 |
| Source | Target | Source NN | Target NN | Exact KDE | Sketch | ||||
|---|---|---|---|---|---|---|---|---|---|
| Mol | PROTEINS | 128 | |||||||
| Mol | D&D | 128 | |||||||
| Protein | AIDS | 128 | |||||||
| Mol | IMDB-B | 128 |
| Target | Graph | Text | Joint | Joint+source |
|---|---|---|---|---|
| PROTEINS | 71.57 | 53.71 | 73.78 | 72.79 |
| D&D | 65.79 | 54.54 | 66.82 | 66.03 |
| AIDS | 90.92 | 79.51 | 88.67 | 85.55 |
| IMDB-B | 59.05 | 57.17 | 59.70 | 59.99 |
Appendix figures & tables6 assets
Supplementary material from the paper’s appendix.
Appendix
| Dataset | # Graphs | # Classes | Avg. Nodes | Avg. Edges | Node Labels | Node Attributes | Node Features | Domain |
|---|---|---|---|---|---|---|---|---|
| (w/o attributes) | ||||||||
| PROTEINS | 1 113 | 2 | 39.1 | 72.8 | 3 SSE types | 1 | 4 (3) | Protein |
| D&D | 1 178 | 2 | 284.3 | 715.7 | 89 AA types | – | 89 (89) | Protein |
| ENZYMES | 600 | 6 | 32.6 | 62.1 | 3 SSE types | 18 | 21 (3) | Protein |
| MUTAG | 188 | 2 | 17.9 | 19.8 | 7 atom types | – | 7 (7) | Molecule |
| DHFR | 756 | 2 | 42.4 | 44.5 | Atom types | 3 | 56 (53) | Molecule |
| Dataset | Graph | Text | Fusion | vMF | SMS | Fixed | GLASS |
|---|---|---|---|---|---|---|---|
| AIDS | 95.52 3.29 | 99.79 0.01 | 97.09 2.02 | 90.67 5.86 | 93.92 3.32 | 99.77 0.03 | 99.32 0.59 |
| IMDB-B | 68.64 0.39 | 74.12 0.51 | 74.13 0.40 | 68.88 2.39 | 65.74 1.11 | 77.29 0.35 | 77.20 0.35 |
| PROTEINS | 74.83 0.91 | 71.31 1.25 | 77.08 0.98 | 69.19 1.65 | 79.70 0.58 | 80.63 0.42 | 80.63 0.42 |
| MUTAG | 91.07 1.10 | 74.20 1.90 | 83.19 1.42 | 68.96 0.71 | 82.30 2.13 | 88.77 0.74 | 91.42 0.87 |
| ENZYMES | 69.12 0.40 | 62.65 0.26 | 69.91 0.64 | 64.41 0.89 | 62.58 1.09 | 66.20 0.46 | 66.20 0.46 |
| DHFR | 70.18 0.39 | 59.09 0.25 | 68.25 0.44 | 61.33 0.66 | 58.26 0.58 | 67.80 0.38 | 69.38 0.37 |
| Regime | Evidence | Interpretation |
|---|---|---|
| Related-domain gain | Mol PROTEINS (+2.9), Mol D&D (+4.6) | shared substructure vocabulary |
| Near-lossless coverage | Protein MUTAG (+0.4), Social/Protein AIDS (+0.06) | compatible normal geometry |
| Few-shot calibration | PROTEINS from shots | target references repair local density |
| Source dilution | All-domain helps PROTEINS but lowers MUTAG/IMDB-B | heterogeneous references broaden density |
| Hard target shift | REDDIT-B loses 15–20pp under transfer | different social semantics |
| Fine-grained gaps | ENZYMES and DHFR remain below the best baselines | missing biochemical substructure fields |
| Dataset | Frozen | LoRA warm-up | LoRA tuned | Warm-up | Frozen |
|---|---|---|---|---|---|
| MUTAG | 91.42 0.87 | 90.02 1.41 | 90.31 1.22 | +0.29 | 1.11 |
| PROTEINS | 80.63 0.42 | 80.05 0.47 | 75.36 0.86 | 4.68 | 5.27 |
| D&D | 79.41 0.49 | 76.23 1.56 | 76.24 1.84 | +0.01 | 3.17 |
| ENZYMES | 66.20 0.46 | 65.05 0.73 | 67.96 0.63 | +2.91 | +1.76 |
| DHFR | 69.38 0.37 | 68.25 0.29 | 68.42 0.26 | +0.17 | 0.96 |
| BZR | 80.93 0.38 | 81.33 0.20 | 83.51 0.22 | +2.19 | +2.58 |
| Source | Target | Source NN | Target NN | Exact KDE | Sketch | ||||
|---|---|---|---|---|---|---|---|---|---|
| Mol | BZR | 128 | |||||||
| Mol | COLLAB | 128 | |||||||
| Mol | COX2 | 128 | |||||||
| Mol | D&D | 128 | |||||||
| Mol | DHFR | 128 | |||||||
| Mol | ENZYMES | 128 |