{"id":7696,"date":"2026-06-09T13:27:41","date_gmt":"2026-06-09T05:27:41","guid":{"rendered":"https:\/\/ab123.xyz\/?p=7696"},"modified":"2026-06-09T13:27:41","modified_gmt":"2026-06-09T05:27:41","slug":"meta-llama-3-%e5%bc%80%e6%ba%90%e5%a4%a7%e6%a8%a1%e5%9e%8b%e6%9c%ac%e5%9c%b0%e9%83%a8%e7%bd%b2%e4%b8%8e%e5%be%ae%e8%b0%83%e6%8c%87%e5%8d%97-2","status":"publish","type":"post","link":"https:\/\/ab123.xyz\/?p=7696","title":{"rendered":"Meta Llama 3 \u5f00\u6e90\u5927\u6a21\u578b\u672c\u5730\u90e8\u7f72\u4e0e\u5fae\u8c03\u6307\u5357"},"content":{"rendered":"<p>Meta Llama 3 \u4f5c\u4e3a\u65b0\u4e00\u4ee3\u5f00\u6e90\u5927\u8bed\u8a00\u6a21\u578b\uff0c\u51ed\u501f\u5176\u5f3a\u5927\u7684\u63a8\u7406\u80fd\u529b\u548c\u7075\u6d3b\u7684\u8bb8\u53ef\u534f\u8bae\uff0c\u8fc5\u901f\u6210\u4e3a\u5f00\u53d1\u8005\u548c\u4f01\u4e1a\u7684\u9996\u9009\u3002\u672c\u6587\u4e3a\u60a8\u63d0\u4f9b\u4e00\u4efd\u5b8c\u6574\u7684\u672c\u5730\u90e8\u7f72\u4e0e\u5fae\u8c03\u6307\u5357\uff0c\u5e2e\u52a9\u60a8\u5feb\u901f\u4e0a\u624b\u3002\u5b98\u65b9\u8d44\u6e90\u8bf7\u8bbf\u95ee <a href=\"https:\/\/llama.meta.com\/\" target=\"_blank\">\u5b98\u65b9\u7f51\u7ad9<\/a>\u3002<\/p>\n<h2>\u4e00\u3001\u672c\u5730\u90e8\u7f72\u73af\u5883\u51c6\u5907<\/h2>\n<p>\u90e8\u7f72 Llama 3 \u9700\u8981\u5177\u5907\u4e00\u5b9a\u7684\u786c\u4ef6\u57fa\u7840\u3002\u5efa\u8bae\u914d\u7f6e\u81f3\u5c11 24GB \u663e\u5b58\u7684 NVIDIA GPU\uff08\u5982 RTX 4090 \u6216 A10G\uff09\uff0c64GB \u7cfb\u7edf\u5185\u5b58\u4ee5\u53ca 200GB \u4ee5\u4e0a SSD \u5b58\u50a8\u7a7a\u95f4\u3002\u8f6f\u4ef6\u73af\u5883\u65b9\u9762\uff0c\u63a8\u8350\u4f7f\u7528 Ubuntu 22.04 \u6216\u66f4\u9ad8\u7248\u672c\uff0c\u5e76\u5b89\u88c5 Python 3.10+\u3001CUDA 12.1 \u53ca PyTorch 2.1\u3002<\/p>\n<h3>1. \u4e0b\u8f7d\u6a21\u578b\u6743\u91cd<\/h3>\n<p>\u4ece Meta \u5b98\u65b9\u4ed3\u5e93\u6216 Hugging Face \u83b7\u53d6 Llama 3 \u6743\u91cd\u6587\u4ef6\u3002\u60a8\u53ef\u4ee5\u901a\u8fc7 git lfs \u514b\u9686\u4ed3\u5e93\uff0c\u6216\u76f4\u63a5\u4f7f\u7528 Hugging Face \u7684 transformers \u5e93\u81ea\u52a8\u4e0b\u8f7d\u3002<\/p>\n<h3>2. \u914d\u7f6e\u63a8\u7406\u6846\u67b6<\/h3>\n<p>\u63a8\u8350\u4f7f\u7528 vLLM \u6216 llama.cpp \u8fdb\u884c\u9ad8\u6548\u63a8\u7406\u3002vLLM \u652f\u6301\u52a8\u6001\u6279\u5904\u7406\uff0c\u663e\u5b58\u5229\u7528\u7387\u9ad8\uff1bllama.cpp \u5219\u66f4\u9002\u5408 CPU \u6216\u6df7\u5408\u90e8\u7f72\u573a\u666f\u3002\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5\uff1a<code>pip install vllm<\/code> \u6216 <code>git clone https:\/\/github.com\/ggerganov\/llama.cpp<\/code>\u3002<\/p>\n<h2>\u4e8c\u3001\u6a21\u578b\u5fae\u8c03\u5b9e\u6218<\/h2>\n<p>\u5fae\u8c03\u53ef\u4ee5\u5927\u5e45\u63d0\u5347\u6a21\u578b\u5728\u7279\u5b9a\u4efb\u52a1\u4e0a\u7684\u8868\u73b0\u3002Llama 3 \u652f\u6301 LoRA\u3001QLoRA \u7b49\u53c2\u6570\u9ad8\u6548\u5fae\u8c03\u65b9\u6cd5\uff0c\u5927\u5e45\u964d\u4f4e\u663e\u5b58\u9700\u6c42\u3002<\/p>\n<h3>1. \u6570\u636e\u51c6\u5907<\/h3>\n<p>\u6574\u7406\u9886\u57df\u5bf9\u8bdd\u6570\u636e\uff0c\u683c\u5f0f\u4e3a JSONL\uff0c\u6bcf\u6761\u5305\u542b instruction \u548c response \u5b57\u6bb5\u3002\u5efa\u8bae\u6570\u636e\u91cf\u4e0d\u5c11\u4e8e 500 \u6761\uff0c\u5e76\u7ecf\u8fc7\u6e05\u6d17\u4e0e\u53bb\u91cd\u3002<\/p>\n<h3>2. \u5fae\u8c03\u5de5\u5177\u9009\u62e9<\/h3>\n<p>\u63a8\u8350\u4f7f\u7528 Hugging Face \u7684 PEFT \u5e93\u642d\u914d transformers\u3002\u4ee5\u4e0b\u4e3a\u5178\u578b\u547d\u4ee4\u793a\u4f8b\uff1a<code>python train.py --model_name meta-llama\/Meta-Llama-3-8B --data_path .\/data.jsonl --output_dir .\/lora_output<\/code>\u3002\u8bad\u7ec3\u65f6\u8bbe\u7f6e learning rate 2e-4\uff0cepoch 3\uff0cLoRA rank 8\u3002<\/p>\n<h3>3. \u5408\u5e76\u4e0e\u6d4b\u8bd5<\/h3>\n<p>\u5fae\u8c03\u5b8c\u6210\u540e\uff0c\u5c06 LoRA \u6743\u91cd\u5408\u5e76\u56de\u57fa\u7840\u6a21\u578b\uff0c\u5e76\u4f7f\u7528\u9a8c\u8bc1\u96c6\u8bc4\u6d4b BLEU \u6216 ROUGE \u5206\u6570\u3002\u82e5\u6548\u679c\u8fbe\u6807\uff0c\u5373\u53ef\u5bfc\u51fa\u4e3a GGUF \u683c\u5f0f\u7528\u4e8e\u751f\u4ea7\u90e8\u7f72\u3002<\/p>\n<h2>\u4e09\u3001\u5e94\u7528\u573a\u666f\u4e0e\u4f18\u52bf<\/h2>\n<p>Meta Llama 3 \u7684\u5f3a\u5927\u4e4b\u5904\u5728\u4e8e\u5176\u5f00\u653e\u6027\u4e0e\u53ef\u5b9a\u5236\u6027\uff0c\u9002\u7528\u4e8e\u4ee5\u4e0b\u573a\u666f\uff1a<\/p>\n<ul>\n<li><strong>\u4f01\u4e1a\u5185\u90e8\u77e5\u8bc6\u5e93\u95ee\u7b54<\/strong>\uff1a\u5fae\u8c03\u540e\u7cbe\u51c6\u56de\u590d\u516c\u53f8\u6587\u6863\u4e0e\u6d41\u7a0b\u3002<\/li>\n<li><strong>\u4ee3\u7801\u751f\u6210\u4e0e\u5ba1\u67e5<\/strong>\uff1a\u5229\u7528 70B \u7248\u672c\u7684\u4ee3\u7801\u80fd\u529b\u8f85\u52a9\u5f00\u53d1\u3002<\/li>\n<li><strong>\u591a\u8bed\u8a00\u7ffb\u8bd1\u4e0e\u6458\u8981<\/strong>\uff1a\u9488\u5bf9\u7279\u5b9a\u8bed\u79cd\u5fae\u8c03\uff0c\u6548\u679c\u8d85\u8d8a\u5546\u7528 API\u3002<\/li>\n<li><strong>\u5b66\u672f\u7814\u7a76<\/strong>\uff1a\u5f00\u6e90\u6743\u91cd\u5141\u8bb8\u6df1\u5165\u5206\u6790\u6a21\u578b\u673a\u5236\u3002<\/li>\n<\/ul>\n<p>\u6b64\u5916\uff0cLlama 3 \u5728 MMLU \u57fa\u51c6\u4e0a\u5f97\u5206\u8d85\u8fc7\u540c\u7c7b\u5f00\u6e90\u6a21\u578b\uff0c\u4e14\u652f\u6301 8K \u4e0a\u4e0b\u6587\u7a97\u53e3\uff0c\u9002\u5408\u957f\u6587\u672c\u5904\u7406\u3002\u90e8\u7f72\u6210\u672c\u53ef\u63a7\uff0c\u7b97\u529b\u6d88\u8017\u4ec5\u4e3a\u76f8\u540c\u89c4\u6a21\u95ed\u6e90\u6a21\u578b\u7684 60%\u3002<\/p>\n<h2>\u56db\u3001\u5e38\u89c1\u95ee\u9898\u4e0e\u4f18\u5316\u5efa\u8bae<\/h2>\n<p>\u9047\u5230\u663e\u5b58\u4e0d\u8db3\u65f6\u53ef\u542f\u7528 Flash Attention \u6216\u68af\u5ea6\u68c0\u67e5\u70b9\uff1b\u82e5\u63a8\u7406\u901f\u5ea6\u6162\uff0c\u53ef\u5c1d\u8bd5 INT4 \u91cf\u5316\uff08llama.cpp \u652f\u6301\uff09\u3002\u59cb\u7ec8\u5efa\u8bae\u4ece 8B \u7248\u672c\u5f00\u59cb\u9a8c\u8bc1\u6d41\u7a0b\uff0c\u518d\u8fc1\u79fb\u81f3 70B\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Meta Llama 3 \u4f5c\u4e3a\u65b0\u4e00\u4ee3\u5f00\u6e90\u5927\u8bed\u8a00\u6a21\u578b\uff0c\u51ed\u501f\u5176\u5f3a\u5927\u7684\u63a8\u7406\u80fd\u529b\u548c\u7075\u6d3b\u7684\u8bb8\u53ef\u534f\u8bae\uff0c\u8fc5\u901f\u6210\u4e3a\u5f00\u53d1\u8005\u548c\u4f01\u4e1a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[9573,9574,4685,9575,2993],"class_list":["post-7696","post","type-post","status-publish","format-standard","hentry","category-4","tag-meta-llama-3","tag-9574","tag-ai","tag-9575","tag-2993"],"_links":{"self":[{"href":"https:\/\/ab123.xyz\/index.php?rest_route=\/wp\/v2\/posts\/7696","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ab123.xyz\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ab123.xyz\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ab123.xyz\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ab123.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=7696"}],"version-history":[{"count":1,"href":"https:\/\/ab123.xyz\/index.php?rest_route=\/wp\/v2\/posts\/7696\/revisions"}],"predecessor-version":[{"id":7698,"href":"https:\/\/ab123.xyz\/index.php?rest_route=\/wp\/v2\/posts\/7696\/revisions\/7698"}],"wp:attachment":[{"href":"https:\/\/ab123.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7696"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ab123.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=7696"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ab123.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=7696"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}