A model gives inconsistent output formats. Adding two worked input and output examples to the prompt fixes it. What is this technique called?
- Exam domain
- Prompt engineering and prompt tuning
- Difficulty
- Easy
- In this mock
- 5 questions on this domainPractise this domain
Why A is the answer
Few-shot prompting
Few-shot prompting puts a few examples of the task in the prompt so the model copies the pattern. No weights change.
Remember: Examples in the prompt: few-shot.
In detail
- Examples in the prompt.
- No training.
Every option, checked
Knowing why each wrong option fails is how you rule it out on exam day.
A. Few-shot promptingRight
Examples in the prompt: few-shot.
B. Prompt tuningWrong
Prompt tuning trains soft prompt vectors.
C. LoRA fine-tuning, because the examples update the adapter weights when they are sentWrong
Sending a prompt does not train adapters.
D. Zero-shot promptingWrong
Zero-shot means no examples.
Use case
An illustrative scenario, not a real incident.
Illustrative: two sample invoices with their JSON output make every new extraction use the same keys.
See it in different ways
flowchart LR S0["Instruction"] --> S1["Example 1"] --> S2["Example 2"] --> S3["New input"]
How to read this chart
- Read it in order: Instruction, then Example 1, then Example 2, then New input.
flowchart TD
Q{"Does zero-shot work?"}
Q -->|"Yes"| A0["Keep it zero-shot"]
Q -->|"No"| A1["Add a few examples"]How to read this chart
- At "Does zero-shot work?": if "Yes", go to "Keep it zero-shot"; if "No", go to "Add a few examples".