<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>Henry_Lee</author_name>
  <author_url>https://blog.hatena.ne.jp/Henry_Lee/</author_url>
  <blog_title>Levis's GenAI Fullstack Engineer Blog</blog_title>
  <blog_url>https://henry-lee-genai-fullstack.hatenablog.com/</blog_url>
  <categories>
  </categories>
  <description>这份笔记来自一次真实的训练实践：在 RTX 3070 (8GB VRAM) + 16GB RAM 上，从零实现并训练了一个 ~10M 参数的 GPT 语言模型。包含完整代码、踩过的坑、训练数据，适合作为深度学习对话的上下文。 一、GPT 是什么？一句话版本 GPT = 只有 Decoder 的 Transformer，任务是&quot;给定前面的文字，预测下一个字&quot;（自回归语言模型）。 训练时：喂一段文本，模型尝试预测每个位置的下一个 token，用 cross-entropy loss 衡量预测好坏。 生成时：给一个开头，模型一个字一个字往后&quot;续写&quot;。 二、核心架构（逐层拆解） 2.1 整体结构 输入…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fhenry-lee-genai-fullstack.hatenablog.com%2Fentry%2F2026%2F03%2F05%2F125729&quot; title=&quot;从零训练一个 Mini GPT — 实战学习笔记 - Levis&amp;#39;s GenAI Fullstack Engineer Blog&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2026-03-05 12:57:29</published>
  <title>从零训练一个 Mini GPT — 实战学习笔记</title>
  <type>rich</type>
  <url>https://henry-lee-genai-fullstack.hatenablog.com/entry/2026/03/05/125729</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
