{"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/mistral-7b","title":"Mistral 7B","arxiv_id":"2310.06825","date":"2023-10-10","proceeding":null,"authors":["Albert Q. Jiang","Alexandre Sablayrolles","Arthur Mensch","Chris Bamford","Devendra Singh Chaplot","Diego de Las Casas","Florian Bressand","Gianna Lengyel","Guillaume Lample","Lucile Saulnier","Lélio Renard Lavaud","Marie-Anne Lachaux","Pierre Stock","Teven Le Scao","Thibaut Lavril","Thomas Wang","Timothée Lacroix","William El Sayed"],"abstract":"We introduce Mistral 7B v0.1, a 7-billion-parameter language model engineered for superior performance and efficiency. Mistral 7B outperforms Llama 2 13B across all evaluated benchmarks, and Llama 1 34B in reasoning, mathematics, and code generation. Our model leverages grouped-query attention (GQA) for faster inference, coupled with sliding window attention (SWA) to effectively handle sequences of arbitrary length with a reduced inference cost. We also provide a model fine-tuned to follow instructions, Mistral 7B -- Instruct, that surpasses the Llama 2 13B -- Chat model both on human and automated benchmarks. Our models are released under the Apache 2.0 license.","url_abs":"https://arxiv.org/abs/2310.06825v1","url_pdf":"https://arxiv.org/pdf/2310.06825v1.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":"mistral-7b","repo_url":"https://github.com/mistralai/mistral-src","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}},{"paper_slug":"mistral-7b","repo_url":"https://github.com/facebookresearch/fairseq2","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"mistral-7b","repo_url":"https://github.com/knowlab/bi-weekly-paper-presentation","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"none","reach":{"status":"ok"}},{"paper_slug":"mistral-7b","repo_url":"https://github.com/mgmalek/efficient_cross_entropy","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"mistral-7b","repo_url":"https://github.com/ninglab/ecellm","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"CC-BY-4.0"}},{"paper_slug":"mistral-7b","repo_url":"https://github.com/pwc-1/Paper-9/tree/main/2/mistral","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"mindspore","reach":null}],"tasks":[{"task_slug":"arithmetic-reasoning","task_name":"Arithmetic Reasoning"},{"task_slug":"chatbot","task_name":"Chatbot"},{"task_slug":"code-generation","task_name":"Code Generation"},{"task_slug":"common-sense-reasoning","task_name":"Common Sense Reasoning"},{"task_slug":"language-modeling","task_name":"Language Modeling"},{"task_slug":"language-modelling","task_name":"Language Modelling"},{"task_slug":"math","task_name":"Math"},{"task_slug":"math-word-problem-solving","task_name":"Math Word Problem Solving"},{"task_slug":"mathematical-reasoning","task_name":"Mathematical Reasoning"},{"task_slug":"multi-task-language-understanding","task_name":"Multi-task Language Understanding"},{"task_slug":"question-answering","task_name":"Question Answering"},{"task_slug":"sentence-completion","task_name":"Sentence Completion"},{"task_slug":"world-knowledge","task_name":"World Knowledge"},{"task_slug":"zeroshot-video-question-answer","task_name":"Zero-Shot Video Question Answer"},{"task_slug":"answerability-prediction","task_name":"answerability prediction"}],"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":"grouped-query-attention","method_name":"Grouped-query attention"},{"method_slug":"softmax","method_name":"Softmax"}],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/arithmetic-reasoning-on-gsm8k","task":"Arithmetic Reasoning","dataset":"GSM8K","model":"Mistral 7B (maj@8)","rank_in_archive_order":131,"of":164,"metrics":{"Accuracy":"52.2","Parameters (Billion)":"7"},"uses_additional_data":false},{"leaderboard":"/sota/code-generation-on-mbpp","task":"Code Generation","dataset":"MBPP","model":"Mistral 7B (3-shot)","rank_in_archive_order":68,"of":99,"metrics":{"Accuracy":"47.5"},"uses_additional_data":false},{"leaderboard":"/sota/common-sense-reasoning-on-arc-challenge","task":"Common Sense Reasoning","dataset":"ARC (Challenge)","model":"Mistral 7B (0-shot)","rank_in_archive_order":30,"of":54,"metrics":{"Accuracy":"55.5"},"uses_additional_data":false},{"leaderboard":"/sota/common-sense-reasoning-on-arc-easy","task":"Common Sense Reasoning","dataset":"ARC (Easy)","model":"Mistral 7B (0-shot)","rank_in_archive_order":16,"of":47,"metrics":{"Accuracy":"80.0"},"uses_additional_data":false},{"leaderboard":"/sota/common-sense-reasoning-on-winogrande","task":"Common Sense Reasoning","dataset":"WinoGrande","model":"Mistral 7B (0-shot)","rank_in_archive_order":26,"of":77,"metrics":{"Accuracy":"75.3"},"uses_additional_data":false},{"leaderboard":"/sota/math-word-problem-solving-on-math","task":"Math Word Problem Solving","dataset":"MATH","model":"Mistral 7B (maj@4)","rank_in_archive_order":111,"of":135,"metrics":{"Accuracy":"13.1","Parameters (Billions)":"7"},"uses_additional_data":false},{"leaderboard":"/sota/multi-task-language-understanding-on-mmlu","task":"Multi-task Language Understanding","dataset":"MML","model":"Mistral 7B (5-shot)","rank_in_archive_order":18,"of":44,"metrics":{"Average (%)":"60.1"},"uses_additional_data":false},{"leaderboard":"/sota/question-answering-on-natural-questions","task":"Question Answering","dataset":"Natural Questions","model":"Mistral 7B (5-shot)","rank_in_archive_order":37,"of":47,"metrics":{"EM":"28.8"},"uses_additional_data":false},{"leaderboard":"/sota/question-answering-on-piqa","task":"Question Answering","dataset":"PIQA","model":"Mistral 7B (0-shot)","rank_in_archive_order":16,"of":67,"metrics":{"Accuracy":"83.0"},"uses_additional_data":false},{"leaderboard":"/sota/question-answering-on-peerqa","task":"Question Answering","dataset":"PeerQA","model":"Mistral-v02-7B-32k","rank_in_archive_order":2,"of":6,"metrics":{"AlignScore":"0.0827","Prometheus-2 Answer Correctness":"3.4245","Rouge-L":"0.1922"},"uses_additional_data":false},{"leaderboard":"/sota/question-answering-on-triviaqa","task":"Question Answering","dataset":"TriviaQA","model":"Mistral 7B (5-shot)","rank_in_archive_order":32,"of":56,"metrics":{"EM":"69.9"},"uses_additional_data":false},{"leaderboard":"/sota/sentence-completion-on-hellaswag","task":"Sentence Completion","dataset":"HellaSwag","model":"Mistral 7B (0-shot)","rank_in_archive_order":41,"of":89,"metrics":{"Accuracy":"81.3"},"uses_additional_data":false},{"leaderboard":"/sota/zero-shot-video-question-answer-on-intentqa","task":"Zero-Shot Video Question Answer","dataset":"IntentQA","model":"Mistral (7B)","rank_in_archive_order":12,"of":13,"metrics":{"Accuracy":"50.4"},"uses_additional_data":false},{"leaderboard":"/sota/zero-shot-video-question-answer-on-next-gqa","task":"Zero-Shot Video Question Answer","dataset":"NExT-GQA","model":"Mistral (7B)","rank_in_archive_order":9,"of":9,"metrics":{"Acc@GQA":"9.2"},"uses_additional_data":false},{"leaderboard":"/sota/zero-shot-video-question-answer-on-next-qa","task":"Zero-Shot Video Question Answer","dataset":"NExT-QA","model":"Mistral (7B)","rank_in_archive_order":27,"of":27,"metrics":{"Accuracy":"51.1"},"uses_additional_data":false},{"leaderboard":"/sota/answerability-prediction-on-peerqa","task":"answerability prediction","dataset":"PeerQA","model":"Mistral-IT-v02-7B-32k","rank_in_archive_order":1,"of":6,"metrics":{"Macro F1":"0.4703"},"uses_additional_data":false}],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2310.06825","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2310.06825"}},"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/mgmalek/efficient_cross_entropy","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/mistralai/mistral-src","reach":{"status":"ok","spdx":"Apache-2.0"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/pwc-1/Paper-9/tree/main/2/mistral","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/facebookresearch/fairseq2","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/knowlab/bi-weekly-paper-presentation","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/ninglab/ecellm","reach":{"status":"ok","spdx":"CC-BY-4.0"}}],"summary":{"ran":9,"unverified":2},"by_repo_kind":{"official":{"samples":10,"ran":9,"repositories":1},"listed":{"samples":1,"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":1,"samples":[{"code_sha256_prefix":"ef46cbe416befd2d","entry":"get_cache_sizes","repo":"mistralai/mistral-src","repo_kind":"official","path":"src/mistral_inference/cache.py","file_url":"https://github.com/mistralai/mistral-src/blob/HEAD/src/mistral_inference/cache.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"ef46cbe416befd2d"}},{"code_sha256_prefix":"b5c578acc311d56e","entry":"get_sub_grids","repo":"mistralai/mistral-src","repo_kind":"official","path":"src/mistral_inference/vision_encoder.py","file_url":"https://github.com/mistralai/mistral-src/blob/HEAD/src/mistral_inference/vision_encoder.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"b5c578acc311d56e"}},{"code_sha256_prefix":"c7a274c6f99bd04a","entry":"interleave_list","repo":"mistralai/mistral-src","repo_kind":"official","path":"src/mistral_inference/cache.py","file_url":"https://github.com/mistralai/mistral-src/blob/HEAD/src/mistral_inference/cache.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":"c7a274c6f99bd04a"}},{"code_sha256_prefix":"61a59ec493b9ba5a","entry":"position_meshgrid","repo":"mistralai/mistral-src","repo_kind":"official","path":"src/mistral_inference/vision_encoder.py","file_url":"https://github.com/mistralai/mistral-src/blob/HEAD/src/mistral_inference/vision_encoder.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"61a59ec493b9ba5a"}},{"code_sha256_prefix":"99e0ca21ba709107","entry":"precompute_freqs_cis","repo":"mistralai/mistral-src","repo_kind":"official","path":"src/mistral_inference/rope.py","file_url":"https://github.com/mistralai/mistral-src/blob/HEAD/src/mistral_inference/rope.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"99e0ca21ba709107"}},{"code_sha256_prefix":"acf80db8b8e014ad","entry":"precompute_freqs_cis_2d","repo":"mistralai/mistral-src","repo_kind":"official","path":"src/mistral_inference/rope.py","file_url":"https://github.com/mistralai/mistral-src/blob/HEAD/src/mistral_inference/rope.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"acf80db8b8e014ad"}},{"code_sha256_prefix":"a034294fb9d68dfa","entry":"repeat_kv","repo":"mistralai/mistral-src","repo_kind":"official","path":"src/mistral_inference/transformer_layers.py","file_url":"https://github.com/mistralai/mistral-src/blob/HEAD/src/mistral_inference/transformer_layers.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"a034294fb9d68dfa"}},{"code_sha256_prefix":"8e0352e68edf6866","entry":"sample","repo":"mistralai/mistral-src","repo_kind":"official","path":"src/mistral_inference/generate.py","file_url":"https://github.com/mistralai/mistral-src/blob/HEAD/src/mistral_inference/generate.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"8e0352e68edf6866"}},{"code_sha256_prefix":"231f8bcb0c0c8bab","entry":"unrotate","repo":"mistralai/mistral-src","repo_kind":"official","path":"src/mistral_inference/cache.py","file_url":"https://github.com/mistralai/mistral-src/blob/HEAD/src/mistral_inference/cache.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":"231f8bcb0c0c8bab"}},{"code_sha256_prefix":"0539a5035c30fa83","entry":"apply_rotary_emb","repo":"mistralai/mistral-src","repo_kind":"official","path":"src/mistral_inference/rope.py","file_url":"https://github.com/mistralai/mistral-src/blob/HEAD/src/mistral_inference/rope.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":"0539a5035c30fa83"}},{"code_sha256_prefix":"29195f3023e17f2d","entry":"get_log_writer","repo":"facebookresearch/fairseq2","repo_kind":"listed","path":"src/fairseq2/logging.py","file_url":"https://github.com/facebookresearch/fairseq2/blob/HEAD/src/fairseq2/logging.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":false,"mcp_get_code":{"code_sha256":"29195f3023e17f2d"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}