How to Use the Few-Shot Prompt & Training Formatter
-
1
Choose your target structure: OpenAI ChatML JSON, Anthropic Claude XML, Alpaca, or Plain Text.
-
2
Input the overarching system task or classification instruction.
-
3
Add demonstration input and target output pairs using the interactive cards.
-
4
Copy the formatted output for direct inference or fine-tuning dataset preparation.
Practical Example & Use Case
Formatting 5 examples of messy customer support feedback into structured JSON output demonstrations to teach Claude 3.5 how to classify sentiment and department routing with 99% consistency.
Technical Notes & Limitations
Formats structured text representations. Token limits depend on your target LLM context window.
Frequently Asked Questions
What is few-shot prompting?
Few-shot prompting provides the model with 2 to 10 concrete input-output examples before presenting the actual test input. This dramatically improves formatting adherence and reasoning accuracy.
When should I use Claude XML formatting?
Anthropic recommends wrapping few-shot examples inside `
Can I use this output for fine-tuning datasets?
Yes, the OpenAI ChatML output produces valid message arrays identical to the format required for JSONL fine-tuning on gpt-4o-mini.