Sebastian Raschka
AI research engineer working on large language models. He writes the Ahead of AI newsletter and is the author of Build a Large Language Model (From Scratch).
Sebastian Raschka did not write this page. ppll compiled it from their own words, each linked to the source. Is this you? · Report a mistake
Latest Site
What they believe
-
Explicit positional methods are useful or essential because they provide attention with a direct signal about positions.
Nonetheless, GPT-2 and most newer LLMs include explicit positional information because it gives attention a direct signal about positions. That’s because even though the causal mask determines which tokens are accessible and provides implicit order information, it doesn’t distinguish a separation of one position from a separation of ten, for example. So, explicit positional methods are still useful (or even essential), since they supply that information.
magazine.sebastianraschka.comSaid 15 Nov 2026This on korrents
-
Reasoning models are an upgrade from conventional LLMs achieved by adding post-training via reinforcement learning and optionally inference scaling.
A reasoning model is essentially an upgrade from a conventional LLM, that is, adding more post-training via reinforcement learning with verifiable rewards (and optionally inference scaling techniques) to make it more capable of solving more challenging problems.
magazine.sebastianraschka.comSaid 24 Oct 2026This on korrents
The bold line is korrents’ wording; the quote is theirs. These 2: what they wrote before what they said aloud, one per source, newest first.
Feed
As its own page →Hiding
3 December
2 December
1 December
22 November
21 November
17 November
16 November
15 November
-
Their words
Nonetheless, GPT-2 and most newer LLMs include explicit positional information because it gives attention a direct signal about positions. That’s because even though the causal mask determines which tokens are accessible and provides implicit order information, it doesn’t distinguish a separation of one position from a separation of ten, for example. So, explicit positional methods are still useful (or even essential), since they supply that information.
14 November
13 November
12 November
11 November
10 November
3 November
25 October
24 October
-
LLMsscaling lawsreinforcement learning
Their words
A reasoning model is essentially an upgrade from a conventional LLM, that is, adding more post-training via reinforcement learning with verifiable rewards (and optionally inference scaling techniques) to make it more capable of solving more challenging problems.
17 October
From one piece Build A Reasoning Model From Scratch 8: Distillation 13 beliefs · youtube.com
-
Their words
And then in my opinion, it's always a good idea. I, it's never a bad idea to check your data because data is often the most precious thing. Like if something is wrong in the data, you will also get really poor training results.
-
korrents.com
Newer reasoning models produce 'wait'-style self-corrections less often than early ones.Their words
And so you see, this is also one of the earlier reasoning models, like newer models don't usually do that as often anymore, but it's kind of funny to see the model arguing through this
-
Their words
So you can get a lot of performance from distillation by trying to mimic the teacher. But then, of course, there's a more risk of overfitting as well. So it's not like a completely free lunch there.
+ 10 more
-
Their words
And I would say the best distilled models are still not as good as the state-of-the-art reasoning models, but it's maybe 80, 90% there.
-
Their words
They complain while people steal our reasoning traces and do distillation, because distillation will eventually get you there quicker if you already have the answers. It's cheaper than reinforcement learning.
-
Their words
So distillation is actually simpler than reinforcement learning. The reason why we did this that way is reinforcement learning really is what is more interesting. That is like the state of the art. And now we are doing an approximation that is more efficient.
-
korrents.com
Whether soft or hard distillation works better is an empirical question, but both are fine approaches.Their words
But yeah, again, this is like empirical. So you will have to run these experiments, but both are really fine approaches. There's nothing wrong with hard distillation.
-
Their words
So you can do it even on a different machine ahead of time, collect everything and then train. But on-policy would be a bit, I guess, even more accurate or better because it's always with the most up-to-date version of your student model.
-
korrents.com
Hard distillation is by far the easiest kind, because its data is the easiest to collect.Their words
So long story short, hard distillation is by far kind of like the easiest because it's the easiest in terms of data collection.
-
Their words
And then again, if you want to distill a model from Claude or OpenAI, which is I think not allowed, so I'm not urging you to do that.
-
Their words
Of course, there are hacks and workaround you can kind of synchronize these vocabularies and kind of make them match up and stuff like that. But it's it's super hacky and tricky. And so most people in practice, they just do hard distillation because it's just easier than doing this.
-
Their words
Now this, of course, like I mentioned before, provides us with more information, but it's not super hard to implement it. The tricky part why not many people do that in practice is that for many models, we don't have access to this information.
-
Their words
It's essentially if reinforcement learning is too expensive, which it is for many people, we can use model distillation to achieve really good results. Maybe not quite as good, but quite good results, a bit more cheaply.
10 October
7 October
6 October
5 October
4 October
Nothing matches.
Beliefs
Korrents What they believe 77 beliefs — each backed by an exact quote.
Each is a — compiled by korrents.com, not by them: the one-line wordings are korrents', the quotes are theirs.
Recent
Explicit positional methods are useful or essential because they provide attention with a direct signal about positions.
Nonetheless, GPT-2 and most newer LLMs include explicit positional information because it gives attention a direct signal about positions. That’s because even though the causal mask determines which tokens are accessible and provides implicit order information, it doesn’t distinguish a separation of one position from a separation of ten, for example. So, explicit positional methods are still useful (or even essential), since they supply that information.
Understanding Positional Embeddings in Modern LLMs Said 15 Nov 2026
Reasoning models are an upgrade from conventional LLMs achieved by adding post-training via reinforcement learning and optionally inference scaling.
A reasoning model is essentially an upgrade from a conventional LLM, that is, adding more post-training via reinforcement learning with verifiable rewards (and optionally inference scaling techniques) to make it more capable of solving more challenging problems.
Building Reasoning Models from the Ground Up: A Video Course Said 24 Oct 2026
If reinforcement learning is too expensive, model distillation can achieve quite good results more cheaply, though maybe not quite as good.
It's essentially if reinforcement learning is too expensive, which it is for many people, we can use model distillation to achieve really good results. Maybe not quite as good, but quite good results, a bit more cheaply.
Build A Reasoning Model From Scratch 8: Distillation Said 17 Oct 2026
Show 57 more
Soft distillation is not hard to implement; few people use it mainly because for many models the full probability distribution is not accessible.
Now this, of course, like I mentioned before, provides us with more information, but it's not super hard to implement it. The tricky part why not many people do that in practice is that for many models, we don't have access to this information.
Build A Reasoning Model From Scratch 8: Distillation Said 17 Oct 2026
Matching vocabularies across model families for soft distillation is super hacky, so most people just do hard distillation.
Of course, there are hacks and workaround you can kind of synchronize these vocabularies and kind of make them match up and stuff like that. But it's it's super hacky and tricky. And so most people in practice, they just do hard distillation because it's just easier than doing this.
Build A Reasoning Model From Scratch 8: Distillation Said 17 Oct 2026
Distilling a model from Claude or OpenAI outputs is probably not allowed.
And then again, if you want to distill a model from Claude or OpenAI, which is I think not allowed, so I'm not urging you to do that.
Build A Reasoning Model From Scratch 8: Distillation Said 17 Oct 2026
Hard distillation is by far the easiest kind, because its data is the easiest to collect.
So long story short, hard distillation is by far kind of like the easiest because it's the easiest in terms of data collection.
Build A Reasoning Model From Scratch 8: Distillation Said 17 Oct 2026
On-policy distillation is probably a bit more accurate than off-policy, because it always uses the most up-to-date student model.
So you can do it even on a different machine ahead of time, collect everything and then train. But on-policy would be a bit, I guess, even more accurate or better because it's always with the most up-to-date version of your student model.
Build A Reasoning Model From Scratch 8: Distillation Said 17 Oct 2026
Whether soft or hard distillation works better is an empirical question, but both are fine approaches.
But yeah, again, this is like empirical. So you will have to run these experiments, but both are really fine approaches. There's nothing wrong with hard distillation.
Build A Reasoning Model From Scratch 8: Distillation Said 17 Oct 2026
Distillation is simpler than reinforcement learning, but reinforcement learning is the state of the art and distillation a more efficient approximation.
So distillation is actually simpler than reinforcement learning. The reason why we did this that way is reinforcement learning really is what is more interesting. That is like the state of the art. And now we are doing an approximation that is more efficient.
Build A Reasoning Model From Scratch 8: Distillation Said 17 Oct 2026
Distilling from a model's reasoning traces gets there quicker and cheaper than reinforcement learning, which is why labs that invest in RL complain about it.
They complain while people steal our reasoning traces and do distillation, because distillation will eventually get you there quicker if you already have the answers. It's cheaper than reinforcement learning.
Build A Reasoning Model From Scratch 8: Distillation Said 17 Oct 2026
The best distilled models are not as good as state-of-the-art reasoning models but are maybe 80 to 90 percent of the way there.
And I would say the best distilled models are still not as good as the state-of-the-art reasoning models, but it's maybe 80, 90% there.
Build A Reasoning Model From Scratch 8: Distillation Said 17 Oct 2026
Distillation carries a higher risk of overfitting, so it is not a free lunch.
So you can get a lot of performance from distillation by trying to mimic the teacher. But then, of course, there's a more risk of overfitting as well. So it's not like a completely free lunch there.
Build A Reasoning Model From Scratch 8: Distillation Said 17 Oct 2026
Newer reasoning models produce 'wait'-style self-corrections less often than early ones.
And so you see, this is also one of the earlier reasoning models, like newer models don't usually do that as often anymore, but it's kind of funny to see the model arguing through this
Build A Reasoning Model From Scratch 8: Distillation Said 17 Oct 2026
It is never a bad idea to check your training data, because data is often the most precious thing and errors in it give poor results.
And then in my opinion, it's always a good idea. I, it's never a bad idea to check your data because data is often the most precious thing. Like if something is wrong in the data, you will also get really poor training results.
Build A Reasoning Model From Scratch 8: Distillation Said 17 Oct 2026
It is more common to train only on answer tokens than on prompt tokens.
But long story short, it is more common to only train on the answer tokens rather than the prompt tokens. It's just like also a common convention.
Build A Reasoning Model From Scratch 8: Distillation Said 17 Oct 2026
Shuffling the training data between epochs is a good idea because it is better for the optimization.
Usually it's a good idea to shuffle between those epochs to just prevent cycles. It's just better for the optimization.
Build A Reasoning Model From Scratch 8: Distillation Said 17 Oct 2026
RLVR is so expensive that it is usually not run for multiple epochs.
So really the core difference is, sure, we have multiple epochs. We could also do that in RLVR, but RLVR is so expensive that we usually don't do multiple epochs.
Build A Reasoning Model From Scratch 8: Distillation Said 17 Oct 2026
A teacher from the same model family likely distills better, because the student is more familiar with its prompt format and answer structure.
It's even better than with a DeepSeek R1. I would say that's likely because it's from the same model family and it's a bit more familiar with a prompt format or the answer structure and so forth.
Build A Reasoning Model From Scratch 8: Distillation Said 17 Oct 2026
Use RLVR to train large state-of-the-art models, but for a smaller model distilling from a bigger one can give better results than RLVR from scratch.
if you train a large state of the art model, you know, like DeepSeek R1 671 billion sure use reasoning, use RLVR for this reasoning training, but if you're developing a smaller model, you can get better results on the smaller model with distillation by distilling from a bigger one than doing RLVR from scratch on a small model.
Build A Reasoning Model From Scratch 8: Distillation Said 17 Oct 2026
Process reward models, such as the additional grader in DeepSeekMath V2, are an interesting direction.
So the DeepSeekMath version two paper is also super interesting because they train an additional grader. So it is kind of like a process reward model, which I personally find interesting.
Build A Reasoning Model From Scratch 8: Distillation Said 17 Oct 2026
Most reasoning models are still trained on code and math, and it would be interesting to go beyond those domains.
Also, most reasoning models are still trained on code and math. So it would be also interesting to go beyond those domains. So applying it to other domains in let's say biology or physics,
Build A Reasoning Model From Scratch 8: Distillation Said 17 Oct 2026
RLVR can be applied to any domain with a verifiable reward, as long as you are careful about reward hacking.
if you think about it, you can apply the RLVR to anything where you have a verifiable reward, right? And so you just have to be a bit careful that it doesn't do the reward hacking.
Build A Reasoning Model From Scratch 8: Distillation Said 17 Oct 2026
A reasoning model that always reasons can be wasteful on simple prompts, so models with different effort levels are useful.
So instead of just developing a reasoning model that always reasons, which can be wasteful if you have a very simple prompt, we can also develop reasoning models that have different effort levels like light, medium, high, extra high, max, and ultra.
Build A Reasoning Model From Scratch 8: Distillation Said 17 Oct 2026
Once you understand the fundamentals, newer techniques built on top of them become easier to understand.
I try to stick to the fundamentals. So everything you see here is like the foundation and then there are always newer techniques on top of it. But once you understand these foundations, it's easier to understand these other yeah, concepts on top of it,
Build A Reasoning Model From Scratch 8: Distillation Said 17 Oct 2026
In reinforcement learning for LLMs, the loss is not as informative as in classic deep learning or pre-training.
So first we have the loss, I should say for reinforcement learning with verifiable rewards or also with human feedback, like the loss is not quite as informative as the one that we would have in, let's say, classic deep learning for training or when we're training a classifier
Build A Reasoning Model From Scratch 7: Reinforcement Learning 2 (Tracking, KL Terms, And More) Said 10 Oct 2026
In GRPO training, the loss should stay roughly stable around a value, and large loss spikes are what to avoid.
So what we want to mainly see is that the loss is kind of stable around a certain value. It might fluctuate, but what we don't want to see is like large loss spikes.
Build A Reasoning Model From Scratch 7: Reinforcement Learning 2 (Tracking, KL Terms, And More) Said 10 Oct 2026
Longer answers are often correlated with answer correctness to a certain degree.
I wouldn't necessarily from one example deduce that these intermediate steps are the ones that made the answer correct. But on average, we often see that longer answers are indeed correlated to answer correctness to a certain degree.
Build A Reasoning Model From Scratch 7: Reinforcement Learning 2 (Tracking, KL Terms, And More) Said 10 Oct 2026
Training runs longer than 10 or 20 minutes are better run as scripts on a separate computer.
But personally, if I'm running things for like longer, more than, let's say, 10 or 20 minutes, I usually prefer using Python scripts. I run those primarily on a separate computer.
Build A Reasoning Model From Scratch 7: Reinforcement Learning 2 (Tracking, KL Terms, And More) Said 10 Oct 2026
It is always a good idea to briefly check that code downloaded from the internet does what you expect.
I personally think it's always a good idea if you're downloading something from the Internet to just briefly double check that it is indeed doing what you expect, because nowadays, you know, with in the age of A.I., it can happen that.
Build A Reasoning Model From Scratch 7: Reinforcement Learning 2 (Tracking, KL Terms, And More) Said 10 Oct 2026
If a model answers every rollout correctly all the time, training might as well stop, because there is no learning signal left.
If it reaches one, and it's like one all the time, we might also as well stop the training, because if it's already answering everything correctly, there's no learning signal anymore.
Build A Reasoning Model From Scratch 7: Reinforcement Learning 2 (Tracking, KL Terms, And More) Said 10 Oct 2026
The small GRPO settings are only for efficiency; whatever you can increase, such as rollouts, you should.
Also the rollout number is very small here, only four. Everything is kept small for efficiency. So whatever you can increase, I would suggest increasing.
Build A Reasoning Model From Scratch 7: Reinforcement Learning 2 (Tracking, KL Terms, And More) Said 10 Oct 2026
In GRPO, a high standard deviation of the advantages is desirable.
What's more interesting is the standard deviation. We want it to be high. Ideally, that means the data is spread out quite a bit.
Build A Reasoning Model From Scratch 7: Reinforcement Learning 2 (Tracking, KL Terms, And More) Said 10 Oct 2026
Extra softmax operations should be avoided in training code because softmax is expensive at scale.
And so technically we always want to avoid softmaxes in, in training code or anywhere. I mean, sometimes it's unavoidable, but we don't want to like have extra softmaxes, for example.
Build A Reasoning Model From Scratch 7: Reinforcement Learning 2 (Tracking, KL Terms, And More) Said 10 Oct 2026
Zero token entropy during RL training is undesirable because the model is too confident and never explores other options.
if the entropy is zero, that means we have probability of one for a certain token, the model is almost too confident, which means it never explores any other options really. So it will always deterministically pick the next token.
Build A Reasoning Model From Scratch 7: Reinforcement Learning 2 (Tracking, KL Terms, And More) Said 10 Oct 2026
For a Qwen-sized vocabulary, a moderate entropy of around one to three is probably good, while zero or the maximum of about 11 would be bad.
So we want maybe in an entropy that is around one, I would say it's good in this case, like zero would be bad. Um, 11 would be certainly also very bad. So like a moderate entropy of like, yeah, one, two, three, something like that.
Build A Reasoning Model From Scratch 7: Reinforcement Learning 2 (Tracking, KL Terms, And More) Said 10 Oct 2026
Clipped policy ratios are technically essential in GRPO.
Then we will make some modifications to the algorithm to hopefully make it even better. For example, clipped policy ratios, they are technically essential in GRPO.
Build A Reasoning Model From Scratch 7: Reinforcement Learning 2 (Tracking, KL Terms, And More) Said 10 Oct 2026
The clip value of 10 taken from DeepSeek-R1 is large in practice; values such as 0.1 are more usual.
So I thought that might be the one using as a reference, but in practice, that's kind of large. So usually smaller values could be, for example, 0.1 and so forth. So 10, 10 is relatively large.
Build A Reasoning Model From Scratch 7: Reinforcement Learning 2 (Tracking, KL Terms, And More) Said 10 Oct 2026
An AI detector used as a reward verifier is brittle: text that does not look human-written, even gibberish, can pass as non-AI-generated.
So the verifier is kind of brittle in that sense. So as soon as you generate a text that doesn't look like human generated text, like just gobbledygook text, it will pass as non-AI generated. And so it was easy to fool the AI detector.
Build A Reasoning Model From Scratch 7: Reinforcement Learning 2 (Tracking, KL Terms, And More) Said 10 Oct 2026
A KL loss term is very important in domains with a lot of reward hacking but usually not necessary for math models.
Now in domains where there's a lot of reward hacking, this is very important, but in other domains, for example, our math verifier, this is usually not necessary. So personally, when I trained math models, so models that generate math answers correctly, I found that it's usually not that necessary.
Build A Reasoning Model From Scratch 7: Reinforcement Learning 2 (Tracking, KL Terms, And More) Said 10 Oct 2026
When a KL loss term is not needed, it is just overhead, since it requires keeping an extra reference model in memory.
They also omitted this KL loss term because it's just making the training more expensive. You have an additional reference model. You have to keep in memory and compute scores for that. And if you don't need that, it's just additional overhead.
Build A Reasoning Model From Scratch 7: Reinforcement Learning 2 (Tracking, KL Terms, And More) Said 10 Oct 2026
Before training a base model with RL to emit think tokens, it is better to do some continued pre-training or supervised fine-tuning with those tokens present.
but in practice, I mean, this would work, but it would be relatively, um, brittle because the model has not seen those during pre-training. So in an ideal case scenario, I would personally recommend taking the base model and do a bit more continued pre-training or supervised fine tuning with think tokens present.
Build A Reasoning Model From Scratch 7: Reinforcement Learning 2 (Tracking, KL Terms, And More) Said 10 Oct 2026
When a format reward is simply added to the correctness reward, a model may over-emphasize the easy format reward and neglect correctness.
And so what's likely happening here is that the model overemphasizes the format reward, so it's trying to get the think tags right, but then the real reward, the correctness reward gets neglected.
Build A Reasoning Model From Scratch 7: Reinforcement Learning 2 (Tracking, KL Terms, And More) Said 10 Oct 2026
A format reward should only be added when the answer is already correct.
So instead of just brute force adding the format reward in every case, I would only personally make the modification that the format reward is only added if the answer is already correct.
Build A Reasoning Model From Scratch 7: Reinforcement Learning 2 (Tracking, KL Terms, And More) Said 10 Oct 2026
Instability in small-scale RL training does not necessarily mean the algorithm is wrong; the scale may be too small to see its benefits.
And if you see instability, it's not necessarily that the algorithm is wrong. It can just be that the settings are just, everything is on a scale that is too small to see the benefits of that.
Build A Reasoning Model From Scratch 7: Reinforcement Learning 2 (Tracking, KL Terms, And More) Said 10 Oct 2026
A model should not be called a reasoning model unless it has been trained with reinforcement learning with verifiable rewards.
I would rather not call this a reasoning model if it has not been trained with reinforcement learning with verifiable rewards.
Build A Reasoning Model From Scratch 6: Reinforcement Learning 1 (Implementing GRPO for RLVR) Said 3 Oct 2026
The self-correcting behaviour of reasoning models should not be called a thought pattern, because LLMs do not think like humans.
I wouldn't call it thought pattern, because it makes it sound like they are thinking like humans, which they don't. I mean, they're still large language models and not human brains or something.
Build A Reasoning Model From Scratch 6: Reinforcement Learning 1 (Implementing GRPO for RLVR) Said 3 Oct 2026
In general, the more capable a model is, the less reasoning it needs to do explicitly.
But what I wanted to say there is that in general, the more capable a model is, the less reasoning it kind of needs to do explicitly.
Build A Reasoning Model From Scratch 6: Reinforcement Learning 1 (Implementing GRPO for RLVR) Said 3 Oct 2026
A more capable model showing less reasoning is not malicious or intentional hiding; it simply needs less backtracking and self-correction.
So I wouldn't say it's like a malicious or intentional thing that the model is doing. But if the model is just like, you know, smarter, it just needs less of this backtracking and self-correction.
Build A Reasoning Model From Scratch 6: Reinforcement Learning 1 (Implementing GRPO for RLVR) Said 3 Oct 2026
A model's reasoning chain is useful because it helps people understand what the model is doing.
It's just like an observation to make. The reasoning chain is useful though, because it can help people understand what the model is doing.
Build A Reasoning Model From Scratch 6: Reinforcement Learning 1 (Implementing GRPO for RLVR) Said 3 Oct 2026
Optimizing a model's reasoning explanations during training might teach it to cheat more efficiently by hiding its intermediate chain.
So as we will see, the model is only trained on the final result, because as soon as we try to optimize the explanations, the model might also learn how to cheat more efficiently by hiding this intermediate chain.
Build A Reasoning Model From Scratch 6: Reinforcement Learning 1 (Implementing GRPO for RLVR) Said 3 Oct 2026
Chat services probably hide raw reasoning traces so that others cannot use them to distill or train their own models.
By default, when you're using something like ChatGPT, they are usually filtering out everything in these think tags and show you only a summary of that. So I guess the intention is that people then can't steal these thinking traces to distill or train their own model, basically.
Build A Reasoning Model From Scratch 6: Reinforcement Learning 1 (Implementing GRPO for RLVR) Said 3 Oct 2026
Human preference rankings for RLHF are partly subjective, because raters with limited time cannot always check which answer is correct.
But you can imagine if you are having to rank answers, and you have to only so much time to rank them, you can't always double check which one is the correct answer. You're sometimes also just ranking them by, well, I like this explanation better, for example.
Build A Reasoning Model From Scratch 6: Reinforcement Learning 1 (Implementing GRPO for RLVR) Said 3 Oct 2026
RLVR is much simpler than RLHF because it needs no reward model, which is why it is attractive in practice.
Now in reinforcement learning with verifiable rewards, we don't need the reward model. So it's actually much simpler. And that is also why it's so attractive and nice to use in practice,
Build A Reasoning Model From Scratch 6: Reinforcement Learning 1 (Implementing GRPO for RLVR) Said 3 Oct 2026
GRPO is a bit nicer and simpler than classic PPO.
One popular one is GRPO. So GRPO is, I would say it's a bit nicer and simpler than the classic PPO.
Build A Reasoning Model From Scratch 6: Reinforcement Learning 1 (Implementing GRPO for RLVR) Said 3 Oct 2026
Reinforcement learning is one of the cornerstone algorithms of the LLM field and worth investing time to understand.
because it is one of the biggest topics in LLM fields where reinforcement learning is one of the cornerstone algorithms. And it does make sense to invest some time to understand it, because it's kind of like a important foundation.
Build A Reasoning Model From Scratch 6: Reinforcement Learning 1 (Implementing GRPO for RLVR) Said 3 Oct 2026
The KL term in GRPO is not essential; whether to use it is a hyperparameter to decide case by case, and on math models may do better without it.
There are a lot of papers or examples showing that actually without KL term on math models perform better. So it's not even essential to do that. It's kind of like a hyper parameter, whether to use it or not. It needs to be decided on a case by case basis.
Build A Reasoning Model From Scratch 6: Reinforcement Learning 1 (Implementing GRPO for RLVR) Said 3 Oct 2026
When training with reinforcement learning, the end-of-text token should be included, or the model might unlearn generating it.
It's actually useful to include end of text for the reinforcement learning because otherwise the model might unlearn to generate those.
Build A Reasoning Model From Scratch 6: Reinforcement Learning 1 (Implementing GRPO for RLVR) Said 3 Oct 2026
Using token-level or sequence-level log probabilities is almost a hyperparameter choice, with good reasons for each.
Yeah, so if we drop the one over T, the token normalization, if we just have the sum, the sum log probability, that would be the sequence level one. And yeah, it's almost like a hyperparameter. And there are good reasons for each of those.
Build A Reasoning Model From Scratch 6: Reinforcement Learning 1 (Implementing GRPO for RLVR) Said 3 Oct 2026
AdamW is still one of the most widely used optimizers, though Muon has become popular for layers other than embeddings.
The optimizer, we use AdamW. That's a common, still one of the most widely used optimizers. Sometimes nowadays, also the Muon optimizer is pretty popular, except for the embedding layers.
Build A Reasoning Model From Scratch 6: Reinforcement Learning 1 (Implementing GRPO for RLVR) Said 3 Oct 2026
What is a korrent?
A korrent is a belief a person has stated in their own words: one sentence stating the claim, backed by a quote and a source, kept at korrents.com.
Under a name here, the quoted block is what they actually said. The korrent beneath it is the claim those words support, in korrents' wording — tap it to see the record, its source, and who else holds it.
Nobody here wrote their own korrents. They are compiled from public statements, and a person can change their mind, which is recorded too.
Recommends rcmnd
rcmnd What they recommend 7 things — each backed by an exact quote.
Compiled by rcmnd.app, not by them: the quotes are theirs, and each links to the post it was copied from.
Recent
Recommends MLX
I highly recommend using *-mlx versions of models working on Macs (if available).
magazine.sebastianraschka.com 27 Jun 2026
Recommends North Mini Code
Alternatively, if you don't want to use Qwen3.6, Cohere's North Mini Code is probably the most interesting, capable alternative at this size class right now.
magazine.sebastianraschka.com 27 Jun 2026
Uses Qwen-Code
Here, I am primarily going to use Qwen3.6 with the Qwen-Coder coding client.
magazine.sebastianraschka.com 27 Jun 2026
Show 4 more
Uses Qwen3.6
Here, I am primarily going to use Qwen3.6 with the Qwen-Coder coding client.
magazine.sebastianraschka.com 27 Jun 2026
Liked Ollama
I am not affiliated with any of the tools mentioned in this article, but one nice thing about Ollama is that they also optionally support open-weight models hosted in the cloud
magazine.sebastianraschka.com 27 Jun 2026
Uses Claude Code
I have to admit that I still primarily alternate between Codex and Claude Code as my daily drivers, for now
magazine.sebastianraschka.com 27 Jun 2026
Uses Codex
I have to admit that I still primarily alternate between Codex and Claude Code as my daily drivers, for now
magazine.sebastianraschka.com 27 Jun 2026
Where they publish
Site sebastianraschka.com His personal site: books, papers, talks and an LLM architecture gallery.
Recent
- How Far Behind Are Open-Weight Models? 3 Dec 2026 A comparison of open-weight and proprietary LLMs from 2024 to 2026, measuring in days how long it took open-weight models to reach earlier frontier scores.
- Amazon Ergo 1.1T Architecture Notes 2 Dec 2026 A quick note on Amazon Ergo's open-weight release, benchmark ranking, and architecture, including sliding-window attention and squared ReLU experts.
- What Counts as an Algorithmic Secret in LLM Research? 1 Dec 2026 My take on Dario Amodei's call to protect algorithmic secrets and how frontier LLMs benefit from publicly shared research.
Show 17 more
- Pre-training is (still) not plateauing 22 Nov 2026 OpenAI's measurements show how next-token prediction on held-out code changed from GPT-4 to GPT-4.5 and later base models.
- The US-China Open-Weight Feedback Loop 21 Nov 2026 How US and Chinese open-weight LLMs build on each other, illustrated with a timeline of architecture ideas from 2021 to 2026.
- Pre-Training Without Learning Rate Decay 17 Nov 2026 A quick comparison of LLM pre-training recipes using cosine decay, warmup-stable-decay, or constant learning rates with checkpoint averaging.
- Understanding Positional Embeddings in Modern LLMs 15 Nov 2026 The Methods Behind How LLMs Represent Token Positions
- From Full to Hybrid Attention in LLMs 10 Nov 2026 How open-weight LLMs are shifting from full attention to hybrid and sparse designs, and what that means for long-context compute and memory.
- Open October LLM Architecture Roundup 3 Nov 2026 A roundup of ten open-weight LLM architecture releases from October 2026, covering attention mechanisms, hybrid layers, and MoE designs.
- Building Reasoning Models from the Ground Up: A Full Video Course 24 Oct 2026 Over 11 hours of coding videos on evaluation, inference-time scaling, reinforcement learning, and distillation, with Python and PyTorch.
- Philosophical Discussion on the Far Future of AI 5 Oct 2026 A discussion with Jürgen Schmidhuber and host Jake Newfield about the far future of AI, human control, and whether AI could develop its own goals.
- Language Models for Text Classification: From Bag-of-Words to Jev 29 Sept 2026 A Visual Guide to RNNs, CNNs, Transformers, and Calibration, with Hands-On Experiments on Accuracy and Efficiency
- Focusing on Post-Training 27 Sept 2026 Why I'd invest in post-training existing open-weight LLMs, with Fireworks' Ember-1 as an example of more token-efficient reasoning.
- MiMo-V2.6 Pro Architecture and Training Notes 22 Sept 2026 Notes on MiMo-V2.6 Pro's GQA and sliding-window attention, agent training tasks, reward signals, and large RL batches.
- It's Easy to Dismiss Jev as Just a Classifier 20 Sept 2026 A short note on Jev's generalization, possible encoder-style architecture and training, and Choice and Noul API examples.
- Pacing != Pacing Development 14 Sept 2026 My take on AI model pacing as a framework for release checks and the competitive pressure around model releases.
- AI Reasoning Models Course on LinkedIn Learning 13 Sept 2026 A 90-minute LinkedIn Learning course on how reasoning models relate to conventional LLMs and how they are developed.
- GPT-6 Astra, Looped Transformers, and Hidden Reasoning 9 Sept 2026 A Look at Recurrent Depth, Hidden Chains of Thought, and Recent Research on Looping Transformer Blocks
- OpenAI Astra and Looped Transformers 2 Sept 2026 A short note on OpenAI Astra, recurrent depth, looped transformers, Nanbeige 4.2, and the Mixture-of-Recursions paper.
- Reasoning Models From Scratch: Code Setup 30 Aug 2026 A short video on how conventional LLMs relate to reasoning models and agents, along with Python and PyTorch setup using uv.
Link verified 4 Sept 2026. Recent items update automatically from the channel.
Newsletter Ahead of AI His deep-dive newsletter on LLM research and architecture.
Open magazine.sebastianraschka.com
Recent
- Understanding Positional Embeddings in Modern LLMs 15 Nov 2026 The Methods Behind How LLMs Represent Token Positions
- Building Reasoning Models from the Ground Up: A Full Video Course 24 Oct 2026 Over 11 hours of coding videos on evaluation, inference-time scaling, reinforcement learning, and distillation, with Python and PyTorch.
- Language Models for Text Classification: From Bag-of-Words to Jev 29 Sept 2026 A Visual Guide to RNNs, CNNs, Transformers, and Calibration, with Hands-On Experiments on Accuracy and Efficiency
Show 17 more
- GPT-6 Astra, Looped Transformers, and Hidden Reasoning 9 Sept 2026 A Look at Recurrent Depth, Hidden Chains of Thought, and Recent Research on Looping Transformer Blocks
- How Claude Watermarks AI-Generated Text 22 Aug 2026 A 48-minute video walkthrough of token sampling, watermark detection, and removal
- Building an AI Text Detector From Scratch 15 Aug 2026 An End-to-End Project With Dataset Construction, Model Training, Local Deployment, and RLVR
- Controlling Reasoning Effort in LLMs 18 Jul 2026 How LLMs Learn Low-, Medium-, and High-Effort Reasoning Modes
- Using Local Coding Agents 27 Jun 2026 Using Open-Weight Models in Local Coding Harnesses as an Alternative to Claude Code and Codex Subscriptions
- LLM Research Papers: The 2026 List (January to May) 6 Jun 2026 A curated roundup of notable LLM research papers that came out this year
- Recent Developments in LLM Architectures: KV Sharing, mHC, and Compressed Attention 16 May 2026 From Gemma 4 to DeepSeek V4, How New Open-Weight LLMs Are Reducing Long-Context Costs
- My Workflow for Understanding LLM Architectures 18 Apr 2026 A learning-oriented workflow for understanding new open-weight model releases
- Components of A Coding Agent 4 Apr 2026 How coding agents use tools, memory, and repo context to make LLMs work better in practice
- A Visual Guide to Attention Variants in Modern LLMs 22 Mar 2026 From MHA and GQA to MLA, sparse attention, and hybrid architectures
- A Dream of Spring for Open-Weight LLMs: 10 Architectures from Jan-Feb 2026 25 Feb 2026 A Round Up And Comparison of 10 Open-Weight LLM Releases in Spring 2026
- Categories of Inference-Time Scaling for Improved LLM Reasoning 24 Jan 2026 And an Overview of Recent Inference-Scaling Papers
- The State Of LLMs 2025: Progress, Problems, and Predictions 30 Dec 2025 A 2025 review of large language models, from DeepSeek R1 and RLVR to inference-time scaling, benchmarks, architectures, and predictions for 2026.
- LLM Research Papers: The 2025 List (July to December) 30 Dec 2025 In June, I shared a bonus article with my curated and bookmarked research paper lists to the paid subscribers who make this Substack possible.
- From DeepSeek V3 to V3.2: Architecture, Sparse Attention, and RL Updates 3 Dec 2025 Understanding How DeepSeek's Flagship Open-Weight Models Evolved
- Beyond Standard LLMs 4 Nov 2025 Linear Attention Hybrids, Text Diffusion, Code World Models, and Small Recursive Transformers
- Understanding the 4 Main Approaches to LLM Evaluation (From Scratch) 5 Oct 2025 Multiple-Choice Benchmarks, Verifiers, Leaderboards, and LLM Judges with Code Examples
Link verified 4 Sept 2026. Recent items update automatically from the channel.
x.com @rasbt Posts about LLM papers and his own writing.
Recent
- The open-source LLM ecosystem could really benefit from an LLM building-block API. We have so many LLM components across different models now. Whether you are using PyTorch or C++ and CUDA code directly, there is a major switching cost when you want to run experiments or ablation studies, say swapping GQA with MLA, dense FFNs with MoE, attention layers with Mamba2 or Gated DeltaNet, or standard residual connections with attention residuals. Currently, it’s very messy even with LLM-assisted coding. It could maybe be on top of PyTorch or CUDA directly, but it needs to be carefully engineered an… 16 Nov 2026
- (Finally) wrote up "Understanding Positional Embeddings in Modern LLMs." A RoPE from-scratch tutorial missing from my LLM building blocks collection + what recent architectures do (NoPE, partial RoPE, hybrids). Prob not the flashiest topic, but essential for understanding LLMs 15 Nov 2026
- Inkling 2 Small took a while... but it's more interesting than I initially thought! Using attention residuals (like Kimi K3), but without the linear-attention hybrid. Food for discussion for the end-of-the-year architecture trends analysis! 14 Nov 2026
Show 17 more
- Seb's Law, co-signed by another Seb 14 Nov 2026
- Wow that escalated quickly. Was gone for a few weeks and now pretty much everyone launched their own decision model copycats: - Sep 23: Together AI, Tev1-4B - Sep 24: Alibaba Cloud, decision-model - Sep 29: Liquid AI, d1 - Sep 30: Databricks, ai_decide - Oct 1: Amazon AWS, Strands Decider 2B - Oct 1: Cloudflare, Clef and Clef-flash (Clef-omni on Oct 9) - Oct 1: Perplexity, Decider (v1.3 on Nov 12) - Oct 6: OpenAI, Decisions API (GPT-6 Luna) - Oct 7: https://t.co/s8O5rwbq5z, H2O-Lightning-4B - Oct 7: Snowflake, Snowflake Decision - Oct 9: Microsoft, Microsoft-Decision-1 - Oct 15: IBM, Granite… 13 Nov 2026
- Hoping Nemotron keeps going. Thankfully, open weight LLMs have some alternatives. But their open data and full training recipes would be much harder to replace. 12 Nov 2026
- LLM training is hard. Hard to be a jack of all trades. 12 Nov 2026
- In reasoning model development, it's always been this interesting tension between training/optimizing chain-of-thoughts (CoTs) vs not touching them to preserve monitorability. CoTs are cool because we can check what the model is up to (e.g., whether it cheats or not) as long as it spells out its thought process. And we risk losing that if we explicitly optimize CoTs. Two caveats: 1) I.e., the catch of CoT and monitorability is that this only works if the written thinking reflects what the model is actually doing. 2) Also, when models become more capable, they spell out less in the CoT (like a… 12 Nov 2026
- Hillclimbing: Make the model better (best intentions). Benchmarking: Measure how much better (best effort). Benchmaxxing: Make the numbers look better (best optics). 11 Nov 2026
- Currently working towards a bigger open LLM roundup. But in the meantime, just one of the interesting trends that stood out. I.e., looks like the transition from full to hybrid attention continues. In 2025, there were still lots of full attention models, with a shift to "some full attention" hybrids. In the first half of 2026, the trend towards "some full attention" hybrids continued. And now, in the second half of 2026, we have a 50/50 split between "some full attention" hybrids and models that don't use full attention at all anymore. And yes, there are also no full attention models anymore.… 10 Nov 2026
- What could possibly go wrong? 3 Nov 2026
- Catching up on the 10 (!) open LLM architecture releases from the past month. Quite a lot happened in October. I guess we can call it "Open October"! 1. Kolibri-1 (78B): A notable model from Germany. Features classic Grouped Query Attention (GQA) and Sliding Window Attention (SWA) attention module. 2. Ling 3.1 Flash (560B): Uses Kimi Delta Attention and the eighth uses gated Multi-head Latent Attention (MLA) inspired by DeepSeek. 3. Muse Spark Open (816B): Besides Musse Glimmer, the first major open weight release from Meta (since Llama). Uses classic GQA + SWA but adds a LatentMoE. 4. Nemotr… 3 Nov 2026
- The complete reasoning-from-scratch video series is now up (and linked) here: https://t.co/5IOHLTCIGt (Taking a short break but will be back with LLM model and research updates in November!) 25 Oct 2026
- Reasoning From Scratch round 8, the finale! This last lecture in the series covers distillation as an efficient alternative to the previous reinforcement learning training runs. (Planning to take a brief break, but I will be back!) 00:00 Introduction and series recap 01:07 Why distill a reasoning model? 02:51 Soft vs. hard distillation 11:06 On-policy vs. off-policy distillation 18:09 Preparing data for reasoning distillation 22:35 Loading the DeepSeek R1 MATH dataset 28:04 Inspecting reasoning traces and final answers 31:27 Tokenization and chat templates 35:58 Pre-tokenizing the training da… 17 Oct 2026
- Reasoning From Scratch: Reinforcement Learning with Verifiable Rewards (RLVR) round 2. Covering clipped policy ratios, KL loss term, format rewards, and other GRPO tips & tricks. 00:00 Introduction and recap 01:52 Interpreting basic GRPO training metrics 06:34 Planned improvements to GRPO 08:58 Running longer training jobs with Python scripts 13:39 Running the baseline GRPO training script 17:29 Loading and plotting training logs 19:29 Diagnosing unstable training 23:55 Evaluating checkpoints on MATH-500 26:26 Downloading existing checkpoints 30:09 Tracking advantage statistics 34:53 Understa… 10 Oct 2026
- Spontaneous morning chat with Juergen Schmidhuber and Jake Newfield philosophizing about AI. Sry my mic somehow disconnected but Juergen had the more interesting points anyways! 6 Oct 2026
- Reasoning from scratch, round number 6! An introduction (and implementation) of Reinforcement Learning with Verifiable Rewards (RLVR) and Group Relative Policy Optimization (GRPO). 00:00 Introduction 01:54 What makes a reasoning model different? 04:25 Reasoning traces and model capability 08:29 Accuracy and format rewards 11:34 Aha moments and DeepSeek-R1 training 14:41 Reasoning effort and answer length 18:38 RLHF and RLVR 23:04 GRPO vs. PPO 26:40 GRPO explained with a cooking analogy 31:43 The KL term and simplified GRPO 35:04 Loading the pretrained model 36:07 Loading the MATH training dat… 3 Oct 2026
- Took a while, but here it is, a mega write-up on language models for text classification and, of course, Jev. It's basically a visual guide to RNNs, CNNs, transformers, and calibration, with hands-on experiments on accuracy and efficiency. 29 Sept 2026
- A little Ember-1 tl;dr. Seems like a great model! (Was recently asked on a podcast, given $ xx million, what's the best way to develop a frontier LLM today? My recommendation was: start with an existing one and spend that budget on post-training. Great example here.) 27 Sept 2026
- 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… 26 Sept 2026
Link verified 4 Sept 2026. Recent items update automatically from the channel.
YouTube Sebastian Raschka Long build-it-from-scratch lectures on LLMs and reasoning models.
Recent
Link verified 8 Nov 2026. Recent items update automatically from the channel.
GitHub github.com/rasbt Code for his books, including LLMs-from-scratch.
Recent
- reasoning-from-scratch — Implement a reasoning LLM in PyTorch from scratch, step by step 3 Dec 2026
- LLMs-from-scratch — Implement a ChatGPT-like LLM in PyTorch from scratch, step by step 2 Dec 2026
- machine-learning-book — Code Repository for Machine Learning with PyTorch and Scikit-Learn 1 Dec 2026
Show 16 more
- mlxtend — A library of extension and helper modules for Python's data analysis and machine learning libraries. 13 Nov 2026
- llm-architecture-gallery — LLM Architecture Gallery source data 11 Nov 2026
- llm-architecture-poster — Create LLM architecture posters from a folder of diagrams using Python and ImageMagick. 11 Nov 2026
- macos-pdf-splitter — Native macOS app for splitting and converting PDF figures 6 Oct 2026
- deeplearning-models — A collection of various deep learning architectures, models, and tips 26 Sept 2026
- ai-detector-from-scratch — End-to-end project training and building AI models / LLMs to detect AI-written text 1 Sept 2026
- python-machine-learning-book — The "Python Machine Learning (1st edition)" book code repository and info resource 18 Jul 2026
- local-coding-agent-evals 26 Jun 2026
- workflow-understanding-LLM-architectures — Materials for the "My Workflow for Understanding LLM Architectures" tutorial 10 Apr 2026
- mini-coding-agent — Minimal and readable coding agent harness implementation in Python to explain the core components of coding agents. 7 Apr 2026
- watermark — An IPython magic extension for printing date and time stamps, version numbers, and hardware information 21 Dec 2025
- math_full_minus_math500 — The MATH training dataset without MATH-500 test portion 20 Dec 2025
- MachineLearning-QandAI-book — Machine Learning Q and AI book 17 Dec 2025
- bugreport — A repository to store code examples to reproduce issues for bug reports. 14 Sept 2025
- rasbt 21 Jan 2025
- RAGs — RAGs: Simple implementations of Retrieval Augmented Generation (RAG) Systems 20 Jan 2025
Link verified 4 Sept 2026. Recent items update automatically from the channel.
About the English under a post
Some people here publish in a language other than English. Where they do, this site shows a machine translation beneath the post, in this typeface — the site's own, not theirs.
The post itself is never changed, moved or hidden: what is set in the serif above is exactly what the person published, and it is what to quote them on. A translation can be wrong in ways that matter, especially about tone.
Only the post's own words are translated. A quoted post, a linked article and a belief on korrents.com are left in their original language.





