{"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/right-for-the-right-reasons-training","title":"Right for the Right Reasons: Training Differentiable Models by Constraining their Explanations","arxiv_id":"1703.03717","date":"2017-03-10","proceeding":null,"authors":["Andrew Slavin Ross","Michael C. Hughes","Finale Doshi-Velez"],"abstract":"Neural networks are among the most accurate supervised learning methods in\nuse today, but their opacity makes them difficult to trust in critical\napplications, especially when conditions in training differ from those in test.\nRecent work on explanations for black-box models has produced tools (e.g. LIME)\nto show the implicit rules behind predictions, which can help us identify when\nmodels are right for the wrong reasons. However, these methods do not scale to\nexplaining entire datasets and cannot correct the problems they reveal. We\nintroduce a method for efficiently explaining and regularizing differentiable\nmodels by examining and selectively penalizing their input gradients, which\nprovide a normal to the decision boundary. We apply these penalties both based\non expert annotation and in an unsupervised fashion that encourages diverse\nmodels with qualitatively different decision boundaries for the same\nclassification problem. On multiple datasets, we show our approach generates\nfaithful explanations and models that generalize much better when conditions\ndiffer between training and test.","url_abs":"http://arxiv.org/abs/1703.03717v2","url_pdf":"http://arxiv.org/pdf/1703.03717v2.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":"right-for-the-right-reasons-training","repo_url":"https://github.com/dtak/rrr","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"none","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=1703.03717","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"1703.03717"}},"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/dtak/rrr","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":1,"unverified":13},"by_repo_kind":{"official":{"samples":14,"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":"9817b40445c2c460","entry":"Bern","repo":"dtak/rrr","repo_kind":"official","path":"rrr/decoy_mnist.py","file_url":"https://github.com/dtak/rrr/blob/HEAD/rrr/decoy_mnist.py","link_basis":"plan_row","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":"9817b40445c2c460"}},{"code_sha256_prefix":"5eccb66a8fd6a7ad","entry":"abs_weights_in","repo":"dtak/rrr","repo_kind":"official","path":"experiments/word_table.py","file_url":"https://github.com/dtak/rrr/blob/HEAD/experiments/word_table.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":"5eccb66a8fd6a7ad"}},{"code_sha256_prefix":"17b25464218ca9f7","entry":"any_repeats","repo":"dtak/rrr","repo_kind":"official","path":"rrr/toy_colors.py","file_url":"https://github.com/dtak/rrr/blob/HEAD/rrr/toy_colors.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":"17b25464218ca9f7"}},{"code_sha256_prefix":"986bd42d6c370e36","entry":"augment","repo":"dtak/rrr","repo_kind":"official","path":"rrr/decoy_mnist.py","file_url":"https://github.com/dtak/rrr/blob/HEAD/rrr/decoy_mnist.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":"986bd42d6c370e36"}},{"code_sha256_prefix":"c38c3140ea99edb0","entry":"download_mnist","repo":"dtak/rrr","repo_kind":"official","path":"rrr/decoy_mnist.py","file_url":"https://github.com/dtak/rrr/blob/HEAD/rrr/decoy_mnist.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":"c38c3140ea99edb0"}},{"code_sha256_prefix":"79b825acdeeb1e5d","entry":"generate_dataset","repo":"dtak/rrr","repo_kind":"official","path":"rrr/iris_cancer.py","file_url":"https://github.com/dtak/rrr/blob/HEAD/rrr/iris_cancer.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":"79b825acdeeb1e5d"}},{"code_sha256_prefix":"c106f94602bc64a0","entry":"generate_image","repo":"dtak/rrr","repo_kind":"official","path":"rrr/toy_colors.py","file_url":"https://github.com/dtak/rrr/blob/HEAD/rrr/toy_colors.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":"c106f94602bc64a0"}},{"code_sha256_prefix":"35ae7d4c0d9d0a3f","entry":"iris_usage","repo":"dtak/rrr","repo_kind":"official","path":"rrr/iris_cancer.py","file_url":"https://github.com/dtak/rrr/blob/HEAD/rrr/iris_cancer.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":"35ae7d4c0d9d0a3f"}},{"code_sha256_prefix":"202c34477ef03008","entry":"listwrap","repo":"dtak/rrr","repo_kind":"official","path":"rrr/local_linear_explanation.py","file_url":"https://github.com/dtak/rrr/blob/HEAD/rrr/local_linear_explanation.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":"202c34477ef03008"}},{"code_sha256_prefix":"781a2d98cab6f688","entry":"max_weight_in","repo":"dtak/rrr","repo_kind":"official","path":"experiments/word_table.py","file_url":"https://github.com/dtak/rrr/blob/HEAD/experiments/word_table.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":"781a2d98cab6f688"}},{"code_sha256_prefix":"fff341b836aa49d0","entry":"one_hot","repo":"dtak/rrr","repo_kind":"official","path":"rrr/multilayer_perceptron.py","file_url":"https://github.com/dtak/rrr/blob/HEAD/rrr/multilayer_perceptron.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":"fff341b836aa49d0"}},{"code_sha256_prefix":"d144728084cadb8c","entry":"one_hot","repo":"dtak/rrr","repo_kind":"official","path":"rrr/tensorflow_perceptron.py","file_url":"https://github.com/dtak/rrr/blob/HEAD/rrr/tensorflow_perceptron.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":"d144728084cadb8c"}},{"code_sha256_prefix":"fd6644bff4456444","entry":"relu","repo":"dtak/rrr","repo_kind":"official","path":"rrr/multilayer_perceptron.py","file_url":"https://github.com/dtak/rrr/blob/HEAD/rrr/multilayer_perceptron.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":"fd6644bff4456444"}},{"code_sha256_prefix":"ff31ad55c2bc4916","entry":"word_tags","repo":"dtak/rrr","repo_kind":"official","path":"experiments/word_table.py","file_url":"https://github.com/dtak/rrr/blob/HEAD/experiments/word_table.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":"ff31ad55c2bc4916"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}