Sebastian Raschka's from-scratch video course on building reasoning models (magazine.sebastianraschka.com)
672 points by sgiannopoulos 16 hours ago
torben-friis 14 hours ago
I've got a question. I'm having a bit of trouble phrasing it, so please don't assume I'm against learning for learning's sake, that's not the point.
Whenever I've tried to learn about LLMs, machine learning, etc. I always come out with a bad feeling, compared to learning about software.
Theoretical courses make me feel like it's all baby steps, unless you assume a level of commitment equivalent to a math degree. Practical/applied stuff seems to require levels of compute, training data, etc. that make it unapproachable for a home hacker for everything beyond basic exercises like a handwritten digit classifier.
Now this feeling of "impracticality" is perfectly fine. It would be the expected outcome if I was taking a course on classic literature or modern art. But machine learning stuff feels like it could have room for learning-by-doing applications that aren't entirely pointless, so I wonder if there's some way to approach the topic I'm simply not finding.
Did anyone have the same experience? any tips if so?
peterlk 13 hours ago
I think this is an outcome of playing with systems that we don’t actually understand very well on a deep level. We have found recipes that work, and have used graduate descent (so many PhD theses) to understand and optimize these systems, but we’ve built a model of language that also encodes reasoning, and those things are extraordinarily complex. Providing proper mathematical rigor for their explanation requires, as you say, the level of commitment equivalent to a math degree. Also, because language is so complicated and subtle, you need highly precise statistical models of it, and that just takes a shitload of data; hence the scale. You can train toy models at home, but they will suck because you actually need massive amounts of data to capture the nuance that language requires. And that’s to say nothing of multimodal models.
billiam 8 hours ago
I think the level of interaction on forums like HN is a great example of the still-yawning gulf between LLMs and humans when it comes to encoding reasoning into language. Even with the self-selection that comes with posting here, think of how many times it is almost impossible to tell if posters are shit-posting, serious, angry, sock puppets, or just weird.
giardini 11 hours ago
You say "...because you actually need massive amounts of data to capture the nuance that language requires..." but humans don't require that! So why do LLMs?
How many books did you read in your education? Far fewer that what LLMs read, no doubt. Of course we "have a life" and so we interact with hundreds of people, which is also a form of learning.
But in any case there's are fundamental differences here between these two systems (LLMs and humans) that we have not yet discerned clearly.
jodrellblank 10 hours ago
ordersofmag 10 hours ago
miki123211 10 hours ago
Machine learning is more like biology, physics or law than like CS or math.
In the software engineering world, we're accustomed to the reality that to do great work, all you need is a sharp mind and a cheap laptop. Better tools help, but aren't really a necessity. You could probably become a top-notch Linux kernel engineer with nothing but dedication and self-study, a $300 laptop and a shabby apartment with internet access.
You just can't really learn ML that way, just like you can't do it with banking, professional trading or medicine.
potsandpans 5 hours ago
Kind of sounds like a truism. You make the claim, but you don't explain why. Also, the analogies at the end are... odd.
Maybe you are right! I'd like to hear the justifications more though.
ksh09 2 hours ago
viklove 8 hours ago
Weird to put banking and trading on the same complexity level as medicine or ML.
wanderingmind 7 hours ago
fantispug 9 hours ago
> Practical/applied stuff seems to require levels of compute, training data, etc. that make it unapproachable for a home hacker for everything beyond basic exercises like a handwritten digit classifier.
Compute is only an issue if you want to train large foundational models from scratch. You can easily train non-neural models on CPU, and fine-tune smaller models (say <4B) on a commodity GPU.
For training data there's lots of datasets online (like Kaggle), but you can build your own and can label things yourself or get a language model to label them for you. Getting good data is the hardest part of ML so this is a good exercise.
Then do some hobby projects: classify whether your photos contain a photo of you or a particular friend/family member, predict the expense category from bank transaction exports, classify your emails into categories, extract book recommendations from Hacker News, ...
danielmarkbruce 13 hours ago
Get Sebastian's book and build an LLM from scratch. The problem with most textbooks (on any subject, it's not unique to ML/AI) is they usually try to build the theoretical foundations first. In many cases things are better taught top down.
myegorov an hour ago
In many cases if you follow a recipe without understanding you're no better off in the end. In cooking at least you can have a cake and eat it too.
torben-friis 13 hours ago
I'm OK going through the learning itself (will definitely check out the book though, since it's so well liked!). The question is more, what do you do with that once the book or course is done?
For a junior coder, there's usually a path to recommend, joining some open source project or doing some home scripting, etc. Something where you can be useful even if it's not your full time job.
I'm wondering whether there's some similar hobbyist path available here, or whether there's too much of a jump between the educational/pop sci stuff and the professional realm. If it's the second, that's also fine, I just want to know if I'm missing something.
kadoban 12 hours ago
throwaway219450 3 hours ago
danielmarkbruce 10 hours ago
dominotw 10 hours ago
i am actually looking for a book that follows like sebastian books but without any hands on coding . i am hoping to read in bed.
dtf 10 hours ago
384028345 4 hours ago
danielmarkbruce 10 hours ago
captainclam 11 hours ago
I completely understand where you're coming from. While understanding the math and architectures of these large models can be edifying, it lacks some of the liberating/empowering spirit of traditional software. You can build a bespoke to-do app that is better suited to your needs than anything produced by some productivity software company, but you're totally beholden to one of the few big players for access to an effective LLM.
But there is so, so much interesting work and research to do at a much smaller scale. I work on drug discovery models, and none of my work requires data or infrastructure that are not generally accessible to the public (it's nice to have the computing resources of my institution but there are other ways to access a GPU).
So if you are really interested in this stuff, I would suggest looking at the endless supply of interesting problems in domains that are not dominated by huge frontier labs.
reedwhistle 10 hours ago
Ive been interested in exploring other domains as well, including biology, genomics, etc. Do you have any recommendations on where to get started?
globular-toast 15 minutes ago
globular-toast 24 minutes ago
Several years ago I put together a classifier for putting my bank account statements into categories (groceries, housing etc). I use it for doing my accounts and budgeting. Maybe you have a similar problem? There are still lots of applications for small classifiers, you don't need a SOTA LLM for everything.
Krei-se 13 hours ago
I have the books on my shelf for 5 years now and never encountered the need to build an AI so i haven't touched it yet. Don't feel bad about using AI to learn but not build one.
You can google stuff to learn without the need to build a search engine too.
I have however learned a lot about math! And other related stuff. I'd argue if you extend your low level skills in math and code when the need for an AI comes up, simple weather / sales forecast, who knows, you'll have an easier time building one.
ramity 10 hours ago
In my experience, until you implement the math of a NN in numpy or something similar, it's easy to feel like a library is abstracting something away from you. Many people in ML focused academia stand on those libraries. They may conceptually understand chain rule but do not manually implement the math. The same feeling exists for encryption. There is a culture of shying away from rolling out your own ops, so it can easily feel like your understanding is segmented to some degree.
catfood 13 hours ago
I think it's one of those things where you have to work in the field to really get it and be productive. You just don't have the time or resources otherwise.
teravor 11 hours ago
if you are willing to put in the work you can devise a hyper specialization for which you can create an RL playground (which is likely absent in the frontier labs), then you can obtain cutting edge results on it by post training an open weights model using minimal resources.
octoberfranklin 3 hours ago
This.
Don't try to pretrain from scratch. Take an already-trained Qwen and give it new powers.
tracerbulletx 12 hours ago
Try making a smaller classifier model for some random problem you have that's immediately useful and doesn't exist yet.
CamperBob2 11 hours ago
But machine learning stuff feels like it could have room for learning-by-doing applications that aren't entirely pointless, so I wonder if there's some way to approach the topic I'm simply not finding.
That's what Karpathy's videos are for. You end up with a GPT-2.0 equivalent if you follow them to the end.
yunwal 11 hours ago
This is still pointless though. I mean it's valuable from a learning perspective but the parent is saying they want to contribute somehow. You can only learn so much from toy examples
bityard 9 hours ago
CamperBob2 11 hours ago
russli1993 13 hours ago
I feel the same. I feel machine learning is 1) you need strong math knowledge but also intuition. 2) You need actual production level data, a lot of the nuances of machine learning, applied scientists' roles are how to build strong models with real world, messy, inconvenient data. You need to apply various techniques and not just memorize a specific formula.
Compared to software coding, you build websites, apps etc. The barrier to entry is much higher.
I am trying to pivot into machine learning myself, so far my understanding is try to find a software engineer role where you deal with data, model infra, data pipeline, etc. Then within the same company, try to do more modeling work and build intuition and resume credentials in this area. Someone correct me if I am wrong.
elzbardico 8 hours ago
Machine learning IS applied mathematics, especially statistics, probability, and optimization. Period.
The "baby steps" are not there just for intelectual satisfaction, the baby steps give you the building blocks to understand things that become progressively more complex. The baby steps are tools, that once you get familiar with them, you'll find new and new uses everywhere.
A good practical illustration of this: It is pretty hard to figure out how differential equations can be useful if you don't understand what they are. And yet, I bet that on january of 2020, there was at least one math teacher deep down in the amazonian jungle playing with a compartimental model based on a system of ordinary differential equations, to figure out the diverse scenarios this new epidemic could play out if that scary new virus escaped China and those few cruise ships.
Another example: take the concept of backpropagation: the underlying idea behind it is the chain rule from calculus, used to work backward through a computation and calculate how each parameter affects the error. Now, it is way easier to understand it in a small CNN that you are training to recognize handwritten digits than trying to understand it in the context of a full transformer model. A digit classifier is something that is way easier and affordable for you to fiddle with stuff and develop and intuition on loss functions, gradients, backpropagation and overfitting.
libraryofbabel 12 hours ago
I feel there's a misconception in a lot of the comment threads about what an LLM-from-scratch tutorial is for. Of course you're not going to come out of this kind of tutorial being able to train a useful LLM from scratch. (It requires too much compute, and datasets you don't have access to, and there are a lot of tricks and operational problems to solve for real training runs.) If that's your bar for "impracticality", then sure, this is impractical.
But that's not the point; the point is understanding these things better by seeing how they are made (or grown, if you prefer). Building something at a level further down the stack than you will ever go forces you to confront details that shape the layers above that you do deal with. This is one reason why Crafting Interpreters is such a beloved book here on HN.
LLMs are now at the core of tools we all use everyday... don't you want to know how they are made? Maybe not everyone has this itch to understand the platforms and tools they use, but I sure do, and it's helped me over and over again. Sure, LLMs aren't like operating systems or compilers. They're a quasi-organic mass of billions of parameters learned during training and honestly nobody (not even the mech interp folks) really deeply understands why they work so well. But that's no reason to completely give up and there is still a lot you can learn.
Take RLVR ("Reinforcement Learning from Verifiable Rewards"). This is the training technique that made LLMs get so good at programming and math in 2025 and 2026. A lot of people who confidently talk about LLM capabilities either haven't heard of it (and thus end up parroting out-of-date factoids about LLM training derived from the pre-2025 era) or have only a very dim idea of what it is. In this course you actually do RL training of an LLM to get it solving math problems better. You're right down in the details. It's interesting for its own sake but it will also give you a grounding for discussing questions such as: "why did LLM writing get so weird and bad in mid-2026?" and "why is it so hard to train LLMs to be good at things that aren't like math and programming?"
Anyway, Sebastian's two books are great and highly recommended; I worked through the first one a year ago and it was one of the best investments of my time in all of 2025. If you prefer video for learning this is great as well (although I'd still say - try the books first).
darrelld 16 hours ago
I got his book Build Your Own LLM From Scratch and it's super readable and does a great job at holding your hand through the entire process...need to finish reading it though!
auraham 13 hours ago
I did the same. I got "Build Your Own LLM From Scratch" last christmas and it is a great resource for learning how LLMs work, from tokenization to generating text. The author makes a great job explaining each new concept. If you know PyTorch (or at least know about tensors), the material will be approachable for you.
Sebastian, if you are reading this, this is an idea for another book: how to orchestrate agents for adversarial code review. I've been looking for learning resources to make something similar to this [1] at a smaller scale. I am aware of codex subagents, though. However, given that Sebastian already has a book for LLMs and another book on planning, I think adversarial code review is an interesting next step.
[1] https://bun.com/blog/bun-in-rust
[2] https://learn.chatgpt.com/docs/agent-configuration/subagents...
lucasoshiro 14 hours ago
I don't like working with neural networks and I always found everything overcomplicated or oversimplified, sometimes both at the same time.
But this book is almost perfect. Every new concept is well described and every is well founded. And every step moves you forward (if you know, you know)
fuddle 14 hours ago
I read it the first time with a study group which was very helpful.
globular-toast 14 hours ago
I like it too. Haven't got very far through it yet but just learning about how to use PyTorch and finally getting how back propagation works via autograd etc. was really fun and enlightening.
kavalg 16 hours ago
Highly recommended! Sebastian does a great job explaining complex AI topics in a very intuitive way.
artninja1988 16 hours ago
Karpathy 2.0!
krosaen 14 hours ago
They are contemporaries - cs231n and Sebastian's first ML book came out in 2015 - both excellent!
tomrod 15 hours ago
Other way around. Raschka's been doing this over a decade.
nxtfari 14 hours ago
recroad 15 hours ago
Karpathy might be Raschka 2.0
flakiness 13 hours ago
What would be the computing cost to go through the book (or the course)? Do you need Cloud GPUs, or can this be run locally, if so how powerful your computer has to be?
I've been wondering about getting a PC to poke around LLM stuff (not a practical use, but more for learning purposes) but I don't have any intuition about how much is enough and whether it is worth it to me.
libraryofbabel 9 hours ago
You can go through it locally just fine; all you need to do is be able to run Qwen3 0.6B, which is a tiny LLM. A recent macbook (air or pro), or a PC with a good gaming GPU is perfect, but you can run the model and training examples on a PC CPU too; it will just be much slower. From his book (same examples as the video course):
> "the code examples have been carefully designed to run efficiently on a regular laptop, without the need for any special hardware. But if you do have access to a GPU, certain sections provide helpful tips on scaling up the datasets and models to take advantage of that extra power... The inference and evaluation chapters work well on CPUs and GPUs, while the training-oriented chapters benefit from access to a GPU if you want to reproduce the larger experiments."
So, consumer GPU helps but not essential. No need for expensive cloud GPU time.
thrw045 5 hours ago
Maybe someone can clarify this:
He says:
> 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.
But this isn't really true is it? When reasoning models came around with OpenAI's o1, the main feature it had was to be able to try several paths and select the best one. This is what a reasoning model is. This was before agents and reinforcement learning with verifiable rewards wasn't it? And then RLVR and agents were added on later. Or am I wrong?
dan-g 14 hours ago
I’ve read, worked through, and watched his LLM book as well as this one! Things finally clicked, can’t recommend both books enough—his pedagogy is great (at least for me).
gradus_ad 13 hours ago
All of these build your own model guides are like someone putting out a build your own CPU guide 10 years ago. Interesting, but not of any practical use.
danielmarkbruce 13 hours ago
You can take any open source model and continue training it. It's nothing like building a CPU.
Dr_Birdbrain 13 hours ago
They’re amazing for interview prep! ;)
dominotw 10 hours ago
which interviews are asking these ?
Dr_Birdbrain 5 hours ago
rhedak 7 hours ago
It seems going forward AI is just going to build more AI and no human will understand it.
abdiadem954 14 hours ago
I just started reading his book, and he makes it easy to grasp difficult concepts. As a matter of fact, I have been working on platform where you can learn how AI models work in an interactive manner.
throwawayb2025 12 hours ago
The way he explained the attention module helped me a lot. I have read other people explanation but his technique helped me 8n remembering it easily.
rvz 13 hours ago
This is an essential resource and his book is a must read from this author. I have the upmost respect for Raschka for his research and detailed explanations in AI including him dissecting research papers.
misiti3780 14 hours ago
I have read both and the are excellent
brcmthrowaway 14 hours ago
saved
GL26 15 hours ago
someone's getting auction-poached at openai and anthropic
_1 15 hours ago
he's a well known author on LLMs already.
an0malous 14 hours ago
Do you not just say “do reasoning” and leave it an open “<reasoning>” tag?
hypfer 15 hours ago
I'm a bit confused as to who this is for - apart from learning how the tech works that is.
If you're truly going to build your own model (and commit to the cost of that), then video tutorials will not cut it.
And if you don't really, then I wonder if this is really the best style of conveying the information you'd be interested in?
I mean I might be wrong and maybe this helps emerging players or something like that, but to me it is more likely that this is more of a monetisation strategy of a personal brand. Living off selling to people that think they _should_ but then in the end don't.
TheCowboy 14 hours ago
You can follow his book and learn how to build an LLM from scratch. What is the issue?
It's also not a bad foundation for people who want to understand how these things are trained and work.
john_strinlai 14 hours ago
>apart from learning how the tech works that is.
some people enjoy learning how the tech works
hypfer 14 hours ago
Like me!
ghurtado 14 hours ago
"apart from learning how to make cookies at home, I really don't see the point of this cookie recipe"
lucasoshiro 14 hours ago
Why teach people to play guitar once a week if they won't be a new Jimi Hendrix? Why teach people to run if they won't be a new Usain Bolt?
Maybe because they don't want to be an "emerging player" or something, they only want to understand how a new technology that is changing the world works and prefer to learn by doing.
If Sebastian is doing it by its personal brand, he really deserves it. I would trust him because I know he is a reference on his area of knowledge and I know he is because he shares his knowledge instead of only making fancy talks.
Lucasoato 15 hours ago
Let’s not be this negative, we might be going towards a new direction with technology that could allow small teams to build their own models. Maybe not frontier models. Maybe not close to the others in generalized benchmarks. But perhaps they could be really specialized into solving one particular problem better than the others.
siva7 14 hours ago
You wrote so many words to say .. nothing of substance .. i still have no clue what you are criticizing.
hypfer 14 hours ago
I think you actually do and that is exactly what resulted in this style of reply.
It's a critique of the people and the lack of substance. But not of the author. The author is highly capable.
CamperBob2 15 hours ago
If you're truly going to build your own model (and commit to the cost of that), then video tutorials will not cut it.
That makes no sense. It's like saying if you want an engineering degree, going to lectures will not cut it. Of course not, you have to do the homework and projects too.
hypfer 15 hours ago
Yeah but if it is not all that useful, why is it saying that it is "from scratch" and what is it doing on #1 of the front page?
Something is off here. It indeed makes no sense
LoadbearingGun 14 hours ago
augment_me 10 hours ago
People are going to be upset about this, but any learning material in this day and age is solely made for your own understanding when writing it. The LLMs can be better teachers and understand your level of need and engagement better than anyone else.