Source-linked AI summary
GLASS: Graph-Language Alignment with Spherical Scoring for Transferable Graph-Level Anomaly Detection
Xudong Wang, Chris Ding, Tongxin Li, Jicong Fan
TL;DR
GLASS addresses the difficulty of transferring graph-level anomaly detection across heterogeneous domains with limited or absent target data. It aligns graph and language representations through GraphDP, Matryoshka slices, and spherical density scoring, and reports the best average AUROC and rank across twelve benchmarks while enabling zero- and few-shot transfer.
Problem
Existing GLAD systems are typically dataset-specific, limiting detection when a new domain has few or no trusted normal graphs and lacks interoperable representations across graph families.
Method
GLASS aligns structure-aware graph codes with frozen instruction-aware text anchors by serializing structural evidence into GraphDP and scoring reference-relative density on Matryoshka hyperspherical slices.
Results
GLASS achieves the best average AUROC (79.85) and average rank (1.75) among listed baselines, with effective zero-shot and few-shot transfer across twelve benchmarks and three meta-domains.
Takeaways & Limitations
The shared hyperspherical graph-language space supports strong in-domain detection and transfer when source and target graphs share structural-language evidence, particularly across molecular and protein domains.
Abstract
from arXiv · showhide
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. For scoring, 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 k-nearest-neighbor scoring as a high-concentration limiting case 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. 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.
I. INTRODUCTION
GLASS addresses transferable graph-level anomaly detection by aligning structure-aware graph representations with instruction-aware language embeddings on a shared hypersphere. Its GraphDP bridge and spherical density scoring support single-domain, zero-shot, and few-shot detection across heterogeneous graph families.
- GLASS targets the lack of interoperable representations and common anomaly-scoring principles across heterogeneous graph domains.
- GraphDP serializes local, global, and spectral graph properties into compact prompts, while LTDs provide structural evidence when raw attributes are missing or incomparable.
- vMF density estimation on the aligned hypersphere explains angular nearest-neighbor scoring as its high-concentration limit.
- GLASS supports single-domain detection, zero-shot transfer without target training data, and few-shot adaptation through reference-set calibration.
- The framework aligns structure-aware graph codes with frozen instruction-aware text anchors using Matryoshka slices and Spherical Multi-Modal Scoring.
- Across twelve benchmarks and three meta-domains, GLASS reports superior single-domain performance and effective cross-domain transfer, especially when GraphDP descriptions share structural semantics.
III. PROBLEM SETUP
GLASS defines graph-level anomaly detection using normal-reference ranking and constructs comparable graph and language views from structural evidence. The graph view combines local topology, optional attributes, global spectral features, and GraphDP text anchors.
- Problem setup: GLAD trains on normal graphs and ranks held-out graphs by anomalousness, with single-domain, zero-shot, and few-shot reference-set regimes.Zero-shot uses source-domain normal references without target training data; few-shot adds trusted target normals while keeping model parameters fixed.
- Dual graph-language views: GLASS serializes topology and optional attributes into a graph code while encoding the same structural evidence as a compact GraphDP prompt.GraphDP includes graph size, density, connectivity, degree, clustering, motif, core, and spectral summaries.
- Local structural evidence: Local topology descriptors provide degree, clustering, core, triangle, and 4-cycle statistics that remain available when raw attributes are missing.These rooted-neighborhood statistics supply a common structural vocabulary across heterogeneous graph families.
- Graph encoder: The graph encoder concatenates LTDs with available attributes, normalizes features per graph, and applies a canonicalization MLP before GIN encoding.Mean and max readouts produce the graph representation, complemented by a lightweight spectral sketch from the normalized Laplacian.
- Text anchors: A frozen Qwen3-Embedding text encoder produces GraphDP anchors, and native Matryoshka prefix slices provide multi-resolution text representations.The text encoder is used only for embeddings, while graph-side mappings are learned against fixed unit-vector anchors.
B. Graph-Language Alignment
GLASS aligns graph evidence with frozen text anchors on shared hyperspheres at multiple representation resolutions. Its objective combines slice-wise soft-cosine alignment with a dimension-adaptive Gram regularizer.
- Multi-slice alignment: Graph-side projections map graph evidence into the spherical coordinate system of each corresponding text slice.The projections are learned for each slice while the text anchors remain fixed.
- Multi-slice alignment: The multi-slice soft-cosine loss aligns graph and language views at multiple resolutions, from coarse structural signals to finer GraphDP evidence.Smaller slices emphasize coarse structure, whereas larger slices retain more detailed evidence.
- Regularization: The dimension-adaptive Gram regularizer stabilizes angular alignment by encouraging orthonormal rows when Ds ≤ Dg and near-isometric embeddings when Ds > Dg.This avoids imposing a rank-impossible orthogonality target across slice dimensions.
C. Training-Time Spherical Density Shaping
GLASS shapes normal graph embeddings into compact spherical modes using prototype-based density regularization. Perturbed graphs are pushed away from these normal modes during training, without changing GraphDP inputs.
- Normal geometry: Spherical prototypes act as a training-time density-shaping regularizer for normal graph embeddings on each representation slice.The objective encourages normal embeddings to occupy a few dense modes rather than spread uniformly across the sphere.
- Perturbation training: A margin term pushes perturbed graphs away from the normal prototype modes.The perturbation indicator is used only inside the training loss and is not inserted into GraphDP.
- Frozen text branch: Text embeddings used in the training objective can be precomputed or passed through the frozen encoder without gradient updates.This preserves the fixed text-anchor geometry during optimization.
D. Spherical Reference-Set Scoring
After training, GLASS scores query graphs by angular density relative to normal graph and text references. The same spherical scoring framework supports single-domain, zero-shot, and few-shot deployment through reference-set construction.
- Reference embeddings: GLASS freezes both encoders and computes graph and text reference embeddings for the selected deployment regime.The normal reference set R is the basis for subsequent angular-density scoring.
- Spherical density: The vMF kernel-density estimator assigns density to unit embeddings using concentration κ and cosine similarity to reference points.The scorer is defined on each slice and can be applied to graph or text reference embeddings.
- High-concentration scoring: The practical scorer uses the high-concentration limit of vMF density, ranking each query by its angular k-nearest references.This connects probabilistic spherical density estimation to cosine-distance nearest-neighbor scoring.
- Multimodal fusion: The final graph-level score combines slice-weighted graph and text channels, with weights and calibration estimated from normal references only.The graph and text channels provide the multimodal components of SMS.
- Deployment regimes: Single-domain, zero-shot, and few-shot settings differ only in their reference sets, while the graph encoder, text encoder, projections, and prototypes remain unchanged.Few-shot calibration adds trusted target normals at inference time; zero-shot uses source-domain normals without target training graphs.
V. SPHERICAL DENSITY PRINCIPLE
GLASS interprets anomaly detection as density estimation on the unit hypersphere, with vMF scoring converging to angular nearest-neighbor scoring at high concentration. The practical k-NN extension retains this density interpretation while reducing sensitivity to isolated references.
- vMF scoring ranks queries by one-minus-cosine nearest-neighbor distance on the sphere in the high-concentration limit.The proposition establishes the exact 1-NN angular limit of the vMF density formulation.
- The vMF KDE-to-nearest-neighbor result follows by a scaled log-sum-exp convergence to the maximum cosine similarity.Terms independent of the query contribute only additive constants, leaving the nearest-reference angular distance to determine rankings.
- The reported mean k-NN score with k > 1 extends the exact 1-NN limit to reduce sensitivity to isolated reference points.The extension preserves the same density intuition while providing a finite-sample robust scorer.
A. Setup
GLASS is evaluated on twelve graph benchmarks spanning molecular, protein, and social domains using normal-only training and AUROC-based anomaly ranking. It achieves strong single-domain performance, while transfer and calibration reveal domain-dependent gains and limitations.
- Setup: 12 benchmarks cover small molecules, proteins, and social graphs, with normal-class training and held-out normal-versus-anomalous evaluation.The study reports mean and standard deviation over five seeds, using AUROC as the primary metric.
- Setup: The default configuration uses a frozen Qwen3-Embedding-0.6B encoder with native MRL slices {64, 128, 256, 512} and a spherical reference-set scorer.Larger frozen encoders and text adaptation are evaluated as ablations.
- Single-Domain Results: 79.85 average AUROC and 1.75 average rank make GLASS the best listed single-domain method across twelve datasets.GLASS ranks first on seven datasets and remains top-two on D&D, COX2, and AIDS.
- Cross-Domain and Few-Shot Transfer: Molecular-to-protein transfer improves PROTEINS by +2.9pp and D&D by +4.6pp over matched single-domain references.These gains are associated with transferable GraphDP fields including motifs, degree profiles, density, and low-frequency connectivity.
- Cross-Domain and Few-Shot Transfer: Transfer into REDDIT-BINARY loses 15–20pp, while all-domain references slightly improve PROTEINS but dilute MUTAG and IMDB-B.The results indicate that source coverage and source weighting matter in heterogeneous reference mixtures.
- Cross-Domain and Few-Shot Transfer: One trusted target normal graph raises PROTEINS AUROC from 65.59 to 73.33 without gradient updates.At 32 shots, MUTAG reaches 84.54, whereas small reference sets remain insufficient for the broader IMDB-BINARY manifold.
D. Ablation Analysis
GLASS ablations show that transferability and scoring depend on matching representation channels and source–target semantics. The experiments support frozen text anchors, high-concentration angular scoring, and distinct biochemical versus social transfer regimes.
- No single scoring channel dominates all datasets, while the full scorer is strongest on PROTEINS, MUTAG, and IMDB-B.Finite-κ vMF and SMS provide the density interpretation but are not uniformly better than angular reference-set scoring.
- Text-encoder scaling reveals a specificity–transferability trade-off rather than monotone improvement with model size.
- Adapting the text encoder is highly dataset-dependent, with large degradations on PROTEINS, AIDS, IMDB-BINARY, and COLLAB.This supports freezing the instruction-aware text space while learning graph-side alignment only.
- Related biochemical domains transfer well when source references cover target substructure semantics, whereas social targets remain hard under biological sources.Few-shot calibration is effective when the target normal manifold is related but locally miscalibrated, as observed on PROTEINS.
- GLASS provides one alignment and scoring framework for single-domain, zero-shot, and few-shot graph-level anomaly detection.Its shared hyperspherical space supports transfer when source and target graphs share structural-language evidence.
A. Evaluation protocol.
The evaluation separates representation learning, reference construction, and scoring across single-domain, zero-shot, and few-shot settings. GLASS uses deterministic structural prompts, frozen text anchors, normal-reference calibration, and reference-set scoring without target-data training for zero-shot transfer.
- Single-domain experiments use target-domain normal graphs, zero-shot transfer uses source-domain normals, and few-shot calibration appends trusted target normals at inference.Test anomaly labels are used only for metric computation.
- The main score is an angular k-NN reference scorer, with graph-only, text-only, fusion, vMF, and SMS variants evaluated as ablations.The reported GLASS scorer uses normal-reference reliability weights rather than fixed equal channel weights.
- The evaluation covers graph datasets characterized by graph counts, classes, average nodes and edges, and node-feature dimensions.
- All reliability statistics and score calibration use normal references only, while zero-shot and few-shot deployment change the reference set without gradient-based adaptation.Few-shot deployment adds trusted target normals to the reference set while model parameters remain fixed.
- GLASS constructs deterministic GraphDP strings from LTDs, graph-level aggregates, motif summaries, and spectral summaries, then embeds them with a frozen instruction-aware encoder.Native Matryoshka slices provide multi-resolution text anchors for graph-side alignment.
G LGNNmGH + N P
Reference scoring has linear dependence on the number of slices, references, and slice dimension during exact inference.
- Exact reference scoring for one query requires O(S|R|Ds) after the graph and text forward pass.Approximate cosine nearest-neighbor indexing can replace exact search for large reference sets.