GOAT EngineerPreparing your learning space…

AI Engineering · Concept Library

Concept Library

One idea per page, each with something you can drive.

These are the fast lanes over the same material the saga covers. Each page answers one question and stops, so you can arrive from a search, get the answer, and leave. Nothing here assumes you have read anything else, and each page says which ideas it sits on top of when that matters.

Every concept in the library

  1. How LLMs Work: Next-Token Prediction

    An LLM reads tokens and predicts the next one, over and over. Attention, sampling and training explained without the maths, with live demos.

  2. What Is a Token in an LLM?

    A token is a subword chunk, roughly three quarters of an English word. Why code and other languages cost more, and how to count them properly.

  3. Why LLMs Hallucinate, and What Reduces It

    Confident wrong answers are structural, not a bug you can patch. How factuality differs from faithfulness, and the defences that actually bound it.

  4. LLM Streaming and Time to First Token

    Streaming is the decode phase made visible, not a UI trick. Optimise time to first token, and know the proxy that silently un-streams you.

  5. How to Get Reliable JSON From an LLM

    Constrained decoding guarantees the shape of a model response. What JSON mode does not promise, and why a schema-valid value can still be wrong.

  6. LLM Cost Optimization: The Levers

    Work out your cost per resolved conversation, then pull the levers in order: output, context, routing, caching, batch, and the traps in each.

  7. Context Engineering vs Prompt Engineering

    Prompt engineering words one instruction. Context engineering curates the whole window, and past the set that answers the question, more is worse.

  8. How Prompt Caching Works, and When It Pays

    Reuse the prefill work of a stable prefix to cut input cost and time to first token. It matches from token zero, so one stray value busts it.

  9. What Is RAG and How Does It Work?

    Retrieval-augmented generation from first principles: chunking, retrieval, grounding and citations, how to evaluate it, and where it breaks.

  10. What Are Embeddings? Text as Vectors

    An embedding turns text into a vector so closeness in meaning becomes closeness in space. What the numbers encode, and how to choose a model.

  11. Vector Search: HNSW, IVF and Recall

    Brute force, HNSW and IVF, the recall and latency curve you cannot cheat, filtered search, and the memory arithmetic behind a billion vectors.

  12. Hybrid Search and Reranking for RAG

    Run BM25 beside the vector search, fuse the two ranked lists with reciprocal rank fusion, then let a cross-encoder reorder the shortlist.

  13. RAG Evaluation: Metrics and Golden Sets

    Score retrieval and generation separately: recall@k and MRR for the fetch, faithfulness and answer relevance for the reply, on a golden set.

  14. LLM Evaluation: Metrics That Gate a Deploy

    Evaluate an LLM feature on a fixed set of real cases, score it with code checks plus a judge, and fail the build when the number drops.

  15. LLM as a Judge: Biases and Validation

    An LLM judge scores output against a rubric. It carries position, verbosity and self-preference bias, so validate it on human labels first.

By GOAT Engineer. AI Engineering · Privacy Policy · Contact.