{"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/quantized-spike-driven-transformer","title":"Quantized Spike-driven Transformer","arxiv_id":"2501.13492","date":"2025-01-23","proceeding":null,"authors":["Xuerui Qiu","Jieyuan Zhang","Wenjie Wei","Honglin Cao","Junsheng Guo","Rui-Jie Zhu","Yimeng Shan","Yang Yang","Malu Zhang","Haizhou Li"],"abstract":"Spiking neural networks are emerging as a promising energy-efficient alternative to traditional artificial neural networks due to their spike-driven paradigm. However, recent research in the SNN domain has mainly focused on enhancing accuracy by designing large-scale Transformer structures, which typically rely on substantial computational resources, limiting their deployment on resource-constrained devices. To overcome this challenge, we propose a quantized spike-driven Transformer baseline (QSD-Transformer), which achieves reduced resource demands by utilizing a low bit-width parameter. Regrettably, the QSD-Transformer often suffers from severe performance degradation. In this paper, we first conduct empirical analysis and find that the bimodal distribution of quantized spike-driven self-attention (Q-SDSA) leads to spike information distortion (SID) during quantization, causing significant performance degradation. To mitigate this issue, we take inspiration from mutual information entropy and propose a bi-level optimization strategy to rectify the information distribution in Q-SDSA. Specifically, at the lower level, we introduce an information-enhanced LIF to rectify the information distribution in Q-SDSA. At the upper level, we propose a fine-grained distillation scheme for the QSD-Transformer to align the distribution in Q-SDSA with that in the counterpart ANN. By integrating the bi-level optimization strategy, the QSD-Transformer can attain enhanced energy efficiency without sacrificing its high-performance advantage.For instance, when compared to the prior SNN benchmark on ImageNet, the QSD-Transformer achieves 80.3% top-1 accuracy, accompanied by significant reductions of 6.0$\\times$ and 8.1$\\times$ in power consumption and model size, respectively. Code is available at https://github.com/bollossom/QSD-Transformer.","url_abs":"https://arxiv.org/abs/2501.13492v2","url_pdf":"https://arxiv.org/pdf/2501.13492v2.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":"quantized-spike-driven-transformer","repo_url":"https://github.com/bollossom/qsd-transformer","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"quantization","task_name":"Quantization"}],"methods":[{"method_slug":"align","method_name":"ALIGN"},{"method_slug":"absolute-position-encodings","method_name":"Absolute Position Encodings"},{"method_slug":"adam","method_name":"Adam"},{"method_slug":"attention","method_name":"Attention"},{"method_slug":"bpe","method_name":"BPE"},{"method_slug":"dense-connections","method_name":"Dense Connections"},{"method_slug":"dropout","method_name":"Dropout"},{"method_slug":"label-smoothing","method_name":"Label Smoothing"},{"method_slug":"layer-normalization","method_name":"Layer Normalization"},{"method_slug":"linear-layer","method_name":"Linear Layer"},{"method_slug":"multi-head-attention","method_name":"Multi-Head Attention"},{"method_slug":"position-wise-feed-forward-layer","method_name":"Position-Wise Feed-Forward Layer"},{"method_slug":"residual-connection","method_name":"Residual Connection"},{"method_slug":"snn","method_name":"SNN"},{"method_slug":"softmax","method_name":"Softmax"},{"method_slug":"transformer","method_name":"Transformer"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2501.13492","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2501.13492"}},"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/bollossom/qsd-transformer","reach":null}],"summary":{"ran":11,"ran_honours":2,"unverified":12},"by_repo_kind":{"official":{"samples":23,"ran":11,"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":25,"samples":[{"code_sha256_prefix":"74d1ce63bd5f842a","entry":"ActLSQ","repo":"bollossom/qsd-transformer","repo_kind":"official","path":"classification/models.py","file_url":"https://github.com/bollossom/qsd-transformer/blob/HEAD/classification/models.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":"74d1ce63bd5f842a"}},{"code_sha256_prefix":"f81565b0f74daf8b","entry":"BNAndPadLayer","repo":"bollossom/qsd-transformer","repo_kind":"official","path":"classification/models.py","file_url":"https://github.com/bollossom/qsd-transformer/blob/HEAD/classification/models.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":"f81565b0f74daf8b"}},{"code_sha256_prefix":"fd8577cc6c4df32f","entry":"Conv1dLSQ","repo":"bollossom/qsd-transformer","repo_kind":"official","path":"classification/models.py","file_url":"https://github.com/bollossom/qsd-transformer/blob/HEAD/classification/models.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":"fd8577cc6c4df32f"}},{"code_sha256_prefix":"1df040edf15964ac","entry":"Conv2dLSQ","repo":"bollossom/qsd-transformer","repo_kind":"official","path":"classification/models.py","file_url":"https://github.com/bollossom/qsd-transformer/blob/HEAD/classification/models.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":"1df040edf15964ac"}},{"code_sha256_prefix":"a68f1f39a2897fde","entry":"LinearLSQ","repo":"bollossom/qsd-transformer","repo_kind":"official","path":"classification/models.py","file_url":"https://github.com/bollossom/qsd-transformer/blob/HEAD/classification/models.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":"a68f1f39a2897fde"}},{"code_sha256_prefix":"ff2a4847eb6e11d2","entry":"Multispike","repo":"bollossom/qsd-transformer","repo_kind":"official","path":"classification/models.py","file_url":"https://github.com/bollossom/qsd-transformer/blob/HEAD/classification/models.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":"ff2a4847eb6e11d2"}},{"code_sha256_prefix":"a9f9bdf13def2d6f","entry":"Multispike_att","repo":"bollossom/qsd-transformer","repo_kind":"official","path":"classification/models.py","file_url":"https://github.com/bollossom/qsd-transformer/blob/HEAD/classification/models.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":"a9f9bdf13def2d6f"}},{"code_sha256_prefix":"ad6a0ecd94a89ea2","entry":"ReLUX","repo":"bollossom/qsd-transformer","repo_kind":"official","path":"classification/models.py","file_url":"https://github.com/bollossom/qsd-transformer/blob/HEAD/classification/models.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":"ad6a0ecd94a89ea2"}},{"code_sha256_prefix":"86dd02836653f2e0","entry":"_Conv2dQ","repo":"bollossom/qsd-transformer","repo_kind":"official","path":"classification/models.py","file_url":"https://github.com/bollossom/qsd-transformer/blob/HEAD/classification/models.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":"86dd02836653f2e0"}},{"code_sha256_prefix":"ded10a8feeb6a5ef","entry":"_LinearQ","repo":"bollossom/qsd-transformer","repo_kind":"official","path":"classification/models.py","file_url":"https://github.com/bollossom/qsd-transformer/blob/HEAD/classification/models.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":"ded10a8feeb6a5ef"}},{"code_sha256_prefix":"d75564df9359ef7b","entry":"grad_scale","repo":null,"repo_kind":null,"path":null,"file_url":null,"link_basis":"identical_code_first_harvested_elsewhere","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":null,"inline_ok":false,"mcp_get_code":{"code_sha256":"d75564df9359ef7b"}},{"code_sha256_prefix":"82ae397418643fa2","entry":"multispike","repo":"bollossom/qsd-transformer","repo_kind":"official","path":"classification/models.py","file_url":"https://github.com/bollossom/qsd-transformer/blob/HEAD/classification/models.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":"82ae397418643fa2"}},{"code_sha256_prefix":"40027e5e78ca8837","entry":"round_pass","repo":null,"repo_kind":null,"path":null,"file_url":null,"link_basis":"identical_code_first_harvested_elsewhere","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":null,"inline_ok":false,"mcp_get_code":{"code_sha256":"40027e5e78ca8837"}},{"code_sha256_prefix":"72e0098c41daeeaa","entry":"MS_Attention_RepConv_qkv_id","repo":"bollossom/qsd-transformer","repo_kind":"official","path":"classification/models.py","file_url":"https://github.com/bollossom/qsd-transformer/blob/HEAD/classification/models.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":"72e0098c41daeeaa"}},{"code_sha256_prefix":"ec49ca703b82bffb","entry":"MS_Block","repo":"bollossom/qsd-transformer","repo_kind":"official","path":"classification/models.py","file_url":"https://github.com/bollossom/qsd-transformer/blob/HEAD/classification/models.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":"ec49ca703b82bffb"}},{"code_sha256_prefix":"080509523416f672","entry":"MS_ConvBlock","repo":"bollossom/qsd-transformer","repo_kind":"official","path":"classification/models.py","file_url":"https://github.com/bollossom/qsd-transformer/blob/HEAD/classification/models.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":"080509523416f672"}},{"code_sha256_prefix":"bcc18883fa271d08","entry":"MS_DownSampling","repo":"bollossom/qsd-transformer","repo_kind":"official","path":"classification/models.py","file_url":"https://github.com/bollossom/qsd-transformer/blob/HEAD/classification/models.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":"bcc18883fa271d08"}},{"code_sha256_prefix":"d439a7665ba3b641","entry":"MS_MLP","repo":"bollossom/qsd-transformer","repo_kind":"official","path":"classification/models.py","file_url":"https://github.com/bollossom/qsd-transformer/blob/HEAD/classification/models.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":"d439a7665ba3b641"}},{"code_sha256_prefix":"bc17ca45511f79e4","entry":"Qmodes","repo":"bollossom/qsd-transformer","repo_kind":"official","path":"classification/models.py","file_url":"https://github.com/bollossom/qsd-transformer/blob/HEAD/classification/models.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":"bc17ca45511f79e4"}},{"code_sha256_prefix":"dea3847a1c1fe943","entry":"RepConv","repo":"bollossom/qsd-transformer","repo_kind":"official","path":"classification/models.py","file_url":"https://github.com/bollossom/qsd-transformer/blob/HEAD/classification/models.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":"dea3847a1c1fe943"}},{"code_sha256_prefix":"f1954be367964988","entry":"SepConv","repo":"bollossom/qsd-transformer","repo_kind":"official","path":"classification/models.py","file_url":"https://github.com/bollossom/qsd-transformer/blob/HEAD/classification/models.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":"f1954be367964988"}},{"code_sha256_prefix":"32f1b759bc59a1b8","entry":"Spiking_vit_MetaFormer","repo":"bollossom/qsd-transformer","repo_kind":"official","path":"classification/models.py","file_url":"https://github.com/bollossom/qsd-transformer/blob/HEAD/classification/models.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":"32f1b759bc59a1b8"}},{"code_sha256_prefix":"3fbe93ab3bb68f7d","entry":"_ActQ","repo":"bollossom/qsd-transformer","repo_kind":"official","path":"classification/models.py","file_url":"https://github.com/bollossom/qsd-transformer/blob/HEAD/classification/models.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":"3fbe93ab3bb68f7d"}},{"code_sha256_prefix":"a4c658c06c77fb94","entry":"_Conv1dQ","repo":"bollossom/qsd-transformer","repo_kind":"official","path":"classification/models.py","file_url":"https://github.com/bollossom/qsd-transformer/blob/HEAD/classification/models.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":"a4c658c06c77fb94"}},{"code_sha256_prefix":"1aaa70701617780d","entry":"get_default_kwargs_q","repo":"bollossom/qsd-transformer","repo_kind":"official","path":"classification/models.py","file_url":"https://github.com/bollossom/qsd-transformer/blob/HEAD/classification/models.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":"1aaa70701617780d"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}