Your Cart
Loading

AI From Scratch in C

On Sale
$35.00
Pay what you want: (minimum $35.00)
$
Added to cart

A complete GPT, written in C from absolute scratch. No libraries, framework or automatic differentiation.


37 chapters and over 178 program exercises. Every one compiles standalone with a C compiler and nothing else.

Free to read online at rvembedded.com. This is the complete offline PDF.


$29 with code LAUNCHMONTH until September 30, then $35.


Bonus Chapters 38 to 45 on the DeepSeek architecture including deployment in production ship in October as a free update, Buy during the launch month and you get the expanded edition at no extra cost. Preview chapter 1 in full, no email required just click the "Preview" button above!


Most people learn neural networks by importing a framework, usually in Python, and trusting it. Then you find out you need a bigger machine, or a package broke. This book builds every part in C, from one neuron to a working GPT, so you can see the arithmetic instead of taking it on faith. If you have ever wanted to know what is actually happening under model.fit(), this is the path.


Everything is vanilla C99. No environment to set up and nothing to break in six months. Every figure showing program output is a capture of a real run, not a diagram of what should happen. You can follow along with these examples on literally any machine.



WHY THIS BOOK EXISTS


I came from embedded systems, where you are expected to know what the silicon does. AI is taught the opposite way. Tutorials hand you a working model and stop exactly where the interesting part begins. Advanced books assume you already know the terminology. Academic books seem more interested in impressing you with mathematics than teaching you. I wanted the arithmetic, and I could not find a book that carried it from a single neuron to a modern language model in one language with no dependencies, so I wrote it.



WHO IT IS FOR


Anyone who can write C and would rather understand than call. It assumes pointers, structs and malloc. It does not assume calculus, and every derivative it needs is explained immediately before it gets used. It is not a fast route to training production models. If that is what you want, use PyTorch, it is genuinely better at that job. This is for the part PyTorch will never show you.



FORMAT AND UPDATES


PDF, 842 pages, 7.5 by 9.25 inches, searchable. Every buyer gets all future revisions of the first edition free, including the October chapters. Corrections are welcome and credited. Send them to armstrongsubero@gmail.com.

You will get the following files:
  • PDF (18MB)
  • ZIP (198KB)