The Leanpub 60 Day 100% Happiness Guarantee
Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
See full terms...

Explore what happens inside modern language models and learn how to make them smaller, faster and more reliable. This bundle takes you from understanding transformer internals to pruning MoE experts, quantizing models and building practical evaluation workflows. A hands-on collection for engineers who want to go beyond using LLMs and start understanding how they really work.
Bought separately
$128
Minimum price
$69.00
$89.00
About the Bundle
Take a deeper look at how modern language models work, how they can be made more efficient and how to evaluate them properly. This bundle brings together four practical books covering some of the most important areas of LLM engineering, from understanding model internals to deploying smaller, faster and more efficient models.
The Ghost in the Weights explores mechanistic interpretability, showing how transformers learn internal algorithms, how attention heads and features work together and how researchers can uncover the computations hidden inside neural networks. It includes mathematical foundations, practical code and hands-on methods for studying real models.
A Practical Guide to Pruning Experts in Mixture-of-Experts (MoE) Models focuses on reducing the size and memory requirements of MoE models through expert pruning. It covers pruning strategies, scoring methods, architectural considerations and working implementations, with an emphasis on making models more efficient without unnecessary retraining.
LLM Quantization Recipes takes a hands-on approach to model compression. It explains techniques such as GPTQ, AWQ, GGUF and NF4, compares their trade-offs and helps readers choose the right quantization method for their hardware, performance requirements and deployment goals.
Evaluating Local and Small Language Models shows how to build reliable evaluation workflows for models running locally or on limited hardware. It covers benchmarking, performance measurement, runtime comparisons and experimental methodology, helping engineers make informed deployment decisions based on reproducible results rather than misleading benchmarks.
Together, these books offer a practical foundation for understanding, optimizing and deploying language models. Whether you are researching model internals, reducing inference costs or building reliable local AI systems, this bundle gives you the knowledge and tools to approach LLM engineering with greater confidence.
About the Books
Modern large language models perform astonishing computations -- writing code, solving math, translating between languages -- yet their internal mechanisms remain largely opaque. This book takes you inside the black box. From the mathematical foundations of neural computation to the cutting edge of mechanistic interpretability research, you will learn how to reverse-engineer the algorithms transformers have learned during training. You will understand how attention heads discover structural patterns, how features emerge and compete in the residual stream, how sparse autoencoders decompose polysemantic neurons into human-readable concepts and how causal intervention methods trace information through computational circuits. Along the way, you will write real code to analyze actual models, reproduce landmark results and develop the skills to conduct independent interpretability research. This is not about what models can do. It is about how they do it.
Mixture-of-Experts models have emerged as the dominant architecture for scaling language models to hundreds of billions and even trillions of parameters while maintaining tractable inference costs. Yet their massive parameter counts create significant memory and deployment challenges. Expert pruning: the systematic removal of redundant or low-contribution experts: offers a direct path to reducing model size without requiring complete retraining. This book provides a rigorous, implementation-focused treatment of expert pruning in MoE models: the mathematical foundations, the complete landscape of scoring and selection methods, the architectural subtleties that determine success or failure, verified open-source tooling and complete working code for loading, analyzing, pruning and evaluating MoE models. By the end, you will be able to implement expert-pruning systems independently, diagnose failures, adapt methods to unfamiliar architectures and make principled decisions about when and how to prune experts in production.
Large language models have become too big to run on a single GPU. Quantization is the technology that makes them deployable, and it has evolved from an academic curiosity into an engineering discipline with its own algorithms, toolchains, and best practices. This book explains how LLM quantization works, from first principles through production deployment. You will learn the internals of GPTQ, AWQ, GGUF, NF4, and other methods; understand their trade-offs in quality, speed, and memory; and find clear guidance for choosing the right approach for your hardware and use case. Along the way you will encounter real benchmarks, reproducible code examples, and a decision framework for navigating one of the most rapidly evolving areas of applied machine learning.
This book teaches engineers how to build reliable evaluation systems for small and locally deployed language models. You will learn to measure performance accurately, compare models across hardware and runtimes, interpret results without being misled by benchmarks, and make evidence-based deployment decisions for real-world workloads. The guide combines rigorous experimental methodology with example code so you can independently establish an evaluation laboratory and produce trustworthy, reproducible results.
Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
See full terms...
We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.
(Yes, some authors have already earned much more than that on Leanpub.)
Learn more about writing on Leanpub
If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).
Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.
Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.
Learn more about Leanpub's ebook formats and where to read them
You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!
Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.
Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.