{"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/discrete-neural-algorithmic-reasoning","title":"Discrete Neural Algorithmic Reasoning","arxiv_id":"2402.11628","date":"2024-02-18","proceeding":null,"authors":["Gleb Rodionov","Liudmila Prokhorenkova"],"abstract":"Neural algorithmic reasoning aims to capture computations with neural networks via learning the models to imitate the execution of classic algorithms. While common architectures are expressive enough to contain the correct model in the weights space, current neural reasoners are struggling to generalize well on out-of-distribution data. On the other hand, classic computations are not affected by distributional shifts as they can be described as transitions between discrete computational states. In this work, we propose to force neural reasoners to maintain the execution trajectory as a combination of finite predefined states. To achieve that, we separate discrete and continuous data flows and describe the interaction between them. Trained with supervision on the algorithm's state transitions, such models are able to perfectly align with the original algorithm. To show this, we evaluate our approach on multiple algorithmic problems and get perfect test scores both in single-task and multitask setups. Moreover, the proposed architectural choice allows us to prove the correctness of the learned algorithms for any test~data.","url_abs":"https://arxiv.org/abs/2402.11628v2","url_pdf":"https://arxiv.org/pdf/2402.11628v2.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":"discrete-neural-algorithmic-reasoning","repo_url":"https://github.com/yandex-research/dnar","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[],"methods":[{"method_slug":"align","method_name":"ALIGN"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2402.11628","atlas_url":"https://app.syntology.ai/?focus=2402.11628","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2402.11628"}},"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/yandex-research/dnar","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran":6,"unverified":1},"by_repo_kind":{"official":{"samples":7,"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":"1b250b791459ce0e","entry":"bfs","repo":"yandex-research/dnar","repo_kind":"official","path":"generate_data.py","file_url":"https://github.com/yandex-research/dnar/blob/HEAD/generate_data.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"1b250b791459ce0e"}},{"code_sha256_prefix":"df4c2e1bb388ca7f","entry":"dfs","repo":"yandex-research/dnar","repo_kind":"official","path":"generate_data.py","file_url":"https://github.com/yandex-research/dnar/blob/HEAD/generate_data.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"df4c2e1bb388ca7f"}},{"code_sha256_prefix":"b1d27ed952dcc5ab","entry":"gumbel_softmax","repo":"yandex-research/dnar","repo_kind":"official","path":"utils.py","file_url":"https://github.com/yandex-research/dnar/blob/HEAD/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"b1d27ed952dcc5ab"}},{"code_sha256_prefix":"3620d36101d9d5c2","entry":"mst","repo":"yandex-research/dnar","repo_kind":"official","path":"generate_data.py","file_url":"https://github.com/yandex-research/dnar/blob/HEAD/generate_data.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"3620d36101d9d5c2"}},{"code_sha256_prefix":"7dc8b4d3f1a728dc","entry":"read_config","repo":"yandex-research/dnar","repo_kind":"official","path":"configs/base_config.py","file_url":"https://github.com/yandex-research/dnar/blob/HEAD/configs/base_config.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"7dc8b4d3f1a728dc"}},{"code_sha256_prefix":"442d7bedb7a5b8b8","entry":"temp_by_step","repo":"yandex-research/dnar","repo_kind":"official","path":"utils.py","file_url":"https://github.com/yandex-research/dnar/blob/HEAD/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"442d7bedb7a5b8b8"}},{"code_sha256_prefix":"c44d8613055ccc58","entry":"reverse_edge_index","repo":"yandex-research/dnar","repo_kind":"official","path":"utils.py","file_url":"https://github.com/yandex-research/dnar/blob/HEAD/utils.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":"c44d8613055ccc58"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}