Sebastian Raschka

Sebastian Raschka, PhD, has been working in machine learning and AI for more than a decade. In addition to being a researcher, Sebastian has a strong passion for education. He is known for his bestselling books on machine learning with Python and his contributions to open source.

Sebastian is a staff research engineer at Lightning AI, focusing on implementing and training LLMs. Before his industry experience, Sebastian was an assistant professor in the Department of Statistics at the University of Wisconsin-Madison, where he focused on deep learning research. You can learn more about Sebastian at https://sebastianraschka.com.

books & videos by Sebastian Raschka

Master and Build Large Language Models

  • Course duration: 17h 15m

The best way to understand LLMs is to build one yourself. This course gives you that power.

In this engaging liveVideo, veteran AI researcher Sebastian Raschka leads you step by step through the inner workings of a large language model. You'll see and hear Sebastian talk you through each step of the LLM project you build in his bestselling book Build a Large Language Model (From Scratch).

In this liveVideo, you'll explore how to:

  • Plan and code all the parts of an LLM
  • Prepare a dataset suitable for LLM training
  • Fine-tune LLMs for text classification and with your own data
  • Use human feedback to ensure your LLM follows instructions
  • Load pretrained weights into an LLM

This liveVideo is the perfect orientation to LLMs for software engineers ready to lead AI initiatives or data scientists and ML researchers who want build or adapt their own LLMs.

This unique course also includes six essential prerequisite videos created by AI expert Abhinav Kimothi, author of A Simple Guide to Retrieval Augmented Generation. Abhinav delivers an insightful review of everything from the Python features you need to work on LLMs to advanced PyTorch operations, ensuring you can succeed regardless of your starting point.

Build a Reasoning Model (From Scratch)

  • June 2026
  • ISBN 9781633434677
  • 440 pages
  • printed in color
print book available Jul 1, 2026

"An exceptional deep dive into the next frontier of AI.”
—Aman Chadha, Google


Build a Reasoning Model (From Scratch) is a practical guide to understanding how modern reasoning-oriented LLMs work by building their core methods step by step. The book tells a clear engineering story: start with a conventional pre-trained LLM, learn how text generation works, build reliable evaluation tools, improve reasoning through inference-time methods, then move into training-based approaches such as reinforcement learning and distillation.

The progression is deliberate. Early chapters establish the baseline model and explain text generation, KV caching, and evaluation with math verifiers. The middle chapters show how reasoning can be improved without changing model weights, using chain-of-thought prompting, sampling, self-consistency, response scoring, and self-refinement. Later chapters move to changing the model itself through reinforcement learning with verifiable rewards, GRPO improvements, format rewards, and finally distillation from stronger reasoning models into smaller ones.

The book is especially useful because it implements the core methods from scratch rather than treating them as black-box library calls. Readers see how self-consistency, self-refinement, Best-of-N, and training-based methods actually work, including their cost and latency trade-offs. It also discusses common failure modes, including cases where refinement can make answers worse. Difficult concepts such as softmax, temperature, and top-p sampling are clarified with code-linked explanations and diagrams, and visual workflows make pipelines and scoring methods easier to follow.

Reading the book feels like following a guided technical build rather than a loose survey of AI topics. Each concept is introduced because the project now needs it. Diagrams, roadmaps, code listings, exercises, and repeated workflow summaries help readers stay oriented through advanced material. This structure reflects Sebastian Raschka’s professional strength: explaining complex machine learning topics by making every detail concrete and showing exactly where each section fits in the larger story. He does not treat mechanisms like evaluation, log-probabilities, KL regularization, or distillation as isolated abstractions; he connects them to the goal of making reasoning models understandable and implementable.

Physically and organizationally, the book has eight chapters and seven substantial appendixes. That design keeps the main narrative focused while moving supporting material like references, exercise solutions, model source code, larger models, batching, evaluation alternatives, and chat interfaces into ordered appendixes. The result is a logically flowing book that remains hands-on, navigable, and technically deep without constantly interrupting the central build.

Build a Large Language Model (From Scratch)

  • September 2024
  • ISBN 9781633437166
  • 368 pages
  • printed in black & white

Build a Large Language Model (From Scratch) is a practical and eminently-satisfying hands-on journey into the foundations of generative AI. Without relying on any existing LLM libraries, you’ll code a base model, evolve it into a text classifier, and ultimately create a chatbot that can follow your conversational instructions. And you’ll really understand it because you built it yourself!

For deeper understanding and better learning we provide a built-in testing system into liveBook, the online version of this book. Separately, you can download a free PDF Test Yourself guide on this book from here.