Dinesh/ Blog

Article series · 26 lessons

LLM engineering

Connect tokenization and model mechanics to retrieval, evaluation, tools and serving.

Start this series

Follow the sequence below, or pick up where you left off. Nothing is locked.

What you’ll work toward & your progress

What you’ll work toward

  • Distinguish byte, character, word and subword coverage
  • Hand-count BPE pairs and implement reversible ranked byte merges
  • Separate WordPiece inference, unigram scoring and SentencePiece configuration
  • Test Unicode, whitespace, unknown IDs and template boundaries
Loading this browser’s progress…

Completion is stored on this device only. Nothing is locked; start where it makes sense.

Before the first lesson

These are the starting lesson’s prerequisites, not requirements for every advanced topic below.

How to practise this subject

Define a testable task and a failure case. Separate model output from authorized actions, examine retrieval evidence, and specify how quality and latency would be measured.

Lessons in order

  1. 01advanced · 45 min

    Tokenization — BPE, WordPiece, SentencePiece

    Tokenization — BPE, WordPiece, SentencePiece: mechanisms, worked examples, assumptions and source-backed corrections with explicit experiment boundaries.

  2. 02advanced · 45 min

    Attention Intuition — Sequence Bottlenecks and Soft Retrieval

    Attention Intuition — Sequence Bottlenecks and Soft Retrieval: mechanisms, worked examples, assumptions and source-backed corrections with explicit experiment boundaries.

  3. 03advanced · 45 min

    Q/K/V Math — Scaled Dot-Product Attention Derived

    Q/K/V Math — Scaled Dot-Product Attention Derived: mechanisms, worked examples, assumptions and source-backed corrections with explicit experiment boundaries.

  4. 04advanced · 45 min

    Multi-Head Attention — Parallel Views

    Multi-Head Attention — Parallel Views: mechanisms, worked examples, assumptions and source-backed corrections with explicit experiment boundaries.

  5. 05advanced · 20 min

    Positional Encoding — Sinusoidal, Learned, RoPE

    Prove attention equivariance, derive sinusoidal and rotary position geometry, and test offsets without confusing computable positions with length generalization.

  6. 06advanced · 20 min

    Full Transformer Architecture — Encoder + Decoder

    Assemble causal and encoder-decoder Transformers, derive residual and normalization behavior, count parameters, and train a tiny CPU character fixture.

  7. 07advanced · 20 min

    Encoder (BERT), Decoder (GPT), Enc-Dec (T5) — When Each

    Separate Transformer families, pretraining losses and output heads; work through BERT corruption and T5 sentinels and inspect local-only inference interfaces.

  8. 08advanced · 20 min

    LLM Sampling — Greedy, Beam, Top-k, Top-p, Temperature

    Derive temperature, nucleus truncation and search; implement edge-case-safe CPU sampling and translate policies into versioned API contracts.

  9. 09advanced · 20 min

    Scaling Laws — Chinchilla, Compute-Optimal Training

    Derive budget-conserving language-model allocations, reconcile Chinchilla and Kaplan, and compare training-only and lifetime-cost objectives.

  10. 10advanced · 20 min

    Efficient Attention — Flash, Sparse, Linear

    Derive online softmax, distinguish exact execution from sparse and kernel operators, and verify CPU parity while specifying a separate GPU-backend proof.

  11. 11advanced · 20 min

    Prompting — Zero-Shot, Few-Shot, Chain-of-Thought, ReAct

    Design testable prompts, bounded tool controllers and evaluation contracts; distinguish published reasoning results from offline fixtures and generated explanations.

  12. 12advanced · 20 min

    RAG I — Chunking Strategies & Indexing

    Build a versioned RAG index with source ranges, tokenizer budgets, stale-chunk removal and access controls; test a complete local lexical-index lifecycle.

  13. 13advanced · 18 min

    RAG II — Retrieval, Hybrid Search, Reranking

    RAG II — Retrieval, Hybrid Search, Reranking: mechanisms, worked examples, assumptions and source-backed corrections with explicit experiment boundaries.

  14. 14advanced · 18 min

    Vector Databases — pgvector, HNSW, IVF

    Vector Databases — pgvector, HNSW, IVF: mechanisms, worked examples, assumptions and source-backed corrections with explicit experiment boundaries.

  15. 15advanced · 18 min

    LLM Agents — Function Calling, Tools, Planning

    LLM Agents — Function Calling, Tools, Planning: mechanisms, worked examples, assumptions and source-backed corrections with explicit experiment boundaries.

  16. 16advanced · 18 min

    Multi-Agent Orchestration — LangGraph, CrewAI Patterns

    Multi-Agent Orchestration — LangGraph, CrewAI Patterns: mechanisms, worked examples, assumptions and source-backed corrections with explicit experiment boundaries.

  17. 17advanced · 18 min

    LLM Evaluation — LLM-as-Judge, RAGAS, Golden Sets

    LLM Evaluation — LLM-as-Judge, RAGAS, Golden Sets: mechanisms, worked examples, assumptions and source-backed corrections with explicit experiment boundaries.

  18. 18advanced · 18 min

    Fine-Tuning — LoRA, QLoRA, PEFT, When NOT to Fine-Tune

    Fine-Tuning — LoRA, QLoRA, PEFT, When NOT to Fine-Tune: mechanisms, worked examples, assumptions and source-backed corrections with explicit experiment boundaries.

  19. 19advanced · 18 min

    LLM Serving — KV Cache, Batching, Speculative Decoding

    LLM Serving — KV Cache, Batching, Speculative Decoding: mechanisms, worked examples, assumptions and source-backed corrections with explicit experiment boundaries.

  20. 20advanced · 18 min

    Multimodal LLMs — CLIP, VLMs, Audio, Video

    Multimodal LLMs — CLIP, VLMs, Audio, Video: mechanisms, worked examples, assumptions and source-backed corrections with explicit experiment boundaries.

  21. 21beginner · 8 min

    Google and Kaggle Gen AI study notes — the opening foundations

    An opening-reading notebook, not a completed five-day course: distinguish recurrence, attention, autoregressive generation, prompting, retrieval and fine-tuning.

  22. 22beginner · 10 min

    A deep-study prompt with examples, evidence and an audio version

    Build a bounded study request, keep sources separate from narration, and evaluate generated explanations instead of mistaking fluent detail for verified knowledge.

  23. 23intermediate · 12 min

    How transformers actually attend — a weighted lookup you can calculate

    Follow queries, keys and values through a numeric attention head, test causal masking, and separate multi-head capacity from guaranteed interpretability or long-context quality.

  24. 24intermediate · 30 min

    Image classification: from a scalar model to a tested experiment contract

    Derive loss and softmax, plan controlled Fashion-MNIST experiments, and follow complete local TensorFlow references for training, callbacks and save/load.

  25. 25intermediate · 18 min

    Reading MEDEC — detection, localization and correction are different tests

    Audit the MEDEC benchmark's data construction, exact reported scores, prompt format and metric limitations without treating a clinical NLP benchmark as deployment validation.

  26. 26intermediate · 17 min

    Stanford CS229: Machine Learning Course

    A source-reviewed CS229 orientation with worked linear algebra, probability, optimization and runnable algorithm fixtures.