{"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/similarity-based-neighbor-selection-for-graph","title":"Similarity-based Neighbor Selection for Graph LLMs","arxiv_id":"2402.03720","date":"2024-02-06","proceeding":null,"authors":["Rui Li","Jiwei Li","Jiawei Han","Guoyin Wang"],"abstract":"Text-attributed graphs (TAGs) present unique challenges for direct processing by Language Learning Models (LLMs), yet their extensive commonsense knowledge and robust reasoning capabilities offer great promise for node classification in TAGs. Prior research in this field has grappled with issues such as over-squashing, heterophily, and ineffective graph information integration, further compounded by inconsistencies in dataset partitioning and underutilization of advanced LLMs. To address these challenges, we introduce Similarity-based Neighbor Selection (SNS). Using SimCSE and advanced neighbor selection techniques, SNS effectively improves the quality of selected neighbors, thereby improving graph representation and alleviating issues like over-squashing and heterophily. Besides, as an inductive and training-free approach, SNS demonstrates superior generalization and scalability over traditional GNN methods. Our comprehensive experiments, adhering to standard dataset partitioning practices, demonstrate that SNS, through simple prompt interactions with LLMs, consistently outperforms vanilla GNNs and achieves state-of-the-art results on datasets like PubMed in node classification, showcasing LLMs' potential in graph structure understanding. Our research further underscores the significance of graph structure integration in LLM applications and identifies key factors for their success in node classification. Code is available at https://github.com/ruili33/SNS.","url_abs":"https://arxiv.org/abs/2402.03720v1","url_pdf":"https://arxiv.org/pdf/2402.03720v1.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":"similarity-based-neighbor-selection-for-graph","repo_url":"https://github.com/ruili33/sns","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"node-classification","task_name":"Node Classification"}],"methods":[{"method_slug":"simcse","method_name":"SimCSE"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2402.03720","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2402.03720"}},"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/ruili33/sns","reach":{"status":"ok"}}],"summary":{"ran":6,"unverified":3},"by_repo_kind":{"official":{"samples":9,"ran":6,"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":9,"samples":[{"code_sha256_prefix":"0ed790f0d6b309cb","entry":"get_logger","repo":"ruili33/sns","repo_kind":"official","path":"logger.py","file_url":"https://github.com/ruili33/sns/blob/HEAD/logger.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":"0ed790f0d6b309cb"}},{"code_sha256_prefix":"66f11824f6c6feed","entry":"get_raw_text_arxiv_2023","repo":"ruili33/sns","repo_kind":"official","path":"llmutils/load_arxiv_2023.py","file_url":"https://github.com/ruili33/sns/blob/HEAD/llmutils/load_arxiv_2023.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":"66f11824f6c6feed"}},{"code_sha256_prefix":"d3b4a5894654d54a","entry":"get_raw_text_citeseer","repo":"ruili33/sns","repo_kind":"official","path":"llmutils/load_citeseer.py","file_url":"https://github.com/ruili33/sns/blob/HEAD/llmutils/load_citeseer.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":"d3b4a5894654d54a"}},{"code_sha256_prefix":"ead3202daf69e84a","entry":"get_sampled_nodes","repo":"ruili33/sns","repo_kind":"official","path":"utils.py","file_url":"https://github.com/ruili33/sns/blob/HEAD/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":"ead3202daf69e84a"}},{"code_sha256_prefix":"75d557b7ddcec540","entry":"read_json","repo":"ruili33/sns","repo_kind":"official","path":"utils.py","file_url":"https://github.com/ruili33/sns/blob/HEAD/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":"75d557b7ddcec540"}},{"code_sha256_prefix":"9e0ab4c54364054f","entry":"read_jsonl","repo":"ruili33/sns","repo_kind":"official","path":"utils.py","file_url":"https://github.com/ruili33/sns/blob/HEAD/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":"9e0ab4c54364054f"}},{"code_sha256_prefix":"a90c67b8e6ad2bf4","entry":"get_cora_casestudy","repo":"ruili33/sns","repo_kind":"official","path":"llmutils/load_cora.py","file_url":"https://github.com/ruili33/sns/blob/HEAD/llmutils/load_cora.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"a90c67b8e6ad2bf4"}},{"code_sha256_prefix":"cc7e0d435a5acc29","entry":"get_raw_dataset","repo":"ruili33/sns","repo_kind":"official","path":"llmutils/load_products.py","file_url":"https://github.com/ruili33/sns/blob/HEAD/llmutils/load_products.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"cc7e0d435a5acc29"}},{"code_sha256_prefix":"645cd0bc994f655c","entry":"get_raw_text_cora","repo":"ruili33/sns","repo_kind":"official","path":"llmutils/load_cora.py","file_url":"https://github.com/ruili33/sns/blob/HEAD/llmutils/load_cora.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"645cd0bc994f655c"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}