Leanpub Header

Skip to main content

Filters

Books

  1. Deriving Algorithms
    Deriving Algorithms
    Reading, Diagnosing, Building: Twenty-Seven Worked Derivations and 285 Problems That Teach You to Find an Algorithm Instead of Recalling One
    Hatem M.

    Most algorithm books are catalogues: here is a technique, here is its proof, here are exercises. This one withholds the name of every technique until after you have built it.

  2. 100 LLM Autopsies
    100 LLM Autopsies
    What broke, why nobody noticed, and how it was found
    Hatem M.

    A model that crashes is a good day. The dangerous failures return answers — plausible, fluent, and wrong. 100 failures. 63 diagnostic instruments. One rule: inspect what actually happened.

  3. Full-Length Practice Exams
    Full-Length Practice Exams
    Where the domains meet — which is where the exam lives
    Hatem M.

    The eight volumes before this one each teach a single domain, and each is deliberatelyself-contained. The exams do not ask about domains — they ask about systems, and a system spansall of them at once. "A retrieval system is slow, expensive and occasionally wrong — which do you fix first?" needsretrieval, optimisation and operations together. Every one of the 150 questions here crosses atleast two domains, because that is the specific thing a single-domain book cannot teach you.

  4. Safety, Ethics and Compliance
    Safety, Ethics and Compliance
    The arithmetic underneath the assurances
    Hatem M.

    "The model is safe." "The filter is effective." "We red-teamed it and found nothing." "Wereviewed a sample and it looked fine." Each of those is a claim about evidence, and each is unfalsifiable as stated. Reviewing thirtyoutputs and finding no problems is consistent with a failure rate of one in eleven. Threehundred tests against a thousand possible failure modes leave seven hundred nobody looked at. This book supplies the missing arithmetic — and it was written without generating a singleharmful output to study.

  5. Deployment, Monitoring and Reliability
    Deployment, Monitoring and Reliability
    What a system looks like as it fails — not after
    Hatem M.

    A model that works in development and fails in production usually fails for reasons that havenothing to do with the model. It waits behind other requests. It loads slowly after a restart.It answers differently because somebody moved a decoding parameter by a tenth of a point. Aguardrail blocks a third of legitimate traffic and reports itself as working. None of those appear in a benchmark. They appear in an incident — and almost every one of themis invisible in an instantaneous measurement and obvious in a trend.

  6. Optimisation and Acceleration
    Optimisation and Acceleration
    Where inference time actually goes — and what each remedy really costs
    Hatem M.

    Quantise the weights. Batch the requests. Add a draft model. Prune what you can. Shorten thecache. A long list of techniques and a short list of reasons. This book measures the reason first: the machine streams memory at 22.54 GB/s and computes at116.58 GFLOP/s, so anything performing fewer than 5.17 operations per byte is waiting. Decodingperforms 0.22. Every technique in the book is then measured against that one number — andseveral turn out to be addressing the wrong side of it.

  7. Adaptation and Fine-Tuning
    Adaptation and Fine-Tuning
    What it costs to teach a model something new — built, broken and measured from scratch
    Hatem M.

    Use LoRA because it forgets less. Keep the learning rate low. Mix in some general data. Stopearly. Four pieces of advice everyone repeats and almost nobody quantifies. This book measures each one — and two turn out to be doing something other than what they arecredited with. LoRA's retention is governed by a scaling constant, not by its parameterefficiency. Early stopping bounds the damage without separating it from the gain. Everyexperiment reports two numbers: the new task, and the capability you were not trying tochange.

  8. Retrieval-Augmented Generation
    Retrieval-Augmented Generation
    Where the pipeline actually fails — chunking, retrieval, attribution and the numbers that hide it
    Hatem M.

    Chunk at 500 with 50 of overlap. Retrieve five. Add a reranker. Use hybrid search.Repeated everywhere, justified almost nowhere. This book measures them instead, on corpora built so that the correct answer follows fromhow they were made. Several results contradicted the advice: the hybrid combination lost inevery condition tested, neither reranker produced an effect above the noise floor, andattribution collapsed to 0.170 while retrieval was still reporting 0.920.

  9. Embeddings and Vector Search
    Embeddings and Vector Search
    Every index built from scratch. Every recall figure checked against exact ground truth.
    Hatem M.

    Vector databases give you a similarity metric, an index with four tuning parameters, acompression option and a way to filter — and almost no guidance on what any of it costs. This book builds each one from scratch and measures it. The proximity graph, the invertedfile, the product quantiser: implemented in NumPy, included with the text, and checkedagainst exhaustive search — so every recall figure here is exact rather than estimated.

  10. Prompting and Controlled Output
    Prompting and Controlled Output
    Why prompting works when it works — built, broken and measured from scratch
    Hatem M.

    Prompting has more advice than evidence. This book measures it instead: a model reading apattern it has never seen, the same model failing at a task in one pass and solving itperfectly in four, a decoder that guarantees a format instead of improving the odds, and amodel that is 2.4% accurate while 78.6% confident. Six central claims are built from scratch and measured on a single CPU core. Everythingtaken from published research sits in a grey box marked "Not measured here" — so you neverhave to guess which is which.

  11. Foundations of Large Language Models
    Foundations of Large Language Models
    What the model is actually doing — and why every certification asks about it differently
    Hatem M.

    Five certifications ask about the same twenty topics, and each one stops at a differentdepth. This book teaches the topic once, properly, then shows you exactly where each examstops — with 61 original practice questions where every wrong option is explained. Every number in it was measured. Every line of code was run. The code is included.

  12. Claude Patterns
    Claude Patterns
    Reusable Workflows for Real Projects with Claude
    Hatem M.

    You already know the principles. Then you hit a wall mid-project — the session died, a decision turned out wrong, four pieces have to become one — and knowing the principles isn't the same as knowing what to do. Claude Patterns is ten reusable workflows for exactly those moments: the assemblies you run when principles alone don't get you through.

  13. Beyond Chat: Managing Complex Projects with Claude
    Beyond Chat: Managing Complex Projects with Claude
    Managing Complex Projects with Claude
    Hatem M.

    Claude can write a chapter, a module, or a report section in minutes — that's exactly what makes long projects dangerous. Beyond Chat is a practical system for staying in control of long, complex work: how to define a project so it holds together, keep a memory that survives sessions, and know when things have quietly drifted off course.

  14. SQL Problem Solving
    SQL Problem Solving
    A Hands-On Workbook with 84 Real SQL Challenges
    Hatem M.

    84 hand-picked SQL problems, fully solved and explained — from your first SELECT to interview-ready queries. Seven volumes of pure practice: a problem, the data, the answer, and why it works. No theory chapters, no filler, every query tested against a real database. Solve first, read second.

  15. LLM Quantization
    LLM Quantization
    From the Bits Up
    Hatem M.

    Anyone can run INT4 and read off the accuracy drop. This book explains why that number is what it is — building every quantization method from scratch, breaking it on purpose, and measuring the result. Quantization, from the bits up.