Manuscript Offprint

arXiv:2609.05253

GLASS: Graph-Language Alignment with Spherical Scoring for Transferable Graph-Level Anomaly Detection

Xudong Wang, Chris Ding, Tongxin Li, Jicong Fan

Xudong Wang, Chris Ding, Tongxin Li, Jicong Fan

School of Data Science, The Chinese University of Hong Kong, Shenzhen (CUHK-Shenzhen), China

xudongwanglink.cuhk.edu.cn, {chrisding, litongxin, fanjicong}cuhk.edu.cn

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. For scoring, we formulate anomaly detection as density estimation on the aligned hypersphere and introduce Spherical Multi-Modal Scoring (SMS), which instantiated von Mises–Fisher kernel density estimators in both graph and text embedding spaces. This probabilistic formulation recovers angular kk-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 any target 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.

Index Terms—graph-level anomaly detection, graph-language alignment, cross-domain transfer, hyperspherical scoring

I. INTRODUCTION

Graphs are primary data objects in molecular screening, protein analysis, social computing, and many other data-mining applications. In graph-level anomaly detection (GLAD), a model observes normal graph instances and must rank unseen graphs by anomalousness [1–3]. Existing GLAD systems usually learn a detector for one dataset: molecules have atom and bond attributes, protein graphs have different structural attributes, and social graphs may have no node attributes at all. This dataset-specific assumption becomes restrictive when a new domain has only a few trusted normal graphs, or no target-domain training data.

The central difficulty is not merely discriminative capacity; it is the absence of an interoperable representation and a common anomaly-scoring principle across heterogeneous graph families. A molecular ring, a protein contact pattern, and a social community are not directly comparable as raw node features. However, they can all be described through structural

language: graph size, density, degree profiles, clustering, motifs, connectivity, core structure, and spectral summaries. This observation suggests a scalable route toward transferable GLAD: align graph representations with an instruction-aware language embedding space that can encode the same structural evidence across domains.

GLASS instantiated this idea through a coherent pipeline. First, Local Topology Descriptors (LTDs) provide stable node-level structural evidence even when raw attributes are missing or incomparable. Second, GraphDP serializes local, global, and spectral graph properties into a compact structured prompt. Third, a frozen instruction-aware text encoder embeds this prompt and provides stable text anchors; we use Qwen3-Embedding [4], an instruction-aware embedding model with native MRL support, as the embedding function rather than a generative reasoner. Finally, a structure-aware graph encoder is trained to align with these anchors on the unit hypersphere through native Matryoshka representation slices.

The hyperspherical view turns GLAD into density estimation. In the aligned graph-text space, a query graph is anomalous when it lies in a low-density region relative to normal references. We formalize this through a von Mises–Fisher (vMF) kernel-density view and use its angular k-NN high-concentration limit as the practical scorer. This single scoring family supports three deployment regimes without changing the architecture: single-domain GLAD uses target normal references; zero-shot transfer uses source-domain normal references; and few-shot adaptation augments the reference set with a handful of trusted target normal graphs.

This design addresses three impediments to transferable GLAD. First, it replaces dataset-specific raw features with a structural-language bridge. Second, it stabilizes cross-domain alignment by freezing the instruction-aware text space and learning graph-side mappings only. Third, it provides a non-parametric spherical scoring rule that is naturally compatible with reference-set calibration. Empirically, GLASS achieves strong single-domain performance across twelve benchmarks and reveals interpretable transfer regimes: molecular and protein graphs transfer well because their GraphDP descriptions share substructure semantics, while larger biological-to-social shifts require richer source weighting or target references.

Our contributions are:

• We propose a transferable GLAD paradigm that formulates anomaly detection as density estimation on an aligned graph-language hypersphere.

• We instantiate this paradigm in GLASS, integrating LTDs, GraphDP, frozen instruction-aware text anchors, native Matryoshka slices, and Spherical Multi-Modal Scoring.

  • We give a rigorous vMF KDE analysis showing why angular nearest-neighbor scoring arises as the high-concentration density limit.

  • Our empirical results demonstrate GLASS's superior single-domain performance and effective zero-/few-shot cross-domain transfer across twelve widely used graph benchmarks and three meta-domains.

References (35)