[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-rasbt--reasoning-from-scratch":3,"tool-rasbt--reasoning-from-scratch":62},[4,18,26,36,46,54],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":17},4358,"openclaw","openclaw\u002Fopenclaw","OpenClaw 是一款专为个人打造的本地化 AI 助手，旨在让你在自己的设备上拥有完全可控的智能伙伴。它打破了传统 AI 助手局限于特定网页或应用的束缚，能够直接接入你日常使用的各类通讯渠道，包括微信、WhatsApp、Telegram、Discord、iMessage 等数十种平台。无论你在哪个聊天软件中发送消息，OpenClaw 都能即时响应，甚至支持在 macOS、iOS 和 Android 设备上进行语音交互，并提供实时的画布渲染功能供你操控。\n\n这款工具主要解决了用户对数据隐私、响应速度以及“始终在线”体验的需求。通过将 AI 部署在本地，用户无需依赖云端服务即可享受快速、私密的智能辅助，真正实现了“你的数据，你做主”。其独特的技术亮点在于强大的网关架构，将控制平面与核心助手分离，确保跨平台通信的流畅性与扩展性。\n\nOpenClaw 非常适合希望构建个性化工作流的技术爱好者、开发者，以及注重隐私保护且不愿被单一生态绑定的普通用户。只要具备基础的终端操作能力（支持 macOS、Linux 及 Windows WSL2），即可通过简单的命令行引导完成部署。如果你渴望拥有一个懂你",349277,3,"2026-04-06T06:32:30",[13,14,15,16],"Agent","开发框架","图像","数据工具","ready",{"id":19,"name":20,"github_repo":21,"description_zh":22,"stars":23,"difficulty_score":10,"last_commit_at":24,"category_tags":25,"status":17},3808,"stable-diffusion-webui","AUTOMATIC1111\u002Fstable-diffusion-webui","stable-diffusion-webui 是一个基于 Gradio 构建的网页版操作界面，旨在让用户能够轻松地在本地运行和使用强大的 Stable Diffusion 图像生成模型。它解决了原始模型依赖命令行、操作门槛高且功能分散的痛点，将复杂的 AI 绘图流程整合进一个直观易用的图形化平台。\n\n无论是希望快速上手的普通创作者、需要精细控制画面细节的设计师，还是想要深入探索模型潜力的开发者与研究人员，都能从中获益。其核心亮点在于极高的功能丰富度：不仅支持文生图、图生图、局部重绘（Inpainting）和外绘（Outpainting）等基础模式，还独创了注意力机制调整、提示词矩阵、负向提示词以及“高清修复”等高级功能。此外，它内置了 GFPGAN 和 CodeFormer 等人脸修复工具，支持多种神经网络放大算法，并允许用户通过插件系统无限扩展能力。即使是显存有限的设备，stable-diffusion-webui 也提供了相应的优化选项，让高质量的 AI 艺术创作变得触手可及。",162132,"2026-04-05T11:01:52",[14,15,13],{"id":27,"name":28,"github_repo":29,"description_zh":30,"stars":31,"difficulty_score":32,"last_commit_at":33,"category_tags":34,"status":17},1381,"everything-claude-code","affaan-m\u002Feverything-claude-code","everything-claude-code 是一套专为 AI 编程助手（如 Claude Code、Codex、Cursor 等）打造的高性能优化系统。它不仅仅是一组配置文件，而是一个经过长期实战打磨的完整框架，旨在解决 AI 代理在实际开发中面临的效率低下、记忆丢失、安全隐患及缺乏持续学习能力等核心痛点。\n\n通过引入技能模块化、直觉增强、记忆持久化机制以及内置的安全扫描功能，everything-claude-code 能显著提升 AI 在复杂任务中的表现，帮助开发者构建更稳定、更智能的生产级 AI 代理。其独特的“研究优先”开发理念和针对 Token 消耗的优化策略，使得模型响应更快、成本更低，同时有效防御潜在的攻击向量。\n\n这套工具特别适合软件开发者、AI 研究人员以及希望深度定制 AI 工作流的技术团队使用。无论您是在构建大型代码库，还是需要 AI 协助进行安全审计与自动化测试，everything-claude-code 都能提供强大的底层支持。作为一个曾荣获 Anthropic 黑客大奖的开源项目，它融合了多语言支持与丰富的实战钩子（hooks），让 AI 真正成长为懂上",160015,2,"2026-04-18T11:30:52",[14,13,35],"语言模型",{"id":37,"name":38,"github_repo":39,"description_zh":40,"stars":41,"difficulty_score":42,"last_commit_at":43,"category_tags":44,"status":17},8272,"opencode","anomalyco\u002Fopencode","OpenCode 是一款开源的 AI 编程助手（Coding Agent），旨在像一位智能搭档一样融入您的开发流程。它不仅仅是一个代码补全插件，而是一个能够理解项目上下文、自主规划任务并执行复杂编码操作的智能体。无论是生成全新功能、重构现有代码，还是排查难以定位的 Bug，OpenCode 都能通过自然语言交互高效完成，显著减少开发者在重复性劳动和上下文切换上的时间消耗。\n\n这款工具专为软件开发者、工程师及技术研究人员设计，特别适合希望利用大模型能力来提升编码效率、加速原型开发或处理遗留代码维护的专业人群。其核心亮点在于完全开源的架构，这意味着用户可以审查代码逻辑、自定义行为策略，甚至私有化部署以保障数据安全，彻底打破了传统闭源 AI 助手的“黑盒”限制。\n\n在技术体验上，OpenCode 提供了灵活的终端界面（Terminal UI）和正在测试中的桌面应用程序，支持 macOS、Windows 及 Linux 全平台。它兼容多种包管理工具，安装便捷，并能无缝集成到现有的开发环境中。无论您是追求极致控制权的资深极客，还是渴望提升产出的独立开发者，OpenCode 都提供了一个透明、可信",144296,1,"2026-04-16T14:50:03",[13,45],"插件",{"id":47,"name":48,"github_repo":49,"description_zh":50,"stars":51,"difficulty_score":32,"last_commit_at":52,"category_tags":53,"status":17},2271,"ComfyUI","Comfy-Org\u002FComfyUI","ComfyUI 是一款功能强大且高度模块化的视觉 AI 引擎，专为设计和执行复杂的 Stable Diffusion 图像生成流程而打造。它摒弃了传统的代码编写模式，采用直观的节点式流程图界面，让用户通过连接不同的功能模块即可构建个性化的生成管线。\n\n这一设计巧妙解决了高级 AI 绘图工作流配置复杂、灵活性不足的痛点。用户无需具备编程背景，也能自由组合模型、调整参数并实时预览效果，轻松实现从基础文生图到多步骤高清修复等各类复杂任务。ComfyUI 拥有极佳的兼容性，不仅支持 Windows、macOS 和 Linux 全平台，还广泛适配 NVIDIA、AMD、Intel 及苹果 Silicon 等多种硬件架构，并率先支持 SDXL、Flux、SD3 等前沿模型。\n\n无论是希望深入探索算法潜力的研究人员和开发者，还是追求极致创作自由度的设计师与资深 AI 绘画爱好者，ComfyUI 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",109154,"2026-04-18T11:18:24",[14,15,13],{"id":55,"name":56,"github_repo":57,"description_zh":58,"stars":59,"difficulty_score":32,"last_commit_at":60,"category_tags":61,"status":17},6121,"gemini-cli","google-gemini\u002Fgemini-cli","gemini-cli 是一款由谷歌推出的开源 AI 命令行工具，它将强大的 Gemini 大模型能力直接集成到用户的终端环境中。对于习惯在命令行工作的开发者而言，它提供了一条从输入提示词到获取模型响应的最短路径，无需切换窗口即可享受智能辅助。\n\n这款工具主要解决了开发过程中频繁上下文切换的痛点，让用户能在熟悉的终端界面内直接完成代码理解、生成、调试以及自动化运维任务。无论是查询大型代码库、根据草图生成应用，还是执行复杂的 Git 操作，gemini-cli 都能通过自然语言指令高效处理。\n\n它特别适合广大软件工程师、DevOps 人员及技术研究人员使用。其核心亮点包括支持高达 100 万 token 的超长上下文窗口，具备出色的逻辑推理能力；内置 Google 搜索、文件操作及 Shell 命令执行等实用工具；更独特的是，它支持 MCP（模型上下文协议），允许用户灵活扩展自定义集成，连接如图像生成等外部能力。此外，个人谷歌账号即可享受免费的额度支持，且项目基于 Apache 2.0 协议完全开源，是提升终端工作效率的理想助手。",100752,"2026-04-10T01:20:03",[45,13,15,14],{"id":63,"github_repo":64,"name":65,"description_en":66,"description_zh":67,"ai_summary_zh":68,"readme_en":69,"readme_zh":70,"quickstart_zh":71,"use_case_zh":72,"hero_image_url":73,"owner_login":74,"owner_name":75,"owner_avatar_url":76,"owner_bio":77,"owner_company":78,"owner_location":78,"owner_email":78,"owner_twitter":74,"owner_website":79,"owner_url":80,"languages":81,"stars":94,"forks":95,"last_commit_at":96,"license":97,"difficulty_score":10,"env_os":98,"env_gpu":99,"env_ram":100,"env_deps":101,"category_tags":107,"github_topics":108,"view_count":32,"oss_zip_url":78,"oss_zip_packed_at":78,"status":17,"created_at":120,"updated_at":121,"faqs":122,"releases":143},9214,"rasbt\u002Freasoning-from-scratch","reasoning-from-scratch","Implement a reasoning LLM in PyTorch from scratch, step by step","reasoning-from-scratch 是一个基于 PyTorch 从零构建推理大语言模型（LLM）的开源教育项目，也是同名技术书籍的官方代码库。它旨在解决当前开发者对\"AI 推理”概念理解抽象、难以掌握其底层实现逻辑的痛点。不同于直接调用现成 API，该项目引导用户从一个预训练的基础模型出发，通过一步步编写代码，亲手添加并优化推理能力，从而直观地揭示模型如何像人类一样进行逻辑思考。\n\n该项目特别适合希望深入理解大模型内部机制的 AI 开发者、研究人员以及计算机专业学生。对于想要探究 DeepSeek R1 或 GPT-5 Thinking 等先进模型背后原理的技术人员，这里提供了极佳的实践路径。其独特的技术亮点在于“手把手”的教学模式：内容涵盖从基础文本生成、模型评估，到利用推理时缩放（Inference-Time Scaling）和自我修正（Self-Refinement）等前沿技术提升模型表现的全过程。所有代码均配有详细的 Jupyter Notebook 教程和习题解答，支持在 Linux、macOS 和 Windows 环境下运行，帮助用户在实战中真正吃透推理模型的构建","reasoning-from-scratch 是一个基于 PyTorch 从零构建推理大语言模型（LLM）的开源教育项目，也是同名技术书籍的官方代码库。它旨在解决当前开发者对\"AI 推理”概念理解抽象、难以掌握其底层实现逻辑的痛点。不同于直接调用现成 API，该项目引导用户从一个预训练的基础模型出发，通过一步步编写代码，亲手添加并优化推理能力，从而直观地揭示模型如何像人类一样进行逻辑思考。\n\n该项目特别适合希望深入理解大模型内部机制的 AI 开发者、研究人员以及计算机专业学生。对于想要探究 DeepSeek R1 或 GPT-5 Thinking 等先进模型背后原理的技术人员，这里提供了极佳的实践路径。其独特的技术亮点在于“手把手”的教学模式：内容涵盖从基础文本生成、模型评估，到利用推理时缩放（Inference-Time Scaling）和自我修正（Self-Refinement）等前沿技术提升模型表现的全过程。所有代码均配有详细的 Jupyter Notebook 教程和习题解答，支持在 Linux、macOS 和 Windows 环境下运行，帮助用户在实战中真正吃透推理模型的构建细节。","# Build A Reasoning Model (From Scratch)\n\nThis repository contains the code for developing an LLM reasoning model and is the official code repository for the book [*Build a Reasoning Model (From Scratch)*](https:\u002F\u002Fmng.bz\u002FlZ5B).\n\n\n\u003Cbr>\n\u003Cbr>\n\n\u003Ca href=\"https:\u002F\u002Fmng.bz\u002FlZ5B\">\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Frasbt_reasoning-from-scratch_readme_3603d5aed1a1.webp\" width=\"250px\">\u003C\u002Fa>\n\n(Printed in color.)\n\n\u003Cbr>\n\nIn [*Build a Reasoning Model (From Scratch)*](https:\u002F\u002Fmng.bz\u002FlZ5B), you will learn and understand how a reasoning large language model (LLM) works.\n\nReasoning is one of the most exciting and important recent advances in improving LLMs, but it’s also one of the easiest to misunderstand if you only hear the term reasoning and read about it in theory. This is why this book takes a hands-on approach. We will start with a pre-trained base LLM and then add reasoning capabilities ourselves, step by step in code, so you can see exactly how it works.\n\nThe methods described in this book walk you through the process of developing your own small-but-functional reasoning model for educational purposes. It mirrors the approaches used in creating large-scale reasoning models such as DeepSeek R1, GPT-5 Thinking, and others. In addition, this book includes code for loading the weights of existing, pretrained models.\n\n- Link to the official [source code repository](https:\u002F\u002Fgithub.com\u002Frasbt\u002Freasoning-from-scratch)\n- Link to the [book at Manning](https:\u002F\u002Fmng.bz\u002FlZ5B) (the publisher's website)\n- Link to the book page on Amazon.com (TBD)\n- ISBN 9781633434677\n\n\n\n\u003Cbr>\n\u003Cbr>\n\nTo download a copy of this repository, click on the [Download ZIP](https:\u002F\u002Fgithub.com\u002Frasbt\u002Freasoning-from-scratch\u002Farchive\u002Frefs\u002Fheads\u002Fmain.zip) button or execute the following command in your terminal:\n\n```bash\ngit clone --depth 1 https:\u002F\u002Fgithub.com\u002Frasbt\u002Freasoning-from-scratch.git\n```\n\n\u003Cbr>\n\n\n> **Tip:**\n> Chapter 2 provides additional tips on installing Python, managing Python packages, and setting up your coding environment.\n\n\u003Cbr>\n\u003Cbr>\n\n## Table of Contents (In Progress)\n\n[![Code tests Linux](https:\u002F\u002Fgithub.com\u002Frasbt\u002Freasoning-from-scratch\u002Factions\u002Fworkflows\u002Ftests-linux.yml\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002Frasbt\u002Freasoning-from-scratch\u002Factions\u002Fworkflows\u002Ftests-linux.yml)\n[![Code tests macOS](https:\u002F\u002Fgithub.com\u002Frasbt\u002Freasoning-from-scratch\u002Factions\u002Fworkflows\u002Ftests-macos.yml\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002Frasbt\u002Freasoning-from-scratch\u002Factions\u002Fworkflows\u002Ftests-macos.yml)\n[![Code tests Windows](https:\u002F\u002Fgithub.com\u002Frasbt\u002Freasoning-from-scratch\u002Factions\u002Fworkflows\u002Ftests-windows.yml\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002Frasbt\u002Freasoning-from-scratch\u002Factions\u002Fworkflows\u002Ftests-windows.yml)\n\n- [Troubleshooting Guide](.\u002Ftroubleshooting.md)\n\n| Chapter Title                                               | Main Code                                                    |\n| ----------------------------------------------------------- | ------------------------------------------------------------ |\n| Ch 1: Understanding reasoning Models                        | No code                                                      |\n| Ch 2: Generating Text with a Pre-trained LLM                | - [ch02_main.ipynb](ch02\u002F01_main-chapter-code\u002Fch02_main.ipynb)\u003Cbr\u002F>- [ch02_exercise-solutions.ipynb](ch02\u002F01_main-chapter-code\u002Fch02_exercise-solutions.ipynb) |\n| Ch 3: Evaluating Reasoning Models                           | - [ch03_main.ipynb](ch03\u002F01_main-chapter-code\u002Fch03_main.ipynb)\u003Cbr\u002F>- [ch03_exercise-solutions.ipynb](ch03\u002F01_main-chapter-code\u002Fch03_exercise-solutions.ipynb) |\n| Ch 4: Improving Reasoning with Inference-Time Scaling       | - [ch04_main.ipynb](ch04\u002F01_main-chapter-code\u002Fch04_main.ipynb)\u003Cbr\u002F>- [ch04_exercise-solutions.ipynb](ch04\u002F01_main-chapter-code\u002Fch04_exercise-solutions.ipynb) |\n| Ch 5: Inference-Time Scaling via Self-Refinement            | - [ch05_main.ipynb](ch05\u002F01_main-chapter-code\u002Fch05_main.ipynb)\u003Cbr\u002F>- [ch05_exercise-solutions.ipynb](ch05\u002F01_main-chapter-code\u002Fch05_exercise-solutions.ipynb) |\n| Ch 6: Training Reasoning Models with Reinforcement Learning | - [ch06_main.ipynb](ch06\u002F01_main-chapter-code\u002Fch06_main.ipynb)\u003Cbr\u002F>- [ch06_exercise-solutions.ipynb](ch06\u002F01_main-chapter-code\u002Fch06_exercise-solutions.ipynb) |\n| Ch 7: Improving GRPO for Reinforcement Learning             | - [ch07_main.ipynb](ch07\u002F01_main-chapter-code\u002Fch07_main.ipynb)\u003Cbr\u002F>- [ch07_exercise-solutions.ipynb](ch07\u002F01_main-chapter-code\u002Fch07_exercise-solutions.ipynb) |\n| Ch 8: Distilling Reasoning Models for Efficient Reasoning   | - [ch08_main.ipynb](ch08\u002F01_main-chapter-code\u002Fch08_main.ipynb)\u003Cbr\u002F>- [ch08_exercise-solutions.ipynb](ch08\u002F01_main-chapter-code\u002Fch08_exercise-solutions.ipynb) |\n| Appendix A: References and Further Reading                  | No code                                                      |\n| Appendix B: Exercise Solutions                              | Code and solutions are in each chapter's subfolder           |\n| Appendix C: Qwen3 LLM Source Code                           | - [chC_main.ipynb](chC\u002F01_main-chapter-code\u002FchC_main.ipynb)  |\n| Appendix D: Using larger LLMs                               | - [chD_main.ipynb](chD\u002FchD_main.ipynb)                       |\n| Appendix E: Batching and throughput-oriented execution      | - [chE_main.ipynb](chE\u002FchE_main.ipynb)                       |\n| Appendix F: Common Approaches to LLM Evaluation             | - [chF_main.ipynb](chF\u002F01_main-chapter-code\u002FchF_main.ipynb)  |\n| Appendix G: Building a Chat Interface                       | - [chG](chG)                                                 |\n\n\u003Cbr>\n&nbsp;\n\nThe mental model below summarizes the main techniques covered in this book.\n\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Frasbt_reasoning-from-scratch_readme_58f9baf57c12.webp\" width=\"650px\">\n\n\n\n\u003Cbr>\n\n\n\n&nbsp;\n## Companion Book\n\nPlease note that *Build A Reasoning Model (From Scratch)* is a standalone book focused on methods to improve LLM reasoning.\n\nIn this book, we work with a pre-trained open-source base LLM (Qwen3) on top of which we code apply reasoning methods from scratch. This includes inference-time scaling, reinforcement learning, and distillation.\n\nHowever, if you are interested in understanding how a conventional base LLM is implemented, you may like my previous book, [*Build a Large Language Model (From Scratch)*](https:\u002F\u002Famzn.to\u002F4fqvn0D).\n\n\u003Ca href=\"https:\u002F\u002Famzn.to\u002F4fqvn0D\">\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Frasbt_reasoning-from-scratch_readme_bf20af783348.jpg\" width=\"120px\">\u003C\u002Fa>\n\n- [Amazon link](https:\u002F\u002Famzn.to\u002F4fqvn0D)\n- [Manning link](http:\u002F\u002Fmng.bz\u002ForYv)\n- [GitHub repository](https:\u002F\u002Fgithub.com\u002Frasbt\u002FLLMs-from-scratch)\n\n\n\u003Cbr>\n&nbsp;\n\n## Hardware Requirements\n\nThe code in the main chapters of this book is designed to mostly run on consumer hardware within a reasonable timeframe and does not require specialized server hardware. This approach ensures that a wide audience can engage with the material. Additionally, the code automatically utilizes GPUs if they are available. That being said, chapters 2-4 will work well on CPUs and GPUs. For chapters 5 and 6, it is recommended to use a GPU if you want to replicate the results in the chapter.\n\n\n(Please see the [setup_tips](ch02\u002F02_setup-tips\u002Fpython-instructions.md) doc for additional recommendations.)\n\n&nbsp;\n## Exercises\n\nEach chapter of the book includes several exercises. The solutions are summarized in Appendix B, and the corresponding code notebooks are available in the main chapter folders of this repository (for example,  [`ch02\u002F01_main-chapter-code\u002Fch02_exercise-solutions.ipynb`](ch02\u002F01_main-chapter-code\u002Fch02_exercise-solutions.ipynb)).\n\n\n&nbsp;\n## Bonus Material\n\nSeveral folders contain optional materials as a bonus for interested readers:\n\n- **Chapter 2: Generating Text with a Pre-trained LLM**\n  - [Optional Python Setup and Cloud GPU Recommendations](ch02\u002F02_setup-tips)\n  - [Using a GPU-optimized version of the LLM](ch02\u002F03_optimized-LLM)\n  - [Using `torch.compile()` on Windows](ch02\u002F04_torch-compile-windows)\n  - [Run inference and chat with the model](ch02\u002F05_use_model)\n- **Chapter 3: Evaluating LLMs**\n  - [MATH-500 Verifier Scripts](ch03\u002F02_math500-verifier-scripts)\n  - [Advanced Parser](ch03\u002F03_advanced-parser) (hybrid LaTeX parser)\n- **Chapter 4: Improving Reasoning with Inference-Time Scaling**\n  - [Inference Scaling on MATH-500](ch04\u002F02_math500-inference-scaling-scripts) (CoT prompting, self-consistency)\n- **Chapter 5: Inference-Time Scaling Via Self-Refinement**\n  - [More Inference Scaling on MATH-500](ch05\u002F02_math500-more-inference-scaling-scripts) (Best-of-N, self-refinement)\n- **Chapter 6: Training Reasoning Models with Reinforcement Learning**\n  - [GRPO scripts](ch06\u002F02_rlvr_grpo_scripts_intro) with a batched mode\n- **Chapter 7: Improving GRPO for Reinforcement Learning**\n  - [Advanced GRPO scripts](ch07\u002F03_rlvr_grpo_scripts_advanced) (including DeepSeek-V3.2-, Olmo3-, and GDPO-style training)\n  - [Download training checkpoints](ch07\u002F04_download_trainining_checkpoints) (how to download and use the chapter 6 and 7 GRPO checkpoints)\n- **Chapter 8: Distilling Reasoning Models for Efficient Reasoning**\n  - [Generate distillation data](ch08\u002F02_generate_distillation_data) (teacher-output generation via Ollama or OpenRouter)\n  - [Train with distillation](ch08\u002F04_train_with_distillation) (including single-example and batched distillation scripts)\n  - [Download training checkpoints](ch08\u002F05_download_training_checkpoints) (how to download and use the chapter 8 distillation checkpoints)\n  - [Use Qwen3 with Hugging Face](ch08\u002F06_use_via_huggingface) (how to use the base model and chapter 6-8 checkpoints with `transformers`)\n- **Appendix F: Common Approaches to LLM Evaluation**\n  - [MMLU Evaluation Methods](chF\u002F02_mmlu)\n  - [LLM leaderboards](chF\u002F03_leaderboards)\n  - [LLM-as-a-judge](chF\u002F04_llm-judge)\n- **Appendix G: Building a Chat Interface**\n  - [Chat interface code](chG\u002F01_main-chapter-code)\n\n\n&nbsp;\n## Questions, Feedback, and Contributing to This Repository\n\nFor common problems, please see the [Troubleshooting Guide](.\u002Ftroubleshooting.md).\n\nI welcome all sorts of feedback, best shared via the [Manning Discussion Forum](https:\u002F\u002Flivebook.manning.com\u002Fforum?product=raschka2&page=1) or [GitHub Discussions](https:\u002F\u002Fgithub.com\u002Frasbt\u002Freasoning-from-scratch\u002Fdiscussions). Likewise, if you have any questions or just want to bounce ideas off others, please don't hesitate to post these in the forum as well.\n\nPlease note that since this repository contains the code corresponding to a print book, I currently cannot accept contributions that would extend the contents of the main chapter code, as it would introduce deviations from the physical book. Keeping it consistent helps ensure a smooth experience for everyone.\n\n&nbsp;\n## Citation\n\nIf you find this book or code useful for your research, please consider citing it.\n\nChicago-style citation:\n\n> Raschka, Sebastian. *Build A Reasoning Model (From Scratch)*. Manning, 2025. ISBN: 9781633434677.\n\nBibTeX entry:\n\n```\n@book{build-llms-from-scratch-book,\n  author       = {Sebastian Raschka},\n  title        = {Build A Reasoning Model (From Scratch)},\n  publisher    = {Manning},\n  year         = {2025},\n  isbn         = {9781633434677},\n  url          = {https:\u002F\u002Fmng.bz\u002FlZ5B},\n  github       = {https:\u002F\u002Fgithub.com\u002Frasbt\u002Freasoning-from-scratch}\n}\n```\n","# 构建一个推理模型（从零开始）\n\n本仓库包含开发 LLM 推理模型的代码，也是书籍 [*构建一个推理模型（从零开始）*](https:\u002F\u002Fmng.bz\u002FlZ5B) 的官方代码库。\n\n\n\u003Cbr>\n\u003Cbr>\n\n\u003Ca href=\"https:\u002F\u002Fmng.bz\u002FlZ5B\">\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Frasbt_reasoning-from-scratch_readme_3603d5aed1a1.webp\" width=\"250px\">\u003C\u002Fa>\n\n（彩色印刷。）\n\n\u003Cbr>\n\n在 [*构建一个推理模型（从零开始）*](https:\u002F\u002Fmng.bz\u002FlZ5B) 中，你将学习并理解推理型大语言模型（LLM）的工作原理。\n\n推理是近年来提升 LLM 性能最令人兴奋且最重要的进展之一，但如果你只是听过“推理”这个词并在理论上读到相关介绍，也最容易产生误解。因此，本书采取了动手实践的方式。我们将从一个预训练的基础 LLM 开始，然后一步步通过代码为其添加推理能力，让你能够清楚地看到其具体实现过程。\n\n本书中介绍的方法会引导你完成一个小型但功能完整的推理模型的开发，用于教学目的。它与 DeepSeek R1、GPT-5 Thinking 等大规模推理模型的构建方法相呼应。此外，本书还包含了加载现有预训练模型权重的代码。\n\n- 官方[源代码仓库链接](https:\u002F\u002Fgithub.com\u002Frasbt\u002Freasoning-from-scratch)\n- [Manning 出版社官网上的书籍链接](https:\u002F\u002Fmng.bz\u002FlZ5B)\n- 亚马逊美国网站上的图书页面链接（待定）\n- ISBN 9781633434677\n\n\n\n\u003Cbr>\n\u003Cbr>\n\n要下载本仓库的副本，请点击 [Download ZIP](https:\u002F\u002Fgithub.com\u002Frasbt\u002Freasoning-from-scratch\u002Farchive\u002Frefs\u002Fheads\u002Fmain.zip) 按钮，或在终端中执行以下命令：\n\n```bash\ngit clone --depth 1 https:\u002F\u002Fgithub.com\u002Frasbt\u002Freasoning-from-scratch.git\n```\n\n\u003Cbr>\n\n\n> **提示：**\n> 第 2 章提供了关于安装 Python、管理 Python 包以及搭建编程环境的更多建议。\n\n\u003Cbr>\n\u003Cbr>\n\n## 目录（持续更新中）\n\n[![Linux 代码测试](https:\u002F\u002Fgithub.com\u002Frasbt\u002Freasoning-from-scratch\u002Factions\u002Fworkflows\u002Ftests-linux.yml\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002Frasbt\u002Freasoning-from-scratch\u002Factions\u002Fworkflows\u002Ftests-linux.yml)\n[![macOS 代码测试](https:\u002F\u002Fgithub.com\u002Frasbt\u002Freasoning-from-scratch\u002Factions\u002Fworkflows\u002Ftests-macos.yml\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002Frasbt\u002Freasoning-from-scratch\u002Factions\u002Fworkflows\u002Ftests-macos.yml)\n[![Windows 代码测试](https:\u002F\u002Fgithub.com\u002Frasbt\u002Freasoning-from-scratch\u002Factions\u002Fworkflows\u002Ftests-windows.yml\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002Frasbt\u002Freasoning-from-scratch\u002Factions\u002Fworkflows\u002Ftests-windows.yml)\n\n- [故障排除指南](.\u002Ftroubleshooting.md)\n\n| 章节标题                                               | 主要代码                                                    |\n| ----------------------------------------------------------- | ------------------------------------------------------------ |\n| 第 1 章：理解推理模型                        | 无代码                                                      |\n| 第 2 章：使用预训练 LLM 生成文本                | - [ch02_main.ipynb](ch02\u002F01_main-chapter-code\u002Fch02_main.ipynb)\u003Cbr\u002F>- [ch02_exercise-solutions.ipynb](ch02\u002F01_main-chapter-code\u002Fch02_exercise-solutions.ipynb) |\n| 第 3 章：评估推理模型                           | - [ch03_main.ipynb](ch03\u002F01_main-chapter-code\u002Fch03_main.ipynb)\u003Cbr\u002F>- [ch03_exercise-solutions.ipynb](ch03\u002F01_main-chapter-code\u002Fch03_exercise-solutions.ipynb) |\n| 第 4 章：通过推理时缩放提升推理能力       | - [ch04_main.ipynb](ch04\u002F01_main-chapter-code\u002Fch04_main.ipynb)\u003Cbr\u002F>- [ch04_exercise-solutions.ipynb](ch04\u002F01_main-chapter-code\u002Fch04_exercise-solutions.ipynb) |\n| 第 5 章：通过自我精炼进行推理时缩放            | - [ch05_main.ipynb](ch05\u002F01_main-chapter-code\u002Fch05_main.ipynb)\u003Cbr\u002F>- [ch05_exercise-solutions.ipynb](ch05\u002F01_main-chapter-code\u002Fch05_exercise-solutions.ipynb) |\n| 第 6 章：用强化学习训练推理模型             | - [ch06_main.ipynb](ch06\u002F01_main-chapter-code\u002Fch06_main.ipynb)\u003Cbr\u002F>- [ch06_exercise-solutions.ipynb](ch06\u002F01_main-chapter-code\u002Fch06_exercise-solutions.ipynb) |\n| 第 7 章：改进强化学习中的 GRPO              | - [ch07_main.ipynb](ch07\u002F01_main-chapter-code\u002Fch07_main.ipynb)\u003Cbr\u002F>- [ch07_exercise-solutions.ipynb](ch07\u002F01_main-chapter-code\u002Fch07_exercise-solutions.ipynb) |\n| 第 8 章：蒸馏推理模型以实现高效推理   | - [ch08_main.ipynb](ch08\u002F01_main-chapter-code\u002Fch08_main.ipynb)\u003Cbr\u002F>- [ch08_exercise-solutions.ipynb](ch08\u002F01_main-chapter-code\u002Fch08_exercise-solutions.ipynb) |\n| 附录 A：参考文献及延伸阅读                  | 无代码                                                      |\n| 附录 B：习题解答                              | 每章子文件夹中均包含代码和解答           |\n| 附录 C：Qwen3 LLM 源代码                           | - [chC_main.ipynb](chC\u002F01_main-chapter-code\u002FchC_main.ipynb)  |\n| 附录 D：使用更大的 LLM                               | - [chD_main.ipynb](chD\u002FchD_main.ipynb)                       |\n| 附录 E：批处理与吞吐量导向的执行      | - [chE_main.ipynb](chE\u002FchE_main.ipynb)                       |\n| 附录 F：LLM 评估的常见方法             | - [chF_main.ipynb](chF\u002F01_main-chapter-code\u002FchF_main.ipynb)  |\n| 附录 G：构建聊天界面                       | - [chG](chG)                                                 |\n\n\u003Cbr>\n&nbsp;\n\n下图总结了本书涵盖的主要技术。\n\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Frasbt_reasoning-from-scratch_readme_58f9baf57c12.webp\" width=\"650px\">\n\n\n\n\u003Cbr>\n\n\n\n&nbsp;\n## 配套书籍\n\n请注意，《构建一个推理模型（从零开始）》是一本独立的书籍，专注于提升 LLM 推理能力的方法。\n\n在本书中，我们基于一个预训练的开源基础 LLM（Qwen3），从零开始编写代码来应用各种推理方法，包括推理时缩放、强化学习和模型蒸馏等。\n\n然而，如果你对传统基础 LLM 的实现方式感兴趣，可能会喜欢我的另一本书《构建一个大语言模型（从零开始）》（[*Build a Large Language Model (From Scratch)*](https:\u002F\u002Famzn.to\u002F4fqvn0D)）。\n\n\u003Ca href=\"https:\u002F\u002Famzn.to\u002F4fqvn0D\">\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Frasbt_reasoning-from-scratch_readme_bf20af783348.jpg\" width=\"120px\">\u003C\u002Fa>\n\n- [亚马逊链接](https:\u002F\u002Famzn.to\u002F4fqvn0D)\n- [Manning 出版社链接](http:\u002F\u002Fmng.bz\u002ForYv)\n- [GitHub 仓库](https:\u002F\u002Fgithub.com\u002Frasbt\u002FLLMs-from-scratch)\n\n\n\u003Cbr>\n&nbsp;\n\n## 硬件要求\n\n本书主要章节中的代码设计为在消费级硬件上以合理的时间范围内运行为主，无需专门的服务器硬件。这种做法确保了广泛的读者群体能够参与学习和实践。此外，如果系统中存在 GPU，代码会自动利用 GPU 进行加速。不过，第 2 至 4 章在 CPU 和 GPU 上均可良好运行。而对于第 5 和第 6 章，若希望复现书中结果，建议使用 GPU。\n\n\n（更多建议请参阅 [setup_tips](ch02\u002F02_setup-tips\u002Fpython-instructions.md) 文档。）\n\n&nbsp;\n## 练习题\n\n本书每章都包含若干练习题。答案汇总于附录 B，相应的代码笔记本则位于本仓库各主章节文件夹中（例如，[`ch02\u002F01_main-chapter-code\u002Fch02_exercise-solutions.ipynb`](ch02\u002F01_main-chapter-code\u002Fch02_exercise-solutions.ipynb)）。\n\n\n&nbsp;\n## 附加资料\n\n多个文件夹中包含了供感兴趣读者参考的可选材料：\n\n- **第 2 章：使用预训练 LLM 生成文本**\n  - [可选 Python 环境配置及云端 GPU 推荐](ch02\u002F02_setup-tips)\n  - [使用 GPU 优化版 LLM](ch02\u002F03_optimized-LLM)\n  - [在 Windows 上使用 `torch.compile()`](ch02\u002F04_torch-compile-windows)\n  - [运行推理并与模型对话](ch02\u002F05_use_model)\n- **第 3 章：评估 LLM**\n  - [MATH-500 验证脚本](ch03\u002F02_math500-verifier-scripts)\n  - [高级解析器](ch03\u002F03_advanced-parser)（混合式 LaTeX 解析器）\n- **第 4 章：通过推理时缩放提升推理能力**\n  - [MATH-500 上的推理缩放](ch04\u002F02_math500-inference-scaling-scripts)（思维链提示、自洽性）\n- **第 5 章：基于自我精炼的推理时缩放**\n  - [MATH-500 上的更多推理缩放](ch05\u002F02_math500-more-inference-scaling-scripts)（Best-of-N、自我精炼）\n- **第 6 章：使用强化学习训练推理模型**\n  - [GRPO 脚本](ch06\u002F02_rlvr_grpo_scripts_intro)，支持批处理模式\n- **第 7 章：改进 GRPO 强化学习方法**\n  - [高级 GRPO 脚本](ch07\u002F03_rlvr_grpo_scripts_advanced)（包括 DeepSeek-V3.2、Olmo3 及 GDPO 风格的训练）\n  - [下载训练检查点](ch07\u002F04_download_trainining_checkpoints)（如何下载并使用第 6、7 章的 GRPO 检查点）\n- **第 8 章：蒸馏推理模型以实现高效推理**\n  - [生成蒸馏数据](ch08\u002F02_generate_distillation_data)（通过 Ollama 或 OpenRouter 生成教师输出）\n  - [使用蒸馏进行训练](ch08\u002F04_train_with_distillation)（包括单样本和批处理蒸馏脚本）\n  - [下载训练检查点](ch08\u002F05_download_training_checkpoints)（如何下载并使用第 8 章的蒸馏检查点）\n  - [在 Hugging Face 中使用 Qwen3](ch08\u002F06_use_via_huggingface)（如何将基础模型与第 6–8 章的检查点结合使用 `transformers` 库）\n- **附录 F：LLM 评估的常用方法**\n  - [MMLU 评估方法](chF\u002F02_mmlu)\n  - [LLM 排行榜](chF\u002F03_leaderboards)\n  - [LLM 作为评判者](chF\u002F04_llm-judge)\n- **附录 G：构建聊天界面**\n  - [聊天界面代码](chG\u002F01_main-chapter-code)\n\n\n&nbsp;\n## 问题、反馈及对本仓库的贡献\n\n如遇常见问题，请参阅 [故障排除指南](.\u002Ftroubleshooting.md)。\n\n我欢迎各种形式的反馈，最佳方式是通过 [Manning 讨论论坛](https:\u002F\u002Flivebook.manning.com\u002Fforum?product=raschka2&page=1) 或 [GitHub Discussions](https:\u002F\u002Fgithub.com\u002Frasbt\u002Freasoning-from-scratch\u002Fdiscussions) 提交。同样地，如果您有任何疑问或只是想与其他读者交流想法，也请随时在论坛中发帖。\n\n请注意，由于本仓库包含与纸质书对应的代码，目前我无法接受任何会扩展主章节代码内容的贡献，因为这会导致与实体书的内容产生偏差。保持一致性有助于为所有用户提供顺畅的学习体验。\n\n&nbsp;\n## 引用\n\n如果您在研究中发现本书或其中的代码有所帮助，请考虑引用它。\n\n芝加哥格式引用：\n\n> Raschka, Sebastian. *从零开始构建推理模型*. Manning 出版社，2025 年。ISBN：9781633434677。\n\nBibTeX 条目：\n\n```\n@book{build-llms-from-scratch-book,\n  author       = {Sebastian Raschka},\n  title        = {从零开始构建推理模型},\n  publisher    = {Manning},\n  year         = {2025},\n  isbn         = {9781633434677},\n  url          = {https:\u002F\u002Fmng.bz\u002FlZ5B},\n  github       = {https:\u002F\u002Fgithub.com\u002Frasbt\u002Freasoning-from-scratch}\n}\n```","# reasoning-from-scratch 快速上手指南\n\n本指南基于 Sebastian Raschka 的开源项目 `reasoning-from-scratch`，旨在帮助开发者从零开始构建和理解大语言模型（LLM）的推理能力。该项目配套书籍《Build a Reasoning Model (From Scratch)》，通过代码实战演示如何在一个预训练基座模型（如 Qwen3）上添加推理、强化学习及蒸馏能力。\n\n## 环境准备\n\n### 系统要求\n- **操作系统**：Linux, macOS, 或 Windows。\n- **硬件建议**：\n  - **第 2-4 章**（基础文本生成、评估、推理缩放）：可在 CPU 或普通 GPU 上运行。\n  - **第 5-6 章**（自优化、强化学习训练）：**强烈建议使用 GPU** 以在合理时间内复现结果。\n  - 代码会自动检测并利用可用的 GPU 资源。\n- **Python 版本**：建议 Python 3.8+（具体版本管理参考书中第 2 章提示）。\n\n### 前置依赖\n确保已安装 Git 和 Python 包管理工具（pip 或 conda）。本项目主要依赖 PyTorch 及相关深度学习库。\n\n## 安装步骤\n\n### 1. 克隆仓库\n使用以下命令下载项目代码：\n\n```bash\ngit clone --depth 1 https:\u002F\u002Fgithub.com\u002Frasbt\u002Freasoning-from-scratch.git\n```\n\n或者点击仓库页面的 [Download ZIP](https:\u002F\u002Fgithub.com\u002Frasbt\u002Freasoning-from-scratch\u002Farchive\u002Frefs\u002Fheads\u002Fmain.zip) 按钮手动下载并解压。\n\n### 2. 进入项目目录\n```bash\ncd reasoning-from-scratch\n```\n\n### 3. 安装依赖\n虽然 README 未直接列出 `requirements.txt`，但根据项目结构（Jupyter Notebooks），通常需要在运行具体章节代码前安装相关库。建议参考 `ch02` 中的设置指南或直接在 Notebook 中运行安装单元格。\n\n若需手动安装基础环境，可尝试：\n```bash\npip install torch torchvision torchaudio --index-url https:\u002F\u002Fdownload.pytorch.org\u002Fwhl\u002Fcu118\npip install transformers accelerate datasets matplotlib jupyterlab\n```\n*(注：具体依赖请以各章节 Notebook 开头的安装指令为准)*\n\n> **提示**：国内用户若下载 PyTorch 或 HuggingFace 模型较慢，可配置国内镜像源：\n> ```bash\n> pip install -r requirements.txt -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple\n> ```\n> 并在代码中设置 HF_ENDPOINT:\n> ```bash\n> export HF_ENDPOINT=https:\u002F\u002Fhf-mirror.com\n> ```\n\n## 基本使用\n\n本项目主要通过 Jupyter Notebook 进行教学和实践。每个章节对应一个主要的代码文件。\n\n### 1. 启动 Jupyter Lab\n在项目根目录下运行：\n```bash\njupyter lab\n```\n\n### 2. 运行示例：生成文本 (第 2 章)\n这是最基础的入门示例，展示如何使用预训练 LLM 生成文本。\n\n1. 在浏览器中打开 `ch02\u002F01_main-chapter-code\u002Fch02_main.ipynb`。\n2. 依次执行单元格。\n3. 核心代码逻辑如下（简化版示意）：\n\n```python\n# 导入必要的库\nimport torch\nfrom transformers import AutoModelForCausalLM, AutoTokenizer\n\n# 加载预训练模型 (例如 Qwen3 或其他指定基座)\nmodel_name = \"Qwen\u002FQwen3-0.6B\" # 示例模型名称，具体以 notebook 为准\ntokenizer = AutoTokenizer.from_pretrained(model_name)\nmodel = AutoModelForCausalLM.from_pretrained(model_name)\n\n# 准备输入提示\nprompt = \"Please reason step by step to solve this math problem: 2 + 2 = ?\"\ninputs = tokenizer(prompt, return_tensors=\"pt\")\n\n# 生成推理过程\nwith torch.no_grad():\n    outputs = model.generate(\n        inputs.input_ids, \n        max_new_tokens=100, \n        do_sample=True, \n        temperature=0.7\n    )\n\n# 解码并打印结果\nresult = tokenizer.decode(outputs[0], skip_special_tokens=True)\nprint(result)\n```\n\n### 3. 进阶实践\n完成基础章节后，可按顺序探索以下核心功能：\n- **推理评估** (`ch03_main.ipynb`)：学习如何量化模型的推理能力。\n- **推理时缩放** (`ch04_main.ipynb`)：实现思维链（CoT）和自我一致性策略。\n- **强化学习训练** (`ch06_main.ipynb` & `ch07_main.ipynb`)：使用 GRPO 算法微调模型以提升推理性能。\n- **模型蒸馏** (`ch08_main.ipynb`)：将大模型的推理能力蒸馏到小模型中。\n\n所有练习的参考答案位于各章节文件夹下的 `*_exercise-solutions.ipynb` 文件中。","某 AI 教育团队计划开发一门关于“大模型推理机制”的实战课程，需要向学员清晰展示如何从零构建具备逻辑推导能力的模型。\n\n### 没有 reasoning-from-scratch 时\n- **理论脱离实践**：学员只能阅读抽象的论文公式，无法理解“思维链”在代码层面是如何具体落地和运作的。\n- **复现门槛极高**：从头编写推理模型涉及复杂的 PyTorch 架构设计，讲师需耗费数周清洗和调试基础代码，难以保证教学进度。\n- **黑盒困惑**：面对 DeepSeek R1 等成熟模型，学员仅能调用 API，完全无法洞察其内部“自我反思”与“推理缩放”的具体实现细节。\n- **缺乏对比基准**：没有标准的基线模型和评估脚本，难以量化展示添加推理模块前后模型性能的直观差异。\n\n### 使用 reasoning-from-scratch 后\n- **代码级透明教学**：直接利用书中提供的分步代码，学员可逐行运行并观察预训练基座模型如何一步步被赋予逻辑推理能力。\n- **快速搭建环境**：复用仓库中经过多平台（Linux\u002FmacOS\u002FWindows）验证的完整工程代码，将课程准备时间从数周缩短至几天。\n- **深度机制拆解**：通过第 4、5 章的实战案例，直观演示“推理时缩放”和“自我修正”技术如何显著提升模型解决数学难题的准确率。\n- **标准化评估体系**：使用内置的评估脚本，即时生成数据图表，清晰对比普通生成模式与推理模式在复杂任务上的表现差距。\n\nreasoning-from-scratch 将高深的推理模型原理转化为可执行、可修改的代码实验，让开发者真正看透大模型“思考”的本质。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Frasbt_reasoning-from-scratch_26d1bceb.png","rasbt","Sebastian Raschka","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Frasbt_4eb76c31.jpg","AI Research Engineer working on LLMs.",null,"https:\u002F\u002Fsebastianraschka.com","https:\u002F\u002Fgithub.com\u002Frasbt",[82,86,90],{"name":83,"color":84,"percentage":85},"Jupyter Notebook","#DA5B0B",68.4,{"name":87,"color":88,"percentage":89},"Python","#3572A5",31.5,{"name":91,"color":92,"percentage":93},"Shell","#89e051",0.1,4136,587,"2026-04-18T11:56:30","Apache-2.0","Linux, macOS, Windows","非必需。第 2-4 章可在 CPU 或 GPU 上运行；第 5-6 章复现结果推荐使用 GPU。具体型号、显存大小及 CUDA 版本未说明。","未说明",{"notes":102,"python":103,"dependencies":104},"代码旨在消费级硬件上运行，无需专用服务器。若有 GPU 会自动利用。详细的环境设置（Python 安装、包管理）请参考第 2 章或仓库内的 setup_tips 文档。基础模型使用 Qwen3。","未说明 (README 指引参考 ch02 中的安装指南)",[105,106],"torch","transformers",[15,35,14,13],[109,110,111,112,113,114,115,116,117,118,119],"ai","artificial-intelligence","deep-learning","deep-neural-networks","large-language-models","llms","machine-learning","python","pytorch","reasoning","reinforcement-learning","2026-03-27T02:49:30.150509","2026-04-19T03:05:04.553503",[123,128,133,138],{"id":124,"question_zh":125,"answer_zh":126,"source_url":127},41369,"为什么在 CPU 上运行的代码结果与书中或 Notebook 中显示的数值不完全一致？","在不同系统（CPU、MPS、CUDA）和设备上，由于浮点数精度差异，极接近零的数值会有细微差别，这是需要接受的正常现象。为了确保代码和图表在特定平台上的一致性，维护者已更新代码硬编码了具体数值，并建议在文本中说明数值已被截断。若需提高显示精度，可使用 `torch.set_printoptions(precision=5)` 或在图表中保留更多小数位。","https:\u002F\u002Fgithub.com\u002Frasbt\u002Freasoning-from-scratch\u002Fissues\u002F152",{"id":129,"question_zh":130,"answer_zh":131,"source_url":132},41370,"无法从镜像下载模型文件（如 qwen3-0.6B-base.pth），可能是 VPN 导致的吗？如何解决？","下载失败可能与网络环境或 VPN 有关。维护者已将下载逻辑切换为使用 `requests` 库以修复此类问题。解决方法是：删除已下载的文件，安装最新版本的包（`pip install reasoning-from-scratch==0.1.7` 或通过源码 `pip install . -e`），然后重新运行第 3 章的代码。如果仍然失败，可以暂时手动指定本地缓存路径（hardcode the hf path）来加载模型。","https:\u002F\u002Fgithub.com\u002Frasbt\u002Freasoning-from-scratch\u002Fissues\u002F53",{"id":134,"question_zh":135,"answer_zh":136,"source_url":137},41371,"当前的 LaTeX 答案解析器有哪些局限性？是否有更好的替代方案？","默认解析器在处理某些边缘情况时可能失败或产生错误解析（例如将下标 `52_8` 误读为 `528`，或将千位分隔符解析为元组）。社区贡献了一个“混合解析器”（hybrid parser），它能更好地处理区间、并集、方程、矩阵及隐式乘法等情况。虽然该解析器在测试集中仅提升了不到 1% 的解析成功率且增加了依赖，但可作为补充材料参考。用户可以通过引入 `latex_normalizer_hybrid.py` 并在代码中调用 `normalize_text_hybrid` 函数来尝试使用。","https:\u002F\u002Fgithub.com\u002Frasbt\u002Freasoning-from-scratch\u002Fissues\u002F133",{"id":139,"question_zh":140,"answer_zh":141,"source_url":142},41372,"如何在非 NVIDIA GPU（如 Intel XPU）上运行代码并获取性能数据？","可以在 XPU 设备上运行推理模型，但具体性能数据可能因硬件和环境而异。如果有具体的性能统计数据（如温度、耗时等），可以分享给维护者以便更新文档。目前如果没有完整数据，可以在相关表格中暂时使用占位符（TBA），待后续在 Linux 环境下完成测试并确认性能差异后再进行更新。","https:\u002F\u002Fgithub.com\u002Frasbt\u002Freasoning-from-scratch\u002Fissues\u002F72",[]]