Prompts can be designed with several reusable patterns. The role pattern assigns the model a persona or function, conditioning its tone, vocabulary, and reasoning style for a specific domain. Related framings include the "act as" pattern, which assigns a job title like "hiring manager," and the "as if" framing, which asks the model to respond "as if" it were a specific expert or in a particular scenario. Persona prompts improve domain-appropriate vocabulary and consistent tone but can introduce stereotypes or overconfidence if the implied expertise exceeds what the model actually knows.
Few-shot prompting supplies a small number of input–output examples inside the prompt before the new query, teaching the desired pattern, format, or schema. Zero-shot prompting asks the model to perform a task using only instructions, relying entirely on its pretrained knowledge. Few-shot examples reduce ambiguity, calibrate tone, and boost accuracy on classification, formatting, and edge cases, though performance is sensitive to the order of demonstrations and to which examples are chosen. When paired with reasoning examples, the approach is called few-shot chain-of-thought, which teaches both the output format and the deliberation process.
Reasoning-specific techniques include chain-of-thought prompting, which encourages the model to produce intermediate reasoning steps before the final answer and typically improves performance on arithmetic, logic, and multi-hop problems. Self-consistency samples multiple chain-of-thought rationales at higher temperature and selects the most frequent final answer, reducing variance. Step-back prompting asks the model to first consider a higher-level principle before tackling the specific question, while least-to-most prompting decomposes a problem into sub-questions ordered from simplest to hardest, solving each in sequence. Tree-of-thought generalizes chain-of-thought by exploring multiple reasoning branches in parallel, evaluating intermediate states, and backtracking when a path is unpromising.
Negative prompting explicitly forbids behaviors ("do not mention prices," "avoid technical jargon") and works best when paired with clear allowed alternatives rather than prohibitions alone. Specifying the output format—length, bullet list, JSON keys, or word count—constrains the model, reduces ambiguity, and makes outputs easier to parse for downstream automation. Structured output goes further by constraining the model to a predefined JSON schema via JSON mode or function calling, and can be enforced reliably through constrained decoding against a regex, JSON schema, or context-free grammar. Common prompt frameworks that combine these elements include Role-Task-Format, CO-STAR (Context, Objective, Style, Tone, Audience, Response), and CURATE.