When should you build a workflow instead of an agent?
Generative AI and LLM Quiz
Generative AI and LLM Quiz1 of 10
Generative AI and LLM Quiz1 of 10
When should you build a workflow instead of an agent?
About · Quizzes · History of AI · To suggest new questions or report an error send me a dm.
Ten questions on large language models in practice: temperature and top-p, retrieval-augmented generation, when to fine-tune, and what sets latency and cost.
10 questions per run, drawn from 26. Free, no sign-up. Every question comes from the generative AI interview questions.
The 10 questions this quiz opens with. Play first, then open one to check your answer.
Whenever the steps are known ahead of time. A fixed sequence of model calls and code is cheaper, faster and testable, and you can see which step broke. An agent earns its loop only when the next action depends on intermediate results. Longer answer
Low-rank adaptation: a fine-tuning method that freezes a model's weights and learns a small low-rank update for chosen weight matrices, W + BA. It trains a fraction of a percent of the parameters, and the update can be merged into W afterwards, so inference costs nothing extra. Longer answer
Self-attention lets every token weigh every other token in one parallel step, instead of pushing information down a recurrent chain, so long-range dependencies survive and training parallelises. The cost is attention quadratic in sequence length. Longer answer
Attention keys and values for the prefix, cached per layer, so each new token attends over saved state instead of recomputing the sequence. The cache grows with batch size, sequence length and layers, so GPU memory rather than compute limits throughput. Longer answer
Grounding, not scolding: retrieval with citations, permission to answer that it does not know, tool calls for facts and arithmetic, and a verification pass. The model optimises for the likeliest next token, not for truth, so instructions alone will not. Longer answer
Direct preference optimization: aligning a language model to human preferences by training directly on pairs of preferred and rejected answers with a simple classification-style loss. It targets the same objective as RLHF without training a separate reward model or running reinforcement learning. Longer answer
Prompting a model to write out intermediate reasoning steps before its final answer, either by showing worked examples or by adding an instruction such as "Let's think step by step". It improves accuracy on multi-step problems such as arithmetic and logic, at the cost of more output tokens. Longer answer
For a fixed compute budget, a language model's size and its number of training tokens should grow in equal proportion, which works out to roughly 20 training tokens per parameter. Hoffmann and colleagues at DeepMind showed in 2022 that most large models of the time were too big and undertrained. Longer answer
How the next token is sampled: temperature flattens or sharpens the distribution, top-k keeps the k likeliest tokens, top-p the smallest set whose mass reaches p. Near zero for extraction and code; raise it only when you want variety. Longer answer
An attention variant in which groups of query heads share one key head and one value head. It shrinks the KV cache, and the memory traffic of generating each token, by the group size while keeping quality close to full multi-head attention. Longer answer