{"id":4133,"date":"2024-06-10T12:51:08","date_gmt":"2024-06-10T04:51:08","guid":{"rendered":"https:\/\/www.aqwu.net\/wp\/?p=4133"},"modified":"2024-06-11T23:01:30","modified_gmt":"2024-06-11T15:01:30","slug":"%e6%9e%84%e5%bb%ba-nanogpt","status":"publish","type":"post","link":"https:\/\/www.aqwu.net\/wp\/?p=4133","title":{"rendered":"\u6784\u5efa nanoGPT"},"content":{"rendered":"\n<p>\u8be5\u5b58\u50a8\u5e93\u5305\u542b&nbsp;<a href=\"https:\/\/github.com\/karpathy\/nanoGPT\/tree\/master\">nanoGPT<\/a>&nbsp;\u7684\u4ece\u5934\u5f00\u59cb\u590d\u5236\u3002git \u63d0\u4ea4\u662f\u4e13\u95e8\u4e00\u6b65\u4e00\u6b65\u5730\u4fdd\u6301\u5e72\u51c0\u7684\uff0c\u56e0\u6b64\u4eba\u4eec\u53ef\u4ee5\u5f88\u5bb9\u6613\u5730\u6d4f\u89c8 git \u63d0\u4ea4\u5386\u53f2\u8bb0\u5f55\uff0c\u770b\u770b\u5b83\u6162\u6162\u6784\u5efa\u3002\u6b64\u5916\uff0cYouTube \u4e0a\u8fd8\u6709\u4e00\u4e2a\u4f34\u594f<a href=\"https:\/\/youtu.be\/l8pRSuU81PU\">\u89c6\u9891\u8bb2\u5ea7<\/a>\uff0c\u60a8\u53ef\u4ee5\u5728\u5176\u4e2d\u770b\u5230\u6211\u4ecb\u7ecd\u6bcf\u4e2a\u63d0\u4ea4\u5e76\u89e3\u91ca\u8fc7\u7a0b\u4e2d\u7684\u5404\u4e2a\u90e8\u5206\u3002<\/p>\n\n\n\n<p>\u6211\u4eec\u57fa\u672c\u4e0a\u4ece\u4e00\u4e2a\u7a7a\u6587\u4ef6\u5f00\u59cb\uff0c\u7136\u540e\u9010\u6b65\u590d\u5236&nbsp;<a href=\"https:\/\/d4mucfpksywv.cloudfront.net\/better-language-models\/language_models_are_unsupervised_multitask_learners.pdf\">GPT-2<\/a>&nbsp;\uff08124M\uff09 \u6a21\u578b\u3002\u5982\u679c\u4f60\u6709\u66f4\u591a\u7684\u8010\u5fc3\u6216\u91d1\u94b1\uff0c\u4ee3\u7801\u4e5f\u53ef\u4ee5\u91cd\u73b0&nbsp;<a href=\"https:\/\/arxiv.org\/pdf\/2005.14165\">GPT-3<\/a>&nbsp;\u6a21\u578b\u3002\u867d\u7136 GPT-2 \uff08124M\uff09 \u6a21\u578b\u53ef\u80fd\u5728\u5f53\u65f6\uff082019 \u5e74\uff0c~5 \u5e74\u524d\uff09\u8bad\u7ec3\u4e86\u76f8\u5f53\u957f\u4e00\u6bb5\u65f6\u95f4\uff0c\u4f46\u4eca\u5929\uff0c\u590d\u5236\u5b83\u53ea\u9700 ~1 \u5c0f\u65f6\u548c ~10 \u7f8e\u5143\u3002\u5982\u679c\u4f60\u6ca1\u6709\u8db3\u591f\u7684\u4e91GPU\u76d2\uff0c\u4f60\u9700\u8981\u4e00\u4e2a\u4e91GPU\u76d2\uff0c\u4e3a\u6b64\u6211\u63a8\u8350<a href=\"https:\/\/lambdalabs.com\/\">Lambda<\/a>\u3002<\/p>\n\n\n\n<p>\u8bf7\u6ce8\u610f\uff0cGPT-2 \u548c GPT-3 \u4ee5\u53ca\u8fd9\u4e24\u79cd\u7b80\u5355\u7684\u8bed\u8a00\u6a21\u578b\uff0c\u90fd\u662f\u5728\u4e92\u8054\u7f51\u6587\u6863\u4e0a\u8bad\u7ec3\u7684\uff0c\u5b83\u4eec\u6240\u505a\u7684\u53ea\u662f\u201c\u68a6\u60f3\u201d\u4e92\u8054\u7f51\u6587\u6863\u3002\u6240\u4ee5\u8fd9\u4e2a reppo\/video \u8fd9\u4e0d\u5305\u62ec\u804a\u5929\u5fae\u8c03\uff0c\u4f60\u4e0d\u80fd\u50cf\u548c ChatGPT \u4ea4\u8c08\u4e00\u6837\u4e0e\u5b83\u4ea4\u8c08\u3002\u5fae\u8c03\u8fc7\u7a0b\uff08\u867d\u7136\u5728\u6982\u5ff5\u4e0a\u975e\u5e38\u7b80\u5355 &#8211; SFT \u53ea\u662f\u5173\u4e8e\u4ea4\u6362\u6570\u636e\u96c6\u5e76\u7ee7\u7eed\u8bad\u7ec3\uff09\u5728\u672c\u90e8\u5206\u4e4b\u540e\uff0c\u7a0d\u540e\u5c06\u4ecb\u7ecd\u3002\u5c31\u76ee\u524d\u800c\u8a00\uff0c\u8fd9\u662f 124M \u6a21\u578b\u5728 10B \u8bad\u7ec3\u540e\u7528\u201c\u4f60\u597d\uff0c\u6211\u662f\u8bed\u8a00\u6a21\u578b\u201d\u63d0\u793a\u5b83\u65f6\u8bf4\u7684\u90a3\u79cd\u4e1c\u897f\uff1a<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:python decode:true \">Hello, I'm a language model, and my goal is to make English as easy and fun as possible for everyone, and to find out the different grammar rules\nHello, I'm a language model, so the next time I go, I'll just say, I like this stuff.\nHello, I'm a language model, and the question is, what should I do if I want to be a teacher?\nHello, I'm a language model, and I'm an English person. In languages, \"speak\" is really speaking. Because for most people, there's<\/pre><\/div>\n\n\n\n<p>\u5728 40B \u4ee4\u724c\u7684\u57f9\u8bad\u4e4b\u540e\uff1a<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:python decode:true \">Hello, I'm a language model, a model of computer science, and it's a way (in mathematics) to program computer programs to do things like write\nHello, I'm a language model, not a human. This means that I believe in my language model, as I have no experience with it yet.\nHello, I'm a language model, but I'm talking about data. You've got to create an array of data: you've got to create that.\nHello, I'm a language model, and all of this is about modeling and learning Python. I'm very good in syntax, however I struggle with Python due<\/pre><\/div>\n\n\n\n<p>\u54c8\u54c8\u3002\u65e0\u8bba\u5982\u4f55\uff0c\u4e00\u65e6\u89c6\u9891\u51fa\u6765\uff0c\u8fd9\u4e5f\u5c06\u6210\u4e3a\u5e38\u89c1\u95ee\u9898\u89e3\u7b54\u7684\u5730\u65b9\uff0c\u4ee5\u53ca\u4fee\u590d\u548c\u52d8\u8bef\u8868\u7684\u5730\u65b9\uff0c\u6211\u76f8\u4fe1\u4f1a\u6709\u5f88\u591a:)<\/p>\n\n\n\n<p>\u6709\u5173\u8ba8\u8bba\u548c\u95ee\u9898\uff0c\u8bf7\u4f7f\u7528<a href=\"https:\/\/github.com\/karpathy\/build-nanogpt\/discussions\">\u201c\u8ba8\u8bba\u201d\u9009\u9879\u5361<\/a>\uff0c\u4e3a\u4e86\u66f4\u5feb\u5730\u6c9f\u901a\uff0c\u8bf7\u67e5\u770b\u6211\u7684&nbsp;<a href=\"https:\/\/discord.gg\/3zy8kqD9Cp\">Zero To Hero Discord<\/a><\/p>\n\n\n\n<p>\u539f\u6587\u94fe\u63a5\uff1a<a href=\"https:\/\/github.com\/karpathy\/build-nanogpt?tab=readme-ov-file\">karpathy\/build-nanogpt\uff1a\u5173\u4e8e\u4ece\u5934\u5f00\u59cb\u6784\u5efa nanoGPT \u7684\u89c6\u9891+\u4ee3\u7801\u8bb2\u5ea7 (github.com)<\/a><\/p>\n\n\n\n<p>\u514b\u9686\u76ee\u5f55<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:python decode:true \" >git clone https:\/\/github.com\/karpathy\/build-nanogpt<\/pre><\/div>\n\n\n\n<p>\u9700\u8981\u5148\u4e0b\u8f7d <a href=\"https:\/\/huggingface.co\/datasets\/HuggingFaceFW\/fineweb-edu\">fineweb-edu<\/a>, \u7136\u540e\u9884\u5904\u7406\u5230edu_fineweb10B \u76ee\u5f55<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:python decode:true \">python fineweb.py<\/pre><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u8be5\u5b58\u50a8\u5e93\u5305\u542b&nbsp;nanoGPT&nbsp;\u7684\u4ece\u5934\u5f00\u59cb\u590d\u5236\u3002git \u63d0\u4ea4\u662f\u4e13\u95e8\u4e00\u6b65\u4e00\u6b65\u5730\u4fdd\u6301\u5e72\u51c0\u7684\uff0c\u56e0\u6b64 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"set","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[444,443,442],"tags":[293,492],"class_list":["post-4133","post","type-post","status-publish","format-standard","hentry","category-ai","category-llm","category-llms","tag-gpt","tag-nanogpt"],"views":1158,"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/www.aqwu.net\/wp\/index.php?rest_route=\/wp\/v2\/posts\/4133","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.aqwu.net\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.aqwu.net\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.aqwu.net\/wp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.aqwu.net\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4133"}],"version-history":[{"count":6,"href":"https:\/\/www.aqwu.net\/wp\/index.php?rest_route=\/wp\/v2\/posts\/4133\/revisions"}],"predecessor-version":[{"id":4140,"href":"https:\/\/www.aqwu.net\/wp\/index.php?rest_route=\/wp\/v2\/posts\/4133\/revisions\/4140"}],"wp:attachment":[{"href":"https:\/\/www.aqwu.net\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4133"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.aqwu.net\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4133"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.aqwu.net\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4133"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}