A prompt is a specification. Prompt engineering is writing it well and checking that the model follows it.
How it works
OpenAI’s guide defines prompt engineering as “the process of writing effective instructions for a model” so it “consistently generates content that meets your requirements.” The core techniques overlap across vendors:
| Technique | What to do |
|---|---|
| Roles | Put rules in the system prompt (or developer message) and the request in the user message |
| Structure | Order the system prompt as identity, instructions, examples, context; use Markdown headings and XML tags to mark sections |
| Examples | Add a few input and output pairs (few-shot prompting) that cover different cases |
| Reasoning | Ask for step-by-step thinking (chain of thought), or use a reasoning model |
| Output format | Ask for a fixed format, or use structured output where the API supports it |
| Stability | Pin a model version so behavior does not shift under you |
Anthropic’s overview says to start with three things: clear success criteria, a way to test against them, and a first draft prompt. In practice that means an eval set.
A short example, before and after:
Before: Summarize this ticket.
After: You summarize support tickets for an engineering team.
Write 3 bullet points: the problem, the customer impact, the next step.
Use the customer's words for error messages. Do not guess at causes.
<ticket>...</ticket>
For agents, the prompt is one part of a larger context. Anthropic’s context engineering post separates prompt engineering, “methods for writing and organizing LLM instructions,” from context engineering, which manages everything else the model sees.
Why it matters
- Quality without training. A better prompt is the cheapest fix to try, before fine-tuning or a bigger model.
- Cost. The system prompt is resent on every request. Cut what does not change the output; see reducing prompt tokens.
- Migration. A prompt tuned for one model may behave differently on another. Rerun your eval set when you switch.
On BroadNet Inference
BroadNet’s chat models take the standard Chat Completions messages list, so system, user and assistant roles and few-shot examples work as usual. You can try prompts in the playground before writing code. For Arabic output, Arabic prompt engineering covers register, dialect, numerals and right-to-left formatting.
Structured output is documented for GLM 5.3 and Qwen3.8 27B. On DeepSeek V4.1 Flash, GLM 5.3 and Qwen3.8 27B, reasoning counts toward max_tokens, so a “think step by step” prompt also needs room in the budget.