Explain how large language models function as reasoning engines, including the role of attention mechanisms, in-context learning, and emergent capabilities
88 important questions on Explain how large language models function as reasoning engines, including the role of attention mechanisms, in-context learning, and emergent capabilities
In an explanation (not just a description), what role does self-attention play in enabling reasoning-like behaviour in large language models?
- Core role: Self-attention combines relevant information from the context, allowing token representations to incorporate information from other tokens.
- Why that matters for reasoning-like behaviour: This enables the model to connect and reuse information such as
- instructions,
- facts stated earlier,
- prompt examples, and
- task requirements,
Explain how in-context learning operates in an LLM-based agent, and what part of the model’s overall computation it affects.
- What it is: In-context learning is the effect where prompt examples and instructions influence the generated continuation.
- How it operates: The agent supplies examples/instructions as tokens in the context; during processing, self-attention and subsequent Transformer layers integrate those tokens into the current representation.
- What it affects: It changes what the model predicts as the next token autoregressively, steering the output toward the pattern implied by the prompt (whether that output is normal text, a plan, structured JSON, or a tool call).
An AI agent can require different output formats (ordinary text, a plan, structured JSON, or a tool call). Explain why an LLM can produce all of these without changing its basic mechanism.
- Single underlying mechanism: An LLM performs autoregressive next-token prediction over tokens, after transforming token representations through a Transformer.
- Why formats differ: “Plan,” “JSON,” and “tool call” are all just different token sequences the model can generate.
- Why prompts matter: Prompt examples and instructions guide which kind of continuation is most likely, so the same language-generation process can yield text reasoning, structured output, or action-selection tokens used by an agent.
- Higher grades + faster learning
- Never study anything twice
- 100% sure, 100% understanding
Explain what it means (in this chapter’s framing) to call an LLM a “statistical sequence model,” and how that relates to “emergent” reasoning-like behaviour.
- Meaning: An LLM is described as a statistical sequence model because its fundamental job is to generate a continuation by predicting the next token based on context, using learned representations in a Transformer.
- Link to reasoning-like behaviour: The model can produce reasoning-like behaviour because attention and learned representations let it integrate instructions, facts, and examples to shape the continuation.
- Important qualification: This framing explicitly says the model does not contain a separate human-like reasoning module; the “reasoning engine” behaviour emerges from the same next-token generation process.
In an exam-length explanation of how an LLM functions as a reasoning engine, what four levels should a strong answer move through, and what is the purpose of each level?
- Start with the Transformer
- Purpose: describe the core machinery that transforms an input prompt (tokens + positions processed through attention and feed-forward layers).
- Explain the generation process
- Purpose: show how a decoder-only model produces output by predicting one next token at a time using causal attention.
- Connect this to reasoning
- Purpose: explain why the mechanisms can yield reasoning-like behaviour (attention + learned patterns + in-context examples + model scale).
- Evaluate the result
- Purpose: discuss agent capabilities and limitations (e.g., tool selection, hallucination, context loss, prompt sensitivity).
When explaining “the Transformer” part of an LLM answer, what components must be named, and what overall transformation do they perform on the prompt?
- Components to name
- Tokens and positions (what the prompt is represented as).
- Attention and feed-forward layers (the processing blocks).
- Overall transformation
- The model uses those components to transform the prompt into internal representations that support predicting subsequent output.
How does a decoder-only LLM generate text, and what is the role of causal attention in that process?
- Generation rule
- A decoder-only model generates by predicting one next token at a time.
- Role of causal attention
- Causal attention supports this step-by-step next-token prediction by structuring attention so the model’s prediction is based on the available prompt/context in a way consistent with left-to-right generation.
To connect an LLM’s mechanism to “reasoning-like behaviour,” which four factors should be explicitly linked, and what does each contribute (at a high level)?
- Attention
- Helps the model use relationships within the prompt/context to guide output patterns.
- Learned patterns
- Training yields statistical regularities the model can reuse as useful “reasoning and action” patterns.
- In-context examples
- Examples included in the prompt can steer the model toward producing the corresponding pattern of solution/explanation.
- Model scale
- Scale is linked (in the lecture framing) to supporting more capable reasoning-like behaviour.
What “engineering interpretation” caution should you state when discussing LLM reasoning, and what is the alternative mistaken interpretation?
- Mistaken interpretation
- Treating “reasoning” output as proof the model has human-like understanding.
- Engineering interpretation (lecture emphasis)
- The model can generate useful reasoning and action patterns because it has learned statistical regularities from training data (not because reasoning implies human-like understanding).
When you “evaluate the result” of an LLM as a reasoning engine, which capabilities/limitations must be discussed, and why is this evaluation step necessary?
- Items to discuss
- Tool selection
- Hallucination
- Context loss
- Prompt sensitivity
- Why evaluation is necessary
- It frames reasoning-like output as something that can succeed or fail in agent-like use, by stating concrete limitations alongside capabilities.
In modern LLMs, what is a Transformer, and what two computational advantages made it replace recurrent neural networks (RNNs) as the dominant architecture for language modelling?
- Parallel processing during training
- Unlike RNNs (which process tokens one after another), Transformers can process all input positions in parallel during training, making training much faster on GPUs.
- Direct long-range connections via attention
- Attention allows a token at one position to connect directly to another position, rather than passing information through every intermediate token (as in RNN-style sequential processing), which helps with distant-token relationships.
Explain two limitations of RNNs on long sequences and how attention in Transformers addresses them.
- Sequential processing constraint
- RNNs process tokens sequentially (one after another), which is less efficient than processing positions in parallel during training.
- Long-distance information dilution
- RNNs may dilute information over long distances because information must be passed through many intermediate tokens.
- Transformer attention can directly connect distant positions, avoiding the need to transmit information step-by-step through every intermediate token.
For agents using LLMs, why does the model’s context window matter, and what are two practical consequences mentioned for long inputs?
- Capacity limit
- It limits how much prior conversation/instructions/tool results can be included and therefore what information the model can access at once.
- Cost and usage effects
- Longer inputs increase computational cost.
- Attention patterns influence which information is actually used from within that context.
An agent receives a system instruction at the start, then many user messages and tool results. What failure mode can occur later in the conversation, and what mechanism is it related to?
- This is related to attention behaviour and the “lost in the middle” phenomenon, where important information earlier in a long context may not be effectively used.
To explain why an LLM can act as an agent’s “reasoning engine,” what Transformer properties should you connect to how the model combines information in a single context?
- Parallel processing during training
- Supports efficient learning at scale (fast GPU training) that underlies modern LLM capability.
- Direct connections between distant tokens via attention
- Lets the model combine instructions, task information, and previous actions within one context by connecting relevant distant positions directly.
- Implications for quality/limits
- These properties determine what information the model can access (via the context window) and how much it costs to process (longer inputs increase computational cost), shaping the quality and limits of agent reasoning.
Give three key comparison points between RNNs and Transformers that are relevant to scaling LLMs.
- Processing pattern
- RNNs process tokens sequentially; Transformers process positions in parallel during training.
- Long-range information handling
- RNNs may dilute information over long distances; Transformer attention can directly connect distant positions.
- Scaling
- Transformers scale effectively to very large parameter counts (a key property for modern LLMs).
In a Transformer-based LLM, what are tokens and embeddings, and why does the model use embeddings rather than “words”?
- Tokens are the units of text the model processes. A token can be a whole word, part of a word, punctuation, or a special symbol.
- Embeddings are vectors (lists) of numerical values that represent learned properties of each token.
- The model uses embeddings because it does not operate on human-readable “words” directly; it converts tokenized text into numerical representations that can be processed inside Transformer blocks.
Why is positional information added to token embeddings in Transformers, and what reasoning-relevant capability does this enable?
- Why add positional information: Token embeddings alone do not specify where tokens occur in the sequence, and attention by itself does not inherently preserve order.
- What it enables: With positional information added, the model can use both token content and token order, allowing it to relate later text (e.g., a question) to earlier text (e.g., an instruction or tool result) in a coherent way.
Describe the full process “from text to ordered representations” that prepares inputs for Transformer blocks in an LLM.
- Text is split into tokens.
- Each token receives a numerical embedding.
- Positional information is added.
- The resulting vectors enter the Transformer blocks.
- The model can now use both token content and token order.
Distinguish three positional encoding approaches—learned absolute embeddings, ALiBi, and RoPE—by stating what each adds or changes for attention.
- Learned absolute embeddings
- Each position has its own learned vector (an absolute position representation added to the token representation).
- ALiBi
- Attention receives a distance-based linear bias, which favours closer positions.
- RoPE
- Query and key vectors are rotated so that attention depends on relative position.
What is the stated advantage of RoPE in many recent models, and what limitation is explicitly noted even with longer context windows?
- Advantage (noted for agents): RoPE supports handling sequences longer than those used during training more effectively than some older positional approaches.
- Limitation: A longer nominal context window does not guarantee perfect recall.
In a Transformer LLM, what problem does self-attention solve for token representations, and how does this support “reasoning-like” context integration?
- Core function: a token can strongly relate to the specific earlier tokens that matter (e.g., linking “it” more to “cat” than “mat”).
- Reasoning-like integration: because relevant words, instructions, and intermediate results can directly influence one another, the model can connect items such as:
- a percentage with a number,
- a user question with a system instruction,
- a pronoun with its antecedent,
producing context-sensitive behavior that looks like reasoning over the prompt.
Given an input matrix X ∈ Rn × d, how are Q, K, and V constructed in self-attention, and what does each represent?
- Q = XWQ
- Query: what each token is looking for.
- K = XWK
- Key: what information each token offers.
- V = XWV
- Value: the information content that can be transmitted.
Here n is the number of tokens and d is the embedding dimension.
Write the self-attention operation Attention(Q, K, V) and explain what each major part does (QKT, softmax, and multiplying by V).
Attention(Q, K, V) = softmax((QKT)/√dk)V.
- QKT: dot products that measure relevance/similarity between each query and each key.
- softmax(…): converts relevance scores into weights (a distribution over token positions).
- (weights) × V: returns a weighted combination of the value vectors, so output representations blend information from relevant tokens.
Why does scaled dot-product attention divide by √dk, and what learning problem can occur without this scaling?
- Without scaling: the dot products in QKT can be large in magnitude.
- Effect on softmax: softmax can become almost one-hot.
- Learning consequence: nearly one-hot softmax yields very small gradients, which makes learning more difficult.
Explain the idea that attention is a soft lookup table. What is “soft” about it compared with a normal lookup table?
- Normal lookup: returns only one item (a hard selection).
- Attention lookup: produces weights over multiple positions and returns a combination of several relevant value vectors, not just one.
What is the main computational cost issue with self-attention for a sequence of length n, and why can this make long inputs expensive?
- Reason: the attention-score matrix involves pairwise comparisons among tokens.
- Cost description: often stated as O(n2).
- Practical implication: processing a large file or a long conversation can be expensive because n is large.
Using the “library search” analogy, map query, key, and value to their roles, and state what makes a token’s value have more influence.
- Query: asks, “What information do I need?”
- Key: indicates, “What information do I contain?”
- Value: provides the actual content.
- Influence condition: high query-key similarity gives that token’s value more influence in the weighted combination.
In a Transformer, what is multi-head attention and how is it computed from Q, K, and V?
- Computation: MultiHead(Q,K,V) = Concat(head1,…,headh)WO.
- Interpretation: each head can learn to focus on a different relationship (e.g., agreement, coreference, positional patterns), and these specializations emerge during training rather than being manually programmed.
What are the main stages inside one Transformer decoder block, and what is each stage for?
- Multi-head self-attention: combines information across positions.
- Residual connection: preserves the earlier representation by adding the sublayer input to its output.
- Layer normalization: stabilizes the computation.
- Feed-forward network: transforms the representation at each position.
- Second residual connection and normalization: prepares the output for the next block.
What is the Transformer feed-forward network (FFN) used in a block, and what is its formula?
- Formula: FFN(x)=W2 ReLU(W1x+b1)+b2.
- Common variants: some modern models use GELU or SwiGLU instead of ReLU as engineering refinements to improve stability/performance.
Distinguish the roles of attention layers versus feed-forward layers in how a Transformer forms representations for “reasoning.”
- Attention layers: combine information between positions, making them especially important for relational connections (how tokens relate across the sequence).
- Feed-forward layers: transform information within each position; research discussed suggests they may store factual associations.
- Important qualification: this is a useful interpretation, not a complete separation of responsibilities.
What is a residual connection in a Transformer block, and why does it matter for deep networks?
- Definition: a residual connection adds the input of a sublayer to its output.
- Why it matters: it allows information and gradients to flow through many stacked layers.
- Failure mode without it: in deep networks, gradients could vanish or explode without residual pathways.
For the sentence “The professor who taught the class also wrote the textbook”, how can different attention heads contribute to representing multiple relationships at once?
- one head connects “professor” with “taught”,
- another identifies “class” as what was taught,
- another connects “professor” with “wrote” and “textbook.”
After concatenation, the combined representation can capture several relationships simultaneously.
When explaining how an LLM constructs a “reasoning representation” before generating an answer, what sequence of mechanisms should you describe (at the level of this chapter summary)?
- Multi-head attention: different heads capture different syntactic, semantic, and positional relationships and combine information across positions.
- Feed-forward processing: refines/transforms the combined representation at each position.
- Residual connections (and normalization around sublayers): preserve earlier representations and help computations remain stable across stacked blocks.
Together, this supports integrating several constraints before producing an answer/action.
In modern LLMs (e.g., GPT/Claude/Llama) using a decoder-only architecture, what does “decoder-only” imply about how the model handles the prompt versus the generated continuation, compared with an encoder-decoder model?
- The prompt (context)
- The continuation (generated output)
Unlike an encoder-decoder model (commonly used for tasks like translation) that has a distinct encoder for input and decoder for output, a decoder-only model treats the prompt as the initial context and then extends it token-by-token using the same mechanism throughout.
What is causal masking in a decoder-only LLM, and why does it matter for next-token prediction?
- Itself
- Earlier tokens
and not to future tokens. This matters because it prevents the model from “seeing the answer” while learning to predict it: the model must form its prediction for the next token using only the already-available context.
Describe the autoregressive generation process used by decoder-only LLMs (give the key steps as a coherent mechanism).
- Read context: the model reads the available context.
- Predict next token: it produces a probability distribution over the next token.
- Select a token: one token is selected.
- Extend context: that token is added to the context.
- Repeat: the model predicts the next token, continuing until the response ends.
What does temperature change in token generation, and what important limitation does the material state about temperature and reasoning?
- Lower temperature generally produces more consistent outputs.
- Higher temperature can produce more varied or creative outputs.
A key limitation is that temperature does not automatically make reasoning more correct.
Explain how a tool call can be produced by an LLM without a separate “decision module,” according to the decoder-only autoregressive view.
- There is no fundamentally separate decision module that decides to use a tool.
- The model generates tokens that match the expected tool-call format because the prompt, training, and surrounding context make that continuation likely.
So “taking an action” can be understood as producing an action-shaped text continuation under decoder-only causal generation.
In the “calculator access” scenario (system: “You are a helpful assistant with calculator access.” user: “What is 15% of 240?”), what role can attention play in enabling a reasoning-like response or tool call?
- Linking “15%” with “240” (task-relevant quantities).
- Linking the tool description with the user’s task (tool applicability).
- Linking the system instruction with the expected response style.
With these connections available in context, the decoder can generate either an answer or a sequence representing a calculator call.
When explaining how an LLM produces an agent action, what explanation does the material recommend, and what reliability caveat should be included?
- The model uses the prompt and previous generated tokens to predict the next token, one at a time.
- Because a tool call is generated by the same mechanism as ordinary text, the model can turn context-dependent reasoning into an action.
Reliability caveat: the action’s reliability remains dependent on learned statistical patterns, not a guaranteed symbolic decision process.
What is in-context learning in large language models, and what does it mean that the model adapts “without changing its parameters”?
- “Without changing its parameters” means the model’s learned weights are not updated; there is no retraining or fine-tuning happening.
- The examples in the prompt act as temporary guidance inside the current context, so the adaptation is context-dependent rather than a permanent change in general behavior.
In an in-context learning scenario where a prompt shows: Input: “red, blue” → Output: {"colors": ["red", "blue"]}, what is the model doing when it produces a similar JSON format for Input: “green, yellow”?
- It is performing format adaptation: recognizing that the output should be a JSON object with the key {"colors"} mapping to a list of the input color strings.
- This behavior does not require retraining; it is a temporary adaptation driven by the information provided in the current prompt.
Explain the role of attention in in-context learning: what does attention enable the model to do with prompt examples and a new input?
- By using attention, the model can relate the examples to the new task instance (e.g., mapping from “red, blue” to a JSON list, then applying the same mapping to “green, yellow”).
- This supports temporary pattern-following within the current context, rather than a lasting change to model behavior.
Distinguish training from in-context learning along the dimensions of parameter change, durability of behavior change, and when it occurs.
- Training
- Parameters: updates model parameters over many examples.
- Durability: produces lasting changes to general behaviour.
- Timing: occurs before deployment or during fine-tuning.
- In-context learning
- Parameters: keeps parameters fixed and uses examples in the current prompt.
- Durability: produces temporary, context-dependent adaptation.
- Timing: occurs during each prompt interaction.
Why can in-context learning enable new “reasoning-like” behaviour without retraining, according to the summary?
- The prompt examples can temporarily define a task or output pattern.
- Attention then lets the model connect (“relate”) those examples to the new input, enabling flexible behavior such as solving a task by analogy or following a required format.
List conditions under which in-context learning may fail, and explain why these conditions matter.
- Examples are ambiguous
- The model may not be able to infer a single clear pattern to apply.
- Examples are inconsistent
- Conflicting demonstrations can prevent stable pattern inference.
- Examples are too numerous
- Too much prompt content can degrade the model’s ability to use the demonstrations effectively.
- The task is outside the model’s learned patterns
- If pre-training did not equip the model with relevant pattern knowledge, the prompt may not be enough to elicit the intended behavior.
How does in-context learning contribute to an LLM being “useful as an agent engine,” and what vulnerability does this create?
- Mechanism: examples in the prompt temporarily define the task, and attention relates them to the new input.
- Vulnerability: the model remains vulnerable to misleading or poorly chosen demonstrations, because its adaptation is guided by whatever examples are provided in-context.
In large language models, what factors are included in model scale, and what kinds of capabilities did the lecture connect scale to?
- Parameter count
- Training data
- Training compute
- Context capacity
The lecture connected larger scale to improved language understanding and more reliable performance on difficult tasks, and associated scale with capabilities such as:
- Arithmetic
- Code generation
- Complex instruction following
What is an emergent capability in the context of scaling large language models, and what key caution should be applied when using the term?
A key caution is that some “emergence” may be an artifact of evaluation:
- It can result from the choice of benchmark or the evaluation metric, rather than a sudden internal change in the model.
Explain the lecture’s causal chain from model scale to agent capability, including the main limitation highlighted at the end.
- Representation capacity: More parameters and training data allow more complex statistical patterns to be represented.
- Reliability on complex tasks: Larger models may follow instructions and combine evidence more reliably.
- Reasoning-to-action: Improved reasoning supports better planning, tool selection, and error analysis.
- Key limitation: Scale does not guarantee factuality, robustness, or safe behaviour.
- Implication for deployment: Agent suitability depends on reliability thresholds, not only headline benchmark scores.
A team argues: “We increased the context window, so the model will have perfect recall.” Using the lecture’s qualifications, evaluate this claim and state at least two additional “scale ≠ guarantee” warnings.
- A high benchmark score does not guarantee reliable tool calls.
- Scale does not eliminate hallucinations or outdated knowledge.
- Agent testing must measure practical failure rates.
So even with more context capacity, you must test whether the system meets practical reliability thresholds.
Give two examples of reported context window sizes from the lecture, and state the lecture’s caveat about some reported model statistics.
- Llama 3.1 405B: reported 128K context window.
- Gemini 1.5 Pro: reported context window of 1M to 2M tokens.
Caveat: some values—especially parameter counts for closed models—are undisclosed or reported as estimates.
When explaining “emergent capabilities” as part of reasoning-like behaviour, how should you connect scale to improved performance without treating it as a guarantee of reasoning or agent success?
- Why scale can help: larger models may form and manipulate more useful patterns, improving planning and action selection.
- Why scale is insufficient: an agent can still fail if the model hallucinates, loses context, or produces invalid structured output.
In an LLM-based agent prompt, what are the main message/context types that can appear, and what does each contribute to the model’s context for reasoning?
- System message
- Defines the agent’s role and rules the model should follow.
- User message
- Defines the current task the agent should accomplish.
- Assistant message
- May contain earlier responses or actions, forming conversation history the model can reuse.
- Tool result
- Provides information returned by an external system that the model should incorporate (rather than invent).
Explain how attention helps a large language model act as a “reasoning engine” in an agent setting with system rules, user goals, conversation history, tool descriptions, and tool results.
- the user’s request to the system rules it must obey,
- the current step to previous conversation (earlier assistant messages),
- the task to tool descriptions (what tools exist and how to call them),
- and the response to returned tool data (tool results).
Because these relationships influence what token is generated next, the model can produce instruction-following responses and agent actions (e.g., tool calls and formatted outputs).
For the agent prompt “Find the latest sales total and return valid JSON,” what distinct pieces of context must the model combine to choose an appropriate next action/output?
- the instruction to obtain current data,
- the description of the sales database tool,
- the requirement to output JSON,
- and the tool result containing the sales total.
An appropriate next action/output depends on relating these constraints: use the described tool to get the latest total, then format the response as valid JSON using the returned value.
The summary says “Reasoning quality depends on whether the model identifies the relevant relationships and produces the correct next action.” What does that mean in an agent prompt with tools and formatting constraints?
- relate user goals to system rules (obey constraints),
- relate the goal to the right tool (retrieve needed info),
- relate the response format requirement to the output (structured output, e.g., JSON),
- and incorporate tool results rather than fabricating values.
If it misses these relationships, it may take the wrong action or output an invalid format.
What six “agent-relevant capabilities” does the lecture identify for an LLM acting as an agent brain, and what does each capability enable?
- Instruction following
- Obeying several rules simultaneously.
- Tool use
- Selecting the right tool and producing valid parameters.
- Structured output
- Generating parseable JSON or function calls.
- Self-correction
- Responding appropriately after an error.
- Long-context handling
- Retaining relevant information over many turns.
- Low hallucination rate
- Avoiding fabricated facts, files, and tool results.
Why can’t a sophisticated agent architecture “fully compensate” if the underlying model is weak in the agent-relevant capabilities listed?
In an LLM-based agent, explain the causal chain by which weak reasoning leads to unreliable final agent behaviour.
- Weak reasoning causes an incorrect interpretation of the task.
- An incorrect interpretation leads to poor planning or wrong tool selection.
- Poor tool selection produces wrong or failed actions.
- Failed actions can create further misleading context for the model.
- With compounding errors and misleading context, the agent’s final behaviour becomes unreliable.
Why can tools (calculator, retrieval system, external application) only partially compensate for weak reasoning in an LLM-based agent?
- Recognize when a tool is appropriate (decide to use it at all).
- Formulate the call correctly (provide the right inputs/instructions).
- Interpret the result (use the tool output correctly in continued reasoning and action).
If these reasoning steps fail, the agent can still act incorrectly even with perfect tools.
What is inference-time compute in the context of LLM reasoning, and what is the main tradeoff of using it?
Explain why “reasoning is the bottleneck” for an agent even if the surrounding software works perfectly.
When explaining the relationship between reasoning and agency in an LLM-based agent, what should you start from, and why does it matter for downstream actions?
- Stronger reasoning supports more effective agent behaviour.
- Hallucination or poor multi-step reasoning becomes an action-level failure (wrong tools, wrong plans, wrong actions).
In the lecture’s example “minimum bars” for agent-brain evaluation, what performance thresholds are suggested for instruction compliance, tool selection, valid JSON, and hallucination rate—and how should these thresholds be interpreted?
- Suggested thresholds
- More than 90% instruction compliance.
- More than 95% correct tool selection.
- More than 98% valid JSON.
- Less than 10% hallucination (on a specified test set).
- How to interpret them
- They are practical targets from the lecture, not universal laws; they are meant to guide whether the model is reliable enough for agency in the tested setting.
You generate the same reasoning problem for a smaller and a larger model. According to the lecture, what should you compare besides the final answer to evaluate the models as reasoning engines for agent use?
- Where each model fails
- Identify the failure points, not just whether it eventually reaches an answer.
- Consistency of reasoning
- Check how consistently it reasons across runs.
- Token usage
- Measure how many tokens it uses (efficiency of the reasoning process).
- Call cost
- Measure how much the calls cost for each model.
- Additional recommended checks
- Test multiple temperatures.
- Test long-context recall.
- Test structured output.
- Test cost at scale.
When evaluating an LLM “as a reasoning engine” for agency, what capability areas does the lecture say you should measure, and what is the rationale for focusing on these areas?
- Capability areas to measure
- Instruction following
- Tool selection
- Structured output
- Error recovery
- Context tracking
- Factual reliability
- Rationale
- These are the capabilities that convert reasoning into action in an agent.
- Measuring them shows whether the model’s attention and learned reasoning patterns are reliable enough for agency, rather than assuming a large parameter count or an impressive benchmark score is sufficient.
In a decoder-only large language model, what does the attention mechanism actually compute, and why does that not imply the model “understands everything” it attends to?
- What attention does
- Produces a weighted mixture of information based on learned relevance signals.
- What attention does not guarantee
- That the model has fully interpreted, verified, or correctly used everything it assigns weight to.
In the lecture’s decoder-only view, how is a tool call produced by the model, and what misconception does this correct?
- Correct view (decoder-only)
- The “tool call” is just part of the model’s token output stream.
- Misconception corrected
- That a tool call comes from a separate decision module rather than being generated text.
Explain why (i) a larger model can still hallucinate and (ii) a long context window does not guarantee “memory.”
- Larger model ≠ no hallucinations
- Scale may improve reliability, but it does not remove hallucinations.
- Long context window ≠ guaranteed memory
- Even with a long window, the model may ignore or underuse information that is present in the context.
What is in-context learning in terms of parameters vs. behaviour, and what misconception does this address?
- What changes
- How the model responds in the current interaction given the provided context.
- What does not change
- The model’s learned weights/parameters are not updated.
- Misconception corrected
- That in-context learning “updates the model.”
What does high temperature mainly change in a language model’s outputs, and why is “high temperature improves reasoning” a misconception?
- Main effect
- More diverse, less deterministic token sampling.
- Misconception corrected
- That higher temperature inherently improves reasoning quality.
Why is “benchmark performance equals agent reliability” a misconception, and what is needed instead?
- Misconception corrected
- Equating good benchmark scores with real-world reliability.
- What is needed
- Evaluation focused on concrete failure modes relevant to agent behaviour.
In an exam question asking “how an LLM functions as a reasoning engine,” what reliable step-by-step answer structure should you use?
- Define the relevant mechanism in ordinary language.
- Explain the computation/process, including the important formula if attention is asked.
- Connect the mechanism to a concrete agent example.
- State the capability it enables.
- State the limitation or trade-off.
- Conclude by linking the mechanism to reasoning and action.
Write the attention computation used in transformer-style LLMs and explain what each symbol (Q, K, V, dk) represents.
- Formula: Attention(Q,K,V) = softmax((QKT)/√dk)V
- Meanings:
- Q (queries): contains information needs.
- K (keys): describes available information.
- V (values): contains transmitted content.
- dk: the key dimension used for scaling.
In an exam explanation of attention, how should you justify the presence of the scaling factor √dk in softmax((QKT)/√dk)?
- State what dk is: dk is the key dimension used for scaling.
- Explain why it matters on the exam: including √dk helps demonstrate both
- the mechanism (how attention is computed), and
- the reason for the scaling factor (that scaling is explicitly part of the computation).
If a question specifically asks about attention in an LLM-as-reasoning-engine explanation, what elements should you include beyond the attention formula itself?
- Include the formula: Attention(Q,K,V) = softmax((QKT)/√dk)V.
- Explain the components:
- Q contains information needs.
- K describes available information.
- V contains transmitted content.
- dk is the key dimension used for scaling.
- Connect to the broader structure:
- Give a concrete agent example.
- State the capability enabled.
- State the limitation or trade-off.
- Conclude by linking attention to reasoning and action.
In a Transformer, what roles do self-attention, multi-head attention, feed-forward layers, and causal masking each play in producing left-to-right generated text?
- Self-attention
- Lets tokens exchange relevant information so each token representation can incorporate context.
- Multi-head attention
- Captures different relationships by attending in multiple “ways” at once (different heads can focus on different patterns).
- Feed-forward layers
- Refine the representations produced by attention, improving the internal features used for prediction.
- Causal masking
- Enables left-to-right generation by preventing a position from using information from future tokens.
What is in-context learning in an LLM, and what does it mean that this adaptation is temporary and tied to “the current prompt”?
- In-context learning is the model’s ability to adapt temporarily to instructions and demonstrations provided in the prompt.
- Temporary means the behaviour change is driven by the prompt’s content (instructions/examples) rather than a permanent update to the model’s parameters.
- Tied to the current prompt means the adapted behaviour depends on what is included in the present context (e.g., examples, stated rules, prior actions mentioned in the text).
How does scale relate to emergent (reasoning-like) capabilities in LLMs, and what key caveat about those capabilities must be included?
- Scale can produce stronger capabilities, including improved arithmetic, code generation, and instruction-following.
- Caveat: these capabilities remain probabilistic and imperfect, so improved performance with scale does not imply guaranteed correctness or fully reliable reasoning.
Why is “a complete explanation” of an LLM as a reasoning engine more than describing the Transformer architecture, and what additional needs does this imply for agent performance?
- It must connect architecture (Transformer + attention + autoregressive generation) with learned behaviour (notably in-context learning) to explain how the model can act as an agent’s reasoning engine.
- It must also make clear that limitations in reasoning, context tracking, and factuality constrain performance.
- Therefore the engine requires testing, prompting, tools, and architectural support rather than being assumed reliably correct on its own.
Explain how positional information, self-attention, and causal masking jointly allow a decoder-only LLM to use earlier prompt information while generating an agent action one token at a time.
How do attention and in-context learning combine to make prompt demonstrations change an LLM-based agent’s behaviour without retraining, and what constraints from long-context handling can still cause failure?
Connect the Transformer’s O(n2) attention cost, context window length, and inference-time compute to the practical tradeoffs an agent designer faces for reasoning quality and latency.
Explain why “scale improves reasoning-like capability” does not guarantee agent reliability by linking scale/emergence claims to attention-based context use and the evaluation tests proposed for agent suitability.
Why are tools only a partial fix for weak reasoning in an LLM-based agent, and how does this limitation follow from decoder-only generation plus the agent-relevant capabilities list?
The question on the page originate from the summary of the following study material:
- A unique study and practice tool
- Never study anything twice again
- Get the grades you hope for
- 100% sure, 100% understanding

















