{"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/high-performance-temporal-reversible-spiking","title":"High-Performance Temporal Reversible Spiking Neural Networks with $O(L)$ Training Memory and $O(1)$ Inference Cost","arxiv_id":"2405.16466","date":"2024-05-26","proceeding":null,"authors":["Jiakui Hu","Man Yao","Xuerui Qiu","Yuhong Chou","Yuxuan Cai","Ning Qiao","Yonghong Tian","Bo Xu","Guoqi Li"],"abstract":"Multi-timestep simulation of brain-inspired Spiking Neural Networks (SNNs) boost memory requirements during training and increase inference energy cost. Current training methods cannot simultaneously solve both training and inference dilemmas. This work proposes a novel Temporal Reversible architecture for SNNs (T-RevSNN) to jointly address the training and inference challenges by altering the forward propagation of SNNs. We turn off the temporal dynamics of most spiking neurons and design multi-level temporal reversible interactions at temporal turn-on spiking neurons, resulting in a $O(L)$ training memory. Combined with the temporal reversible nature, we redesign the input encoding and network organization of SNNs to achieve $O(1)$ inference energy cost. Then, we finely adjust the internal units and residual connections of the basic SNN block to ensure the effectiveness of sparse temporal information interaction. T-RevSNN achieves excellent accuracy on ImageNet, while the memory efficiency, training time acceleration, and inference energy efficiency can be significantly improved by $8.6 \\times$, $2.0 \\times$, and $1.6 \\times$, respectively. This work is expected to break the technical bottleneck of significantly increasing memory cost and training time for large-scale SNNs while maintaining high performance and low inference energy cost. Source code and models are available at: https://github.com/BICLab/T-RevSNN.","url_abs":"https://arxiv.org/abs/2405.16466v1","url_pdf":"https://arxiv.org/pdf/2405.16466v1.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":"high-performance-temporal-reversible-spiking","repo_url":"https://github.com/biclab/t-revsnn","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok"}},{"paper_slug":"high-performance-temporal-reversible-spiking","repo_url":"https://github.com/MindSpore-scientific-2/code-7/blob/main/rev_function.py","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"mindspore","reach":null}],"tasks":[],"methods":[{"method_slug":"snn","method_name":"SNN"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2405.16466","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2405.16466"}},"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/MindSpore-scientific-2/code-7/blob/main/rev_function.py","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/biclab/t-revsnn","reach":{"status":"ok"}}],"summary":{"ran":10,"ran_honours":1,"unverified":8},"by_repo_kind":{"official":{"samples":15,"ran":11,"repositories":1},"listed":{"samples":4,"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":15,"samples":[{"code_sha256_prefix":"a71accca7675fc44","entry":"TET_loss","repo":"biclab/t-revsnn","repo_kind":"official","path":"loss.py","file_url":"https://github.com/biclab/t-revsnn/blob/HEAD/loss.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"a71accca7675fc44"}},{"code_sha256_prefix":"c9aba121df4c6d52","entry":"build_scheduler","repo":"biclab/t-revsnn","repo_kind":"official","path":"lr_scheduler.py","file_url":"https://github.com/biclab/t-revsnn/blob/HEAD/lr_scheduler.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"c9aba121df4c6d52"}},{"code_sha256_prefix":"30efe3fef88ef14c","entry":"calc_firing_rate","repo":"biclab/t-revsnn","repo_kind":"official","path":"main_no_decoder.py","file_url":"https://github.com/biclab/t-revsnn/blob/HEAD/main_no_decoder.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"30efe3fef88ef14c"}},{"code_sha256_prefix":"d61a821f2b84fe36","entry":"calc_non_zero_rate","repo":"biclab/t-revsnn","repo_kind":"official","path":"main_no_decoder.py","file_url":"https://github.com/biclab/t-revsnn/blob/HEAD/main_no_decoder.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"d61a821f2b84fe36"}},{"code_sha256_prefix":"85558ca537762448","entry":"compound_loss_only_cls","repo":"biclab/t-revsnn","repo_kind":"official","path":"loss.py","file_url":"https://github.com/biclab/t-revsnn/blob/HEAD/loss.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"85558ca537762448"}},{"code_sha256_prefix":"3227c202c2b3ebf1","entry":"detach_and_grad","repo":"biclab/t-revsnn","repo_kind":"official","path":"models/rev_function.py","file_url":"https://github.com/biclab/t-revsnn/blob/HEAD/models/rev_function.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"3227c202c2b3ebf1"}},{"code_sha256_prefix":"c2a073f0eb31bd73","entry":"get_cpu_and_gpu_states","repo":"biclab/t-revsnn","repo_kind":"official","path":"models/rev_function.py","file_url":"https://github.com/biclab/t-revsnn/blob/HEAD/models/rev_function.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"c2a073f0eb31bd73"}},{"code_sha256_prefix":"eec1e7cba51d5e8e","entry":"get_grad_norm","repo":"biclab/t-revsnn","repo_kind":"official","path":"utils.py","file_url":"https://github.com/biclab/t-revsnn/blob/HEAD/utils.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"eec1e7cba51d5e8e"}},{"code_sha256_prefix":"d429b6a417929c36","entry":"load_checkpoint","repo":"biclab/t-revsnn","repo_kind":"official","path":"utils.py","file_url":"https://github.com/biclab/t-revsnn/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":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"d429b6a417929c36"}},{"code_sha256_prefix":"5dd42a7ce2cea5bd","entry":"set_weight_decay","repo":"biclab/t-revsnn","repo_kind":"official","path":"optimizer.py","file_url":"https://github.com/biclab/t-revsnn/blob/HEAD/optimizer.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"5dd42a7ce2cea5bd"}},{"code_sha256_prefix":"670bc2732a11c7eb","entry":"unitwise_norm","repo":"biclab/t-revsnn","repo_kind":"official","path":"utils.py","file_url":"https://github.com/biclab/t-revsnn/blob/HEAD/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"670bc2732a11c7eb"}},{"code_sha256_prefix":"b0a5beb34716d5a6","entry":"check_keywords_in_name","repo":"biclab/t-revsnn","repo_kind":"official","path":"optimizer.py","file_url":"https://github.com/biclab/t-revsnn/blob/HEAD/optimizer.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"b0a5beb34716d5a6"}},{"code_sha256_prefix":"80450600f7f09b0a","entry":"create_logger","repo":"biclab/t-revsnn","repo_kind":"official","path":"logger.py","file_url":"https://github.com/biclab/t-revsnn/blob/HEAD/logger.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"80450600f7f09b0a"}},{"code_sha256_prefix":"547f21f5227890b7","entry":"get_config","repo":"biclab/t-revsnn","repo_kind":"official","path":"config.py","file_url":"https://github.com/biclab/t-revsnn/blob/HEAD/config.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"547f21f5227890b7"}},{"code_sha256_prefix":"09909a0053973029","entry":"get_gpu_states","repo":"biclab/t-revsnn","repo_kind":"official","path":"models/rev_function.py","file_url":"https://github.com/biclab/t-revsnn/blob/HEAD/models/rev_function.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"09909a0053973029"}},{"code_sha256_prefix":"e2a6feec71c8cf83","entry":"get_padding","repo":"MindSpore-scientific-2/code-7","repo_kind":"listed","path":"ms_spike_modules.py","file_url":"https://github.com/MindSpore-scientific-2/code-7/blob/HEAD/ms_spike_modules.py","link_basis":"harvester_set","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":"e2a6feec71c8cf83"}},{"code_sha256_prefix":"a41e4bcb54a4b5d2","entry":"laplacians","repo":"MindSpore-scientific-2/code-7","repo_kind":"listed","path":"pointdpi/utils_for_matching_dtinet.py","file_url":"https://github.com/MindSpore-scientific-2/code-7/blob/HEAD/pointdpi/utils_for_matching_dtinet.py","link_basis":"harvester_set","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":"a41e4bcb54a4b5d2"}},{"code_sha256_prefix":"038548fc8980d84c","entry":"line_normalize","repo":"MindSpore-scientific-2/code-7","repo_kind":"listed","path":"pointdpi/utils_for_matching_dtinet.py","file_url":"https://github.com/MindSpore-scientific-2/code-7/blob/HEAD/pointdpi/utils_for_matching_dtinet.py","link_basis":"harvester_set","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":"038548fc8980d84c"}},{"code_sha256_prefix":"ec5063b857ea5fa8","entry":"max_min_normalize","repo":"MindSpore-scientific-2/code-7","repo_kind":"listed","path":"pointdpi/utils_for_matching_dtinet.py","file_url":"https://github.com/MindSpore-scientific-2/code-7/blob/HEAD/pointdpi/utils_for_matching_dtinet.py","link_basis":"harvester_set","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":"ec5063b857ea5fa8"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}