Github Copilot · Free Practice Question Medium
Question 17
A software engineer is using GitHub Copilot to generate code snippets for a machine learning project. They want to improve the quality of Copilot’s suggestions by modifying their prompts effectively. The engineer is trying to understand the difference between zero-shot and few-shot prompting. Which of the following best describes the difference between zero-shot and few-shot prompting?
-
A
Zero-shot prompting provides an answer based on previous interactions, while few-shot prompting resets Copilot’s memory and starts fresh with new examples.
-
B
Zero-shot prompting provides no examples in the prompt, while few-shot prompting includes a few examples to guide the AI’s response.
-
C
Zero-shot prompting requires the AI to use its pre-existing knowledge, while few-shot prompting requires Copilot to access external documentation before generating a response.
-
D
Zero-shot prompting generates shorter responses, whereas few-shot prompting always generates longer, more detailed answers.
Reveal correct answer
Correct answer: B
A.
Copilot does not maintain memory across different interactions. Each prompt is processed independently. Few-shot prompting helps shape responses by including examples in the same prompt but does not "reset" Copilot’s state.
B.
Zero-shot prompting means asking Copilot to generate code or text without providing any examples. The AI relies entirely on its pre-trained knowledge to make a prediction. Few-shot prompting involves including a few examples in the prompt to guide Copilot’s response. This helps the model understand the desired pattern or format, improving the relevance of the generated output.
C.
Copilot does not dynamically retrieve external documentation. Few-shot prompting helps guide Copilot’s response, but it does not involve external knowledge retrieval beyond its pre-trained model.
D.
Response length is not inherently tied to the number of examples provided. While few-shot prompting can improve structure and relevance, it does not necessarily make responses longer. Zero-shot prompts can still generate detailed responses if the model deems it necessary.
Discussion
Think the marked answer is wrong, or have a better explanation? Share it below — comments appear after review.
