{"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/online-training-through-time-for-spiking","title":"Online Training Through Time for Spiking Neural Networks","arxiv_id":"2210.04195","date":"2022-10-09","proceeding":null,"authors":["Mingqing Xiao","Qingyan Meng","Zongpeng Zhang","Di He","Zhouchen Lin"],"abstract":"Spiking neural networks (SNNs) are promising brain-inspired energy-efficient models. Recent progress in training methods has enabled successful deep SNNs on large-scale tasks with low latency. Particularly, backpropagation through time (BPTT) with surrogate gradients (SG) is popularly used to achieve high performance in a very small number of time steps. However, it is at the cost of large memory consumption for training, lack of theoretical clarity for optimization, and inconsistency with the online property of biological learning and rules on neuromorphic hardware. Other works connect spike representations of SNNs with equivalent artificial neural network formulation and train SNNs by gradients from equivalent mappings to ensure descent directions. But they fail to achieve low latency and are also not online. In this work, we propose online training through time (OTTT) for SNNs, which is derived from BPTT to enable forward-in-time learning by tracking presynaptic activities and leveraging instantaneous loss and gradients. Meanwhile, we theoretically analyze and prove that gradients of OTTT can provide a similar descent direction for optimization as gradients based on spike representations under both feedforward and recurrent conditions. OTTT only requires constant training memory costs agnostic to time steps, avoiding the significant memory costs of BPTT for GPU training. Furthermore, the update rule of OTTT is in the form of three-factor Hebbian learning, which could pave a path for online on-chip learning. With OTTT, it is the first time that two mainstream supervised SNN training methods, BPTT with SG and spike representation-based training, are connected, and meanwhile in a biologically plausible form. Experiments on CIFAR-10, CIFAR-100, ImageNet, and CIFAR10-DVS demonstrate the superior performance of our method on large-scale static and neuromorphic datasets in small time steps.","url_abs":"https://arxiv.org/abs/2210.04195v2","url_pdf":"https://arxiv.org/pdf/2210.04195v2.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":"online-training-through-time-for-spiking","repo_url":"https://github.com/pkuxmq/ottt-snn","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"event-data-classification","task_name":"Event data classification"},{"task_slug":null,"task_name":"GPU"},{"task_slug":"gesture-recognition","task_name":"Gesture Recognition"},{"task_slug":"image-classification","task_name":"Image Classification"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/event-data-classification-on-cifar10-dvs-1","task":"Event data classification","dataset":"CIFAR10-DVS","model":"OTTT","rank_in_archive_order":3,"of":7,"metrics":{"Accuracy":"77.1"},"uses_additional_data":false},{"leaderboard":"/sota/gesture-recognition-on-dvs128-gesture","task":"Gesture Recognition","dataset":"DVS128 Gesture","model":"OTTT","rank_in_archive_order":8,"of":14,"metrics":{"Accuracy (%)":"96.88"},"uses_additional_data":false},{"leaderboard":"/sota/image-classification-on-cifar-10","task":"Image Classification","dataset":"CIFAR-10","model":"OTTT","rank_in_archive_order":170,"of":265,"metrics":{"Percentage correct":"93.73"},"uses_additional_data":false},{"leaderboard":"/sota/image-classification-on-cifar-100","task":"Image Classification","dataset":"CIFAR-100","model":"OTTT","rank_in_archive_order":173,"of":211,"metrics":{"Percentage correct":"71.05"},"uses_additional_data":false},{"leaderboard":"/sota/image-classification-on-fashion-mnist","task":"Image Classification","dataset":"Fashion-MNIST","model":"OTTT","rank_in_archive_order":19,"of":34,"metrics":{"Percentage error":"9.6"},"uses_additional_data":false},{"leaderboard":"/sota/image-classification-on-imagenet","task":"Image Classification","dataset":"ImageNet","model":"OTTT","rank_in_archive_order":1047,"of":1060,"metrics":{"Top 1 Accuracy":"65.15%"},"uses_additional_data":false}],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2210.04195","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2210.04195"}},"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":"deterministic:regex_extraction","url":"https://github.com/pkuxmq/OTTT-SNN","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/pkuxmq/ottt-snn","reach":{"status":"ok"}}],"summary":{"ran_draft_wrong":2,"ran_fixture":1},"by_repo_kind":{"official":{"samples":3,"ran":3,"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":3,"samples":[{"code_sha256_prefix":"e5e746cb5389e8e3","entry":"redundant_one_hot","repo":"pkuxmq/OTTT-SNN","repo_kind":"official","path":"spikingjelly_codes/reference_codes/functional.py","file_url":"https://github.com/pkuxmq/OTTT-SNN/blob/HEAD/spikingjelly_codes/reference_codes/functional.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":2,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"e5e746cb5389e8e3"}},{"code_sha256_prefix":"5d857db4a57f07c7","entry":"kernel_dot_product","repo":"pkuxmq/OTTT-SNN","repo_kind":"official","path":"spikingjelly_codes/reference_codes/functional.py","file_url":"https://github.com/pkuxmq/OTTT-SNN/blob/HEAD/spikingjelly_codes/reference_codes/functional.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"5d857db4a57f07c7"}},{"code_sha256_prefix":"e0fce279566e48bb","entry":"spike_similar_loss","repo":"pkuxmq/OTTT-SNN","repo_kind":"official","path":"spikingjelly_codes/reference_codes/functional.py","file_url":"https://github.com/pkuxmq/OTTT-SNN/blob/HEAD/spikingjelly_codes/reference_codes/functional.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"e0fce279566e48bb"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}