{"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/rodimus-breaking-the-accuracy-efficiency","title":"Rodimus*: Breaking the Accuracy-Efficiency Trade-Off with Efficient Attentions","arxiv_id":"2410.06577","date":"2024-10-09","proceeding":null,"authors":["Zhihao He","Hang Yu","Zi Gong","Shizhan Liu","Jianguo Li","Weiyao Lin"],"abstract":"Recent advancements in Transformer-based large language models (LLMs) have set new standards in natural language processing. However, the classical softmax attention incurs significant computational costs, leading to a $O(T)$ complexity for per-token generation, where $T$ represents the context length. This work explores reducing LLMs' complexity while maintaining performance by introducing Rodimus and its enhanced version, Rodimus$+$. Rodimus employs an innovative data-dependent tempered selection (DDTS) mechanism within a linear attention-based, purely recurrent framework, achieving significant accuracy while drastically reducing the memory usage typically associated with recurrent models. This method exemplifies semantic compression by maintaining essential input information with fixed-size hidden states. Building on this, Rodimus$+$ combines Rodimus with the innovative Sliding Window Shared-Key Attention (SW-SKA) in a hybrid approach, effectively leveraging the complementary semantic, token, and head compression techniques. Our experiments demonstrate that Rodimus$+$-1.6B, trained on 1 trillion tokens, achieves superior downstream performance against models trained on more tokens, including Qwen2-1.5B and RWKV6-1.6B, underscoring its potential to redefine the accuracy-efficiency balance in LLMs. Model code and pre-trained checkpoints are open-sourced at https://github.com/codefuse-ai/rodimus.","url_abs":"https://arxiv.org/abs/2410.06577v2","url_pdf":"https://arxiv.org/pdf/2410.06577v2.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":"rodimus-breaking-the-accuracy-efficiency","repo_url":"https://github.com/sustcsonglin/flash-linear-attention","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"rodimus-breaking-the-accuracy-efficiency","repo_url":"https://github.com/codefuse-ai/rodimus","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":"semantic-compression","task_name":"Semantic Compression"}],"methods":[{"method_slug":"attention","method_name":"Attention"},{"method_slug":"set","method_name":"SET"},{"method_slug":"softmax","method_name":"Softmax"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2410.06577","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2410.06577"}},"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/codefuse-ai/rodimus","reach":{"status":"ok","spdx":"Apache-2.0"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/sustcsonglin/flash-linear-attention","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":3,"unverified":3},"by_repo_kind":{"official":{"samples":6,"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":0,"samples":[{"code_sha256_prefix":"81331f172e60d23b","entry":"align_multiple","repo":"codefuse-ai/rodimus","repo_kind":"official","path":"modules/utils.py","file_url":"https://github.com/codefuse-ai/rodimus/blob/HEAD/modules/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"81331f172e60d23b"}},{"code_sha256_prefix":"afa433ff13d99c6b","entry":"autocast_to_2B","repo":"codefuse-ai/rodimus","repo_kind":"official","path":"modules/utils.py","file_url":"https://github.com/codefuse-ai/rodimus/blob/HEAD/modules/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"afa433ff13d99c6b"}},{"code_sha256_prefix":"ff6f383386aa4caf","entry":"safe_eval_number","repo":"codefuse-ai/rodimus","repo_kind":"official","path":"modules/utils.py","file_url":"https://github.com/codefuse-ai/rodimus/blob/HEAD/modules/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"ff6f383386aa4caf"}},{"code_sha256_prefix":"2ce8fcf5bedd19ec","entry":"layer_norm_ref","repo":"codefuse-ai/rodimus","repo_kind":"official","path":"ops/layernorm.py","file_url":"https://github.com/codefuse-ai/rodimus/blob/HEAD/ops/layernorm.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"2ce8fcf5bedd19ec"}},{"code_sha256_prefix":"019b69251d0aed68","entry":"rms_norm_ref","repo":"codefuse-ai/rodimus","repo_kind":"official","path":"ops/layernorm_gated.py","file_url":"https://github.com/codefuse-ai/rodimus/blob/HEAD/ops/layernorm_gated.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"019b69251d0aed68"}},{"code_sha256_prefix":"ab802ae3195c6316","entry":"rms_norm_ref","repo":"codefuse-ai/rodimus","repo_kind":"official","path":"ops/layernorm.py","file_url":"https://github.com/codefuse-ai/rodimus/blob/HEAD/ops/layernorm.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"ab802ae3195c6316"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}