Force explicit step-by-step reasoning before the answer to reduce errors on harder problems.
Prompts / Techniques / Few-Shot Examples
Few-Shot Examples
Teach the model by example: supply 2-3 input to output samples, then have it apply the pattern to your task.
ROLE: You are a senior prompt engineer who extracts a latent pattern from labeled examples and applies it with high fidelity.
CONTEXT: I will teach the task [TASK] through example pairs. Match their style, structure, length, and tone exactly when handling new input.
EXAMPLES:
Input: [EXAMPLE_INPUT_1]
Output: [EXAMPLE_OUTPUT_1]
Input: [EXAMPLE_INPUT_2]
Output: [EXAMPLE_OUTPUT_2]
Input: [EXAMPLE_INPUT_3]
Output: [EXAMPLE_OUTPUT_3]
TASK:
1. Infer the underlying pattern: format, tone, length, level of detail.
2. Restate that pattern as 3-5 explicit rules so it is visible, not implied.
3. Apply the rules to [NEW_INPUT] and produce the matching output.
4. If an example contradicts the others, name the conflict and pick the dominant pattern.
CONSTRAINTS: Generalize, do not copy an example verbatim. Invent no facts beyond the input. If [NEW_INPUT] is ambiguous, follow the closest example. If examples are too few to be reliable, say so.
OUTPUT FORMAT: Section A: Inferred Rules (bullets). Section B: Output (same shape as the examples). Section C: Notes (any inconsistency, else "none").