{"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/graphinstruct-empowering-large-language","title":"GraphInstruct: Empowering Large Language Models with Graph Understanding and Reasoning Capability","arxiv_id":"2403.04483","date":"2024-03-07","proceeding":null,"authors":["Zihan Luo","Xiran Song","Hong Huang","Jianxun Lian","Chenhao Zhang","Jinqi Jiang","Xing Xie"],"abstract":"Evaluating and enhancing the general capabilities of large language models (LLMs) has been an important research topic. Graph is a common data structure in the real world, and understanding graph data is a crucial part for advancing general intelligence. To evaluate and enhance the graph understanding abilities of LLMs, in this paper, we propose a benchmark named GraphInstruct, which comprehensively includes 21 classical graph reasoning tasks, providing diverse graph generation pipelines and detailed reasoning steps. Based on GraphInstruct, we further construct GraphLM through efficient instruction-tuning, which shows prominent graph understanding capability. In order to enhance the LLM with graph reasoning capability as well, we propose a step mask training strategy, and construct a model named GraphLM+. As one of the pioneering efforts to enhance the graph understanding and reasoning abilities of LLMs, extensive experiments have demonstrated the superiority of GraphLM and GraphLM+ over other LLMs. We look forward to more researchers exploring the potential of LLMs in the graph data mining domain through GraphInstruct. Our code for generating GraphInstruct is released publicly at: https://github.com/CGCL-codes/GraphInstruct.","url_abs":"https://arxiv.org/abs/2403.04483v2","url_pdf":"https://arxiv.org/pdf/2403.04483v2.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":"graphinstruct-empowering-large-language","repo_url":"https://github.com/cgcl-codes/graphinstruct","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"none","reach":{"status":"ok"}}],"tasks":[{"task_slug":"graph-generation","task_name":"Graph Generation"}],"methods":[],"datasets_introduced":[{"slug":"graphinstruct","name":"GraphInstruct","full_name":""}],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2403.04483","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2403.04483"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+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/cgcl-codes/graphinstruct","reach":{"status":"ok"}}],"summary":{"ran":8},"by_repo_kind":{"official":{"samples":8,"ran":8,"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":8,"samples":[{"code_sha256_prefix":"3a49f4f639600ca7","entry":"display_sample","repo":"cgcl-codes/graphinstruct","repo_kind":"official","path":"GTG/utils/utils.py","file_url":"https://github.com/cgcl-codes/graphinstruct/blob/HEAD/GTG/utils/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"3a49f4f639600ca7"}},{"code_sha256_prefix":"9918dc2c6ee6dfa7","entry":"eval_bool","repo":"cgcl-codes/graphinstruct","repo_kind":"official","path":"GTG/utils/evaluation.py","file_url":"https://github.com/cgcl-codes/graphinstruct/blob/HEAD/GTG/utils/evaluation.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"9918dc2c6ee6dfa7"}},{"code_sha256_prefix":"7d250730bef643cc","entry":"get_rand_letter","repo":"cgcl-codes/graphinstruct","repo_kind":"official","path":"GTG/process_node_id/letter_id.py","file_url":"https://github.com/cgcl-codes/graphinstruct/blob/HEAD/GTG/process_node_id/letter_id.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"7d250730bef643cc"}},{"code_sha256_prefix":"2b8693d5e49d9e80","entry":"make_sample","repo":"cgcl-codes/graphinstruct","repo_kind":"official","path":"GTG/utils/utils.py","file_url":"https://github.com/cgcl-codes/graphinstruct/blob/HEAD/GTG/utils/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"2b8693d5e49d9e80"}},{"code_sha256_prefix":"cb27cfbf649cb064","entry":"parse_bool","repo":"cgcl-codes/graphinstruct","repo_kind":"official","path":"GTG/utils/parse_output.py","file_url":"https://github.com/cgcl-codes/graphinstruct/blob/HEAD/GTG/utils/parse_output.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"cb27cfbf649cb064"}},{"code_sha256_prefix":"2b93db8e2d43a597","entry":"parse_first_node_id","repo":"cgcl-codes/graphinstruct","repo_kind":"official","path":"GTG/utils/parse_output.py","file_url":"https://github.com/cgcl-codes/graphinstruct/blob/HEAD/GTG/utils/parse_output.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"2b93db8e2d43a597"}},{"code_sha256_prefix":"ed97394cdcef9bda","entry":"parse_wrapped_answer","repo":"cgcl-codes/graphinstruct","repo_kind":"official","path":"GTG/utils/parse_output.py","file_url":"https://github.com/cgcl-codes/graphinstruct/blob/HEAD/GTG/utils/parse_output.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"ed97394cdcef9bda"}},{"code_sha256_prefix":"eadbd56951ebf2aa","entry":"string_to_integer_hashing","repo":"cgcl-codes/graphinstruct","repo_kind":"official","path":"GTG/utils/utils.py","file_url":"https://github.com/cgcl-codes/graphinstruct/blob/HEAD/GTG/utils/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"eadbd56951ebf2aa"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}