{"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/prompt-prompted-mixture-of-experts-for","title":"Prompt-prompted Adaptive Structured Pruning for Efficient LLM Generation","arxiv_id":"2404.01365","date":"2024-04-01","proceeding":null,"authors":["Harry Dong","Beidi Chen","Yuejie Chi"],"abstract":"With the development of transformer-based large language models (LLMs), they have been applied to many fields due to their remarkable utility, but this comes at a considerable computational cost at deployment. Fortunately, some methods such as pruning or constructing a mixture of experts (MoE) aim at exploiting sparsity in transformer feedforward (FF) blocks to gain boosts in speed and reduction in memory requirements. However, these techniques can be very costly and inflexible in practice, as they often require training or are restricted to specific types of architectures. To address this, we introduce GRIFFIN, a novel training-free and calibration-free method that selects unique FF experts at the sequence level for efficient generation across a plethora of LLMs with different non-ReLU activation functions. This is possible due to a critical observation that many trained LLMs naturally produce highly structured FF activation patterns within a sequence, which we call flocking. Despite our method's simplicity, we show with 50% of the FF parameters, GRIFFIN maintains the original model's performance with little to no degradation on a variety of classification and generation tasks, all while improving latency (e.g. 1.29$\\times$ and 1.25$\\times$ speed-ups in Gemma 7B and Llama 2 13B, respectively, on an NVIDIA L40). Code is available at https://github.com/hdong920/GRIFFIN.","url_abs":"https://arxiv.org/abs/2404.01365v3","url_pdf":"https://arxiv.org/pdf/2404.01365v3.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":"prompt-prompted-mixture-of-experts-for","repo_url":"https://github.com/hdong920/griffin","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"none","reach":{"status":"ok"}}],"tasks":[{"task_slug":"mixture-of-experts","task_name":"Mixture-of-Experts"}],"methods":[{"method_slug":"llama","method_name":"LLaMA"},{"method_slug":"moe","method_name":"MoE"},{"method_slug":"pruning","method_name":"Pruning"},{"method_slug":"speed","method_name":"SPEED"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2404.01365","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2404.01365"}},"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/hdong920/griffin","reach":{"status":"ok"}}],"summary":{"ran_violates":1,"ran":6,"ran_draft_wrong":2,"unverified":1},"by_repo_kind":{"official":{"samples":10,"ran":9,"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":10,"samples":[{"code_sha256_prefix":"0928f497e20fb443","entry":"mean","repo":"hdong920/griffin","repo_kind":"official","path":"src/lm_eval/metrics.py","file_url":"https://github.com/hdong920/griffin/blob/HEAD/src/lm_eval/metrics.py","link_basis":"harvester_set","language":"python","status":"ran_violates","verification_level":2,"contract_check":"VIOLATES","metamorphic_tier":"well_formed","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"0928f497e20fb443"}},{"code_sha256_prefix":"57e732507bad40db","entry":"escaped_split","repo":"hdong920/griffin","repo_kind":"official","path":"src/lm_eval/utils.py","file_url":"https://github.com/hdong920/griffin/blob/HEAD/src/lm_eval/utils.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":"57e732507bad40db"}},{"code_sha256_prefix":"359c35fdcd7a0ee5","entry":"group","repo":"hdong920/griffin","repo_kind":"official","path":"src/lm_eval/utils.py","file_url":"https://github.com/hdong920/griffin/blob/HEAD/src/lm_eval/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":"359c35fdcd7a0ee5"}},{"code_sha256_prefix":"ea06eaae4fc1eaf0","entry":"hash_args","repo":"hdong920/griffin","repo_kind":"official","path":"src/lm_eval/base.py","file_url":"https://github.com/hdong920/griffin/blob/HEAD/src/lm_eval/base.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"ea06eaae4fc1eaf0"}},{"code_sha256_prefix":"d3ade8d49512a76b","entry":"json_serial","repo":"hdong920/griffin","repo_kind":"official","path":"src/lm_eval/decontamination/archiver.py","file_url":"https://github.com/hdong920/griffin/blob/HEAD/src/lm_eval/decontamination/archiver.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":"d3ade8d49512a76b"}},{"code_sha256_prefix":"518b2201c66c2ad3","entry":"pop_stddev","repo":"hdong920/griffin","repo_kind":"official","path":"src/lm_eval/metrics.py","file_url":"https://github.com/hdong920/griffin/blob/HEAD/src/lm_eval/metrics.py","link_basis":"harvester_set","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":"518b2201c66c2ad3"}},{"code_sha256_prefix":"d40f0123e8a8f5c0","entry":"sample_stddev","repo":"hdong920/griffin","repo_kind":"official","path":"src/lm_eval/metrics.py","file_url":"https://github.com/hdong920/griffin/blob/HEAD/src/lm_eval/metrics.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"well_formed","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"d40f0123e8a8f5c0"}},{"code_sha256_prefix":"84f1aef48d28008a","entry":"select_neurons","repo":"hdong920/griffin","repo_kind":"official","path":"src/griffin/utils.py","file_url":"https://github.com/hdong920/griffin/blob/HEAD/src/griffin/utils.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":"84f1aef48d28008a"}},{"code_sha256_prefix":"cd999ad59caf84a7","entry":"simple_parse_args_string","repo":"hdong920/griffin","repo_kind":"official","path":"src/lm_eval/utils.py","file_url":"https://github.com/hdong920/griffin/blob/HEAD/src/lm_eval/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":"cd999ad59caf84a7"}},{"code_sha256_prefix":"9d95c14130837ee4","entry":"make_table","repo":"hdong920/griffin","repo_kind":"official","path":"src/lm_eval/evaluator.py","file_url":"https://github.com/hdong920/griffin/blob/HEAD/src/lm_eval/evaluator.py","link_basis":"plan_row","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":"9d95c14130837ee4"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}