{
 "generated": "2026-11-20",
 "sha": "",
 "node": {
  "date": "2026-05-16",
  "updated": "2026-05-16",
  "kind": "topic",
  "category": "Agent 工程",
  "group": "agents",
  "page": "/deepdive/llm-from-scratch/",
  "summary": "从随机权重预训练到推理服务的完整 LLM 全栈实现：8 层架构、约 1 万行代码、零外部 API/权重，RTX 5090 上 70 秒训出会调用工具的 agent",
  "version": 1,
  "tags": [
   "LLM",
   "from-scratch",
   "CUDA",
   "Triton",
   "Pretraining"
  ],
  "langs": [
   "zh",
   "en"
  ],
  "words": 4058,
  "n_sections": 7,
  "related": [
   "skill-market-boundary",
   "agent-onboarding-gates",
   "work-agent-ecosystem",
   "ai-coding-weekly-notes"
  ],
  "id": "dd:llm-from-scratch",
  "type": "Article",
  "article": "llm-from-scratch",
  "name": "LLM from Scratch · 全栈 LLM 系统",
  "title": "LLM from Scratch · 全栈 LLM 系统",
  "slug": "llm-from-scratch",
  "kind_zh": "热点专题",
  "entry": "agent",
  "n_ents": 4,
  "n_entities": 4
 },
 "page": "https://xiaopingfeng.com/graph/e/dd/llm-from-scratch/",
 "out": [
  {
   "type": "covers",
   "sentence": "LLM from Scratch · 全栈 LLM 系统讲到Claude",
   "direction": "out",
   "id": "app:claude",
   "name": "Claude",
   "role": "mention",
   "status": "agent",
   "evidence": []
  },
  {
   "type": "covers",
   "sentence": "LLM from Scratch · 全栈 LLM 系统讲到Anthropic",
   "direction": "out",
   "id": "org:anthropic",
   "name": "Anthropic",
   "role": "mention",
   "status": "agent",
   "evidence": []
  },
  {
   "type": "covers",
   "sentence": "LLM from Scratch · 全栈 LLM 系统讲到OpenAI",
   "direction": "out",
   "id": "org:openai",
   "name": "OpenAI",
   "role": "mention",
   "status": "agent",
   "evidence": []
  },
  {
   "type": "covers",
   "sentence": "LLM from Scratch · 全栈 LLM 系统讲到PyTorch",
   "direction": "out",
   "id": "org:pytorch",
   "name": "PyTorch",
   "role": "mention",
   "status": "agent",
   "evidence": []
  }
 ],
 "in": [
  {
   "type": "part_of",
   "sentence": "这个 demo属于LLM from Scratch · 全栈 LLM 系统",
   "direction": "in",
   "id": "ddsec:llm-from-scratch-demo",
   "name": "这个 demo",
   "status": "derived",
   "evidence": []
  },
  {
   "type": "part_of",
   "sentence": "八层架构属于LLM from Scratch · 全栈 LLM 系统",
   "direction": "in",
   "id": "ddsec:llm-from-scratch-s",
   "name": "八层架构",
   "status": "derived",
   "evidence": []
  },
  {
   "type": "part_of",
   "sentence": "关键数字属于LLM from Scratch · 全栈 LLM 系统",
   "direction": "in",
   "id": "ddsec:llm-from-scratch-s-2",
   "name": "关键数字（实测）",
   "status": "derived",
   "evidence": []
  },
  {
   "type": "part_of",
   "sentence": "最重要的 demo：1234 + 5678 → 6912属于LLM from Scratch · 全栈 LLM 系统",
   "direction": "in",
   "id": "ddsec:llm-from-scratch-demo-1234-5678-6912",
   "name": "最重要的 demo：1234 + 5678 → 6912",
   "status": "derived",
   "evidence": []
  },
  {
   "type": "part_of",
   "sentence": "从零启动属于LLM from Scratch · 全栈 LLM 系统",
   "direction": "in",
   "id": "ddsec:llm-from-scratch-s-3",
   "name": "从零启动",
   "status": "derived",
   "evidence": []
  },
  {
   "type": "part_of",
   "sentence": "深度阅读属于LLM from Scratch · 全栈 LLM 系统",
   "direction": "in",
   "id": "ddsec:llm-from-scratch-s-4",
   "name": "深度阅读",
   "status": "derived",
   "evidence": []
  },
  {
   "type": "part_of",
   "sentence": "差异化贡献属于LLM from Scratch · 全栈 LLM 系统",
   "direction": "in",
   "id": "ddsec:llm-from-scratch-s-5",
   "name": "差异化贡献",
   "status": "derived",
   "evidence": []
  }
 ]
}