{"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/differentiable-reasoning-on-large-knowledge","title":"Differentiable Reasoning on Large Knowledge Bases and Natural Language","arxiv_id":"1912.10824","date":"2019-12-17","proceeding":null,"authors":["Pasquale Minervini","Matko Bošnjak","Tim Rocktäschel","Sebastian Riedel","Edward Grefenstette"],"abstract":"Reasoning with knowledge expressed in natural language and Knowledge Bases (KBs) is a major challenge for Artificial Intelligence, with applications in machine reading, dialogue, and question answering. General neural architectures that jointly learn representations and transformations of text are very data-inefficient, and it is hard to analyse their reasoning process. These issues are addressed by end-to-end differentiable reasoning systems such as Neural Theorem Provers (NTPs), although they can only be used with small-scale symbolic KBs. In this paper we first propose Greedy NTPs (GNTPs), an extension to NTPs addressing their complexity and scalability limitations, thus making them applicable to real-world datasets. This result is achieved by dynamically constructing the computation graph of NTPs and including only the most promising proof paths during inference, thus obtaining orders of magnitude more efficient models. Then, we propose a novel approach for jointly reasoning over KBs and textual mentions, by embedding logic facts and natural language sentences in a shared embedding space. We show that GNTPs perform on par with NTPs at a fraction of their cost while achieving competitive link prediction results on large datasets, providing explanations for predictions, and inducing interpretable models. Source code, datasets, and supplementary material are available online at https://github.com/uclnlp/gntp.","url_abs":"https://arxiv.org/abs/1912.10824v1","url_pdf":"https://arxiv.org/pdf/1912.10824v1.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":"differentiable-reasoning-on-large-knowledge","repo_url":"https://github.com/uclnlp/gntp","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"tf","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"differentiable-reasoning-on-large-knowledge","repo_url":"https://github.com/uclnlp/ntp","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"tf","reach":{"status":"ok","spdx":"Apache-2.0"}},{"paper_slug":"differentiable-reasoning-on-large-knowledge","repo_url":"https://github.com/uclnlp/ctp","is_official":1,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"link-prediction","task_name":"Link Prediction"},{"task_slug":"question-answering","task_name":"Question Answering"},{"task_slug":"reading-comprehension","task_name":"Reading Comprehension"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/link-prediction-on-fb122","task":"Link Prediction","dataset":"FB122","model":"GNTPs","rank_in_archive_order":3,"of":5,"metrics":{"HITS@3":"69.2","Hits@10":"73.2","Hits@5":"71.1","MRR":"67.8"},"uses_additional_data":false}],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=1912.10824","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"1912.10824"}},"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/uclnlp/ctp","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/uclnlp/ntp","reach":{"status":"ok","spdx":"Apache-2.0"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/uclnlp/gntp","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"unverified":26},"by_repo_kind":{"official":{"samples":26,"ran":0,"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":0,"samples":[{"code_sha256_prefix":"842678021f43c382","entry":"atom2string","repo":"uclnlp/ntp","repo_kind":"official","path":"ntp/tp.py","file_url":"https://github.com/uclnlp/ntp/blob/HEAD/ntp/tp.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"842678021f43c382"}},{"code_sha256_prefix":"8ff6535b5f8688aa","entry":"attention","repo":"uclnlp/gntp","repo_kind":"official","path":"gntp/attention.py","file_url":"https://github.com/uclnlp/gntp/blob/HEAD/gntp/attention.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":"8ff6535b5f8688aa"}},{"code_sha256_prefix":"9a713eefc8e66051","entry":"bilstm_nosupport_reader_model_with_cands","repo":"uclnlp/ntp","repo_kind":"official","path":"ntp/jtr/nn/models.py","file_url":"https://github.com/uclnlp/ntp/blob/HEAD/ntp/jtr/nn/models.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"9a713eefc8e66051"}},{"code_sha256_prefix":"19db131ea10b3837","entry":"bilstm_reader_model_with_cands","repo":"uclnlp/ntp","repo_kind":"official","path":"ntp/jtr/nn/models.py","file_url":"https://github.com/uclnlp/ntp/blob/HEAD/ntp/jtr/nn/models.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"19db131ea10b3837"}},{"code_sha256_prefix":"a3b949dcebbfa464","entry":"boe_nosupport_cands_reader_model","repo":"uclnlp/ntp","repo_kind":"official","path":"ntp/jtr/nn/models.py","file_url":"https://github.com/uclnlp/ntp/blob/HEAD/ntp/jtr/nn/models.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"a3b949dcebbfa464"}},{"code_sha256_prefix":"6ff9dbea90d5710f","entry":"check_checkpoint_finished","repo":"uclnlp/gntp","repo_kind":"official","path":"bin/gntp-cli.py","file_url":"https://github.com/uclnlp/gntp/blob/HEAD/bin/gntp-cli.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":"6ff9dbea90d5710f"}},{"code_sha256_prefix":"504b918b060a4ed7","entry":"clip","repo":"uclnlp/gntp","repo_kind":"official","path":"gntp/losses.py","file_url":"https://github.com/uclnlp/gntp/blob/HEAD/gntp/losses.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":"504b918b060a4ed7"}},{"code_sha256_prefix":"bd0230f569a312c8","entry":"create_mask","repo":"uclnlp/gntp","repo_kind":"official","path":"gntp/masking.py","file_url":"https://github.com/uclnlp/gntp/blob/HEAD/gntp/masking.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":"bd0230f569a312c8"}},{"code_sha256_prefix":"137ebc202f3a3a6e","entry":"diff_k_max","repo":"uclnlp/ntp","repo_kind":"official","path":"ntp/kmax.py","file_url":"https://github.com/uclnlp/ntp/blob/HEAD/ntp/kmax.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"137ebc202f3a3a6e"}},{"code_sha256_prefix":"16b7fa57446bec19","entry":"diff_k_max_grad","repo":"uclnlp/ntp","repo_kind":"official","path":"ntp/kmax.py","file_url":"https://github.com/uclnlp/ntp/blob/HEAD/ntp/kmax.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"16b7fa57446bec19"}},{"code_sha256_prefix":"b6dbe45fcd29ec5e","entry":"get_buckets","repo":"uclnlp/ntp","repo_kind":"official","path":"ntp/jtr/preprocess/batch.py","file_url":"https://github.com/uclnlp/ntp/blob/HEAD/ntp/jtr/preprocess/batch.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"b6dbe45fcd29ec5e"}},{"code_sha256_prefix":"805c610d7342febb","entry":"iopen","repo":"uclnlp/gntp","repo_kind":"official","path":"gntp/io.py","file_url":"https://github.com/uclnlp/gntp/blob/HEAD/gntp/io.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":"805c610d7342febb"}},{"code_sha256_prefix":"08da9620aade33aa","entry":"is_atom","repo":"uclnlp/ntp","repo_kind":"official","path":"ntp/util.py","file_url":"https://github.com/uclnlp/ntp/blob/HEAD/ntp/util.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"08da9620aade33aa"}},{"code_sha256_prefix":"86a13149d6073483","entry":"is_tensor","repo":"uclnlp/ntp","repo_kind":"official","path":"ntp/prover.py","file_url":"https://github.com/uclnlp/ntp/blob/HEAD/ntp/prover.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"86a13149d6073483"}},{"code_sha256_prefix":"35f3db77164bbce5","entry":"is_variable","repo":"uclnlp/ntp","repo_kind":"official","path":"ntp/tp.py","file_url":"https://github.com/uclnlp/ntp/blob/HEAD/ntp/tp.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"35f3db77164bbce5"}},{"code_sha256_prefix":"ebf7f09a2e38dd00","entry":"is_variables_list","repo":"uclnlp/ntp","repo_kind":"official","path":"ntp/prover.py","file_url":"https://github.com/uclnlp/ntp/blob/HEAD/ntp/prover.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"ebf7f09a2e38dd00"}},{"code_sha256_prefix":"7aff3f773673f361","entry":"kb_ids2known_facts","repo":"uclnlp/ntp","repo_kind":"official","path":"ntp/experiments/recover.py","file_url":"https://github.com/uclnlp/ntp/blob/HEAD/ntp/experiments/recover.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"7aff3f773673f361"}},{"code_sha256_prefix":"b0f8f95117e6f32b","entry":"load_random_state","repo":"uclnlp/gntp","repo_kind":"official","path":"bin/gntp-cli.py","file_url":"https://github.com/uclnlp/gntp/blob/HEAD/bin/gntp-cli.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":"b0f8f95117e6f32b"}},{"code_sha256_prefix":"23981ea194ca5abd","entry":"logistic_loss","repo":"uclnlp/gntp","repo_kind":"official","path":"gntp/losses.py","file_url":"https://github.com/uclnlp/gntp/blob/HEAD/gntp/losses.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":"23981ea194ca5abd"}},{"code_sha256_prefix":"8025ce61959161a4","entry":"my_py_func","repo":"uclnlp/ntp","repo_kind":"official","path":"ntp/kmax.py","file_url":"https://github.com/uclnlp/ntp/blob/HEAD/ntp/kmax.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"8025ce61959161a4"}},{"code_sha256_prefix":"fd3cdc689950a17a","entry":"read_mentions","repo":"uclnlp/gntp","repo_kind":"official","path":"gntp/io.py","file_url":"https://github.com/uclnlp/gntp/blob/HEAD/gntp/io.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":"fd3cdc689950a17a"}},{"code_sha256_prefix":"e918b6b61c80d29b","entry":"read_triples","repo":"uclnlp/gntp","repo_kind":"official","path":"gntp/io.py","file_url":"https://github.com/uclnlp/gntp/blob/HEAD/gntp/io.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":"e918b6b61c80d29b"}},{"code_sha256_prefix":"1d05c029e1a88874","entry":"rep2string","repo":"uclnlp/ntp","repo_kind":"official","path":"ntp/prover.py","file_url":"https://github.com/uclnlp/ntp/blob/HEAD/ntp/prover.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"1d05c029e1a88874"}},{"code_sha256_prefix":"68763b0b0695fd72","entry":"representation_match","repo":"uclnlp/ntp","repo_kind":"official","path":"ntp/nunify.py","file_url":"https://github.com/uclnlp/ntp/blob/HEAD/ntp/nunify.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"68763b0b0695fd72"}},{"code_sha256_prefix":"a1c7a129b1ccd13a","entry":"sparse_softmax","repo":"uclnlp/gntp","repo_kind":"official","path":"gntp/attention.py","file_url":"https://github.com/uclnlp/gntp/blob/HEAD/gntp/attention.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":"a1c7a129b1ccd13a"}},{"code_sha256_prefix":"b6b34a3aaa5bb4e9","entry":"trim","repo":"uclnlp/ntp","repo_kind":"official","path":"ntp/util.py","file_url":"https://github.com/uclnlp/ntp/blob/HEAD/ntp/util.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"b6b34a3aaa5bb4e9"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}