Karpathy推超輕量ChatGPT nanochat 教你4小時自建AI對話機器人

Ai




Andrej Karpathy 推出 nanochat:輕量版 ChatGPT 克隆模型

OpenAI 聯合創辦人兼 Eureka Labs 創始人 Andrej Karpathy 最近發布了一個名為 nanochat 的開源項目,這是一套完整的訓練及推理流程,專門用於打造一個簡易的 ChatGPT 風格模型。這個項目是他之前 nanoGPT 的升級版,nanoGPT 只專注於預訓練部分,而 nanochat 則涵蓋了整個模型開發流程。

Karpathy 在社交平台 X(前身為 Twitter)表示,用戶只需啟動一個雲端 GPU 節點,運行一個腳本,4 小時內就可以透過類 ChatGPT 的網頁界面與自己訓練的語言模型互動。整個代碼庫大約有 8,000 行,覆蓋從訓練分詞器(用 Rust 語言編寫)、在 FineWeb 數據上預訓練 Transformer 模型,到中期訓練用戶與助理的對話、多選題訓練、監督式微調(SFT)以及選擇性強化學習(RL)等多個階段。最終,模型還支援通過鍵值緩存(KV caching)來提升推理效率。

用戶可選擇命令行界面或網頁界面與模型交互,系統同時會生成一份 Markdown 格式的性能報告。Karpathy 指出,模型訓練的規模可根據時間和預算調整:只需約 100 美元,4 小時在 8×H100 GPU 節點上即可訓練出一個基本的 ChatGPT 克隆,支持簡單對話;訓練 12 小時左右,模型性能可超越 GPT-2 CORE 基準;若投入約 1,000 美元、42 小時訓練,模型將更為連貫,能解答簡單數學、編碼問題,並處理多選題。

Karpathy 表示,他的目標是將整個「強基線」技術棧整合為一個簡潔、易讀、易修改、易分叉的代碼庫,nanochat 將成為他們正在開發的 LLM101n 課程的總結項目。LLM101n 是 Eureka Labs 為本科生設計的課程,旨在指導學生如何從零開始構建 AI 模型。Karpathy 也透露,nanochat 項目未來有可能發展成為一個研究工具或基準測試平台,類似於他之前的 nanoGPT。

編輯評論與深入分析

Andrej Karpathy 一直以來都是 AI 領域的風向標,他這次推出的 nanochat 不僅是技術上的突破,更是一種教育和開源精神的體現。這個項目將複雜的語言模型訓練流程極大地簡化,使得更多開發者和學生能以低門檻快速上手,這對於推動 AI 知識普及和人才培養意義重大。

從商業角度來看,Karpathy 將訓練成本壓縮到數百美元以內,並在數小時內完成模型搭建,這無疑降低了中小企業甚至個人開發者進入大型語言模型領域的門檻。這種「輕量化」趨勢有望推動更多定制化、針對特定場景的 AI 助理誕生,避免了過度依賴大型科技公司提供的閉源服務,促進生態多元化。

教育層面,nanochat 作為 LLM101n 課程的核心項目,將讓學生親身體驗從數據預處理、模型訓練到部署的完整流程,這種實操經驗對培養未來 AI 人才尤為關鍵。Karpathy 透過開源的形式,營造出一個可被全球社群共同參與和改進的學習平台,這正是推動 AI 持續進步的關鍵。

不過,隨著這類「輕量版 ChatGPT」的普及,如何防範錯誤信息擴散、確保模型安全與合規,也將成為不可忽視的挑戰。Karpathy 項目雖然專注於技術開發,但未來若要推向更廣泛應用,相關的倫理與監管框架同樣需要同步完善。

總結來說,nanochat 是 AI 開發者和教育者的福音,它不僅降低了技術門檻,更為 AI 社群提供了一個開放、可持續發展的基礎設施。未來這種「人人可訓練」的模型有望激發更多創新應用,推動 AI 走向更民主化、更普及的發展階段。

以上文章由特價GPT API KEY所翻譯及撰寫。而圖片則由FLUX根據內容自動生成。

🎬 YouTube Premium 家庭 Plan成員一位 只需 HK$148/年

不用提供密碼、不用VPN、無需轉區
直接升級你的香港帳號 ➜ 即享 YouTube + YouTube Music 無廣告播放

立即升級 🔗

🎨 Nano Banana Pro 圖像生成器|打幾句說話就出圖

想畫人像、產品圖、插畫?SSFuture 圖像生成器支援 Flux Gemini Nano Banana Pro 改圖 / 合成, 打廣東話都得,仲可以沿用上一張圖繼續微調。

🆓 Flux 模型即玩,不用登入
🤖 登入後解鎖 Gemini 改圖
📷 支援上載參考圖再生成
⚡ 每天免費額度任你玩
✨ 即刻玩 AI 畫圖
A hand holding a broken mirror piece with a man's face reflected in it against a cloudy sky background. The mirror piece is jagged and held up by fingers, showing the man's close-up face with stubble and piercing eyes 
100% use my upload reference image image generate Use the original face exactly as it is, without changing a details. A striking, high-fashion editorial portrait of a white -skinned model, captured outdoors with a bright, sunny, slightly hazy ambiance reminiscent of the late 1980s or early 1990s.
Model and Styling
• Model: A female model with elegant features and dark, curly hair, posed looking over her shoulder towards the camera. Her expression is confident and alluring.
• Outfit: She is wearing a two-piece outfit (or a playsuit/romper) entirely covered in black and white polka dots.
• Top: A loose, long-sleeved shirt, worn off one shoulder, showcasing the neckline. The polka dots on the shirt appear slightly smaller and more uniform.
• Bottom: Matching shorts or a skirt with a tight, fitted silhouette, emphasizing her figure. The polka dots here appear slightly denser.
• Hat: A defining accessory—a dramatically oversized sun hat with a wide, floppy brim. The crown is white, and the large, voluminous brim is patterned with large black and white polka dots, cascading down. A black fabric tie/ribbon is visible around the crown.
• Accessories: Large, circular or crescent-shaped gold earrings dangle from her ears.
Lighting and Setting
• Lighting: Natural, bright, direct sunlight creating a warm, sun-kissed, and slightly nostalgic aesthetic. The overall color palette leans towards desaturated pastels and warm creamy whites.
• Setting: She is positioned on a rooftop, terrace, or balcony, with a hazy, mountainous or coastal landscape visible in the blurred background. The background is predominantly soft blues and pale purples, suggesting a distant view over a city or ocean.
• Composition: A vertical, full-body to three-quarter shot. The model is the central focus, framed against the soft background.
Keywords/Style
• Style: High Fashion, Editorial, Retro, 90s Fashion, Resort Wear, Glamorous, Iconic.
• Vibe: Sophisticated, Sunny, Vacation Chic, Bold Pattern. Create a sticker set maintaining 100% of the woman's original facial features from the provided image. Do not alter the face, focusing on ultra-realistic details of the facial structure, eyes, eyebrows, nose, mouth, and expression. The final face must be realistic, not cartoon-like. She has long, voluminous hair.
1. Makeup:Maintain Original Face: We will preserve the structure of your face, eyes, eyebrows, nose, mouth, and expression as closely as possible to the original image to maintain naturalness and uniqueness, while adjusting the tone to be softer:

Eyes: Slightly reduce the sharpness of the Cat Eye eyeliner to a thin line close to the lash line for a softer look, while still maintaining eye definition.
Eyeshadow: Use natural tones like light brown, peach, or beige.
Eyebrows: Original shape, but brushed up to look softer and more natural.
Lips: Glossy, pink-tinted, nude-pink, or coral-toned lipstick/tint to make the lips look full and moisturized. Focus on a bright but not overly intense look.
2. Hairstyle:Natural Voluminous Long Hair: Her hair is long and flowing, but the styling will emphasize natural volume and movement. Soft, natural waves.
3. Outfit:

Attire: A white open-back bodysuit paired with distressed, faded blue denim shorts. There is a message "Kunika" on the shirt.
Shoes: Elegant, simple open-toe flat sandals.
Accessories: Styled freely and fittingly for each scene.
4. Poses & Sticker Elements:Poses: Various poses such as waving, jumping, walking playfully, reading a book, holding up a sign, cheering with both hands, stretching, or making a celebratory gesture, to create a cheerful and friendly atmosphere.Decoration: Include elements like small rainbows, sparkling stars, clear bubbles, hearts, balloons, or light-colored dots to decorate and enhance the fun of each sticker scene.Style: Thin black border around the sticker. Use a modern, rounded 'Itim' style font for the text.Text: Add short emotional phrases written in a cute, beautiful script near the sticker (no speech bubbles/text boxes):

"Hello"
"Love you"
"Submitting work"
"Great"
"Got it"
"Thanks!"
"Wait a sec"
"Ready to care"
"Fight"
"Let's do it"
"So cute"
"OK"
"Sweet dreams:
"Get well soon"
"555"
"You're welcome"
"HBD" 
"OMG" 
"Sorry"
"Got a headache" 
Guidelines: Do not include a text box. Ensure balanced composition with sufficient white space—not cluttered. Match the pose to the text.
Emphasis: Reiterate 'maintain 100% of the original face features from the provided image,' 'ultra-realistic facial detail,' and 'professional studio lighting on face (realistic face, not cartoon face).

Use Cantonese in the stickers.