{"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/models-that-prove-their-own-correctness","title":"Models That Prove Their Own Correctness","arxiv_id":"2405.15722","date":"2024-05-24","proceeding":null,"authors":["Noga Amit","Shafi Goldwasser","Orr Paradise","Guy Rothblum"],"abstract":"How can we trust the correctness of a learned model on a particular input of interest? Model accuracy is typically measured *on average* over a distribution of inputs, giving no guarantee for any fixed input. This paper proposes a theoretically-founded solution to this problem: to train *Self-Proving models* that prove the correctness of their output to a verification algorithm $V$ via an Interactive Proof. Self-Proving models satisfy that, with high probability over a random input, the model generates a correct output *and* successfully proves its correctness to $V\\!$. The *soundness* property of $V$ guarantees that, for *every* input, no model can convince $V$ of the correctness of an incorrect output. Thus, a Self-Proving model proves correctness of most of its outputs, while *all* incorrect outputs (of any model) are detected by $V$. We devise a generic method for learning Self-Proving models, and we prove convergence bounds under certain assumptions. The theoretical framework and results are complemented by experiments on an arithmetic capability: computing the greatest common divisor (GCD) of two integers. Our learning method is used to train a Self-Proving transformer that computes the GCD *and* proves the correctness of its answer.","url_abs":"https://arxiv.org/abs/2405.15722v3","url_pdf":"https://arxiv.org/pdf/2405.15722v3.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":"models-that-prove-their-own-correctness","repo_url":"https://github.com/orrp/self-proving-models","is_official":1,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2405.15722","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2405.15722"}},"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/orrp/self-proving-models","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":6},"by_repo_kind":{"official":{"samples":6,"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":0,"samples":[{"code_sha256_prefix":"77a1aa6411d31114","entry":"arr_split","repo":"orrp/self-proving-models","repo_kind":"official","path":"spm/utils.py","file_url":"https://github.com/orrp/self-proving-models/blob/HEAD/spm/utils.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":"77a1aa6411d31114"}},{"code_sha256_prefix":"011a6cdc68aa95ff","entry":"average_scores","repo":"orrp/self-proving-models","repo_kind":"official","path":"spm/gpt/trainer.py","file_url":"https://github.com/orrp/self-proving-models/blob/HEAD/spm/gpt/trainer.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":"011a6cdc68aa95ff"}},{"code_sha256_prefix":"72bd7a0b26a1e56f","entry":"human_readable_size","repo":"orrp/self-proving-models","repo_kind":"official","path":"spm/utils.py","file_url":"https://github.com/orrp/self-proving-models/blob/HEAD/spm/utils.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":"72bd7a0b26a1e56f"}},{"code_sha256_prefix":"e347cce3439bb828","entry":"np_to_torch","repo":"orrp/self-proving-models","repo_kind":"official","path":"spm/utils.py","file_url":"https://github.com/orrp/self-proving-models/blob/HEAD/spm/utils.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":"e347cce3439bb828"}},{"code_sha256_prefix":"f9422a99babbdd60","entry":"num_unique_prime_factors","repo":"orrp/self-proving-models","repo_kind":"official","path":"figs/diff_bases.py","file_url":"https://github.com/orrp/self-proving-models/blob/HEAD/figs/diff_bases.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"f9422a99babbdd60"}},{"code_sha256_prefix":"93f887ce55123776","entry":"to_tr_name","repo":"orrp/self-proving-models","repo_kind":"official","path":"spm/train_diff_bases.py","file_url":"https://github.com/orrp/self-proving-models/blob/HEAD/spm/train_diff_bases.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":"93f887ce55123776"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}