PassDrill Free practice questions with explanations that actually teach.

Prompt Engineering

12 questions · AI & LLM Engineering · answer each one, then read the explanation. Your score tallies at the bottom.

0 / 12 answered · 0 correct

AI-ENGINEERING · prompting · Q001 · easy

According to the original GPT-3 paper, "Language Models are Few-Shot Learners" (Brown et al., 2020), which best describes the difference between zero-shot and few-shot prompting?

  1. Zero-shot provides no task examples in the prompt, relying only on a natural language instruction, while few-shot includes a small number of input-output examples in the prompt before the actual query
  2. Zero-shot requires the model to be fine-tuned on the target task first, while few-shot requires no training at all
  3. Zero-shot and few-shot both require gradient updates to the model's weights; they differ only in how many examples are used per update
  4. Few-shot prompting means the model is shown zero examples but asked to solve the task in fewer than five reasoning steps

AI-ENGINEERING · prompting · Q002 · easy

Under the technique introduced by Wei et al. (2022) in "Chain-of-Thought Prompting Elicits Reasoning in Large Language Models," what does chain-of-thought prompting add to a standard few-shot prompt?

  1. It replaces the task examples with a single, more detailed instruction and removes all examples from the prompt
  2. It includes intermediate reasoning steps leading to the final answer within the few-shot exemplars, rather than showing only the input and final answer
  3. It requires retraining the model on a dataset of step-by-step solutions before it can be used
  4. It instructs the model to output only the final answer with no explanation, in order to reduce token usage and cost

AI-ENGINEERING · prompting · Q003 · easy

Anthropic's prompt engineering documentation for Claude recommends "giving Claude a role." Where does it say a role description should be written, and why?

  1. In the system prompt, because even a single sentence establishing a role there focuses Claude's behavior and tone for the specific use case
  2. In the final line of the user's message, because Claude only applies role instructions that appear immediately before the question being asked
  3. In a separate fine-tuning dataset, because role behavior can only be changed by retraining the model on role-labeled examples
  4. In the assistant's prior turn, because Claude infers its role only from how it phrased earlier responses in the conversation

AI-ENGINEERING · prompting · Q004 · easy

In LLM inference APIs such as Anthropic's Messages API and OpenAI's Chat Completions API, what effect does lowering the `temperature` sampling parameter toward 0 have on generated text?

  1. It sharpens the probability distribution over next tokens so the model more consistently picks the highest-probability token, producing more deterministic, less varied output
  2. It reduces the model's context window, so fewer previous tokens are considered when generating each new token
  3. It increases the number of tokens the model is allowed to generate in a single response
  4. It disables sampling entirely and forces the model to retrieve an exact quote from its training data

AI-ENGINEERING · prompting · Q005 · easy

Per the OWASP Top 10 for LLM Applications (2025), which best distinguishes "indirect" prompt injection from "direct" prompt injection?

  1. Direct prompt injection means malicious instructions are typed straight into the model's input by the user; indirect prompt injection means the malicious instructions are hidden in external content, such as a webpage or document, that the LLM later ingests and follows
  2. Direct prompt injection only affects open-source models, while indirect prompt injection only affects closed, API-based models
  3. Indirect prompt injection requires physical access to the server running the model, while direct prompt injection can be performed remotely over the network
  4. Direct prompt injection is a purely theoretical risk with no real-world examples, while indirect prompt injection has already been fixed in all major LLM products

AI-ENGINEERING · prompting · Q006 · easy

According to Anthropic's prompt engineering documentation, what is the stated benefit of wrapping different parts of a prompt (instructions, context, examples, input) in distinct XML tags such as `<instructions>` and `<context>`?

  1. It helps Claude parse complex prompts unambiguously by clearly separating different types of content, reducing the chance the model misinterprets what is instruction versus example versus input
  2. It is required syntax without which the Messages API will reject the request with a formatting error
  3. It compresses the prompt so that it consumes fewer tokens than the equivalent plain-text prompt
  4. It automatically translates the tagged sections into a different language before the model processes them

AI-ENGINEERING · prompting · Q007 · medium

Zhao et al. (2021), "Calibrate Before Use: Improving Few-Shot Performance of Language Models," identify "recency bias" as one cause of instability in few-shot prompting. What does recency bias describe?

  1. The model's tendency to disproportionately predict whichever label appeared in the example placed nearest the end of the few-shot prompt, regardless of the true input
  2. The tendency of a model's accuracy to decline over time as new versions of the model are released
  3. The model favoring the most recently published research papers when asked to cite sources
  4. The tendency to give more weight to the very first example in a few-shot prompt while ignoring later examples

AI-ENGINEERING · prompting · Q008 · medium

Wang et al. (2022), "Self-Consistency Improves Chain of Thought Reasoning in Language Models," propose replacing greedy decoding with what alternative decoding strategy for chain-of-thought prompts?

  1. Sample multiple diverse reasoning paths for the same question at a nonzero temperature, then take a majority vote over the final answers each path arrives at
  2. Always generate exactly one reasoning path deterministically, then ask a separate human reviewer to check it before accepting the answer
  3. Fine-tune the model on the correct chain-of-thought path found by brute-force search over the entire training set
  4. Discard chain-of-thought reasoning entirely and instead retrieve the answer from an external search engine

AI-ENGINEERING · prompting · Q009 · medium

Zhou et al. (2022), "Least-to-Most Prompting Enables Complex Reasoning in Large Language Models," describe a two-stage strategy for solving problems harder than those shown in the prompt's examples. What is that strategy?

  1. First prompt the model to decompose the problem into a sequence of simpler subproblems, then sequentially prompt it to solve each subproblem in order, feeding each prior subproblem's answer into the context used for the next
  2. First fine-tune the model on the hardest available examples, then evaluate it zero-shot on easier examples to measure generalization downward
  3. First ask the model to guess the final answer directly, then ask it to generate a chain-of-thought justification for that already-chosen answer after the fact
  4. First run the same prompt through several different LLMs from different vendors, then pick whichever vendor's answer appears most frequently

AI-ENGINEERING · prompting · Q010 · medium

OpenAI's documentation distinguishes "Structured Outputs" from the older "JSON mode" feature of its Chat Completions / Responses APIs. According to that documentation, what is the key difference between the two?

  1. Both guarantee syntactically valid JSON, but only Structured Outputs also guarantees the output conforms to the caller's supplied JSON Schema (for example, required keys and enum values); JSON mode guarantees valid JSON syntax only
  2. JSON mode guarantees schema conformance, while Structured Outputs only guarantees syntactically valid JSON without any schema checking
  3. Structured Outputs can only be used with image inputs, while JSON mode is restricted to text-only prompts
  4. The two features are functionally identical; "Structured Outputs" is simply a rebranding of "JSON mode" with no change in behavior

AI-ENGINEERING · prompting · Q011 · hard

Turpin et al. (2023), "Language Models Don't Always Say What They Think: Unfaithful Explanations in Chain-of-Thought Prompting," demonstrate unfaithfulness by manipulating what feature of a few-shot prompt, and observing what result?

  1. They reordered the multiple-choice options in the few-shot examples so the correct answer was biased to always fall on a particular letter (e.g., always "(A)"); the model's chain-of-thought then rationalized picking that biased letter while never mentioning the answer ordering as its real reason
  2. They removed all chain-of-thought reasoning from the few-shot examples entirely and found the model refused to answer at all without it
  3. They translated the few-shot examples into a different natural language and found the model's final answers became random regardless of the question
  4. They increased the number of few-shot examples from 2 to 200 and found chain-of-thought accuracy improved with no change in faithfulness concerns

AI-ENGINEERING · prompting · Q012 · hard

Sclar et al. (2023), "Quantifying Language Models' Sensitivity to Spurious Features in Prompt Design," measure how much purely cosmetic formatting choices (such as separators and spacing) in a few-shot prompt affect accuracy, holding the semantic content constant. What did they find?

  1. Purely formatting-level changes to a semantically identical few-shot prompt caused accuracy swings of up to tens of accuracy points (as much as 76 points for one open-source model tested), and this sensitivity persisted even with larger models, more few-shot examples, and instruction tuning
  2. Formatting choices had no measurable effect on accuracy once a model exceeded roughly one billion parameters, fully resolving the issue at modern model scales
  3. Formatting only matters for image-based prompts and has no measurable effect on plain-text few-shot prompts
  4. Accuracy differences from formatting disappeared entirely once few-shot examples were replaced with zero-shot instructions