{"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/recurrent-distance-encoding-neural-networks","title":"Recurrent Distance Filtering for Graph Representation Learning","arxiv_id":"2312.01538","date":"2023-12-03","proceeding":null,"authors":["Yuhui Ding","Antonio Orvieto","Bobby He","Thomas Hofmann"],"abstract":"Graph neural networks based on iterative one-hop message passing have been shown to struggle in harnessing the information from distant nodes effectively. Conversely, graph transformers allow each node to attend to all other nodes directly, but lack graph inductive bias and have to rely on ad-hoc positional encoding. In this paper, we propose a new architecture to reconcile these challenges. Our approach stems from the recent breakthroughs in long-range modeling provided by deep state-space models: for a given target node, our model aggregates other nodes by their shortest distances to the target and uses a linear RNN to encode the sequence of hop representations. The linear RNN is parameterized in a particular diagonal form for stable long-range signal propagation and is theoretically expressive enough to encode the neighborhood hierarchy. With no need for positional encoding, we empirically show that the performance of our model is comparable to or better than that of state-of-the-art graph transformers on various benchmarks, with a significantly reduced computational cost. Our code is open-source at https://github.com/skeletondyh/GRED.","url_abs":"https://arxiv.org/abs/2312.01538v3","url_pdf":"https://arxiv.org/pdf/2312.01538v3.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":"recurrent-distance-encoding-neural-networks","repo_url":"https://github.com/skeletondyh/gred","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"jax","reach":{"status":"ok"}}],"tasks":[{"task_slug":"graph-classification","task_name":"Graph Classification"},{"task_slug":"graph-representation-learning","task_name":"Graph Representation Learning"},{"task_slug":"inductive-bias","task_name":"Inductive Bias"},{"task_slug":"long-range-modeling","task_name":"Long-range modeling"},{"task_slug":"representation-learning","task_name":"Representation Learning"},{"task_slug":"state-space-models","task_name":"State Space Models"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/graph-classification-on-cifar10-100k","task":"Graph Classification","dataset":"CIFAR10 100k","model":"GRED","rank_in_archive_order":3,"of":20,"metrics":{"Accuracy (%)":"76.853±0.185"},"uses_additional_data":false},{"leaderboard":"/sota/graph-classification-on-peptides-func","task":"Graph Classification","dataset":"Peptides-func","model":"GRED+LapPE","rank_in_archive_order":10,"of":44,"metrics":{"AP":"0.7133±0.0011"},"uses_additional_data":false},{"leaderboard":"/sota/graph-classification-on-peptides-func","task":"Graph Classification","dataset":"Peptides-func","model":"GRED","rank_in_archive_order":12,"of":44,"metrics":{"AP":"0.7085±0.0027"},"uses_additional_data":false}],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2312.01538","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2312.01538"}},"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":"deterministic:regex_extraction","url":"https://github.com/skeletondyh/GRED","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/skeletondyh/gred","reach":{"status":"ok"}}],"summary":{"ran":8,"ran_draft_wrong":3,"ran_violates":1,"unverified":9},"by_repo_kind":{"official":{"samples":21,"ran":12,"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":21,"samples":[{"code_sha256_prefix":"e01e88637e577256","entry":"LRU","repo":"skeletondyh/gred","repo_kind":"official","path":"model.py","file_url":"https://github.com/skeletondyh/gred/blob/HEAD/model.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":"e01e88637e577256"}},{"code_sha256_prefix":"0f3fd4edd18faabe","entry":"MLP","repo":"skeletondyh/gred","repo_kind":"official","path":"model.py","file_url":"https://github.com/skeletondyh/gred/blob/HEAD/model.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":"0f3fd4edd18faabe"}},{"code_sha256_prefix":"ba8e9577ac8dfb73","entry":"binary_operator_diag","repo":"skeletondyh/gred","repo_kind":"official","path":"model.py","file_url":"https://github.com/skeletondyh/gred/blob/HEAD/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":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"ba8e9577ac8dfb73"}},{"code_sha256_prefix":"c0d6908dc30f37ec","entry":"eval_ap","repo":"skeletondyh/GRED","repo_kind":"official","path":"utils.py","file_url":"https://github.com/skeletondyh/GRED/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":"c0d6908dc30f37ec"}},{"code_sha256_prefix":"0a96efa6922a586d","entry":"gen_dist_mask","repo":"skeletondyh/GRED","repo_kind":"official","path":"preprocess_peptides.py","file_url":"https://github.com/skeletondyh/GRED/blob/HEAD/preprocess_peptides.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":"0a96efa6922a586d"}},{"code_sha256_prefix":"5554946bc57de2fc","entry":"init_eig_magnitude","repo":"skeletondyh/gred","repo_kind":"official","path":"model.py","file_url":"https://github.com/skeletondyh/gred/blob/HEAD/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":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"5554946bc57de2fc"}},{"code_sha256_prefix":"5fc3334db5d62b03","entry":"init_eig_phase","repo":"skeletondyh/gred","repo_kind":"official","path":"model.py","file_url":"https://github.com/skeletondyh/gred/blob/HEAD/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":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"5fc3334db5d62b03"}},{"code_sha256_prefix":"2d73261700dbcade","entry":"init_gamma_log","repo":"skeletondyh/gred","repo_kind":"official","path":"model.py","file_url":"https://github.com/skeletondyh/gred/blob/HEAD/model.py","link_basis":"first_harvest_node","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"2d73261700dbcade"}},{"code_sha256_prefix":"86e644e878701a9e","entry":"load","repo":"skeletondyh/GRED","repo_kind":"official","path":"datasets.py","file_url":"https://github.com/skeletondyh/GRED/blob/HEAD/datasets.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":"86e644e878701a9e"}},{"code_sha256_prefix":"0072481168942fc0","entry":"load_sbm","repo":"skeletondyh/GRED","repo_kind":"official","path":"datasets.py","file_url":"https://github.com/skeletondyh/GRED/blob/HEAD/datasets.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":"0072481168942fc0"}},{"code_sha256_prefix":"9ff9d48e2f6c01d2","entry":"load_superpixel","repo":"skeletondyh/GRED","repo_kind":"official","path":"datasets.py","file_url":"https://github.com/skeletondyh/GRED/blob/HEAD/datasets.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":"9ff9d48e2f6c01d2"}},{"code_sha256_prefix":"1fc8ab51b4d7b0b2","entry":"map_nested_fn","repo":"skeletondyh/GRED","repo_kind":"official","path":"utils.py","file_url":"https://github.com/skeletondyh/GRED/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":"1fc8ab51b4d7b0b2"}},{"code_sha256_prefix":"f50e322383b7d10f","entry":"GRED","repo":"skeletondyh/gred","repo_kind":"official","path":"model.py","file_url":"https://github.com/skeletondyh/gred/blob/HEAD/model.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":"f50e322383b7d10f"}},{"code_sha256_prefix":"33f96f60e03d9f4d","entry":"eval_step","repo":"skeletondyh/GRED","repo_kind":"official","path":"train_peptides_func.py","file_url":"https://github.com/skeletondyh/GRED/blob/HEAD/train_peptides_func.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":"33f96f60e03d9f4d"}},{"code_sha256_prefix":"573953132860b6c8","entry":"eval_step","repo":"skeletondyh/GRED","repo_kind":"official","path":"train_peptides_struct.py","file_url":"https://github.com/skeletondyh/GRED/blob/HEAD/train_peptides_struct.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":"573953132860b6c8"}},{"code_sha256_prefix":"361ca6724f795584","entry":"eval_step","repo":"skeletondyh/GRED","repo_kind":"official","path":"train_pixel.py","file_url":"https://github.com/skeletondyh/GRED/blob/HEAD/train_pixel.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":"361ca6724f795584"}},{"code_sha256_prefix":"2ce1907d2dc05d8f","entry":"eval_step","repo":"skeletondyh/GRED","repo_kind":"official","path":"train_sbm.py","file_url":"https://github.com/skeletondyh/GRED/blob/HEAD/train_sbm.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":"2ce1907d2dc05d8f"}},{"code_sha256_prefix":"9bc42f02f987a9cc","entry":"train_step","repo":"skeletondyh/GRED","repo_kind":"official","path":"train_peptides_func.py","file_url":"https://github.com/skeletondyh/GRED/blob/HEAD/train_peptides_func.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":"9bc42f02f987a9cc"}},{"code_sha256_prefix":"551c7a7eef38710d","entry":"train_step","repo":"skeletondyh/GRED","repo_kind":"official","path":"train_peptides_struct.py","file_url":"https://github.com/skeletondyh/GRED/blob/HEAD/train_peptides_struct.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":"551c7a7eef38710d"}},{"code_sha256_prefix":"5ab5f97bf4fe2a26","entry":"train_step","repo":"skeletondyh/GRED","repo_kind":"official","path":"train_pixel.py","file_url":"https://github.com/skeletondyh/GRED/blob/HEAD/train_pixel.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":"5ab5f97bf4fe2a26"}},{"code_sha256_prefix":"2f7255aaf56805b4","entry":"train_step","repo":"skeletondyh/GRED","repo_kind":"official","path":"train_sbm.py","file_url":"https://github.com/skeletondyh/GRED/blob/HEAD/train_sbm.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":"2f7255aaf56805b4"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}