Prompt Engineering
Use structured formats
By formatting the generated output, it’s easier to interpret and parse the information. This is especially useful for data extraction or wheres tandardized responses is needed.
How to use structured formats
- Provide a template or example output.
- Use clear delimiters and labels. For example, label sections and use delimiters to separate different parts of the response.
- Use formatting conventions. For example, “generate a Markdown-formatted summary with headings and bullet points”.
Common structured formats
- JSON/XML: Ideal for data interchange between systems.
- Bullet points/lists: Useful for summaries or step-by-step instructions.
- Tables: Great for comparing data or presenting multiple related items.
- Headings and subheadings: Organizes content for readability, especially in longer texts.
- Custom templates: Tailored formats specific to your application’s needs.
Examples
Tips for effective structured formatting
- Choose straightforward formats that the model can easily replicate.
- Experiment with different prompts and refine them based on the model’s outputs.
- Include any necessary background information to aid model understanding.
- Implement checks to validate that the responses meet your format requirements.
Was this page helpful?