SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2502.01113 · NeurIPS · 2025

GFM-RAG: Graph Foundation Model for Retrieval Augmented Generation

Chen Gong, Dinh Phung, Shirui Pan, Linhao Luo, Gholamreza Haffari, Zicheng Zhao

arXiv · PDF · Open in the Atlas

Code that ran

3 of 12 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (1 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 1 has no contract verdict; 2 failures of our instrument; 9 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2502.01113.json · badge: /api/ran/2502.01113.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
RManLuo/gfm-rag canonical (classifier label)
classifier basis: classifier_2025
1 ran · 9 no recorded run
copy not recorded community
not in the paper's declared repositories
2 ran · 0 no recorded run
FunctionStatusWhere it lives
BaseNBFNet Ran
ran on a synthesized input · constructed an object; no result was computed
RManLuo/gfm-rag/gfmrag/models/gfm_rag_v1/model.py
code served (permissive licence) · get_code("5d0da801282cb283")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, BaseNBFNet: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
from torch import nn

torch.manual_seed(0)

# Create a minimal mock for `tasks` module since it's used in the code
class MockTasks:
    @staticmethod
    def edge_match(edge_index, easy_edge):
        # Return indices of matching edges
        return (torch.tensor([], dtype=torch.long),)

class MockData:
    def __init__(self):
        self.num_relations = 8
        self.num_edges = 10
        self.edge_index = torch.tensor([[0, 1, 2], [1, 2, 3]], dtype=torch.long)
        self.edge_type = torch.tensor([0, 1, 2], dtype=torch.long)

# Inject mock tasks module into the namespace where it would be used
import sys
class TasksModule:
    @staticmethod
    def edge_match(edge_index, easy_edge):
        return (torch.tensor([], dtype=torch.long),)

tasks = TasksModule()

ARGS = {
    'input_dim': 4,
    'hidden_dims': [8, 8],
    'num_relation': 6,
    'message_func': 'distmult',
    'aggregate_func': 'sum',
    'short_cut': False,
    'layer_norm': False,
    'activation': 'relu',
    'concat_hidden': False,
    'num_mlp_layer': 2,
    'dependent': False,
    'remove_one_hop': False,
    'num_beam': 10,
    'path_topk': 10,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type BaseNBFNet — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a BaseNBFNet output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
index_to_mask Ran
ran; our contract draft was wrong, not the code
this paper's copy was not recorded; identical code first harvested from KiddoZhu/NBFNet-PyG
pointer only · get_code("9664f4b5c60ab1bf")
How it ran

The body of this sample is withheld: this paper's copy of the code was not recorded (its link names no repository or source path), so no licence was read for it. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

size_to_index Ran
ran; our contract draft was wrong, not the code
this paper's copy was not recorded; identical code first harvested from KiddoZhu/NBFNet-PyG
pointer only · get_code("4ddf5f547371a7f7")
How it ran

The body of this sample is withheld: this paper's copy of the code was not recorded (its link names no repository or source path), so no licence was read for it. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

BaseDocRanker Not yet run
unverified (harvested, no recorded run)
RManLuo/gfm-rag/gfmrag/models/gfm_rag_v1/model.py
code served (permissive licence) · get_code("c34f3d06ecafa853")
How it ran

no invocation recorded.

BaseGNNModel Not yet run
unverified (harvested, no recorded run)
RManLuo/gfm-rag/gfmrag/models/gfm_rag_v1/model.py
code served (permissive licence) · get_code("cb80ef9d19ad39ae")
How it ran

no invocation recorded.

EntityNBFNet Not yet run
unverified (harvested, no recorded run)
RManLuo/gfm-rag/gfmrag/models/gfm_rag_v1/model.py
code served (permissive licence) · get_code("e32d331a7452930b")
How it ran

no invocation recorded.

GNNRetriever Not yet run
unverified (harvested, no recorded run)
RManLuo/gfm-rag/gfmrag/models/gfm_rag_v1/model.py
code served (permissive licence) · get_code("f0ae7d13f8554d44")
How it ran

no invocation recorded.

QueryGNN Not yet run
unverified (harvested, no recorded run)
RManLuo/gfm-rag/gfmrag/models/gfm_rag_v1/model.py
code served (permissive licence) · get_code("765c0c1c55be3583")
How it ran

no invocation recorded.

QueryNBFNet Not yet run
unverified (harvested, no recorded run)
RManLuo/gfm-rag/gfmrag/models/gfm_rag_v1/model.py
code served (permissive licence) · get_code("db7c14422ada8d9f")
How it ran

no invocation recorded.

multi_slice_mask Not yet run
unverified (harvested, no recorded run)
RManLuo/gfm-rag/gfmrag/models/gfm_rag_v1/model.py
code served (permissive licence) · get_code("90451408a79c07c5")
How it ran

no invocation recorded.

scatter_extend Not yet run
unverified (harvested, no recorded run)
RManLuo/gfm-rag/gfmrag/models/gfm_rag_v1/model.py
code served (permissive licence) · get_code("8877e4c655410109")
How it ran

no invocation recorded.

scatter_topk Not yet run
unverified (harvested, no recorded run)
RManLuo/gfm-rag/gfmrag/models/gfm_rag_v1/model.py
code served (permissive licence) · get_code("a3254ec30b9d591e")
How it ran

no invocation recorded.

Also present in other papers' code

Of 12 samples lifted from this paper's linked repositories, 12 carry a function identity and 0 do not. Of the 12 distinct functions with an identity, 6 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 0 the same month, 6 later) and 6 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
index_to_mask
brick of this paper's assembly: helper
2 other papers
1 dated earlier, 1 later · 1 only as an assembly brick
2106.06935 (2021-06)
Neural Bellman-Ford Networks: A General Graph Neural Network Framework for Link Prediction
2604.22282 (2026-04)
STEM: Structure-Tracing Evidence Mining for Knowledge Graphs-Driven Retrieval-Augmented Generation
size_to_index
brick of this paper's assembly: helper
2 other papers
1 dated earlier, 1 later · 1 only as an assembly brick
2106.06935 (2021-06)
Neural Bellman-Ford Networks: A General Graph Neural Network Framework for Link Prediction
2604.22282 (2026-04)
STEM: Structure-Tracing Evidence Mining for Knowledge Graphs-Driven Retrieval-Augmented Generation
BaseNBFNet
brick of this paper's assembly: helper
1 other paper
1 later
2604.22282 (2026-04)
STEM: Structure-Tracing Evidence Mining for Knowledge Graphs-Driven Retrieval-Augmented Generation
multi_slice_mask
brick of this paper's assembly: helper
1 other paper
1 later · 1 only as an assembly brick
2604.22282 (2026-04)
STEM: Structure-Tracing Evidence Mining for Knowledge Graphs-Driven Retrieval-Augmented Generation
scatter_extend
brick of this paper's assembly: helper
1 other paper
1 later · 1 only as an assembly brick
2604.22282 (2026-04)
STEM: Structure-Tracing Evidence Mining for Knowledge Graphs-Driven Retrieval-Augmented Generation
scatter_topk
brick of this paper's assembly: helper
1 other paper
1 later · 1 only as an assembly brick
2604.22282 (2026-04)
STEM: Structure-Tracing Evidence Mining for Knowledge Graphs-Driven Retrieval-Augmented Generation

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Retrieval-augmented generation (RAG) has proven effective in integrating knowledge into large language models (LLMs). However, conventional RAGs struggle to capture complex relationships between pieces of knowledge, limiting their performance in intricate reasoning that requires integrating knowledge from multiple sources. Recently, graph-enhanced retrieval augmented generation (GraphRAG) builds graph structure to explicitly model these relationships, enabling more effective and efficient retrievers. Nevertheless, its performance is still hindered by the noise and incompleteness within the graph structure. To address this, we introduce GFM-RAG, a novel graph foundation model (GFM) for retrieval augmented generation. GFM-RAG is powered by an innovative graph neural network that reasons over graph structure to capture complex query-knowledge relationships. The GFM with 8M parameters undergoes a two-stage training process on large-scale datasets, comprising 60 knowledge graphs with over 14M triples and 700k documents. This results in impressive performance and generalizability for GFM-RAG, making it the first graph foundation model applicable to unseen datasets for retrieval without any domain-specific fine-tuning required. Extensive experiments on three multi-hop QA datasets and seven domain-specific RAG datasets demonstrate that GFM-RAG achieves state-of-the-art performance while maintaining efficiency and alignment with neural scaling laws, highlighting its potential for further improvement.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2502.01113")
get_code_for_paper("2502.01113")
have("2502.01113")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2502.01113.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2502.01113.svg)](https://syntology.ai/paper/2502.01113)

Connect an agent — have() is free.