{"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/training-free-activation-sparsity-in-large","title":"Training-Free Activation Sparsity in Large Language Models","arxiv_id":"2408.14690","date":"2024-08-26","proceeding":null,"authors":["James Liu","Pragaash Ponnusamy","Tianle Cai","Han Guo","Yoon Kim","Ben Athiwaratkun"],"abstract":"Activation sparsity can enable practical inference speedups in large language models (LLMs) by reducing the compute and memory-movement required for matrix multiplications during the forward pass. However, existing methods face limitations that inhibit widespread adoption. Some approaches are tailored towards older models with ReLU-based sparsity, while others require extensive continued pre-training on up to hundreds of billions of tokens. This paper describes TEAL, a simple training-free method that applies magnitude-based activation sparsity to hidden states throughout the entire model. TEAL achieves 40-50% model-wide sparsity with minimal performance degradation across Llama-2, Llama-3, and Mistral families, with sizes varying from 7B to 70B. We improve existing sparse kernels and demonstrate wall-clock decoding speed-ups of up to 1.53$\\times$ and 1.8$\\times$ at 40% and 50% model-wide sparsity. TEAL is compatible with weight quantization, enabling further efficiency gains.","url_abs":"https://arxiv.org/abs/2408.14690v2","url_pdf":"https://arxiv.org/pdf/2408.14690v2.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":"training-free-activation-sparsity-in-large","repo_url":"https://github.com/fasterdecoding/teal","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"quantization","task_name":"Quantization"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2408.14690","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2408.14690"}},"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/fasterdecoding/teal","reach":null}],"summary":{"ran":2,"ran_draft_wrong":3,"ran_fixture":2,"unverified":7},"by_repo_kind":{"official":{"samples":14,"ran":7,"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":"4f283dcb0a0422d7","entry":"ActivationModule","repo":"fasterdecoding/teal","repo_kind":"official","path":"teal/model.py","file_url":"https://github.com/fasterdecoding/teal/blob/HEAD/teal/model.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"4f283dcb0a0422d7"}},{"code_sha256_prefix":"c5354bfc34cf09a3","entry":"Distribution","repo":"fasterdecoding/teal","repo_kind":"official","path":"teal/model.py","file_url":"https://github.com/fasterdecoding/teal/blob/HEAD/teal/model.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"c5354bfc34cf09a3"}},{"code_sha256_prefix":"9b77813d7a7d746d","entry":"get_layer_greedy_sparsities","repo":"fasterdecoding/teal","repo_kind":"official","path":"teal/model.py","file_url":"https://github.com/fasterdecoding/teal/blob/HEAD/teal/model.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":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"9b77813d7a7d746d"}},{"code_sha256_prefix":"e141b830083564c0","entry":"interp","repo":"fasterdecoding/teal","repo_kind":"official","path":"teal/model.py","file_url":"https://github.com/fasterdecoding/teal/blob/HEAD/teal/model.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":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"e141b830083564c0"}},{"code_sha256_prefix":"f4d39ec8a89dcfa0","entry":"logits_to_probs","repo":"FasterDecoding/TEAL","repo_kind":"official","path":"gpt-fast/generate.py","file_url":"https://github.com/FasterDecoding/TEAL/blob/HEAD/gpt-fast/generate.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"f4d39ec8a89dcfa0"}},{"code_sha256_prefix":"5b6f45360aa68edd","entry":"multinomial_sample_one_no_sync","repo":"FasterDecoding/TEAL","repo_kind":"official","path":"gpt-fast/generate.py","file_url":"https://github.com/FasterDecoding/TEAL/blob/HEAD/gpt-fast/generate.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":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"5b6f45360aa68edd"}},{"code_sha256_prefix":"8465782fc7e1fe39","entry":"sample","repo":"FasterDecoding/TEAL","repo_kind":"official","path":"gpt-fast/generate.py","file_url":"https://github.com/FasterDecoding/TEAL/blob/HEAD/gpt-fast/generate.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"8465782fc7e1fe39"}},{"code_sha256_prefix":"dc1705f0ac812a98","entry":"SparseModelMixin","repo":"fasterdecoding/teal","repo_kind":"official","path":"teal/model.py","file_url":"https://github.com/fasterdecoding/teal/blob/HEAD/teal/model.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"dc1705f0ac812a98"}},{"code_sha256_prefix":"8247ca701a965ec3","entry":"SparsifyFn","repo":"fasterdecoding/teal","repo_kind":"official","path":"teal/model.py","file_url":"https://github.com/fasterdecoding/teal/blob/HEAD/teal/model.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"8247ca701a965ec3"}},{"code_sha256_prefix":"82f026ca4d133e3f","entry":"_FA2_forward","repo":"fasterdecoding/teal","repo_kind":"official","path":"teal/model.py","file_url":"https://github.com/fasterdecoding/teal/blob/HEAD/teal/model.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"82f026ca4d133e3f"}},{"code_sha256_prefix":"8f9f6dcb910a3d1e","entry":"_mlp_forward","repo":"fasterdecoding/teal","repo_kind":"official","path":"teal/model.py","file_url":"https://github.com/fasterdecoding/teal/blob/HEAD/teal/model.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"8f9f6dcb910a3d1e"}},{"code_sha256_prefix":"9d238e7c8da0339a","entry":"_monkeypatch_layer","repo":"fasterdecoding/teal","repo_kind":"official","path":"teal/model.py","file_url":"https://github.com/fasterdecoding/teal/blob/HEAD/teal/model.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"9d238e7c8da0339a"}},{"code_sha256_prefix":"31cd3abe1ae1c21e","entry":"_monkeypatch_mlp","repo":"fasterdecoding/teal","repo_kind":"official","path":"teal/model.py","file_url":"https://github.com/fasterdecoding/teal/blob/HEAD/teal/model.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"31cd3abe1ae1c21e"}},{"code_sha256_prefix":"f89bf27e96be35db","entry":"_monkeypatch_self_attn","repo":"fasterdecoding/teal","repo_kind":"official","path":"teal/model.py","file_url":"https://github.com/fasterdecoding/teal/blob/HEAD/teal/model.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"f89bf27e96be35db"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}