Table of Contents
Fetching ...

Contextual Tokenization for Graph Inverted Indices

Pritish Chakraborty, Indradyumna Roy, Soumen Chakrabarti, Abir De

TL;DR

CORGII addresses scalable retrieval of subgraph-containing graphs by translating graphs to discrete tokens via a graph tokenizer, enabling use of inverted indices while preserving contextual containment signals. It introduces a trainable Impact_ψ to weight token matches and a co-occurrence based multiprobing scheme to boost recall before applying an accurate, pretrained graph alignment model for reranking. The approach combines differentiable tokenization with Chamfer-based matching and an asymmetric GTNet, yielding superior accuracy-efficiency trade-offs across multiple datasets compared to strong baselines. Practically, CORGII enables fast, scalable graph search in large corpora with configurable latency-accuracy tradeoffs, and opens avenues for dynamic vocabularies and richer graph representations in retrieval systems.

Abstract

Retrieving graphs from a large corpus, that contain a subgraph isomorphic to a given query graph, is a core operation in many real-world applications. While recent multi-vector graph representations and scores based on set alignment and containment can provide accurate subgraph isomorphism tests, their use in retrieval remains limited by their need to score corpus graphs exhaustively. We introduce CORGII (Contextual Representation of Graphs for Inverted Indexing), a graph indexing framework in which, starting with a contextual dense graph representation, a differentiable discretization module computes sparse binary codes over a learned latent vocabulary. This text document-like representation allows us to leverage classic, highly optimized inverted indices, while supporting soft (vector) set containment scores. Pushing this paradigm further, we replace the classical, fixed impact weight of a `token' on a graph (such as TFIDF or BM25) with a data-driven, trainable impact weight. Finally, we explore token expansion to support multi-probing the index for smoother accuracy-efficiency tradeoffs. To our knowledge, CORGII is the first indexer of dense graph representations using discrete tokens mapping to efficient inverted lists. Extensive experiments show that CORGII provides better trade-offs between accuracy and efficiency, compared to several baselines.

Contextual Tokenization for Graph Inverted Indices

TL;DR

CORGII addresses scalable retrieval of subgraph-containing graphs by translating graphs to discrete tokens via a graph tokenizer, enabling use of inverted indices while preserving contextual containment signals. It introduces a trainable Impact_ψ to weight token matches and a co-occurrence based multiprobing scheme to boost recall before applying an accurate, pretrained graph alignment model for reranking. The approach combines differentiable tokenization with Chamfer-based matching and an asymmetric GTNet, yielding superior accuracy-efficiency trade-offs across multiple datasets compared to strong baselines. Practically, CORGII enables fast, scalable graph search in large corpora with configurable latency-accuracy tradeoffs, and opens avenues for dynamic vocabularies and richer graph representations in retrieval systems.

Abstract

Retrieving graphs from a large corpus, that contain a subgraph isomorphic to a given query graph, is a core operation in many real-world applications. While recent multi-vector graph representations and scores based on set alignment and containment can provide accurate subgraph isomorphism tests, their use in retrieval remains limited by their need to score corpus graphs exhaustively. We introduce CORGII (Contextual Representation of Graphs for Inverted Indexing), a graph indexing framework in which, starting with a contextual dense graph representation, a differentiable discretization module computes sparse binary codes over a learned latent vocabulary. This text document-like representation allows us to leverage classic, highly optimized inverted indices, while supporting soft (vector) set containment scores. Pushing this paradigm further, we replace the classical, fixed impact weight of a `token' on a graph (such as TFIDF or BM25) with a data-driven, trainable impact weight. Finally, we explore token expansion to support multi-probing the index for smoother accuracy-efficiency tradeoffs. To our knowledge, CORGII is the first indexer of dense graph representations using discrete tokens mapping to efficient inverted lists. Extensive experiments show that CORGII provides better trade-offs between accuracy and efficiency, compared to several baselines.
Paper Structure (74 sections, 22 equations, 12 figures, 8 tables)

This paper contains 74 sections, 22 equations, 12 figures, 8 tables.

Figures (12)

  • Figure 1: CoRGII block diagram. Each (query, corpus) graph pair $(G_q, G_c)$ is encoded using a shared $\mathrm{GNN}_\theta$, followed by separate MLPs ($\mathrm{MLP}_{\phi_1}$ and $\mathrm{MLP}_{\phi_2}$) to compute soft binary node embeddings $\bm{z}_{c}(v), \bm{z}_{q}(u) \in (0,1)^D$. These are thresholded to obtain discrete binary codes $\widehat{\bm{z}}_c(v), \widehat{\bm{z}}_q(u) \in \{0,1\}^D$, mapped to integer-valued latent tokens $\tau \in \mathcal{T} = [2^D]$. Corpus tokens are indexed into posting lists $\mathrm{PostingList}(\tau)$, enabling sparse inverted indexing. During retrieval, query tokens $\tau_q(u)$ are expanded via co-occurrence–based multi-probing (CM) to select similar tokens $\mathcal{N}_b(\tau_q(u))$. Each expanded token $\tau$ contributes to the corpus score through an impact score $\mathrm{Impact}_\psi(\tau, \bm{h}_q(u))$, producing the overall retrieval score $S_{\text{impact,CM}}(G_q, G_c)$. Graphs with score exceeding a threshold $\delta$ are shortlisted and reranked using the alignment distance $\Delta (G_q, G_c)$ (Eq. \ref{['eq:hsh']}).
  • Figure 2: (a) preprocessing and (b) query-time components of CoRGII.
  • Figure 3: Tradeoff between retrieval accuracy and efficiency for CoRGII, FHN fhashnet, IVF-single douze2024faiss, IVF-multi douze2024faiss, DiskANN-single disk-ann, DiskANN disk-ann and Random, on 20% test queries on all four datasets. Here, retrieval accuracy is measured in terms of mean average precision (MAP) and efficiency is measured as fraction of corpus graphs retrieved ($k/C$).
  • Figure 4: Multiprobing: CM vs. HM
  • Figure 5: Ablation on impact weight network
  • ...and 7 more figures