What is the primary purpose of 'prompt engineering' in the context of large language models (LLMs)?
Answer: B
Prompt engineering refers to the practice of carefully crafting and optimizing input prompts given to an LLM so that the model produces accurate, relevant, and useful outputs. It does not involve changing model weights or training data.
Q.2Medium
Which prompting technique involves providing the model with a few labeled input-output examples before asking it to solve a new problem?
Answer: C
Few-shot prompting provides the LLM with a small number of example input-output pairs (shots) within the prompt itself, helping the model understand the task format before generating a response for the actual query.
Q.3Medium
In 'Chain-of-Thought' (CoT) prompting, what is the key idea that improves model performance?
Answer: B
Chain-of-Thought prompting encourages the LLM to articulate its intermediate reasoning steps explicitly. This step-by-step reasoning process significantly improves performance on complex tasks like arithmetic and logical reasoning.
Q.4Medium
What does 'zero-shot prompting' mean in the context of prompt engineering?
Answer: B
Zero-shot prompting involves giving the model only a task description or question without providing any examples. The model relies solely on its pre-trained knowledge to generate a response.
Q.5Medium
Which of the following best describes 'prompt injection' in AI systems?
Answer: B
Prompt injection is a security vulnerability where an attacker embeds hidden or overriding instructions within user input, causing the LLM to perform unintended or harmful actions, bypassing its original instructions.
Q.6Medium
What is the role of a 'system prompt' in an LLM-based application?
Answer: B
A system prompt is provided by the developer or application to establish the model's persona, constraints, and context at the start of a conversation. It guides how the model should behave throughout the session.
Q.7Medium
Which prompting strategy asks a model to produce multiple reasoning paths and then select the most consistent answer?
Answer: C
Self-consistency prompting generates multiple diverse reasoning chains for the same question and then aggregates or selects the most frequent or consistent final answer, improving reliability over a single chain-of-thought.
Q.8Medium
In prompt engineering, what is 'temperature' a parameter of?
Answer: B
Temperature is a decoding parameter that controls the randomness of an LLM's output. A higher temperature produces more creative and varied responses, while a lower temperature makes the output more deterministic and focused.
Q.9Medium
What is 'role prompting' in prompt engineering?
Answer: B
Role prompting involves instructing the LLM to behave as a specific character, expert, or persona (e.g., 'You are an experienced doctor'). This shapes the tone, vocabulary, and depth of the model's responses.
Q.10Medium
Which of the following is a key challenge addressed by 'prompt chaining' in complex AI workflows?
Answer: B
Prompt chaining decomposes a complex task into manageable steps. The output of each prompt becomes the input for the next, enabling more reliable and structured handling of multi-step reasoning or workflows.
Q.11Medium
What does 'RAG' stand for in the context of LLM-based applications, and how does it relate to prompt engineering?
Answer: B
RAG (Retrieval-Augmented Generation) is a technique where relevant documents or information are retrieved from an external knowledge base and inserted into the prompt. This grounds the model's response in factual, up-to-date information.
Q.12Medium
Which of the following statements about 'negative prompting' is most accurate?
Answer: B
Negative prompting guides the model by explicitly stating what it should not include or how it should not respond. While especially prominent in image generation, it is also used in text LLMs to avoid unwanted content or styles.
Q.13Medium
What is the concept of 'hallucination' in the context of large language models?
Answer: B
Hallucination refers to the tendency of LLMs to generate confident, fluent, but factually incorrect or entirely made-up information. Prompt engineering techniques like RAG and explicit fact-checking instructions help mitigate this.
Q.14Medium
In the 'Tree of Thoughts' (ToT) prompting framework, what is the primary advantage over standard Chain-of-Thought prompting?
Answer: B
Tree of Thoughts extends Chain-of-Thought by allowing the model to explore multiple possible reasoning paths simultaneously (like a tree), evaluate intermediate states, and backtrack from dead ends, enabling better performance on complex planning and reasoning tasks.
Q.15Medium
What is 'few-shot in-context learning' and how does it differ from traditional machine learning fine-tuning?
Answer: B
Few-shot in-context learning allows the model to learn a task from a handful of examples embedded directly in the prompt, at inference time, without any gradient updates or changes to model weights. Traditional fine-tuning, by contrast, updates model parameters.
Q.16Medium
Which parameter, along with temperature, is commonly used to control the diversity of an LLM's output by limiting token selection to the top cumulative probability mass?
Answer: B
Top-p (nucleus) sampling restricts the model to choose from only the smallest set of tokens whose cumulative probability exceeds a threshold p. Combined with temperature, it controls the creativity and diversity of generated text.
Q.17Medium
What is the main purpose of using 'delimiters' (such as triple backticks or XML tags) in a prompt?
Answer: B
Delimiters like triple backticks (```), angle brackets, or XML tags visually and semantically separate different parts of a prompt (e.g., instructions vs. user input). This helps the model parse the prompt correctly and reduces the risk of prompt injection attacks.
Q.18Medium
Which of the following best describes 'instruction tuning' in the development of LLMs?
Answer: B
Instruction tuning is a training-time process where a pre-trained LLM is further fine-tuned on curated datasets of (instruction, response) pairs. This makes the model much better at following natural language instructions, which complements prompt engineering at inference time.
Q.19Medium
What is 'prompt compression' and why is it useful in LLM applications?
Answer: B
Prompt compression techniques reduce the number of tokens in a prompt by removing redundant or less critical information while retaining the key context. This lowers API costs, reduces latency, and fits more information within the model's context window.
Q.20Medium
In prompt engineering, what does the acronym 'RLHF' stand for, and what is its significance?
Answer: B
RLHF (Reinforcement Learning from Human Feedback) is a training paradigm where human raters evaluate model outputs, and the model is fine-tuned using reinforcement learning to produce outputs that align better with human preferences. It underlies models like ChatGPT and is foundational to understanding why certain prompts work better.