Deep Stackby Burak
All posts
5 min read

The Reasoning Model You Build Yourself

Eleven hours of code, one small model, and the part of modern AI that usually stays behind an API.

The Reasoning Model You Build Yourself

The interesting thing about Sebastian Raschka’s new video course is not that it teaches reasoning models. It is that it refuses to treat them as magic. Eight coding videos, about eleven hours in total, walk through building a reasoning model from scratch in Python and PyTorch — starting from a small pre-trained model and implementing every reasoning method by hand.

That sounds like a tutorial. It isn’t. It is a corrective to the way most builders now meet reasoning: as a toggle on someone else’s API, priced per million tokens, with the mechanism hidden behind it.

The engine, not the dashboard

Raschka frames the course with an analogy worth keeping. A conventional language model is the engine. A reasoning model is that engine after more post-training — reinforcement learning with verifiable rewards, plus inference-time scaling techniques that spend extra compute at answer time. An agent harness is the machinery bolted around the engine: context management, tool access, the scaffolding that turns a chatbot into something that can tackle a bigger task.

Most current-generation models, Raschka notes in his announcement, are reasoning models or offer a reasoning mode. So the engine is no longer a special case. It is the default — and most people using it have never seen inside it.

The course starts, deliberately, not from nothing. Instead of training a base model from scratch — a whole other book, and Raschka’s previous one — it loads the weights of a pre-trained Qwen3 0.6B model, then implements text generation with streaming, a KV cache, and torch.compile. That is the baseline everything else improves on. The choice matters: a 0.6-billion-parameter model is small enough to actually run, inspect, and break on ordinary hardware, which is the whole point. You cannot learn how reasoning works by watching a model you cannot afford to run.

What “reasoning” actually consists of

The syllabus is a tour of the techniques that usually arrive as marketing terms. First, a math-answer verifier built step by step — answer extraction, normalization, checking mathematical equivalence — used to evaluate the model on the MATH-500 dataset. That verifier then does a second job later in the series: it becomes the reward signal for reinforcement learning.

Then inference scaling with the weights frozen: temperature scaling, multinomial sampling, top-p filtering, and self-consistency, where multiple candidate answers are combined by majority vote. The course makes the tradeoff explicit — each extra candidate costs compute, and the videos measure MATH-500 accuracy against that cost rather than presenting inference scaling as free performance.

Then the training itself: a simplified version of Group Relative Policy Optimization, generating groups of responses, scoring them with the verifier, and updating weights from relative rewards. Later videos add the diagnostics that separate a training run you understand from one you merely launched — entropy and advantage statistics, clipped policy ratios, KL loss terms, format rewards — and check whether each addition actually helps. The final method is distillation: learning from answers generated by a stronger, bigger teacher model.

None of this is presented as a recipe for beating frontier models. Raschka is blunt about the scale in a comment on the announcement: on the course’s independent test set, accuracy goes from 15 percent for the base model to 48 percent for the reasoning model — a large gain, and still far from larger state-of-the-art models, which score above 90 percent on the same dataset. The model, he says, is for education purposes.

That honesty is the course’s real argument. The gap between 48 and 90 percent is not a mystery to be admired; it is the price of scale, data, and compute, made visible by building the small version yourself.

The cost question, answered in hardware

For builders, the takeaway is practical: the course’s hardware story is refreshingly small. Raschka says the early text-generation and evaluation examples can run on a CPU, while a GPU makes the later experiments, especially training, much more practical. The repository includes hardware and environment recommendations, and the first video covers setup, including remote GPUs via VS Code.

That is a very different cost curve from the one most AI work now assumes. The Hacker News discussion, which put the course at the top of the front page with 346 points and 50 comments at the time of writing, treated it as exactly that kind of resource: not a launch, but a way in. Nobody in that thread needed to be sold on reasoning models. What they wanted was the mechanism, in code they could run.

There is a second, quieter point here. When reasoning becomes a billed feature — extra tokens for a longer chain of thought, a higher tier for a “thinking” mode — the buyer cannot tell what they are paying for. Is the extra compute buying a better answer, or a longer performance of one? Someone who has implemented self-consistency and watched accuracy move against inference cost has a calibrated answer to that question. Someone who has only toggled “high effort” does not.

The catch

The catch is the usual one for from-scratch work: it teaches the mechanism, not the product. Nothing in eleven hours turns a 0.6B model into a production reasoner, and the simplified GRPO in the course is not the training stack behind a frontier release. The verifier works because math answers can be checked; most real problems cannot be graded so cleanly, which is why reinforcement learning with verifiable rewards has a natural ceiling that the course does not pretend away.

But that limitation is also why the course is worth more than another framework announcement. Frameworks change every quarter. The loop — generate, verify, score, update — does not, and once you have built it yourself, every vendor claim about reasoning lands differently. You stop asking what the model can do and start asking what it costs, per answer, and what the verifier is actually checking.

Raschka’s earlier from-scratch course did the same thing for language models themselves, and its staying power suggests this sequel will last longer than most of this month’s model launches. Launches expire. Understanding compounds.

That is the problem with treating reasoning as a feature: a feature can be repriced, throttled, or taken away. A mechanism you built yourself cannot.

Source: Build Your Own Reasoning Model: A Full Video Course

Latest from Deep Stack

5 min read

Open Weights, Closed Map

Baidu's ERNIE 5.5 Flash Base is downloadable, cheap per token, and 280 gigabytes of fine print.