{"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/skyformer-remodel-self-attention-with","title":"Skyformer: Remodel Self-Attention with Gaussian Kernel and Nyström Method","arxiv_id":"2111.00035","date":"2021-10-29","proceeding":"NeurIPS 2021 12","authors":["Yifan Chen","Qi Zeng","Heng Ji","Yun Yang"],"abstract":"Transformers are expensive to train due to the quadratic time and space complexity in the self-attention mechanism. On the other hand, although kernel machines suffer from the same computation bottleneck in pairwise dot products, several approximation schemes have been successfully incorporated to considerably reduce their computational cost without sacrificing too much accuracy. In this work, we leverage the computation methods for kernel machines to alleviate the high computational cost and introduce Skyformer, which replaces the softmax structure with a Gaussian kernel to stabilize the model training and adapts the Nystr\\\"om method to a non-positive semidefinite matrix to accelerate the computation. We further conduct theoretical analysis by showing that the matrix approximation error of our proposed method is small in the spectral norm. Experiments on Long Range Arena benchmark show that the proposed method is sufficient in getting comparable or even better performance than the full self-attention while requiring fewer computation resources.","url_abs":"https://arxiv.org/abs/2111.00035v1","url_pdf":"https://arxiv.org/pdf/2111.00035v1.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":"skyformer-remodel-self-attention-with","repo_url":"https://github.com/pkuzengqi/skyformer","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"skyformer-remodel-self-attention-with","repo_url":"https://github.com/osu-starlab/leapformer","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[],"methods":[{"method_slug":"softmax","method_name":"Softmax"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2111.00035","atlas_url":"https://app.syntology.ai/?focus=2111.00035","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2111.00035"}},"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":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/osu-starlab/leapformer","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/pkuzengqi/skyformer","reach":null}],"summary":{"ran_draft_wrong":4,"ran_fixture":2,"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":7,"samples":[{"code_sha256_prefix":"9676f64725245dfa","entry":"iterative_inv","repo":"pkuzengqi/skyformer","repo_kind":"official","path":"src/models/attention_skyformer.py","file_url":"https://github.com/pkuzengqi/skyformer/blob/HEAD/src/models/attention_skyformer.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"9676f64725245dfa"}},{"code_sha256_prefix":"4f468c11bf5c5690","entry":"kernel_RS_RBF","repo":"pkuzengqi/skyformer","repo_kind":"official","path":"src/models/attention_skyformer.py","file_url":"https://github.com/pkuzengqi/skyformer/blob/HEAD/src/models/attention_skyformer.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"4f468c11bf5c5690"}},{"code_sha256_prefix":"08a642d871e4fcb5","entry":"kernel_RS_SM","repo":"pkuzengqi/Skyformer","repo_kind":"official","path":"src/models/attention_skyformer.py","file_url":"https://github.com/pkuzengqi/Skyformer/blob/HEAD/src/models/attention_skyformer.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":"08a642d871e4fcb5"}},{"code_sha256_prefix":"083db2be269bee62","entry":"kernel_SM","repo":"pkuzengqi/Skyformer","repo_kind":"official","path":"src/models/attention_skyformer.py","file_url":"https://github.com/pkuzengqi/Skyformer/blob/HEAD/src/models/attention_skyformer.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"083db2be269bee62"}},{"code_sha256_prefix":"759d31d9c669b282","entry":"kernel_sketch","repo":"pkuzengqi/skyformer","repo_kind":"official","path":"src/models/attention_skyformer.py","file_url":"https://github.com/pkuzengqi/skyformer/blob/HEAD/src/models/attention_skyformer.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"759d31d9c669b282"}},{"code_sha256_prefix":"285e3997b7d7c24b","entry":"linear_attention","repo":"pkuzengqi/Skyformer","repo_kind":"official","path":"src/models/attention_skyformer.py","file_url":"https://github.com/pkuzengqi/Skyformer/blob/HEAD/src/models/attention_skyformer.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"285e3997b7d7c24b"}},{"code_sha256_prefix":"c21748cf3d7653e8","entry":"Skyformer","repo":"pkuzengqi/skyformer","repo_kind":"official","path":"src/models/attention_skyformer.py","file_url":"https://github.com/pkuzengqi/skyformer/blob/HEAD/src/models/attention_skyformer.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":"c21748cf3d7653e8"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}