跳到正文
Hacker News· theali·· 10 天前AI 评分60

在 CPU 上从零构建并训练 25M 参数 LLM

Build and Train a 25M Parameter LLM from Scratch on Your CPU

AI 导读

freeCodeCamp 发布一小时视频教程,教你在笔记本或普通 CPU 上从零构建、预训练并微调一个 2500 万参数的语言模型。课程涵盖混合线性/稀疏注意力、MoE、绑定嵌入权重和多模态图像 patch 输入等现代 LLM 架构,并演示模型从随机字符生成逐步学会 Python 语法。后训练部分搭建轻量 RL 循环,让模型写代码、跑单元测试并获取奖励,任务成功率从 0% 提升到通过多数评测。

正文 · 原文

freeCodeCamp.org

Build and Train a 25M Parameter LLM From Scratch on Your CPU

You don't need a massive GPU cluster to learn how modern frontier AI works. In our new video on the freeCodeCamp.org YouTube channel, you will build, pre-train, and fine-tune a working 25-million parameter language model directly on your laptop or standard CPU.

Frontier labs train massive systems with billions of parameters, but the core architecture, math, and workflows are fundamentally identical. Scaling the architecture down to 25 million parameters with a compact byte-level vocabulary strips away expensive cloud compute costs and lets training loops run locally on your CPU in seconds. This rapid iteration allows you to directly observe how changes to data curricula, loss functions, and reward designs alter model behavior in real time.

Here are some things covered in the course:

  • Modern LLM Architecture
    Learn how cutting-edge techniques work under the hood, including hybrid linear/sparse attention, Mixture of Experts (MoE), tied embedding weights, and multimodal image patch inputs.

  • Pre-Training from Zero
    Watch the model start from generating random characters and learn Python syntax and structure step-by-step using cross-entropy loss.

  • Post-Training with Reinforcement Learning (RL)
    Build a lightweight RL loop where the model writes code, runs against automated unit tests, and receives rewards—boosting its task success rate from 0% up to passing the majority of evaluations.

  • How AI Researchers Actually Work
    Learn how to think like a modern researcher by forming testable hypotheses, tweaking temperatures and reward structures, and checking for real statistical significance across multiple seeds.

Watch the full tutorial for free on the freeCodeCamp.org YouTube channel (1-hour watch).



Learn to code for free. freeCodeCamp's open source curriculum has helped more than 40,000 people get jobs as developers. Get started

来源:Hacker News · freecodecamp.org