知识卡片
固定数量与累计质量不同
top-k 保留排名前 k 项,候选数固定;top-p 随分布形状变化而调整候选数。两者都只改变选择范围,不保证被保留的词具有事实正确性;选择方法应服务任务的多样性与连贯性需求。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
- · 推理时计算扩展
原书出处 · 1 处
- · 查看原书依据
is removed. The remaining k tokens are then renormalized and sampled from. In short, top-k keeps a fixed number of the most likely tokens, whereas top-p keeps a variable number of tokens depending on their cumulative mass. Top-k is simpler to implement, and I covered it in my Build a Large Language Model (From Scratch) book. However, top-p sampling has become more popular recently. Exercise
参考来源
- 位置:《Build a Reasoning Model (From Scratch)》第04章《推理时计算扩展》(来源项目:a19c7933-4eda-4176-aebd-30fe7e1ad292;源文件:extracted/Build a Reasoning Model (From Scratch)/_epub-src/OEBPS/Text/chapter-4.html)
- 结论依据:摘录中关于固定数量与累计质量不同的定义、比较或条件支撑卡片;原书表述不严谨的范围已在覆盖记录逐项限定,不把案例结果外推为普遍结论。
- 原始内容:is removed. The remaining k tokens are then renormalized and sampled from. In short, top-k keeps a fixed number of the most likely tokens, whereas top-p keeps a variable number of tokens depending on their cumulative mass. Top-k is simpler to implement, and I covered it in my Build a Large Language Model (From Scratch) book. However, top-p sampling has become more popular recently. Exercise