{"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/arxiv-2602-05830","title":"Learning Compact Boolean Networks","arxiv_id":"2602.05830","date":"2026-02-05","proceeding":null,"authors":["Shengpu Wang","Yuhao Mao","Yani Zhang","Martin Vechev"],"abstract":"Floating-point neural networks dominate modern machine learning but incur substantial inference costs, motivating emerging interest in Boolean networks for resource-constrained deployments. Since Boolean networks use only Boolean operations, they can achieve nanosecond-scale inference latency. However, learning Boolean networks that are both compact and accurate remains challenging because of their discrete, combinatorial structure. In this work we address this challenge via three novel, complementary contributions: (i) a new parameter-free strategy for learning effective connections, (ii) a novel compact convolutional Boolean architecture that exploits spatial locality while requiring fewer Boolean operations than existing convolutional kernels, and (iii) an adaptive discretization procedure that reduces the accuracy drop incurred when converting a continuously relaxed network into a discrete Boolean network. Across standard vision benchmarks, our method improves the Pareto frontier over prior state-of-the-art methods, achieving higher accuracy with up to $47\\times$ fewer Boolean operations. This advantage also extends to other modalities. Further, on an FPGA, our model on MNIST achieves 99.38\\% accuracy with 6.48 ns latency, surpassing the prior state-of-the-art in both accuracy and runtime, while generating a $7\\times$ smaller circuit. Code and models are available at https://github.com/eth-sri/CompactLogic.","url_abs":"https://arxiv.org/abs/2602.05830","url_pdf":"https://arxiv.org/pdf/2602.05830","source":{"archive":null,"snapshot":"2025-07-28","note":"not in the Papers with Code archive (frozen at the snapshot)","row_kind":"graph","title_abstract_authors_date":"arXiv metadata, CC0 1.0 (https://info.arxiv.org/help/license)"},"code_links":[],"tasks":[],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2602.05830","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2602.05830"}},"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":[{"mentioned_in_github":null,"is_official":null,"provenance":"deterministic:regex_extraction","mentioned_in_paper":null,"url":"https://github.com/eth-sri/CompactLogic","reach":null}],"summary":{"unverified":18},"by_repo_kind":{"found_in_text":{"samples":18,"ran":0,"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":"5c2f9e1a7b96d390","entry":"binarize_2D","repo":"eth-sri/CompactLogic","repo_kind":"found_in_text","path":"experiments/ecg_dataset.py","file_url":"https://github.com/eth-sri/CompactLogic/blob/HEAD/experiments/ecg_dataset.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":"5c2f9e1a7b96d390"}},{"code_sha256_prefix":"f152a8954eeea37c","entry":"binarize_flat","repo":"eth-sri/CompactLogic","repo_kind":"found_in_text","path":"experiments/ecg_dataset.py","file_url":"https://github.com/eth-sri/CompactLogic/blob/HEAD/experiments/ecg_dataset.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":"f152a8954eeea37c"}},{"code_sha256_prefix":"7d9322d31da5531d","entry":"binarize_tensor","repo":"eth-sri/CompactLogic","repo_kind":"found_in_text","path":"experiments/experiment_script.py","file_url":"https://github.com/eth-sri/CompactLogic/blob/HEAD/experiments/experiment_script.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":"7d9322d31da5531d"}},{"code_sha256_prefix":"55a7335a4896082f","entry":"default_pruned_module_name","repo":"eth-sri/CompactLogic","repo_kind":"found_in_text","path":"compiler/naming.py","file_url":"https://github.com/eth-sri/CompactLogic/blob/HEAD/compiler/naming.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":"55a7335a4896082f"}},{"code_sha256_prefix":"7d0bdc7f57f35316","entry":"emit_clocked_wrapper_verilog","repo":"eth-sri/CompactLogic","repo_kind":"found_in_text","path":"compiler/clocked.py","file_url":"https://github.com/eth-sri/CompactLogic/blob/HEAD/compiler/clocked.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":"7d0bdc7f57f35316"}},{"code_sha256_prefix":"77981c6865c19ec5","entry":"emit_naive_pruned_reindexed_clocked_bundle_from_checkpoint","repo":"eth-sri/CompactLogic","repo_kind":"found_in_text","path":"compiler/clocked.py","file_url":"https://github.com/eth-sri/CompactLogic/blob/HEAD/compiler/clocked.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":"77981c6865c19ec5"}},{"code_sha256_prefix":"5b2ae47540075a3b","entry":"eval_gate_torch","repo":"eth-sri/CompactLogic","repo_kind":"found_in_text","path":"compiler/gates.py","file_url":"https://github.com/eth-sri/CompactLogic/blob/HEAD/compiler/gates.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":"5b2ae47540075a3b"}},{"code_sha256_prefix":"0803d9ef52f24c28","entry":"get_data_dir","repo":"eth-sri/CompactLogic","repo_kind":"found_in_text","path":"experiments/experiment_script.py","file_url":"https://github.com/eth-sri/CompactLogic/blob/HEAD/experiments/experiment_script.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":"0803d9ef52f24c28"}},{"code_sha256_prefix":"d2d9416392ffe25f","entry":"infer_metadata_path","repo":"eth-sri/CompactLogic","repo_kind":"found_in_text","path":"compiler/extract.py","file_url":"https://github.com/eth-sri/CompactLogic/blob/HEAD/compiler/extract.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":"d2d9416392ffe25f"}},{"code_sha256_prefix":"700beef031b89839","entry":"input_dim_of_dataset","repo":"eth-sri/CompactLogic","repo_kind":"found_in_text","path":"compiler/model_builder.py","file_url":"https://github.com/eth-sri/CompactLogic/blob/HEAD/compiler/model_builder.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":"700beef031b89839"}},{"code_sha256_prefix":"459081541341753b","entry":"input_shape_of_dataset","repo":"eth-sri/CompactLogic","repo_kind":"found_in_text","path":"compiler/model_builder.py","file_url":"https://github.com/eth-sri/CompactLogic/blob/HEAD/compiler/model_builder.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":"459081541341753b"}},{"code_sha256_prefix":"a2a627f547c4fa12","entry":"load_checkpoint_artifacts","repo":"eth-sri/CompactLogic","repo_kind":"found_in_text","path":"compiler/extract.py","file_url":"https://github.com/eth-sri/CompactLogic/blob/HEAD/compiler/extract.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":"a2a627f547c4fa12"}},{"code_sha256_prefix":"81de69b524c2229b","entry":"load_ecg_loaders","repo":"eth-sri/CompactLogic","repo_kind":"found_in_text","path":"experiments/ecg_dataset.py","file_url":"https://github.com/eth-sri/CompactLogic/blob/HEAD/experiments/ecg_dataset.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":"81de69b524c2229b"}},{"code_sha256_prefix":"81e47d8ec93a5c61","entry":"module_name_from_metadata","repo":"eth-sri/CompactLogic","repo_kind":"found_in_text","path":"compiler/naming.py","file_url":"https://github.com/eth-sri/CompactLogic/blob/HEAD/compiler/naming.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":"81e47d8ec93a5c61"}},{"code_sha256_prefix":"68703c94f45c875b","entry":"num_classes_of_dataset","repo":"eth-sri/CompactLogic","repo_kind":"found_in_text","path":"compiler/model_builder.py","file_url":"https://github.com/eth-sri/CompactLogic/blob/HEAD/compiler/model_builder.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":"68703c94f45c875b"}},{"code_sha256_prefix":"e0506c590809caa4","entry":"stable_sample_key","repo":"eth-sri/CompactLogic","repo_kind":"found_in_text","path":"experiments/cancer_dataset.py","file_url":"https://github.com/eth-sri/CompactLogic/blob/HEAD/experiments/cancer_dataset.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":"e0506c590809caa4"}},{"code_sha256_prefix":"2e8ccc1dae06051a","entry":"truth_eval_scalar","repo":"eth-sri/CompactLogic","repo_kind":"found_in_text","path":"compiler/gates.py","file_url":"https://github.com/eth-sri/CompactLogic/blob/HEAD/compiler/gates.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":"2e8ccc1dae06051a"}},{"code_sha256_prefix":"81739331a6f03b6f","entry":"verilog_gate_expr","repo":"eth-sri/CompactLogic","repo_kind":"found_in_text","path":"compiler/gates.py","file_url":"https://github.com/eth-sri/CompactLogic/blob/HEAD/compiler/gates.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":"81739331a6f03b6f"}}]},"arxiv_metadata":{"licence":"arXiv metadata, CC0 1.0 (https://info.arxiv.org/help/license)","fields":["title","abstract","authors","date"],"primary_category":"cs.LG","source":"arxiv_2026.jsonl"},"syntology_extracted_results":null}