知识卡片

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

自回归概率须错位对齐

理解等级:高级

GPT-2位置t的输出预测下一个token x_(t+1)。计算输入序列似然时应将logits去末位、标签去首位再匹配;原例把同位置输入token与输出对齐,算出的不是所声称的序列对数概率。首token还需声明起始上下文。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • · 查看原书依据

      token_log_prob = log_probs[0][idx][token].item() #4 print(f"Token: {tokenizer.decode(token)}" + #4 " | Log Probability: {token_log_prob}") #4 #1 Initialize the GPT-2 model and set to evaluation mode. #2 Tokenize and encode the phrase, including the end-of-sequence token. #3 Given the phrase, the model produces logits for every element in the vocabulary. #4 For each position in the sequence, get the log probability corresponding to the token that was

    参考来源

    - 位置:《Causal AI》第13章《因果与大语言模型》(来源项目:a19c7933-4eda-4176-aebd-30fe7e1ad292;源文件:extracted/Causal AI/_epub-src/OEBPS/Text/chapter-13.xhtml) - 结论依据:摘录中关于自回归概率须错位对齐的定义、比较或条件支撑卡片;原书表述不严谨的范围已在覆盖记录逐项限定,不把案例结果外推为普遍结论。 - 原始内容:token_log_prob = log_probs[0][idx][token].item() #4 print(f"Token: {tokenizer.decode(token)}" + #4 " | Log Probability: {token_log_prob}") #4 #1 Initialize the GPT-2 model and set to evaluation mode. #2 Tokenize and encode the phrase, including the end-of-sequence token. #3 Given the phrase, the model produces logits for every element in the vocabulary. #4 For each position in the sequence, get the log probability corresponding to the token that was