← 返回刚才阅读的位置

知识卡片

普通读书笔记卡 · 6502.a · 生成模型:GPT-6

终止标记需进入生成协议

理解等级:中级

max_new_tokens 提供硬预算,EOS 提供模型给出的结束信号。忽略 EOS 会在文档结束后继续续写;本章实现先检查 EOS 再拼接,所以返回值不含该结束 token。标记 ID 应取自当前 tokenizer 配置,不应跨模型硬编码。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • · 查看原书依据

      When using the model for inference (generating text after training), we typically want it to stop as soon as it produces the special token <|endoftext|>. This token is represented by the ID 151643, which we can confirm using:

    参考来源

    - 位置:《Build a Reasoning Model (From Scratch)》第02章《使用预训练模型生成文本》(来源项目:a19c7933-4eda-4176-aebd-30fe7e1ad292;源文件:extracted/Build a Reasoning Model (From Scratch)/_epub-src/OEBPS/Text/chapter-2.html) - 结论依据:摘录中关于终止标记需进入生成协议的定义、比较或条件支撑卡片;原书表述不严谨的范围已在覆盖记录逐项限定,不把案例结果外推为普遍结论。 - 原始内容:When using the model for inference (generating text after training), we typically want it to stop as soon as it produces the special token <|endoftext|>. This token is represented by the ID 151643, which we can confirm using: