{"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/nbdt-neural-backed-decision-trees","title":"NBDT: Neural-Backed Decision Trees","arxiv_id":"2004.00221","date":"2020-04-01","proceeding":null,"authors":["Alvin Wan","Lisa Dunlap","Daniel Ho","Jihan Yin","Scott Lee","Henry Jin","Suzanne Petryk","Sarah Adel Bargal","Joseph E. Gonzalez"],"abstract":"Machine learning applications such as finance and medicine demand accurate and justifiable predictions, barring most deep learning methods from use. In response, previous work combines decision trees with deep learning, yielding models that (1) sacrifice interpretability for accuracy or (2) sacrifice accuracy for interpretability. We forgo this dilemma by jointly improving accuracy and interpretability using Neural-Backed Decision Trees (NBDTs). NBDTs replace a neural network's final linear layer with a differentiable sequence of decisions and a surrogate loss. This forces the model to learn high-level concepts and lessens reliance on highly-uncertain decisions, yielding (1) accuracy: NBDTs match or outperform modern neural networks on CIFAR, ImageNet and better generalize to unseen classes by up to 16%. Furthermore, our surrogate loss improves the original model's accuracy by up to 2%. NBDTs also afford (2) interpretability: improving human trustby clearly identifying model mistakes and assisting in dataset debugging. Code and pretrained NBDTs are at https://github.com/alvinwan/neural-backed-decision-trees.","url_abs":"https://arxiv.org/abs/2004.00221v3","url_pdf":"https://arxiv.org/pdf/2004.00221v3.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":"nbdt-neural-backed-decision-trees","repo_url":"https://github.com/alvinwan/neural-backed-decision-trees","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"nbdt-neural-backed-decision-trees","repo_url":"https://github.com/XAVILLA/nbdt","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[],"methods":[{"method_slug":"1x1-convolution","method_name":"1x1 Convolution"},{"method_slug":"average-pooling","method_name":"Average Pooling"},{"method_slug":"batch-normalization","method_name":"Batch Normalization"},{"method_slug":"convolution","method_name":"Convolution"},{"method_slug":"dense-connections","method_name":"Dense Connections"},{"method_slug":"depthwise-convolution","method_name":"Depthwise Convolution"},{"method_slug":"depthwise-separable-convolution","method_name":"Depthwise Separable Convolution"},{"method_slug":"dropout","method_name":"Dropout"},{"method_slug":"efficientnet","method_name":"EfficientNet"},{"method_slug":"interpretability","method_name":"Interpretability"},{"method_slug":"inverted-residual-block","method_name":"Inverted Residual Block"},{"method_slug":"linear-layer","method_name":"Linear Layer"},{"method_slug":"pointwise-convolution","method_name":"Pointwise Convolution"},{"method_slug":"rmsprop","method_name":"RMSProp"},{"method_slug":"relu","method_name":"ReLU"},{"method_slug":"sigmoid-activation","method_name":"Sigmoid Activation"},{"method_slug":"squeeze-and-excitation-block","method_name":"Squeeze-and-Excitation Block"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2004.00221","atlas_url":"https://app.syntology.ai/?focus=2004.00221","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2004.00221"}},"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":"deterministic:regex_extraction","url":"https://github.com/alvinwan/neural-backed-decision-trees","reach":null},{"provenance":"deterministic:regex_extraction","url":"https://github.com/rwightman/pytorch-image-models","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/XAVILLA/nbdt","reach":null}],"summary":{"ran":3,"ran_draft_wrong":14,"ran_honours":1,"unverified":11},"by_repo_kind":{"official":{"samples":6,"ran":1,"repositories":1},"listed":{"samples":23,"ran":17,"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":"1020d5e79c4766de","entry":"Colors","repo":"XAVILLA/nbdt","repo_kind":"listed","path":"nbdt/model.py","file_url":"https://github.com/XAVILLA/nbdt/blob/HEAD/nbdt/model.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":"1020d5e79c4766de"}},{"code_sha256_prefix":"52cf40b8aae2967f","entry":"FakeSynset","repo":"XAVILLA/nbdt","repo_kind":"listed","path":"nbdt/model.py","file_url":"https://github.com/XAVILLA/nbdt/blob/HEAD/nbdt/model.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":"52cf40b8aae2967f"}},{"code_sha256_prefix":"303cf42ae5edc004","entry":"coerce_state_dict","repo":"XAVILLA/nbdt","repo_kind":"listed","path":"nbdt/model.py","file_url":"https://github.com/XAVILLA/nbdt/blob/HEAD/nbdt/model.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"303cf42ae5edc004"}},{"code_sha256_prefix":"23b18dbf212e73e9","entry":"dataset_to_default_path_graph","repo":"XAVILLA/nbdt","repo_kind":"listed","path":"nbdt/model.py","file_url":"https://github.com/XAVILLA/nbdt/blob/HEAD/nbdt/model.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"23b18dbf212e73e9"}},{"code_sha256_prefix":"e081d64f5cad1cd9","entry":"dataset_to_default_path_wnids","repo":"XAVILLA/nbdt","repo_kind":"listed","path":"nbdt/model.py","file_url":"https://github.com/XAVILLA/nbdt/blob/HEAD/nbdt/model.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"e081d64f5cad1cd9"}},{"code_sha256_prefix":"4625fb450d4c7b8c","entry":"dataset_to_dummy_classes","repo":"XAVILLA/nbdt","repo_kind":"listed","path":"nbdt/model.py","file_url":"https://github.com/XAVILLA/nbdt/blob/HEAD/nbdt/model.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"4625fb450d4c7b8c"}},{"code_sha256_prefix":"a32351468906ce8a","entry":"dataset_to_dummy_classes","repo":"alvinwan/neural-backed-decision-trees","repo_kind":"official","path":"nbdt/model.py","file_url":"https://github.com/alvinwan/neural-backed-decision-trees/blob/HEAD/nbdt/model.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"a32351468906ce8a"}},{"code_sha256_prefix":"8497ac1255b3b1a5","entry":"fwd","repo":"XAVILLA/nbdt","repo_kind":"listed","path":"nbdt/model.py","file_url":"https://github.com/XAVILLA/nbdt/blob/HEAD/nbdt/model.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":"8497ac1255b3b1a5"}},{"code_sha256_prefix":"642244caa777143c","entry":"get_leaf_to_path","repo":"XAVILLA/nbdt","repo_kind":"listed","path":"nbdt/model.py","file_url":"https://github.com/XAVILLA/nbdt/blob/HEAD/nbdt/model.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"642244caa777143c"}},{"code_sha256_prefix":"6cbac319834ba8ae","entry":"get_leaves","repo":"XAVILLA/nbdt","repo_kind":"listed","path":"nbdt/model.py","file_url":"https://github.com/XAVILLA/nbdt/blob/HEAD/nbdt/model.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"6cbac319834ba8ae"}},{"code_sha256_prefix":"e31c7cca6d6133a2","entry":"get_roots","repo":"XAVILLA/nbdt","repo_kind":"listed","path":"nbdt/model.py","file_url":"https://github.com/XAVILLA/nbdt/blob/HEAD/nbdt/model.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"e31c7cca6d6133a2"}},{"code_sha256_prefix":"e270d7f9006e5c50","entry":"get_wnids","repo":"XAVILLA/nbdt","repo_kind":"listed","path":"nbdt/model.py","file_url":"https://github.com/XAVILLA/nbdt/blob/HEAD/nbdt/model.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"e270d7f9006e5c50"}},{"code_sha256_prefix":"8c79e86eb84f0948","entry":"hierarchy_to_path_graph","repo":"XAVILLA/nbdt","repo_kind":"listed","path":"nbdt/model.py","file_url":"https://github.com/XAVILLA/nbdt/blob/HEAD/nbdt/model.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"8c79e86eb84f0948"}},{"code_sha256_prefix":"626c774cdb0ecdea","entry":"is_leaf","repo":"XAVILLA/nbdt","repo_kind":"listed","path":"nbdt/model.py","file_url":"https://github.com/XAVILLA/nbdt/blob/HEAD/nbdt/model.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"626c774cdb0ecdea"}},{"code_sha256_prefix":"7ef704b1f90df1c8","entry":"read_graph","repo":"XAVILLA/nbdt","repo_kind":"listed","path":"nbdt/model.py","file_url":"https://github.com/XAVILLA/nbdt/blob/HEAD/nbdt/model.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"7ef704b1f90df1c8"}},{"code_sha256_prefix":"8d5c8808f6873339","entry":"synset_to_name","repo":"XAVILLA/nbdt","repo_kind":"listed","path":"nbdt/model.py","file_url":"https://github.com/XAVILLA/nbdt/blob/HEAD/nbdt/model.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"8d5c8808f6873339"}},{"code_sha256_prefix":"71ff6b40cffae955","entry":"wnid_to_name","repo":"XAVILLA/nbdt","repo_kind":"listed","path":"nbdt/model.py","file_url":"https://github.com/XAVILLA/nbdt/blob/HEAD/nbdt/model.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"71ff6b40cffae955"}},{"code_sha256_prefix":"1743b41d3adb91a6","entry":"wnid_to_synset","repo":"XAVILLA/nbdt","repo_kind":"listed","path":"nbdt/model.py","file_url":"https://github.com/XAVILLA/nbdt/blob/HEAD/nbdt/model.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"1743b41d3adb91a6"}},{"code_sha256_prefix":"95c098426e5a427f","entry":"EmbeddedDecisionRules","repo":"XAVILLA/nbdt","repo_kind":"listed","path":"nbdt/model.py","file_url":"https://github.com/XAVILLA/nbdt/blob/HEAD/nbdt/model.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":"95c098426e5a427f"}},{"code_sha256_prefix":"55ce848c52ee5cb8","entry":"EmbeddedDecisionRules","repo":"alvinwan/neural-backed-decision-trees","repo_kind":"official","path":"nbdt/model.py","file_url":"https://github.com/alvinwan/neural-backed-decision-trees/blob/HEAD/nbdt/model.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":"55ce848c52ee5cb8"}},{"code_sha256_prefix":"e9189fbf051e129d","entry":"HardEmbeddedDecisionRules","repo":"XAVILLA/nbdt","repo_kind":"listed","path":"nbdt/model.py","file_url":"https://github.com/XAVILLA/nbdt/blob/HEAD/nbdt/model.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":"e9189fbf051e129d"}},{"code_sha256_prefix":"be59a6ad0e2ddec0","entry":"HardEmbeddedDecisionRules","repo":"alvinwan/neural-backed-decision-trees","repo_kind":"official","path":"nbdt/model.py","file_url":"https://github.com/alvinwan/neural-backed-decision-trees/blob/HEAD/nbdt/model.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":"be59a6ad0e2ddec0"}},{"code_sha256_prefix":"13e0602b87690b50","entry":"NBDT","repo":"XAVILLA/nbdt","repo_kind":"listed","path":"nbdt/model.py","file_url":"https://github.com/XAVILLA/nbdt/blob/HEAD/nbdt/model.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":"13e0602b87690b50"}},{"code_sha256_prefix":"899f401f38f1fd83","entry":"NBDT","repo":"alvinwan/neural-backed-decision-trees","repo_kind":"official","path":"nbdt/model.py","file_url":"https://github.com/alvinwan/neural-backed-decision-trees/blob/HEAD/nbdt/model.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":"899f401f38f1fd83"}},{"code_sha256_prefix":"20d642b846aa125d","entry":"Node","repo":"XAVILLA/nbdt","repo_kind":"listed","path":"nbdt/model.py","file_url":"https://github.com/XAVILLA/nbdt/blob/HEAD/nbdt/model.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":"20d642b846aa125d"}},{"code_sha256_prefix":"4553e20f251d19cb","entry":"Tree","repo":"XAVILLA/nbdt","repo_kind":"listed","path":"nbdt/model.py","file_url":"https://github.com/XAVILLA/nbdt/blob/HEAD/nbdt/model.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":"4553e20f251d19cb"}},{"code_sha256_prefix":"fbc1d6876bb0df31","entry":"Tree","repo":"alvinwan/neural-backed-decision-trees","repo_kind":"official","path":"nbdt/model.py","file_url":"https://github.com/alvinwan/neural-backed-decision-trees/blob/HEAD/nbdt/model.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":"fbc1d6876bb0df31"}},{"code_sha256_prefix":"e33501c9d70eab4b","entry":"load_state_dict_from_key","repo":"XAVILLA/nbdt","repo_kind":"listed","path":"nbdt/model.py","file_url":"https://github.com/XAVILLA/nbdt/blob/HEAD/nbdt/model.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":"e33501c9d70eab4b"}},{"code_sha256_prefix":"14f8f9f850c7e428","entry":"load_state_dict_from_key","repo":"alvinwan/neural-backed-decision-trees","repo_kind":"official","path":"nbdt/model.py","file_url":"https://github.com/alvinwan/neural-backed-decision-trees/blob/HEAD/nbdt/model.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":"14f8f9f850c7e428"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}