{"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/distributed-inference-and-fine-tuning-of-1","title":"Distributed Inference and Fine-tuning of Large Language Models Over The Internet","arxiv_id":"2312.08361","date":"2023-12-13","proceeding":"NeurIPS 2023 11","authors":["Alexander Borzunov","Max Ryabinin","Artem Chumachenko","Dmitry Baranchuk","Tim Dettmers","Younes Belkada","Pavel Samygin","Colin Raffel"],"abstract":"Large language models (LLMs) are useful in many NLP tasks and become more capable with size, with the best open-source models having over 50 billion parameters. However, using these 50B+ models requires high-end hardware, making them inaccessible to most researchers. In this work, we investigate methods for cost-efficient inference and fine-tuning of LLMs, comparing local and distributed strategies. We observe that a large enough model (50B+) can run efficiently even on geodistributed devices in a consumer-grade network. This could allow running LLM efficiently by pooling together idle compute resources of multiple research groups and volunteers. We address two open problems: (1) how to perform inference and fine-tuning reliably if any device can disconnect abruptly and (2) how to partition LLMs between devices with uneven hardware, joining and leaving at will. In order to do that, we develop special fault-tolerant inference algorithms and load-balancing protocols that automatically assign devices to maximize the total system throughput. We showcase these algorithms in Petals - a decentralized system that runs Llama 2 (70B) and BLOOM (176B) over the Internet up to 10x faster than offloading for interactive generation. We evaluate the performance of our system in simulated conditions and a real-world setup spanning two continents.","url_abs":"https://arxiv.org/abs/2312.08361v1","url_pdf":"https://arxiv.org/pdf/2312.08361v1.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":"distributed-inference-and-fine-tuning-of-1","repo_url":"https://github.com/bigscience-workshop/petals","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"distributed-inference-and-fine-tuning-of-1","repo_url":"https://github.com/learning-at-home/hivemind","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[],"methods":[{"method_slug":"bloom","method_name":"BLOOM"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2312.08361","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2312.08361"}},"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/bigscience-workshop/petals","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/learning-at-home/hivemind","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":5,"unverified":1},"by_repo_kind":{"listed":{"samples":6,"ran":5,"repositories":2}},"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":"2dc754a7f4ecd0a5","entry":"get_num_bits","repo":"learning-at-home/hivemind","repo_kind":"listed","path":"hivemind/compression/floating.py","file_url":"https://github.com/learning-at-home/hivemind/blob/HEAD/hivemind/compression/floating.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":"2dc754a7f4ecd0a5"}},{"code_sha256_prefix":"9e05736269e82a16","entry":"hagenbach_bishoff","repo":"learning-at-home/hivemind","repo_kind":"listed","path":"hivemind/averaging/load_balancing.py","file_url":"https://github.com/learning-at-home/hivemind/blob/HEAD/hivemind/averaging/load_balancing.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":"9e05736269e82a16"}},{"code_sha256_prefix":"2c5d895963e9f129","entry":"is_power_of_two","repo":"learning-at-home/hivemind","repo_kind":"listed","path":"hivemind/averaging/key_manager.py","file_url":"https://github.com/learning-at-home/hivemind/blob/HEAD/hivemind/averaging/key_manager.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"2c5d895963e9f129"}},{"code_sha256_prefix":"6141227efca7e0f0","entry":"is_valid_group","repo":"learning-at-home/hivemind","repo_kind":"listed","path":"hivemind/averaging/key_manager.py","file_url":"https://github.com/learning-at-home/hivemind/blob/HEAD/hivemind/averaging/key_manager.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":"6141227efca7e0f0"}},{"code_sha256_prefix":"6d3ed3ad756758ee","entry":"next_power_of_two","repo":"learning-at-home/hivemind","repo_kind":"listed","path":"hivemind/averaging/key_manager.py","file_url":"https://github.com/learning-at-home/hivemind/blob/HEAD/hivemind/averaging/key_manager.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"6d3ed3ad756758ee"}},{"code_sha256_prefix":"b1127d1faed386cf","entry":"parse_uid","repo":"bigscience-workshop/petals","repo_kind":"listed","path":"src/petals/data_structures.py","file_url":"https://github.com/bigscience-workshop/petals/blob/HEAD/src/petals/data_structures.py","link_basis":"harvester_set","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":"b1127d1faed386cf"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}