{"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/few-shot-relational-reasoning-via-connection","title":"Few-shot Relational Reasoning via Connection Subgraph Pretraining","arxiv_id":"2210.06722","date":"2022-10-13","proceeding":null,"authors":["Qian Huang","Hongyu Ren","Jure Leskovec"],"abstract":"Few-shot knowledge graph (KG) completion task aims to perform inductive reasoning over the KG: given only a few support triplets of a new relation $\\bowtie$ (e.g., (chop,$\\bowtie$,kitchen), (read,$\\bowtie$,library), the goal is to predict the query triplets of the same unseen relation $\\bowtie$, e.g., (sleep,$\\bowtie$,?). Current approaches cast the problem in a meta-learning framework, where the model needs to be first jointly trained over many training few-shot tasks, each being defined by its own relation, so that learning/prediction on the target few-shot task can be effective. However, in real-world KGs, curating many training tasks is a challenging ad hoc process. Here we propose Connection Subgraph Reasoner (CSR), which can make predictions for the target few-shot task directly without the need for pre-training on the human curated set of training tasks. The key to CSR is that we explicitly model a shared connection subgraph between support and query triplets, as inspired by the principle of eliminative induction. To adapt to specific KG, we design a corresponding self-supervised pretraining scheme with the objective of reconstructing automatically sampled connection subgraphs. Our pretrained model can then be directly applied to target few-shot tasks on without the need for training few-shot tasks. Extensive experiments on real KGs, including NELL, FB15K-237, and ConceptNet, demonstrate the effectiveness of our framework: we show that even a learning-free implementation of CSR can already perform competitively to existing methods on target few-shot tasks; with pretraining, CSR can achieve significant gains of up to 52% on the more challenging inductive few-shot tasks where the entities are also unseen during (pre)training.","url_abs":"https://arxiv.org/abs/2210.06722v1","url_pdf":"https://arxiv.org/pdf/2210.06722v1.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":"few-shot-relational-reasoning-via-connection","repo_url":"https://github.com/snap-stanford/csr","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"few-shot-image-classification","task_name":"Few-Shot Image Classification"},{"task_slug":"meta-learning","task_name":"Meta-Learning"},{"task_slug":null,"task_name":"Relation"},{"task_slug":"relational-reasoning","task_name":"Relational Reasoning"}],"methods":[{"method_slug":"hoc","method_name":"HOC"}],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/few-shot-image-classification-on-imagenet-fs","task":"Few-Shot Image Classification","dataset":"ImageNet-FS (1-shot, novel)","model":"KTCH (ResNet-50)","rank_in_archive_order":5,"of":7,"metrics":{"Top-5 Accuracy (%)":"58.1"},"uses_additional_data":false},{"leaderboard":"/sota/few-shot-image-classification-on-imagenet-fs-1","task":"Few-Shot Image Classification","dataset":"ImageNet-FS (2-shot, novel)","model":"KTCH (ResNet-50)","rank_in_archive_order":5,"of":8,"metrics":{"Top-5 Accuracy (%)":"67.3"},"uses_additional_data":false},{"leaderboard":"/sota/few-shot-image-classification-on-imagenet-fs-6","task":"Few-Shot Image Classification","dataset":"ImageNet-FS (5-shot, all)","model":"KTCH (ResNet-50)","rank_in_archive_order":4,"of":8,"metrics":{"Top-5 Accuracy (%)":"77.6"},"uses_additional_data":false}],"syntology":{"syntology_url":null,"atlas_url":"https://app.syntology.ai/?focus=2210.06722","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2210.06722"}},"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/snap-stanford/csr","reach":null}],"summary":{"ran_honours":1},"by_repo_kind":{"official":{"samples":1,"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":0,"samples":[{"code_sha256_prefix":"be97d6e924794bab","entry":"load_embed","repo":"snap-stanford/csr","repo_kind":"official","path":"models.py","file_url":"https://github.com/snap-stanford/csr/blob/HEAD/models.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"be97d6e924794bab"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}