Книга THE LLM ENGINEER Lachlan James

THE LLM ENGINEER

Building Transformer Language Models with Python and PyTorch

Автор: Lachlan James
Език: Английски език
Корици: С меки корици
Издател: Independently published
Наличност: Външен склад
Изпращаме след 14-21 дни
44.73 87.48 лв
Most developers working with large language models today are flying blind. They understand the inter...

Информация за книгата

Автор
Език
Английски език
Корици
Книга - С меки корици
Издадена
2026
страници
246
EAN
9798255965939
Enbook ID
51946507
Издател
Теглоt
431
Размери
191 x 235 x 13

Пълно описание

Most developers working with large language models today are flying blind. They understand the interface but they don't really understand the machine. And there lies the gap - between knowing how to use a model and knowing how to build, debug, and adapt one - is where real engineering capability lives.

The LLM Engineer is a hands-on implementation guide that closes that gap completely. Starting from a single sentence - predict the next token - and ending with a quantized model serving requests through an OpenAI-compatible API, this book walks you through every layer of the modern LLM stack. No black boxes. No magic. Every concept is introduced once, explained precisely, and immediately followed by complete, runnable code.

The architecture you build matches the design of Llama 3, Mistral, and Gemma at the blueprint level - rotary position embeddings, grouped-query attention, SwiGLU activations, RMSNorm - not a toy approximation, but the real thing at teachable scale.

Inside this book, you'll learn how to:

  • Implement byte-pair encoding from scratch and understand the tokenizer quirks that cause real production bugs
  • Build scaled dot-product attention, multi-head attention, and grouped-query attention (GQA) - the memory-efficient variant used by every major open-weight model since 2022
  • Construct a complete transformer block using pre-norm RMSNorm, SwiGLU feed-forward layers, RoPE positional encodings, and residual connections
  • Design and run a full training pipeline: packed sequences, AdamW with parameter-group weight decay, cosine warmup scheduling, gradient clipping, mixed-precision bfloat16, and distributed data parallelism
  • Fine-tune models efficiently using LoRA and QLoRA - implemented entirely from scratch, not just called from a library
  • Train for human preference alignment using Direct Preference Optimization (DPO), the technique that replaced PPO-based RLHF in most production pipelines
  • Quantize models to INT8 and 4-bit precision using GPTQ, AWQ, and GGUF for CPU deployment with llama.cpp
  • Serve models at scale using vLLM with PagedAttention and continuous batching, and expose an OpenAI-compatible API

Along the way, you'll build:

  • A byte-pair encoding tokenizer that handles Unicode, byte-level encoding, and the edge cases that break naive implementations
  • A complete GPT-style transformer language model - architecturally identical to Llama 3 - trained from scratch on real text data
  • A full training loop with Weights & Biases experiment tracking, checkpointing, and distributed GPU support via PyTorch DDP
  • An inference engine with greedy decoding, temperature sampling, top-k, top-p, repetition penalties, speculative decoding, and structured output generation
  • LoRA and QLoRA adapters injected and merged into a pre-trained model, reducing trainable parameters by over 99%
  • A DPO-aligned instruct model trained on preference pairs, starting from an SFT checkpoint
  • A production-ready serving stack: quantized model exported to GGUF, served locally via Ollama, and deployed at scale with vLLM

Every chapter includes working, runnable code, common bug sections drawn from real implementation failures, and exercises that push your understanding beyond what the text alone can teach.

Може също да ви хареса

40.31 78.83 лв

Viking Boys

Jessie Margaret Edmondston Saxby
23.02 45.01 лв

Messing with My Head

Charles Fleming
14.52 28.40 лв
12.71 24.86 лв
288.66 564.56 лв

Клиенти, които купиха тази книга, купиха също

8.54 16.70 лв
10.30 20.14 лв

Les Chemins de la memoire

Marie Husson-Robert
8.89 17.39 лв
105.00 205.35 лв
16.08 31.45 лв
48.95 95.74 лв