Stay Practiced.
Local toolsSite guideSettings
Curriculum

LLM and RAG engineering

Build the conceptual and executable foundations of language models, training, retrieval, evaluation, access control and grounded systems.

20 units · Web, Plus, Pro · 20 programming subjects + 2 security tracks

Branches show this unit’s authored theory, coding and assessment work.

Select a node. Drag the background to pan.100%

Unit 1 / 20

Turn text into token IDs

Map text to a fixed vocabulary and preserve unknown tokens explicitly.

0 prerequisite skills · Reading, guided completion and independent success remain separate evidence.

Open this unit

The course, in order

Open a unit in the map to inspect its activities. Reading, guided completion, independent work and review remain distinct evidence.

  1. Turn text into token IDs

    Map text to a fixed vocabulary and preserve unknown tokens explicitly.

    Open this unit
  2. Train a tiny next-token model

    Learn adjacent-token counts from a corpus without crossing document boundaries.

    Open this unit
  3. Normalize logits safely

    Use stable softmax and temperature without confusing confidence with correctness.

    Open this unit
  4. Measure next-token prediction loss

    Compute mean negative log-likelihood only over assessed target positions.

    Open this unit
  5. Update model parameters from error

    Perform one gradient step and check whether a small training objective improves.

    Open this unit
  6. Combine context with attention weights

    Build an attention-weighted value vector and enforce causal visibility.

    Open this unit
  7. Separate training from evaluation

    Keep related documents in one split and reject contaminated evaluations.

    Open this unit
  8. Prepare supervised fine-tuning examples

    Select valid instruction-response pairs and build an explicit completion-loss mask.

    Open this unit
  9. Chunk documents with source provenance

    Create bounded overlapping chunks while keeping source identity and offsets.

    Open this unit
  10. Compare embeddings correctly

    Use cosine similarity without confusing vector length with relevance.

    Open this unit
  11. Rank retrieval candidates with stable ties

    Choose top-k unique retrieval results and measure whether relevant sources were found.

    Open this unit
  12. Filter evidence before it reaches the model

    Prevent cross-tenant retrieval and preserve source revision boundaries.

    Open this unit
  13. Fit evidence into a bounded context

    Reserve output space and select complete chunks within a token budget.

    Open this unit
  14. Check answer provenance and abstention

    Validate citation membership and abstain when supplied evidence is insufficient.

    Open this unit
  15. Assemble a small AI and retrieval pipeline

    Connect learned next-token counts to inference, and authorized retrieval to a grounded model request.

    Open this unit
  16. Control optimization across microbatches

    Combine gradients by example count and schedule learning rates with explicit warmup and decay boundaries.

    Open this unit
  17. Build causal transformer mechanics

    Construct causal visibility and normalize attention only over tokens available at a query position.

    Open this unit
  18. Evaluate models across meaningful slices

    Measure token prediction quality and expose subgroup failures that a single aggregate can hide.

    Open this unit
  19. Evaluate retrieval before generation

    Measure coverage and first-hit rank on frozen relevance judgments before blaming the generator.

    Open this unit
  20. Release and monitor an AI system

    Compute a release decision from supplied quality, latency and safety metrics, then measure total-variation distance between supplied distributions. Use these bounded checks as preparation for deployment monitoring, not proof that monitoring ran.

    Open this unit
TheoryHands-on codingEvidence / reviewTechnical wikiMembership access