{"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/one-for-all-towards-training-one-graph-model","title":"One for All: Towards Training One Graph Model for All Classification Tasks","arxiv_id":"2310.00149","date":"2023-09-29","proceeding":null,"authors":["Hao liu","Jiarui Feng","Lecheng Kong","Ningyue Liang","DaCheng Tao","Yixin Chen","Muhan Zhang"],"abstract":"Designing a single model to address multiple tasks has been a long-standing objective in artificial intelligence. Recently, large language models have demonstrated exceptional capability in solving different tasks within the language domain. However, a unified model for various graph tasks remains underexplored, primarily due to the challenges unique to the graph learning domain. First, graph data from different areas carry distinct attributes and follow different distributions. Such discrepancy makes it hard to represent graphs in a single representation space. Second, tasks on graphs diversify into node, link, and graph tasks, requiring distinct embedding strategies. Finally, an appropriate graph prompting paradigm for in-context learning is unclear. We propose \\textbf{One for All (OFA)}, the first general framework that can use a single graph model to address the above challenges. Specifically, OFA proposes text-attributed graphs to unify different graph data by describing nodes and edges with natural language and uses language models to encode the diverse and possibly cross-domain text attributes to feature vectors in the same embedding space. Furthermore, OFA introduces the concept of nodes-of-interest to standardize different tasks with a single task representation. For in-context learning on graphs, OFA introduces a novel graph prompting paradigm that appends prompting substructures to the input graph, which enables it to address varied tasks without fine-tuning. We train the OFA model using graph data from multiple domains (including citation networks, molecular graphs, knowledge graphs, etc.) simultaneously and evaluate its ability in supervised, few-shot, and zero-shot learning scenarios. OFA performs well across different tasks, making it the first general-purpose across-domains classification model on graphs.","url_abs":"https://arxiv.org/abs/2310.00149v3","url_pdf":"https://arxiv.org/pdf/2310.00149v3.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":"one-for-all-towards-training-one-graph-model","repo_url":"https://github.com/lechengkong/oneforall","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"all","task_name":"All"},{"task_slug":"graph-classification","task_name":"Graph Classification"},{"task_slug":"graph-learning","task_name":"Graph Learning"},{"task_slug":"in-context-learning","task_name":"In-Context Learning"},{"task_slug":"knowledge-graphs","task_name":"Knowledge Graphs"},{"task_slug":"zero-shot-learning","task_name":"Zero-Shot Learning"}],"methods":[{"method_slug":"ofa","method_name":"OFA"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2310.00149","atlas_url":"https://app.syntology.ai/?focus=2310.00149","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2310.00149"}},"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":"deterministic:regex_extraction","url":"https://github.com/LechengKong/OneForAll","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/lechengkong/oneforall","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":3,"ran_draft_wrong":2,"unverified":13},"by_repo_kind":{"official":{"samples":18,"ran":5,"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":0,"samples":[{"code_sha256_prefix":"ad60d5c30ea175c9","entry":"ArxivSplitter","repo":"LechengKong/OneForAll","repo_kind":"official","path":"task_constructor.py","file_url":"https://github.com/LechengKong/OneForAll/blob/HEAD/task_constructor.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"ad60d5c30ea175c9"}},{"code_sha256_prefix":"7826f03da19a967c","entry":"masked_edge_index","repo":"LechengKong/OneForAll","repo_kind":"official","path":"gp/nn/layer/pyg.py","file_url":"https://github.com/LechengKong/OneForAll/blob/HEAD/gp/nn/layer/pyg.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"7826f03da19a967c"}},{"code_sha256_prefix":"43281e60ab9405f3","entry":"mean_pooling","repo":"LechengKong/OneForAll","repo_kind":"official","path":"models/model.py","file_url":"https://github.com/LechengKong/OneForAll/blob/HEAD/models/model.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"43281e60ab9405f3"}},{"code_sha256_prefix":"ff7d55c8c0dd7dde","entry":"normalize_string","repo":"lechengkong/oneforall","repo_kind":"official","path":"models/model.py","file_url":"https://github.com/lechengkong/oneforall/blob/HEAD/models/model.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"ff7d55c8c0dd7dde"}},{"code_sha256_prefix":"3a4a478be185334b","entry":"swish","repo":"lechengkong/oneforall","repo_kind":"official","path":"models/model.py","file_url":"https://github.com/lechengkong/oneforall/blob/HEAD/models/model.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"3a4a478be185334b"}},{"code_sha256_prefix":"5f925b34de0a38cb","entry":"ArxivFSSplitter","repo":"LechengKong/OneForAll","repo_kind":"official","path":"task_constructor.py","file_url":"https://github.com/LechengKong/OneForAll/blob/HEAD/task_constructor.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"5f925b34de0a38cb"}},{"code_sha256_prefix":"4d74d0c9e6317861","entry":"BinGraphAttModel","repo":"lechengkong/oneforall","repo_kind":"official","path":"models/model.py","file_url":"https://github.com/lechengkong/oneforall/blob/HEAD/models/model.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"4d74d0c9e6317861"}},{"code_sha256_prefix":"840cce4bf1e34557","entry":"CiteSplitter","repo":"LechengKong/OneForAll","repo_kind":"official","path":"task_constructor.py","file_url":"https://github.com/LechengKong/OneForAll/blob/HEAD/task_constructor.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"840cce4bf1e34557"}},{"code_sha256_prefix":"c4f4edb029c0bebe","entry":"MLP","repo":"lechengkong/oneforall","repo_kind":"official","path":"models/model.py","file_url":"https://github.com/lechengkong/oneforall/blob/HEAD/models/model.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"c4f4edb029c0bebe"}},{"code_sha256_prefix":"ae908941a6b72092","entry":"SingleHeadAtt","repo":"lechengkong/oneforall","repo_kind":"official","path":"models/model.py","file_url":"https://github.com/lechengkong/oneforall/blob/HEAD/models/model.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"ae908941a6b72092"}},{"code_sha256_prefix":"d15a20d9776a5201","entry":"activation_resolver","repo":"lechengkong/oneforall","repo_kind":"official","path":"models/model.py","file_url":"https://github.com/lechengkong/oneforall/blob/HEAD/models/model.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"d15a20d9776a5201"}},{"code_sha256_prefix":"352a58f5914509ef","entry":"binary_apr_func","repo":"LechengKong/OneForAll","repo_kind":"official","path":"utils.py","file_url":"https://github.com/LechengKong/OneForAll/blob/HEAD/utils.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"352a58f5914509ef"}},{"code_sha256_prefix":"c06eaa1bc9d830c1","entry":"binary_single_auc_func","repo":"LechengKong/OneForAll","repo_kind":"official","path":"utils.py","file_url":"https://github.com/LechengKong/OneForAll/blob/HEAD/utils.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"c06eaa1bc9d830c1"}},{"code_sha256_prefix":"2f952f786f090a85","entry":"classification_func","repo":"LechengKong/OneForAll","repo_kind":"official","path":"gp/lightning/metric.py","file_url":"https://github.com/LechengKong/OneForAll/blob/HEAD/gp/lightning/metric.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"2f952f786f090a85"}},{"code_sha256_prefix":"1ae9c9bd82345553","entry":"flat_auc","repo":"LechengKong/OneForAll","repo_kind":"official","path":"utils.py","file_url":"https://github.com/LechengKong/OneForAll/blob/HEAD/utils.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"1ae9c9bd82345553"}},{"code_sha256_prefix":"ba35408d43f03da8","entry":"flat_binary_func","repo":"LechengKong/OneForAll","repo_kind":"official","path":"gp/lightning/metric.py","file_url":"https://github.com/LechengKong/OneForAll/blob/HEAD/gp/lightning/metric.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"ba35408d43f03da8"}},{"code_sha256_prefix":"743ac2471dcc771b","entry":"resolver","repo":"lechengkong/oneforall","repo_kind":"official","path":"models/model.py","file_url":"https://github.com/lechengkong/oneforall/blob/HEAD/models/model.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"743ac2471dcc771b"}},{"code_sha256_prefix":"0806c1152385d974","entry":"similarity_func","repo":"LechengKong/OneForAll","repo_kind":"official","path":"gp/lightning/metric.py","file_url":"https://github.com/LechengKong/OneForAll/blob/HEAD/gp/lightning/metric.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"0806c1152385d974"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}