AlgoViz
Learning paths

AI Engineering

Follow a token through a model, a passage through retrieval, or an action across an agent’s trust boundary. Explore 318 concepts in 75 chapters.

Chapter guide

Model foundationsFollow text into a model, one prediction at a time.
Running open-weight modelsLoad a verified checkpoint, measure quantization error and choose where inference runs.
Building model applicationsTurn an application request into a validated result.
Training and inferenceTrace which parameters change and where serving capacity goes.
Retrieval and groundingFollow a source document from ingestion to a cited answer.
Agent design and orchestrationDecide what the model controls and where a workflow must stop.
Running agents reliablyTest trajectories, recover failed runs and evaluate changes.
Model Context ProtocolTrace July 2026 requests and compare each walkthrough with its November 2025 counterpart.
Production AI architecturesFollow eight production systems from a real request through an engineering decision.

Reels and mnemonics

Reel production list · 35 topics

Each brief pairs a proposed explainer with a pause for recall.

  • Predict one token, then feed it back

    Follow one logit vector through a draw and show the changed prefix.

    Pause after the draw and predict what the next call receives.

    From an example to a next-token prediction
  • A word crosses two boundaries

    Animate text becoming token IDs and then rows of a learned table.

    Hide the table and ask which step determines sequence length.

    Tokens, vocabulary and learned representations
  • One attention head, two keys

    Show a causal mask and combine two values with weights ¾ and ¼.

    Reveal the values first and ask for the weighted output.

    Attention and the context window
  • Move the nucleus cutoff

    Keep three masses fixed and move top-p from 0.85 to 0.95.

    Predict the first threshold at which the third token can appear.

    Sampling and trustworthy answers
  • Watch three clocks on a streaming response

    Contrast first byte, first visible text and validated completion.

    Pause at a disconnect and decide whether the task finished.

    Streaming, token budgets and cost
  • A valid receipt with the wrong total

    Trace an amount through parser, schema and source verification.

    Hide the receipt and ask which gates have actually passed.

    Structured output and validation
  • Two small matrices change one projection

    Freeze a weight grid and add the product of two narrow matrices.

    Recover adapter parameter count for rank four.

    Supervised tuning, LoRA and training data
  • Pairwise feedback and the length shortcut

    Show a judge ranking answers before and after controlling for verbosity.

    Choose the independent check that tests a preference gain.

    Learning from preferences
  • Where the KV cache grows

    Append tokens while retaining key and value blocks per layer.

    Double context and predict the change in cache bytes.

    Attention kernels, KV heads and long context
  • A short request leaves the batch

    Animate a three-step and a one-step request sharing decode slots.

    Choose when a waiting request can enter.

    Batching, decoding and serving caches
  • The exception across a chunk boundary

    Slide the split across a policy and its exception.

    Choose a unit that can answer the holiday question.

    Choosing and annotating chunk boundaries
  • Return the price with its header

    Detach a table cell from its row and then reconstruct its evidence.

    Name the metadata needed to cite this amount.

    Chunking documents with internal structure
  • Two rankings for one error code

    Fuse a lexical list and a dense list, showing each contribution.

    Recompute the winner after removing one list.

    Lexical, semantic and hybrid retrieval
  • Promote the exception from eighth to first

    Trace a correct passage through shortlist, reranker and final context.

    Predict what happens when the passage starts outside the shortlist.

    Rewriting, filtering and re-ranking
  • A correct quotation that misses the question

    Follow two gold passages and two generated claims through separate checks.

    Identify which metric the second missing fact can reduce.

    Evaluating retrieval and answer quality
  • Compare possible routes with one actual run

    Animate a state update selecting one edge of a graph.

    Find the first wrong decision from its trace.

    Typed state, routing and graph execution
  • A crash between a refund and a checkpoint

    Stop a worker immediately after the external ledger commits.

    Decide which record to inspect before a retry.

    Checkpoints, interrupts and replay
  • A proposal crosses the authority boundary

    Show a valid refund request being stopped before execution.

    Name the check that schema validation cannot replace.

    Tool selection, execution and observation
  • A deleted address in a cached summary

    Trace one fact through authoritative memory and its derivatives.

    Find the remaining copy after the primary record is deleted.

    Working memory, retrieval and forgetting
  • Two workers, one underlying source

    Trace two agent messages back to the original draft and approved policy.

    Count independent evidence rather than workers.

    Multi-agent coordination and shared state
  • One more search or abstain?

    Track a missing date, a targeted rewrite and a finite search budget.

    Choose a stop condition when the date stays missing.

    Grading evidence and adapting retrieval
  • Grade the environment after three runs

    Replay equivalent trajectories and a duplicate booking.

    Pick the run that fails despite a convincing final message.

    Evaluating complete agent runs
  • One request, two protocol revisions

    Compare an initialized November connection with a self-describing July request to another replica.

    Pause at replica B and identify where the quote state lives.

    MCP hosts, clients and stateless requests
  • The quote needs one more answer

    Trace a request for missing input and compare it with historical server-requested sampling.

    Pause before resumption and identify the caller and the pending input.

    Multi-round input and legacy sampling
  • Two replies arrive out of order

    Return IDs 42 and 41 in reverse order to the client.

    Reconnect each response to its original caller.

    Authorization, tasks and request tracing
  • Fit a small weight and an outlier on four bits

    These two weights share a toy group. The first lies inside the fine codebook range and the second exceeds it.

    Increasing the toy scale reduces outlier clipping but what can it cost?

    What quantization does to a weight
  • Should the bilingual support model ship?

    The evaluation team records both outcomes for each task, retaining ties and reviewer disagreements. Eight net wins are encouraging, but they do not establish improvement for each population.

    The shadow worker is faster and the aggregate rises, but the Spanish guardrail fails. What should control promotion?

    Model evaluation, rollout and rollback
  • Can a former team member reopen a cached answer?

    Removing the employee from payroll changes membership while the indexed handbook remains byte-identical.

    The source text is unchanged and the old answer is a perfect semantic match. Can it be served after access is revoked?

    Permission-aware enterprise retrieval
  • Interrupt the interviewer halfway through a question

    The input stream continues during playback. Track turn identity and the device clock so the new speech can be associated with an interruption.

    The answer was fully generated before interruption, but only half was audible. Which history should guide the next turn?

    Real-time voice interview architecture
  • Find the quarter behind a plotted value

    Store the source revision, OCR and the page image. Preserve the visual relationship between line style and legend entry.

    The correct page is retrieved but the highlighted value belongs to another series. Where should evaluation record the failure?

    Visual documents and video evidence
  • A long document arrives among short conversations

    Reserve capacity for prompt tokens, concurrent chats and the expected decode state. Queue or decline a request that cannot fit its declared limits.

    Split pools reduce prefill delay but repeatedly miss the inter-token target. What comparison should decide deployment?

    Serving mixed workloads on an inference cluster
  • Could the fraud model know this at purchase time?

    The ledger records event and arrival times. A later fraud report labels this transaction after the prediction has already been served.

    A new feature is highly predictive but arrives after the purchase. How should the training set use it?

    Predictive ML features and feedback
  • Resume a draft after approval expires

    A durable event records the draft version, operation key and original approval expiry. It can be read after the worker vanishes.

    An old summary says “approved” but the current grant expired. What may the worker do?

    Durable sessions and isolated agent workers
  • A slow provider during an invoice rush

    The tenant requires EU processing and a typed amount field. A third provider fails residency and never receives the input.

    Only an out-of-region route can meet the deadline. Which response respects the contract?

    Routing across model providers
  • From a downloaded checkpoint to a local chat reply

    Download the Q4_K_M file at the pinned revision, compare its SHA-256 digest and retain the license alongside the artifact.

    A model starts but prints role markers and continues the user’s message. What should be checked first?

    Run an open-weight model on your computer
Illustrated mnemonics · 11 stories