Research
Contextual Tokenization for Graph Inverted Indices
Contextual Tokenization for Graph Inverted Indices Overview Research area: Graph retrieval and indexing; specifically neural subgraph-containment search over large graph corpora, drawing on techniques
- arXiv
- 2510.22479
- Published
- 2025-10-26
- Authors
- Pritish Chakraborty, Indradyumna Roy, Soumen Chakrabarti, Abir De
AI summary
Contextual Tokenization for Graph Inverted IndicesOverview
Research area: Graph retrieval and indexing; specifically neural subgraph-containment search over large graph corpora, drawing on techniques from dense text retrieval (inverted indices, impact weights, multi-probe expansion).
Technical level: Advanced. The paper assumes familiarity with graph neural networks, subgraph isomorphism, optimal transport / Gumbel-Sinkhorn relaxations, Chamfer distance, and classical information retrieval concepts (posting lists, TFIDF, BM25, SPLADE, ColBERT).
Scope: The paper introduces CoRGII (Contextual Representation of Graphs for Inverted Indexing), a framework that converts contextual dense graph node representations into discrete binary tokens so that corpus graphs can be retrieved with classical inverted indices rather than exhaustive pairwise scoring.
Note on completeness: The supplied paper content is truncated in the middle of the opening sentence of Section 4 (Experiments). Therefore this summary reports the paper's stated design, losses, and abstract-level claims, but no experimental numbers, dataset names, benchmark metrics, or baseline results, because none appear in the provided content.
What This Paper Is About
Given a query graph, the task is to retrieve, from a corpus of graphs, those graphs that contain a subgraph isomorphic to the query. Accurate neural approaches to this task require early cross-interaction between the query and every corpus graph, which forces query time proportional to the corpus size (written in the paper as an impractical Omega(C)). The paper's goal is to build an index over graph representations that avoids scoring the entire corpus, while retaining much of the accuracy of the expensive alignment-based scores.
Key Contributions
-
A differentiable graph tokenizer network (GTNet). A shared GNN encodes query and corpus graphs, and two separate MLPs (one for queries, one for corpus graphs, with parameters φ1 and φ2) produce soft binary node codes that are thresholded into discrete bit-vector tokens over a latent vocabulary of size 2^D. This yields multi-vector, discrete, text-document-like graph representations that can be stored in standard inverted lists.
-
Replacing permutation-based alignment with Chamfer distance. Because inverted indices require documents to be indexed independently of queries, CoRGII drops the doubly stochastic permutation matrix P from the hinge distance and instead matches each query node independently via the Chamfer distance over discrete node representations, which permits non-injective mappings and is described as more compatible with token matching.
-
A trainable, query-aware token impact network. An MLP, Impact_ψ(τ, h), takes a binary token together with the continuous pre-trained node embedding and outputs a learned importance weight, analogous in spirit to TFIDF or BM25 term weights but data-driven and query-sensitive. The paper notes that impact weights are not stored per document in the index, unlike classical inverted indices.
-
Two multi-probing strategies for recall. Hamming expansion (probing all tokens within a Hamming ball of radius r, building on locality-sensitive hashing practice) and a novel co-occurrence expansion (selecting the b tokens whose posting lists overlap most with a query token's posting list) provide smoother accuracy-efficiency trade-offs, combined with a tunable score threshold δ for shortlisting before reranking.
Main Findings
-
Indexing dense graph representations is claimed to be a first. The paper states that CoRGII is, to the authors' knowledge, the first indexer of dense graph representations using discrete tokens mapped to efficient inverted lists.
-
Abstract-level accuracy/efficiency claim. The abstract states that extensive experiments show CoRGII provides better trade-offs between accuracy and efficiency compared to several baselines. The specific datasets, baselines, metrics, and all numeric results are not present in the provided content.
-
Exhaustive scoring is identified as the bottleneck. The paper frames the core obstacle as the Omega(C) query cost arising from the need for early cross-interaction between query and corpus graph, which is what prevents accurate alignment-based scores from being indexable.
-
Injective alignment is argued to be suboptimal. Prior works use injective node alignment; the paper finds it suboptimal due to inconsistencies introduced by its continuous relaxation, and reports that Chamfer distance over discrete representations supports accurate token matching without requiring injectivity.
-
Impact weights differ from IDF-style weighting. The paper notes that in the graph setting, combinatorial explosion of motifs makes estimating motif frequencies intractable, and unlike text IDF, frequent structures cannot simply be down-weighted because subgraph retrieval must match all query components regardless of subgraph frequency.
-
Single-probe retrieval was observed to lose recall. Preliminary experiments (described qualitatively, without numbers) suggested that one probe per query token loses recall, attributed partly to information loss from continuous to bit-like representations and partly to replacing permutation-based alignment with the Chamfer score.
-
A tunable threshold controls the trade-off. The threshold δ on the aggregated score determines shortlist size: high δ means a smaller shortlist and lower query time, low δ means higher query time, giving a smooth latency/quality dial.
Methodology in Plain English
CoRGII has a two-stage training procedure followed by a query-time pipeline.
Stage 1 — train the tokenizer. A shared GNN (the paper builds on an existing subgraph matching backbone, IsoNet, for the final reranking scores) contextualizes each node in its graph neighborhood. Two separate MLPs then map query nodes and corpus nodes into values in (0,1)^D via sigmoid activations. Separate MLPs are used deliberately: subgraph containment is asymmetric — G_q being contained in G_c does not imply the reverse — and order embeddings produced by shared Siamese networks are incompatible with the exact token matching that inverted indices require. The network is trained with a margin-based pairwise ranking loss on the Chamfer distance, so that a relevant corpus graph is closer to the query by a margin m than a non-relevant one. Training is driven purely by retrieval accuracy, not by reconstruction.
Stage 2 — learn token impacts. After GTNet is frozen, soft codes are thresholded at 0.5 into D-bit binary vectors, giving discrete tokens from a vocabulary of 2^D. Each graph becomes a multiset of such tokens (padded nodes are excluded). A second pairwise hinge loss with margin γ trains the impact MLP ψ using the aggregated impact-weighted scores.
Indexing and querying. Each corpus graph is represented as its token multiset and tokens are mapped to posting lists of corpus graph IDs. At query time, the query is tokenized the same way, its tokens are used to probe the index (optionally expanded by Hamming-ball probing of radius r, or by co-occurrence-based selection of the b most similar tokens by posting-list overlap), and the contributions are aggregated — either uniformly or weighted by Impact_ψ and by token similarity for co-occurrence expansion. Corpus graphs whose aggregated score meets the threshold δ form the shortlist, which is then reranked using the more expensive pre-trained alignment distance.
Design rationale. The design is explicitly framed as porting lessons from text retrieval — inverted indices, impact-ordered posting lists, ColBERT-style contextualized late interaction, and SPLADE-style document expansion — into the graph domain, where the "expansion" signal must come from structure and posting-list co-occurrence rather than word context.
Why This Matters
Impact on research: The paper opens a bridge between two largely separate lines of work: multi-vector neural graph representations with transport-based containment scores, and the heavily optimized inverted-index infrastructure used in text search. It suggests that graph retrieval can inherit decades of engineering investment in inverted indices rather than requiring exhaustive neural scoring, and it introduces a learned, query-aware analogue of term impact weighting for graphs.
Real-world applications (as listed in the paper):
- Functional group search in molecular databases.
- Control-flow pattern detection in program analysis.
- Semantic search in scene graphs.
- The paper also notes the general task of finding, from a large corpus, graphs containing a given query subgraph as a subgraph.
Industry relevance: Systems that must search large graph collections — molecular and materials databases, program-analysis tooling, scene-graph or knowledge-graph search — face exactly the cost problem the paper targets: accurate neural containment scoring scales with corpus size. An indexing layer that shortlists candidates with sparse dot-product-style scans over posting lists, with a knob for latency-versus-quality, is directly aligned with production search requirements. The release of code at github.com/structlearning/corgii supports reproducibility and reuse.
Future Directions
-
Closing the recall gap from discretization. The paper identifies lost recall from continuous-to-binary representation and from replacing permutation alignment with Chamfer scoring as a problem partially addressed by multi-probing; how far multi-probing can close that gap remains an open question.
-
Scaling and maintaining the token vocabulary and posting lists. With a token space of size 2^D, questions of vocabulary growth, index size, and posting-list overlap computation cost for co-occurrence expansion are natural next concerns.
-
Combining expansion strategies. The paper lists Hamming expansion and co-occurrence expansion as alternatives that could be used "either by itself, or in conjunction"; the joint design and analysis of hybrid probing is left open.
-
Extending learned impact weighting. Since impact weights are learned as a function of token and continuous embedding rather than stored per document, a natural direction is refining this weighting scheme and understanding its behavior across different graph corpora and query workloads.
Target Audience
This paper is most valuable to researchers and practitioners working on neural graph retrieval, subgraph matching at scale, and learned sparse retrieval. It will be particularly useful to those already familiar with ColBERT, PLAID, or SPLADE-style text retrieval who want to see the same inverted-index and multi-probe ideas transferred to graphs, and to engineers building large-scale molecular, program-analysis, or scene-graph search systems who need accuracy-latency trade-offs. Readers without background in GNNs, optimal transport relaxations, or information retrieval internals will find the paper demanding.
Authors’ 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.