知识卡片
下一词分布来自最后可见位置
形状为批次×位置×词表的输出,每个位置负责其后的预测。本例用output.logits[0,-1,:]取得一个样本的下一token分数,再归一或排序;批内有padding时还需确认所取位置,不能任意取最后一格。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- · 查看原书依据
Incidentally, 50,257 is the size of GPT-2’s vocabulary—that is, the total number of tokens this model uses. (To understand why its size is this particular number, you can explore the BPE tokenization algorithm GPT-2 uses in Hugging Face’s tutorial on tokenization).39 So the raw output of our model is basically a probability for every token in the vocabulary. Remember how, earlier, we said that the
参考来源
- 位置:《Natural Language Processing in Action, Second Edition》第10章《真实世界中的大语言模型》(来源项目:a19c7933-4eda-4176-aebd-30fe7e1ad292;源文件:extracted/Natural Language Processing in Action, Second Edition/_epub-src/OEBPS/Text/chapter-10.html)
- 结论依据:摘录中关于下一词分布来自最后可见位置的定义、比较或条件支撑卡片;原书表述不严谨的范围已在覆盖记录逐项限定,不把案例结果外推为普遍结论。
- 原始内容:Incidentally, 50,257 is the size of GPT-2’s vocabulary—that is, the total number of tokens this model uses. (To understand why its size is this particular number, you can explore the BPE tokenization algorithm GPT-2 uses in Hugging Face’s tutorial on tokenization).39 So the raw output of our model is basically a probability for every token in the vocabulary. Remember how, earlier, we said that the