{"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/complex-query-answering-with-neural-link-1","title":"Complex Query Answering with Neural Link Predictors","arxiv_id":"2011.03459","date":"2020-11-06","proceeding":"ICLR 2021 1","authors":["Erik Arakelyan","Daniel Daza","Pasquale Minervini","Michael Cochez"],"abstract":"Neural link predictors are immensely useful for identifying missing edges in large scale Knowledge Graphs. However, it is still not clear how to use these models for answering more complex queries that arise in a number of domains, such as queries using logical conjunctions ($\\land$), disjunctions ($\\lor$) and existential quantifiers ($\\exists$), while accounting for missing edges. In this work, we propose a framework for efficiently answering complex queries on incomplete Knowledge Graphs. We translate each query into an end-to-end differentiable objective, where the truth value of each atom is computed by a pre-trained neural link predictor. We then analyse two solutions to the optimisation problem, including gradient-based and combinatorial search. In our experiments, the proposed approach produces more accurate results than state-of-the-art methods -- black-box neural models trained on millions of generated queries -- without the need of training on a large and diverse set of complex queries. Using orders of magnitude less training data, we obtain relative improvements ranging from 8% up to 40% in Hits@3 across different knowledge graphs containing factual information. Finally, we demonstrate that it is possible to explain the outcome of our model in terms of the intermediate solutions identified for each of the complex query atoms. All our source code and datasets are available online, at https://github.com/uclnlp/cqd.","url_abs":"https://arxiv.org/abs/2011.03459v4","url_pdf":"https://arxiv.org/pdf/2011.03459v4.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":"complex-query-answering-with-neural-link-1","repo_url":"https://github.com/uclnlp/cqd","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":null},{"paper_slug":"complex-query-answering-with-neural-link-1","repo_url":"https://github.com/Blidge/KGReasoning","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"complex-query-answering-with-neural-link-1","repo_url":"https://github.com/LHY-24/KG-Compilation","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"complex-query-answering-with-neural-link-1","repo_url":"https://github.com/dice-group/dice-embeddings","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"complex-query-answering-with-neural-link-1","repo_url":"https://github.com/pminervini/kgreasoning","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"unanswered"}}],"tasks":[{"task_slug":"complex-query-answering","task_name":"Complex Query Answering"},{"task_slug":"knowledge-graphs","task_name":"Knowledge Graphs"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/complex-query-answering-on-fb15k","task":"Complex Query Answering","dataset":"FB15k","model":"CQD","rank_in_archive_order":2,"of":9,"metrics":{"MRR 1p":"0.892","MRR 2i":"0.771","MRR 2p":"0.653","MRR 2u":"0.723","MRR 3i":"0.806","MRR ip":"0.716"},"uses_additional_data":false},{"leaderboard":"/sota/complex-query-answering-on-fb15k","task":"Complex Query Answering","dataset":"FB15k","model":"CQD-Beam","rank_in_archive_order":8,"of":9,"metrics":{"Hits@3 1p":"0.918","Hits@3 2i":"0.796","Hits@3 2p":"0.779","Hits@3 2u":"0.839","Hits@3 3i":"0.837","Hits@3 3p":"0.577","Hits@3 ip":"0.375","Hits@3 pi":"0.658","Hits@3 up":"0.345"},"uses_additional_data":false},{"leaderboard":"/sota/complex-query-answering-on-fb15k","task":"Complex Query Answering","dataset":"FB15k","model":"CQD-CO","rank_in_archive_order":9,"of":9,"metrics":{"Hits@3 1p":"0.918","Hits@3 2i":"0.796","Hits@3 2p":"0.454","Hits@3 2u":"0.816","Hits@3 3i":"0.837","Hits@3 3p":"0.191","Hits@3 ip":"0.336","Hits@3 pi":"0.513","Hits@3 up":"0.319"},"uses_additional_data":false},{"leaderboard":"/sota/complex-query-answering-on-fb15k-237","task":"Complex Query Answering","dataset":"FB15k-237","model":"CQD","rank_in_archive_order":7,"of":9,"metrics":{"MRR 3i":"0.486"},"uses_additional_data":false},{"leaderboard":"/sota/complex-query-answering-on-fb15k-237","task":"Complex Query Answering","dataset":"FB15k-237","model":"CQD-CO","rank_in_archive_order":8,"of":9,"metrics":{"Hits@3 1p":"0.512","Hits@3 2i":"35.2","Hits@3 2p":"0.213","Hits@3 2u":"0.281","Hits@3 3i":"0.457","Hits@3 3p":"0.131","Hits@3 ip":"0.146","Hits@3 pi":"0.222","Hits@3 up":"0.132"},"uses_additional_data":false},{"leaderboard":"/sota/complex-query-answering-on-fb15k-237","task":"Complex Query Answering","dataset":"FB15k-237","model":"CQD-Beam","rank_in_archive_order":9,"of":9,"metrics":{"Hits@3 1p":"0.512","Hits@3 2i":"0.352","Hits@3 2p":"0.288","Hits@3 2u":"0.284","Hits@3 3i":"0.457","Hits@3 3p":"0.221","Hits@3 ip":"0.129","Hits@3 pi":"0.249","Hits@3 up":"0.121"},"uses_additional_data":false},{"leaderboard":"/sota/complex-query-answering-on-nell-995","task":"Complex Query Answering","dataset":"NELL-995","model":"CQD","rank_in_archive_order":2,"of":6,"metrics":{"MRR 1p":"0.604","MRR 2i":"0.436","MRR ip":"0.256"},"uses_additional_data":false},{"leaderboard":"/sota/complex-query-answering-on-nell995","task":"Complex Query Answering","dataset":"NELL995","model":"CQD-Beam","rank_in_archive_order":1,"of":2,"metrics":{"Hits@3 2p":"0.350","Hits@3 3p":"0.288","Hits@3 ip":"0.171","Hits@3 pi":"0.277","Hits@3 up":"0.156"},"uses_additional_data":false},{"leaderboard":"/sota/complex-query-answering-on-nell995","task":"Complex Query Answering","dataset":"NELL995","model":"CQD-CO","rank_in_archive_order":2,"of":2,"metrics":{"Hits@3 1p":"0.667","Hits@3 2i":"0.410","Hits@3 2p":"0.265","Hits@3 2u":"0.531","Hits@3 3i":"0.529","Hits@3 3p":"0.220","Hits@3 ip":"0.196","Hits@3 pi":"0.302","Hits@3 up":"0.194"},"uses_additional_data":false}],"syntology":{"syntology_url":"https://syntology.ai/paper/2011.03459","atlas_url":"https://app.syntology.ai/?focus=2011.03459","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2011.03459"}},"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":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/dice-group/dice-embeddings","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/pminervini/kgreasoning","reach":{"status":"unanswered"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/Blidge/KGReasoning","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/LHY-24/KG-Compilation","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/uclnlp/cqd","reach":null}],"summary":{"ran":4,"ran_draft_wrong":1,"unverified":2},"by_repo_kind":{"listed":{"samples":7,"ran":5,"repositories":2}},"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":4,"samples":[{"code_sha256_prefix":"8ffbdd40f46c7744","entry":"BetaIntersection","repo":"LHY-24/KG-Compilation","repo_kind":"listed","path":"src/operator_fuser.py","file_url":"https://github.com/LHY-24/KG-Compilation/blob/HEAD/src/operator_fuser.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":"8ffbdd40f46c7744"}},{"code_sha256_prefix":"af41baf7167a162e","entry":"BetaUnion","repo":"LHY-24/KG-Compilation","repo_kind":"listed","path":"src/operator_fuser.py","file_url":"https://github.com/LHY-24/KG-Compilation/blob/HEAD/src/operator_fuser.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":"af41baf7167a162e"}},{"code_sha256_prefix":"f500993bdc21b4ce","entry":"FusedOperator","repo":"LHY-24/KG-Compilation","repo_kind":"listed","path":"src/operator_fuser.py","file_url":"https://github.com/LHY-24/KG-Compilation/blob/HEAD/src/operator_fuser.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":"f500993bdc21b4ce"}},{"code_sha256_prefix":"6bf9498fc1a88844","entry":"QueryGenerator","repo":"dice-group/dice-embeddings","repo_kind":"listed","path":"dicee/query_generator.py","file_url":"https://github.com/dice-group/dice-embeddings/blob/HEAD/dicee/query_generator.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":"6bf9498fc1a88844"}},{"code_sha256_prefix":"5484d29ab2e86ff8","entry":"load_pickle","repo":"dice-group/dice-embeddings","repo_kind":"listed","path":"dicee/query_generator.py","file_url":"https://github.com/dice-group/dice-embeddings/blob/HEAD/dicee/query_generator.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"5484d29ab2e86ff8"}},{"code_sha256_prefix":"10e78fd3323d9e98","entry":"OperatorFuser","repo":"LHY-24/KG-Compilation","repo_kind":"listed","path":"src/operator_fuser.py","file_url":"https://github.com/LHY-24/KG-Compilation/blob/HEAD/src/operator_fuser.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":"10e78fd3323d9e98"}},{"code_sha256_prefix":"8f9261c61b1a5014","entry":"save_pickle","repo":"dice-group/dice-embeddings","repo_kind":"listed","path":"dicee/query_generator.py","file_url":"https://github.com/dice-group/dice-embeddings/blob/HEAD/dicee/query_generator.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":"8f9261c61b1a5014"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}