{"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/mobilellm-optimizing-sub-billion-parameter","title":"MobileLLM: Optimizing Sub-billion Parameter Language Models for On-Device Use Cases","arxiv_id":"2402.14905","date":"2024-02-22","proceeding":null,"authors":["Zechun Liu","Changsheng Zhao","Forrest Iandola","Chen Lai","Yuandong Tian","Igor Fedorov","Yunyang Xiong","Ernie Chang","Yangyang Shi","Raghuraman Krishnamoorthi","Liangzhen Lai","Vikas Chandra"],"abstract":"This paper addresses the growing need for efficient large language models (LLMs) on mobile devices, driven by increasing cloud costs and latency concerns. We focus on designing top-quality LLMs with fewer than a billion parameters, a practical choice for mobile deployment. Contrary to prevailing belief emphasizing the pivotal role of data and parameter quantity in determining model quality, our investigation underscores the significance of model architecture for sub-billion scale LLMs. Leveraging deep and thin architectures, coupled with embedding sharing and grouped-query attention mechanisms, we establish a strong baseline network denoted as MobileLLM, which attains a remarkable 2.7%/4.3% accuracy boost over preceding 125M/350M state-of-the-art models. Additionally, we propose an immediate block-wise weight-sharing approach with no increase in model size and only marginal latency overhead. The resultant models, denoted as MobileLLM-LS, demonstrate a further accuracy enhancement of 0.7%/0.8% than MobileLLM 125M/350M. Moreover, MobileLLM model family shows significant improvements compared to previous sub-billion models on chat benchmarks, and demonstrates close correctness to LLaMA-v2 7B in API calling tasks, highlighting the capability of small models for common on-device use cases.","url_abs":"https://arxiv.org/abs/2402.14905v2","url_pdf":"https://arxiv.org/pdf/2402.14905v2.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":"mobilellm-optimizing-sub-billion-parameter","repo_url":"https://github.com/facebookresearch/mobilellm","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"mobilellm-optimizing-sub-billion-parameter","repo_url":"https://github.com/facebookresearch/LLM-QAT","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"mobilellm-optimizing-sub-billion-parameter","repo_url":"https://github.com/facebookresearch/spinquant","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"NOASSERTION"}},{"paper_slug":"mobilellm-optimizing-sub-billion-parameter","repo_url":"https://github.com/jingyaogong/minimind","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[],"methods":[{"method_slug":"attention","method_name":"Attention"},{"method_slug":"dense-connections","method_name":"Dense Connections"},{"method_slug":"feedforward-network","method_name":"Feedforward Network"},{"method_slug":"focus","method_name":"Focus"},{"method_slug":"grouped-query-attention","method_name":"Grouped-query attention"},{"method_slug":"softmax","method_name":"Softmax"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2402.14905","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2402.14905"}},"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/facebookresearch/spinquant","reach":{"status":"ok","spdx":"NOASSERTION"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/jingyaogong/minimind","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/facebookresearch/LLM-QAT","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/facebookresearch/mobilellm","reach":null}],"summary":{"ran":9,"ran_honours":1,"ran_fixture":1,"unverified":17},"by_repo_kind":{"official":{"samples":10,"ran":6,"repositories":1},"listed":{"samples":16,"ran":5,"repositories":2},"community":{"samples":2,"ran":0,"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":20,"samples":[{"code_sha256_prefix":"eae5ddb4e89f48a1","entry":"LlamaConfig","repo":"facebookresearch/LLM-QAT","repo_kind":"listed","path":"models/modeling_llama_quant.py","file_url":"https://github.com/facebookresearch/LLM-QAT/blob/HEAD/models/modeling_llama_quant.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"eae5ddb4e89f48a1"}},{"code_sha256_prefix":"a70d6d3c2afe50fe","entry":"LlamaDynamicNTKScalingRotaryEmbedding","repo":"facebookresearch/mobilellm","repo_kind":"official","path":"utils/modeling_llama.py","file_url":"https://github.com/facebookresearch/mobilellm/blob/HEAD/utils/modeling_llama.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"a70d6d3c2afe50fe"}},{"code_sha256_prefix":"0b85db0b5fb36aa3","entry":"LlamaLinearScalingRotaryEmbedding","repo":"facebookresearch/mobilellm","repo_kind":"official","path":"utils/modeling_llama.py","file_url":"https://github.com/facebookresearch/mobilellm/blob/HEAD/utils/modeling_llama.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"0b85db0b5fb36aa3"}},{"code_sha256_prefix":"fd1eec3e84da40f6","entry":"LlamaMLP","repo":"facebookresearch/mobilellm","repo_kind":"official","path":"utils/modeling_llama.py","file_url":"https://github.com/facebookresearch/mobilellm/blob/HEAD/utils/modeling_llama.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"fd1eec3e84da40f6"}},{"code_sha256_prefix":"c9b44d1ee2b9d567","entry":"LlamaPreTrainedModel","repo":"facebookresearch/mobilellm","repo_kind":"official","path":"utils/modeling_llama.py","file_url":"https://github.com/facebookresearch/mobilellm/blob/HEAD/utils/modeling_llama.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"c9b44d1ee2b9d567"}},{"code_sha256_prefix":"b601acb1c084205e","entry":"LlamaRMSNorm","repo":"facebookresearch/LLM-QAT","repo_kind":"listed","path":"models/modeling_llama_quant.py","file_url":"https://github.com/facebookresearch/LLM-QAT/blob/HEAD/models/modeling_llama_quant.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"b601acb1c084205e"}},{"code_sha256_prefix":"29fb31107100b259","entry":"LlamaRotaryEmbedding","repo":"facebookresearch/mobilellm","repo_kind":"official","path":"utils/modeling_llama.py","file_url":"https://github.com/facebookresearch/mobilellm/blob/HEAD/utils/modeling_llama.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"29fb31107100b259"}},{"code_sha256_prefix":"56c331e4f0ffb350","entry":"LlamaSdpaAttention","repo":"facebookresearch/mobilellm","repo_kind":"official","path":"utils/modeling_llama.py","file_url":"https://github.com/facebookresearch/mobilellm/blob/HEAD/utils/modeling_llama.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"56c331e4f0ffb350"}},{"code_sha256_prefix":"a8a84e7ddb0551b0","entry":"RMSNorm","repo":"jingyaogong/minimind","repo_kind":"listed","path":"model/model_minimind.py","file_url":"https://github.com/jingyaogong/minimind/blob/HEAD/model/model_minimind.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"a8a84e7ddb0551b0"}},{"code_sha256_prefix":"9c1c3b7f0fe82a6d","entry":"precompute_freqs_cis","repo":"jingyaogong/minimind","repo_kind":"listed","path":"model/model_minimind.py","file_url":"https://github.com/jingyaogong/minimind/blob/HEAD/model/model_minimind.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"9c1c3b7f0fe82a6d"}},{"code_sha256_prefix":"226c2c7378c2826e","entry":"repeat_kv","repo":"jingyaogong/minimind","repo_kind":"listed","path":"model/model_minimind.py","file_url":"https://github.com/jingyaogong/minimind/blob/HEAD/model/model_minimind.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"226c2c7378c2826e"}},{"code_sha256_prefix":"21b27f7007d54dbc","entry":"Attention","repo":"jingyaogong/minimind","repo_kind":"listed","path":"model/model_minimind.py","file_url":"https://github.com/jingyaogong/minimind/blob/HEAD/model/model_minimind.py","link_basis":"first_harvest_node","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":"21b27f7007d54dbc"}},{"code_sha256_prefix":"f7eec176aae368de","entry":"LlamaAttention","repo":"facebookresearch/mobilellm","repo_kind":"official","path":"utils/modeling_llama.py","file_url":"https://github.com/facebookresearch/mobilellm/blob/HEAD/utils/modeling_llama.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"f7eec176aae368de"}},{"code_sha256_prefix":"ae14385b5684f28e","entry":"LlamaAttention","repo":"facebookresearch/LLM-QAT","repo_kind":"listed","path":"models/modeling_llama_quant.py","file_url":"https://github.com/facebookresearch/LLM-QAT/blob/HEAD/models/modeling_llama_quant.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"ae14385b5684f28e"}},{"code_sha256_prefix":"287760d8764c9f55","entry":"LlamaDecoderLayer","repo":"facebookresearch/mobilellm","repo_kind":"official","path":"utils/modeling_llama.py","file_url":"https://github.com/facebookresearch/mobilellm/blob/HEAD/utils/modeling_llama.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"287760d8764c9f55"}},{"code_sha256_prefix":"4d865933cc1c7185","entry":"LlamaDecoderLayer","repo":"facebookresearch/LLM-QAT","repo_kind":"listed","path":"models/modeling_llama_quant.py","file_url":"https://github.com/facebookresearch/LLM-QAT/blob/HEAD/models/modeling_llama_quant.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"4d865933cc1c7185"}},{"code_sha256_prefix":"9311b50f80e60c54","entry":"LlamaFlashAttention2","repo":"facebookresearch/mobilellm","repo_kind":"official","path":"utils/modeling_llama.py","file_url":"https://github.com/facebookresearch/mobilellm/blob/HEAD/utils/modeling_llama.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"9311b50f80e60c54"}},{"code_sha256_prefix":"941348872c1175c4","entry":"LlamaForCausalLM","repo":"facebookresearch/LLM-QAT","repo_kind":"listed","path":"models/modeling_llama_quant.py","file_url":"https://github.com/facebookresearch/LLM-QAT/blob/HEAD/models/modeling_llama_quant.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"941348872c1175c4"}},{"code_sha256_prefix":"96f0ec4ad32ef95e","entry":"LlamaMLP","repo":"facebookresearch/LLM-QAT","repo_kind":"listed","path":"models/modeling_llama_quant.py","file_url":"https://github.com/facebookresearch/LLM-QAT/blob/HEAD/models/modeling_llama_quant.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"96f0ec4ad32ef95e"}},{"code_sha256_prefix":"6586f04f76b3fad7","entry":"LlamaModel","repo":"facebookresearch/mobilellm","repo_kind":"official","path":"utils/modeling_llama.py","file_url":"https://github.com/facebookresearch/mobilellm/blob/HEAD/utils/modeling_llama.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"6586f04f76b3fad7"}},{"code_sha256_prefix":"c9a1b892ddcc160b","entry":"LlamaModel","repo":"facebookresearch/LLM-QAT","repo_kind":"listed","path":"models/modeling_llama_quant.py","file_url":"https://github.com/facebookresearch/LLM-QAT/blob/HEAD/models/modeling_llama_quant.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"c9a1b892ddcc160b"}},{"code_sha256_prefix":"a34a56cc2de22f8f","entry":"MiniMindBlock","repo":"jingyaogong/minimind","repo_kind":"listed","path":"model/model_minimind.py","file_url":"https://github.com/jingyaogong/minimind/blob/HEAD/model/model_minimind.py","link_basis":"first_harvest_node","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":"a34a56cc2de22f8f"}},{"code_sha256_prefix":"59ce4efe16d7b6e4","entry":"MiniMindForCausalLM","repo":"jingyaogong/minimind","repo_kind":"listed","path":"model/model_minimind.py","file_url":"https://github.com/jingyaogong/minimind/blob/HEAD/model/model_minimind.py","link_basis":"first_harvest_node","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":"59ce4efe16d7b6e4"}},{"code_sha256_prefix":"6c359011117cb016","entry":"MiniMindModel","repo":"jingyaogong/minimind","repo_kind":"listed","path":"model/model_minimind.py","file_url":"https://github.com/jingyaogong/minimind/blob/HEAD/model/model_minimind.py","link_basis":"first_harvest_node","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":"6c359011117cb016"}},{"code_sha256_prefix":"3013c6ea70f1983f","entry":"QuantizeLinear","repo":"facebookresearch/LLM-QAT","repo_kind":"listed","path":"models/modeling_llama_quant.py","file_url":"https://github.com/facebookresearch/LLM-QAT/blob/HEAD/models/modeling_llama_quant.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"3013c6ea70f1983f"}},{"code_sha256_prefix":"415c32c683875908","entry":"apply_rotary_pos_emb","repo":"jingyaogong/minimind","repo_kind":"listed","path":"model/model_minimind.py","file_url":"https://github.com/jingyaogong/minimind/blob/HEAD/model/model_minimind.py","link_basis":"first_harvest_node","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":"415c32c683875908"}},{"code_sha256_prefix":"9a433eced0086de3","entry":"get_folder_paths","repo":"facebookresearch/MobileLLM-R1","repo_kind":"community","path":"pretrain/pretrain.py","file_url":"https://github.com/facebookresearch/MobileLLM-R1/blob/HEAD/pretrain/pretrain.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"9a433eced0086de3"}},{"code_sha256_prefix":"e3820b27e772b468","entry":"get_logger","repo":"facebookresearch/MobileLLM-R1","repo_kind":"community","path":"pretrain/pretrain.py","file_url":"https://github.com/facebookresearch/MobileLLM-R1/blob/HEAD/pretrain/pretrain.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"e3820b27e772b468"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}