{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/gfm-rag-graph-foundation-model-for-retrieval","title":"GFM-RAG: Graph Foundation Model for Retrieval Augmented Generation","arxiv_id":"2502.01113","date":"2025-02-03","proceeding":null,"authors":["Linhao Luo","Zicheng Zhao","Gholamreza Haffari","Dinh Phung","Chen Gong","Shirui Pan"],"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 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.","url_abs":"https://arxiv.org/abs/2502.01113v1","url_pdf":"https://arxiv.org/pdf/2502.01113v1.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"gfm-rag-graph-foundation-model-for-retrieval","repo_url":"https://github.com/RManLuo/gfm-rag","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"graph-neural-network","task_name":"Graph Neural Network"},{"task_slug":"knowledge-graphs","task_name":"Knowledge Graphs"},{"task_slug":"rag","task_name":"RAG"},{"task_slug":"retrieval","task_name":"Retrieval"},{"task_slug":"retrieval-augmented-generation","task_name":"Retrieval-augmented Generation"}],"methods":[{"method_slug":"adam","method_name":"Adam"},{"method_slug":"attention","method_name":"Attention"},{"method_slug":"attention-dropout","method_name":"Attention Dropout"},{"method_slug":"bart","method_name":"BART"},{"method_slug":"bert","method_name":"BERT"},{"method_slug":"bpe","method_name":"BPE"},{"method_slug":"dense-connections","method_name":"Dense Connections"},{"method_slug":"dropout","method_name":"Dropout"},{"method_slug":"graph-neural-network","method_name":"Graph Neural Network"},{"method_slug":"layer-normalization","method_name":"Layer Normalization"},{"method_slug":"linear-layer","method_name":"Linear Layer"},{"method_slug":"linear-warmup-with-linear-decay","method_name":"Linear Warmup With Linear Decay"},{"method_slug":"multi-head-attention","method_name":"Multi-Head Attention"},{"method_slug":"rag","method_name":"RAG"},{"method_slug":"residual-connection","method_name":"Residual Connection"},{"method_slug":"softmax","method_name":"Softmax"},{"method_slug":"weight-decay","method_name":"Weight Decay"},{"method_slug":"wordpiece","method_name":"WordPiece"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2502.01113","atlas_url":"https://app.syntology.ai/?focus=2502.01113","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2502.01113"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/RManLuo/gfm-rag","reach":null}],"summary":{"ran":1,"ran_draft_wrong":2,"unverified":9},"by_repo_kind":{"official":{"samples":10,"ran":1,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":2,"samples":[{"code_sha256_prefix":"5d0da801282cb283","entry":"BaseNBFNet","repo":"RManLuo/gfm-rag","repo_kind":"official","path":"gfmrag/models/gfm_rag_v1/model.py","file_url":"https://github.com/RManLuo/gfm-rag/blob/HEAD/gfmrag/models/gfm_rag_v1/model.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"5d0da801282cb283"}},{"code_sha256_prefix":"9664f4b5c60ab1bf","entry":"index_to_mask","repo":null,"repo_kind":null,"path":null,"file_url":null,"link_basis":"identical_code_first_harvested_elsewhere","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":null,"inline_ok":false,"mcp_get_code":{"code_sha256":"9664f4b5c60ab1bf"}},{"code_sha256_prefix":"4ddf5f547371a7f7","entry":"size_to_index","repo":null,"repo_kind":null,"path":null,"file_url":null,"link_basis":"identical_code_first_harvested_elsewhere","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":null,"inline_ok":false,"mcp_get_code":{"code_sha256":"4ddf5f547371a7f7"}},{"code_sha256_prefix":"c34f3d06ecafa853","entry":"BaseDocRanker","repo":"RManLuo/gfm-rag","repo_kind":"official","path":"gfmrag/models/gfm_rag_v1/model.py","file_url":"https://github.com/RManLuo/gfm-rag/blob/HEAD/gfmrag/models/gfm_rag_v1/model.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"c34f3d06ecafa853"}},{"code_sha256_prefix":"cb80ef9d19ad39ae","entry":"BaseGNNModel","repo":"RManLuo/gfm-rag","repo_kind":"official","path":"gfmrag/models/gfm_rag_v1/model.py","file_url":"https://github.com/RManLuo/gfm-rag/blob/HEAD/gfmrag/models/gfm_rag_v1/model.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"cb80ef9d19ad39ae"}},{"code_sha256_prefix":"e32d331a7452930b","entry":"EntityNBFNet","repo":"RManLuo/gfm-rag","repo_kind":"official","path":"gfmrag/models/gfm_rag_v1/model.py","file_url":"https://github.com/RManLuo/gfm-rag/blob/HEAD/gfmrag/models/gfm_rag_v1/model.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"e32d331a7452930b"}},{"code_sha256_prefix":"f0ae7d13f8554d44","entry":"GNNRetriever","repo":"RManLuo/gfm-rag","repo_kind":"official","path":"gfmrag/models/gfm_rag_v1/model.py","file_url":"https://github.com/RManLuo/gfm-rag/blob/HEAD/gfmrag/models/gfm_rag_v1/model.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"f0ae7d13f8554d44"}},{"code_sha256_prefix":"765c0c1c55be3583","entry":"QueryGNN","repo":"RManLuo/gfm-rag","repo_kind":"official","path":"gfmrag/models/gfm_rag_v1/model.py","file_url":"https://github.com/RManLuo/gfm-rag/blob/HEAD/gfmrag/models/gfm_rag_v1/model.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"765c0c1c55be3583"}},{"code_sha256_prefix":"db7c14422ada8d9f","entry":"QueryNBFNet","repo":"RManLuo/gfm-rag","repo_kind":"official","path":"gfmrag/models/gfm_rag_v1/model.py","file_url":"https://github.com/RManLuo/gfm-rag/blob/HEAD/gfmrag/models/gfm_rag_v1/model.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"db7c14422ada8d9f"}},{"code_sha256_prefix":"90451408a79c07c5","entry":"multi_slice_mask","repo":"RManLuo/gfm-rag","repo_kind":"official","path":"gfmrag/models/gfm_rag_v1/model.py","file_url":"https://github.com/RManLuo/gfm-rag/blob/HEAD/gfmrag/models/gfm_rag_v1/model.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"90451408a79c07c5"}},{"code_sha256_prefix":"8877e4c655410109","entry":"scatter_extend","repo":"RManLuo/gfm-rag","repo_kind":"official","path":"gfmrag/models/gfm_rag_v1/model.py","file_url":"https://github.com/RManLuo/gfm-rag/blob/HEAD/gfmrag/models/gfm_rag_v1/model.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"8877e4c655410109"}},{"code_sha256_prefix":"a3254ec30b9d591e","entry":"scatter_topk","repo":"RManLuo/gfm-rag","repo_kind":"official","path":"gfmrag/models/gfm_rag_v1/model.py","file_url":"https://github.com/RManLuo/gfm-rag/blob/HEAD/gfmrag/models/gfm_rag_v1/model.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"a3254ec30b9d591e"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}