Пропустить навигацию
Reasoning from scratch, round number 5! This time, talking about log-probability scoring (also a…
0:00 / 1:08:39

Reasoning from scratch, round number 5! This time, talking about log-probability scoring (also a…

Sebastian Raschka

@rasbt542 тыс. подписчиков

Открыть в X
1 030 отметок «Нравится»СкачатьОригинальный пост

61 154 просмотра

Reasoning from scratch, round number 5! This time, talking about log-probability scoring (also a great fundamental concept for loss functions like cross-entropy in pre-training and distillation) and self-refinement. 00:00 Introduction and inference-time scaling recap 05:02 Loading the pretrained LLM 08:00 Comparing and scoring model answers 10:18 Building a rule-based scorer 17:53 Token probabilities and sequence likelihood 26:47 Computing token probabilities in PyTorch 30:12 Token indexing and shifted targets 37:27 Log probabilities and numerical stability 45:57 Scoring answers with average log probabilities 56:24 How self-refinement works 59:07 Generating critiques and revised answers 1:01:00 Implementing the self-refinement loop 1:05:57 MATH-500 evaluation results 1:07:35 Takeaways and next steps

27 комментариев

Комментарии из оригинального поста в X (Twitter)

  • Фото профиля Sebastian Raschka

    @rasbt

    And a link to the video on YouTube:

    26 отметок «Нравится»

  • Фото профиля Parul Pandey

    @pandeyparul

    Reading this chapter from your book as I type. Its a joy to read it. Also the visuals make it really easy to grasp the topic.

    9 отметок «Нравится»

  • Фото профиля Sebastian Raschka

    @rasbt

    Thanks a lot! Put lots of work went into it, and it really feels good to hear this :)

    3 отметки «Нравится»

  • Фото профиля Giacomo Masseroni

    @giacomomasseron

    log probs for numerical stability instead of raw probabilities, that part alone saves people from nan hell

    4 отметки «Нравится»

  • Фото профиля Sebastian Raschka

    @rasbt

    Yup. Also covered that explicitly there :)

    2 отметки «Нравится»

  • Фото профиля Victor Akinode

    @VictorAkinode

    The timestamps make this much easier to learn from, Sebastian. For anyone following along, changing one scoring choice and comparing the answers could be a lovely little experiment. It gives those probability calculations something concrete to connect to.

    2 отметки «Нравится»

  • Фото профиля Sebastian Raschka

    @rasbt

    Thanks!

    1 отметка «Нравится»

  • Фото профиля Fireply.ai

    @fireplyai

    timestamps going past an hour and it's still just round 5, this book is going to be dense

    2 отметки «Нравится»

  • Фото профиля Sebastian Raschka

    @rasbt

    some would say "you get your money's worth" :P

    1 отметка «Нравится»

  • Фото профиля lewington

    @lewingtonpitsos

    log probabilities are quite useful to understand cuz getting a model to generate an answer and figuring out if its answer is actually better are two very different things.

    1 отметка «Нравится»

  • Фото профиля Daniel Priscu

    @daniel_priscu

    log-prob scoring pairs well with self-refinement, since the model can rank its own revisions instead of guessing which one improved

    1 отметка «Нравится»

  • Фото профиля The Lunar Misfit

    @ExiledonMoon

    Self-refinement is a much kinder name than 'read that back to yourself'.

    1 отметка «Нравится»

  • Фото профиля David Arnal

    @davidarngar

    The average log-probability scoring setup is a nice detail; it also makes the numerical-stability discussion feel directly relevant rather than incidental.

    1 отметка «Нравится»

  • Фото профиля Siddharth Jain

    @Quaxguy

    Computing token probabilities in PyTorch was my fav part, very well explained.

  • Фото профиля Bk1man|AI 开源雷达

    @Bk1man

    想快速验证自精炼到底贡献了多少,可以先做一个 20 分钟测试:① 准备 50 道有标准答案的题先跑一遍,记下基线准确率 ② 打开自精炼再跑一遍,统计修正率和误修率 ③ 把自精炼关掉、只保留 logprob 阈值过滤跑第三遍,看阈值这一步单独贡献了多少。这样就知道收益是来自精炼本身,还是来自筛掉低置信样本。

  • Фото профиля Jatin Garg

    @jatingargiitk

    Log-probability scoring makes sense for evaluating model confidence, but how do you handle cases where the model is confidently wrong? High log-prob on an incorrect answer seems like it would still score well.

  • Фото профиля Sebastian Raschka

    @rasbt

    Yes, this is confidence, not correctness.I am talking through that issue in this video. You could technically use a second stronger model though that checks the answer. Kind of like speculative decoding works (the more expensive model accepts/rejects cheaply generated suggestions). But yeah, either way, the other motivation to introduce log-probability scoring is that it is essential for the upcoming training chapters (RL and distillations).

    1 отметка «Нравится»

  • Фото профиля VisiveAI

    @VisiveAI

    Log-prob scoring is the boring fundamental that keeps evals honest — glad R5 drills it from scratch. Stack ↓ #LLM #ML

  • Фото профиля Saksham Jain

    @sakshjn

    does log-prob self-scoring hold up when the model's miscalibrated? wondered if self-refinement just reinforces the confident wrong ones

  • Фото профиля Oleks

    @oleksantoniv

    saving the log-prob section for tomorrow morning