CS336.wiki
CS336 中文实验手册/实验与消融
反馈与讨论
ASSIGNMENT 01 / 7.5

自选修改与排行榜

2026 春季 · v26.0.3原文 p. 45–46对照 PDF ↗

7.5 自选修改与排行榜#

你已经接近完成。接下来尝试改进 Transformer 架构,并与其他同学比较超参数和架构选择的效果。

排行榜规则#

除以下两项外,没有其他限制:

项目 规则
运行时间 单次提交在一张 B200 上最多运行 45 分钟。使用 SLURM 或 Modal 时,可在提交脚本中主动限制时间。
数据 只能使用课程提供的 OpenWebText 训练集。

除此之外,可以自由尝试。

原文给出的参考方向#

指导书建议参考 Llama 3 [14]、Qwen 2.5 [15] 等先进开源模型家族的论文,也提到了社区为小规模语言模型预训练加速而进行的实验。

原文举出的一个已有例子,是将输入、输出嵌入权重绑定,参见 [8] 第 3.4 节及 [16] 第 2 节;如果尝试权重绑定,可能需要降低嵌入/LM head 初始化的标准差。

进行完整 45 分钟运行前,先在 OpenWebText 子集或 TinyStories 上测试。

需要注意:在这个排行榜的小规模设置中有效的修改,不一定能推广到更大规模的预训练;课程的缩放定律单元将继续研究这个问题。

编者说明

阅读说明

原指导书中的第三方实现链接仅保留在下方英文原文中。本中文站点遵循作业的学习要求,不提供实现导引或新增解题建议。

练习 leaderboard6 分 · 10 B200 小时

排行榜

在上述规则下训练模型,目标是在 0.75 B200 小时内尽可能降低验证损失。

交付物: 最终验证损失;横轴清楚标注真实经过时间、且在 45 分钟以内的学习曲线;以及对所做修改的描述。

期望排行榜提交至少优于损失为 5.0 的朴素基线。

提交地址:assignment1-basics-leaderboard。

一起把这一章读得更好

发现翻译、公式或排版错误?欢迎反馈。概念疑问和学习心得,也可以在本章讨论中交流。

直接选中正文,点击旁边的「反馈这处错误」,即可在页内填写并提交,无需登录。
English original 展开本章英文原文 PDF 文本提取

下列文本提取自本地原版 PDF。图表和公式的准确布局请对照 PDF。

7.5 Your own modification + leaderboard
Congratulations on getting to this point. You’re almost done! You will now try to improve upon the
Transformer architecture, and see how your hyperparameters and architecture stack up against other
students in the class.

Rules for the leaderboard
There are no restrictions other than the following:
Runtime: Your submission can run for at most 45 minutes on a B200. You might want to enforce this in
  your submission script if you use either SLURM or Modal.
Data: You may only use the OpenWebText training dataset that we provide.
Otherwise, you are free to do whatever your heart desires.
If you are looking for some ideas on what to implement, you can check out some of these resources:
• State-of-the-art open-source LLM families, such as Llama 3 [A. Grattafiori et al., 2024] or Qwen 2.5
  [A. Yang et al., 2024].
• The NanoGPT speedrun repository (github.com/KellerJordan/modded-nanogpt), where community
  members post many interesting modifications for “speedrunning” small-scale language model
  pretraining. For example, a common modification that dates back to the original Transformer paper is
  to tie the weights of the input and output embeddings together (see A. Vaswani et al. [8] (Section 3.4)
  and A. Chowdhery et al. [16] (Section 2)). If you do try weight tying, you may have to decrease the
  standard deviation of the embedding/LM head init.
You will want to test these on either a small subset of OpenWebText or on TinyStories before trying the
full 45-minute run.
As a caveat, we do note that some of the modifications you may find working well in this leaderboard
may not generalize to larger-scale pretraining. We will explore this idea further in the scaling laws unit of
the course.


 Problem (leaderboard): Leaderboard (10 B200 hrs) (6 points)

      You will train a model under the leaderboard rules above with the goal of minimizing the
      validation loss of your language model within 0.75 B200-hours.
      Deliverable: The final validation loss that was recorded, an associated learning curve that clearly
      shows a wall-clock-time x-axis that is less than 45 minutes, and a description of what you did. We
      expect a leaderboard submission to beat at least the naive baseline of a 5.0 loss. Submit to the
      leaderboard here: github.com/stanford-cs336/assignment1-basics-leaderboard.

关于这一章的疑问、理解与心得,都可以在这里交流。阅读无需登录;发表评论或回复时使用 GitHub 账号。

正在加载本章讨论…

欢迎交流概念与阅读疑问,请勿发布作业完整实现或题目答案。

输入中文、英文术语或题号,例如 RoPE、检查点、train_bpe。