rasbt

rasbt/reasoning-from-scratch

Jupyter Notebook Apache-2.0 Education

Implement a reasoning LLM in PyTorch from scratch, step by step

4.7k stars
705 forks
active
GitHub +69 / week

4.7k

Stars

705

Forks

2

Open issues

4

Contributors

v1.0 18 May 2026

AI Analysis

This repository is the official code companion to a Manning book that teaches how to build a reasoning LLM from scratch using PyTorch, starting with a pre-trained base model and adding reasoning capabilities step by step. It is specifically designed for machine learning practitioners and students who want to understand the internals of reasoning models like DeepSeek R1 and GPT-5 Thinking through hands-on implementation, not for practitioners seeking a production-ready reasoning system or gene...

Education Research Project Discovery value: 5/10
Documentation 8/10
Activity 9/10
Community 8/10
Code quality 7/10

Inferred from signals mentioned in the README (tests, CI, type safety) — not a review of the actual code.

Overall score 8/10

AI's overall editorial judgment — not an average of the bars above, can weigh other factors too.

llm-reasoning reinforcement-learning pytorch-education inference-scaling chain-of-thought
Actively maintained Educational Niche/specialized use case Well documented Beginner friendly
Deep Analysis · Based on README and public signals
1w ago

Educational code companion for building reasoning LLMs step-by-step in PyTorch

Reasoning-from-scratch is a Jupyter Notebook-based learning resource accompanying a Manning book. It teaches how to implement reasoning capabilities in large language models through hands-on PyTorch code, covering inference-time scaling, reinforcement learning, and model distillation. Built by Sebastian Raschka (author of the LLMs-from-scratch series). Adoption is primarily academic/educational; not positioned as production software or a reusable library.

Origin

Created March 2025 as an official code companion to a Manning book on reasoning LLMs. Appears part of Raschka's pedagogical series (which includes the 98k-star LLMs-from-scratch repo). Targets the emerging interest in understanding how reasoning models like DeepSeek R1 and GPT-5 Thinking work.

Growth

Reached 4,608 stars in ~15 months with steady engagement (47 stars in last 7 days as of June 2026). Growth appears driven by the book's release and educators/students seeking hands-on reasoning model tutorials. Last commit 12 June 2026 shows active maintenance aligned with book development.

In production

Adoption not verified. README frames this as educational code ('for educational purposes') accompanying a published book. No mention of production deployments, industry usage, or enterprise adoption. 4,600 stars likely reflect student/educator interest rather than production usage. Comparable to other 'learn from scratch' educational repos in the ML space.

Code analysis
Architecture

Appears to be a collection of progressive Jupyter Notebooks covering: text generation with pre-trained LLMs (Ch2), evaluation methods (Ch3), inference-time scaling (Ch4-5), reinforcement learning with GRPO (Ch6-7), distillation (Ch8), and optional appendices on batching and chat interfaces. Based on README, likely uses PyTorch and Qwen3 as the base model. Structured as chapter-by-chapter tutorials rather than a monolithic library.

Tests

README documents cross-platform CI workflows (Linux, macOS, Windows test badges visible), suggesting automated test coverage exists. Specific test framework and coverage percentage not documented in README excerpt.

Maintenance

Last push 12 June 2026 (19 days prior to analysis date) indicates active maintenance. CI/CD pipelines present. Repository marked 'In Progress' for table of contents, suggesting ongoing development. No evidence of stagnation; appears aligned with book production schedule.

Honest verdict

ADOPT IF: you are a student, educator, or ML researcher learning how reasoning LLMs work and prefer step-by-step PyTorch code over theory alone. AVOID IF: you need production-ready reasoning model code, a reusable library/framework, or industrial-scale training infrastructure. MONITOR IF: you are tracking the reasoning LLM education space — this repo is well-maintained and may become a standard reference as reasoning models proliferate.

Independent dimensions

Mainstream potential

2/10

Technical importance

6/10

Adoption evidence

3/10

Risks
  • Educational focus limits scope; code likely simplified for clarity rather than optimized for performance or scale.
  • Tightly coupled to a specific book (Manning 'Build a Reasoning Model') — if the book goes out of print or is not updated, repo may accumulate stale dependencies or outdated methods.
  • Dependency on Qwen3 and specific pre-trained models; if underlying models are deprecated or require authentication, code examples may break.
  • Jupyter Notebooks are less conducive to versioning, CI/CD, and production integration compared to modular Python packages; adoption by practitioners may be limited.
  • No evidence of contributions from external maintainers; relies on Raschka's personal maintenance bandwidth.
Prediction

Likely to remain a stable, well-maintained educational resource for 2–3 years as long as the book is actively marketed. Will probably see steady citations in course syllabi and tutorials. Unlikely to evolve into a production framework; may be superseded if more advanced reasoning techniques emerge and require new pedagogical materials.

0 found this helpful

Newsletter

Get analyses like this every Monday

Free weekly digest of the most interesting open-source discoveries.

Languages

Jupyter Notebook
68.3%
Python
31.6%
Shell
0.1%

Information

Language
Jupyter Notebook
License
Apache-2.0
Last updated
4d ago
Created
16mo ago
Analyzed with
anthropic/claude-haiku-4-5

Stars over time

Loading…

Contributors over time

Top 100 contributors only — repos with more will plateau at 100.

Loading…

Similar repos

rasbt

rasbt/LLMs-from-scratch

A Jupyter Notebook-based companion repository to the book 'Build a Large...

98.9k Jupyter Notebook AI & ML
hijkzzz

hijkzzz/Awesome-LLM-Strawberry

A curated collection of research papers, blogs, and projects focused on OpenAI...

TsinghuaC3I

TsinghuaC3I/Awesome-RL-for-LRMs

This is a curated survey and collection of papers on reinforcement learning...

2.5k TeX AI & ML
raiyanyahya

raiyanyahya/how-to-train-your-gpt

An interactive 12-chapter textbook that teaches how to build a modern LLM...

2.3k Jupyter Notebook Education
vs. alternatives
rasbt/LLMs-from-scratch

Same author; vastly more mature (98k stars vs 4.6k). LLMs-from-scratch teaches foundational LLM concepts; reasoning-from-scratch is a narrower follow-up focused on post-training reasoning. Different scope, not a direct replacement.

hijkzzz/Awesome-LLM-Strawberry

Another curated reasoning+LLM resource (6.9k stars). Appears to be a collection/curation rather than hands-on code tutorials. Reasoning-from-scratch differentiates via step-by-step PyTorch implementation.

raiyanyahya/how-to-train-your-gpt

Similar genre (educational, training-focused); 2.3k stars. Reasoning-from-scratch has higher adoption and appears more actively maintained (recent push). Both serve niche educational market.

Official model repos (DeepSeek R1, OpenAI examples)

Those repos focus on reproducing specific production models. Reasoning-from-scratch is explicitly simplified for learning, not production-grade. Different use case entirely.

University course materials / papers

Competes informally with academic resources and papers on reasoning. No direct technical competition; serves as an accessible supplement to published research.