← 返回刚才阅读的位置

知识卡片

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

嵌套括号需要深度解析

理解等级:中级

提取 boxed 内容不能停在遇到的第一个右括号,因为分数等表达式自身也带括号。本章用深度计数找到与最外层开括号匹配的位置;不平衡时返回缺失。它仍是受限语法解析器,未覆盖完整 LaTeX 的转义和注释规则。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • · 查看原书依据

      The get_last_box helper utility function in listing 3.4 extracts out the content of the last \boxed{...} expression from a model's output. More specifically, it scans for the final \boxed, skips over whitespace, checks for braces, and handles any nesting so that we capture the intended answer string.

    参考来源

    - 位置:《Build a Reasoning Model (From Scratch)》第03章《评估推理模型》(来源项目:a19c7933-4eda-4176-aebd-30fe7e1ad292;源文件:extracted/Build a Reasoning Model (From Scratch)/_epub-src/OEBPS/Text/chapter-3.html) - 结论依据:摘录中关于嵌套括号需要深度解析的定义、比较或条件支撑卡片;原书表述不严谨的范围已在覆盖记录逐项限定,不把案例结果外推为普遍结论。 - 原始内容:The get_last_box helper utility function in listing 3.4 extracts out the content of the last \boxed{...} expression from a model's output. More specifically, it scans for the final \boxed, skips over whitespace, checks for braces, and handles any nesting so that we capture the intended answer string.