Using Models / Prompt Engineering›
Foundations
Tokens & Embeddings
Transformers
Training
Fine-Tuning & RL
Model Behavior
Inference
Using Models
Evals & Measurement
Prompt Engineering
Prompt engineering is the craft of writing inputs that get the output you want. Since the model maps your input to a prediction, the input is your main steering wheel, and small changes can move the result a lot.
For most engineers it's the highest-leverage skill in AI. You'll write prompts long before you ever fine-tune a model, and a good prompt often beats a fancier technique.
A few reliable habits:
- Be specific. Spell out the format, the audience, and the constraints. Vague prompts get vague answers.
- Show examples. A couple of input-output pairs, called few-shot prompting, teach the model the pattern you want.
- Give it room to think. For hard problems, ask for reasoning before the answer.
- Put the stable parts first. System prompt, examples, and documents up front, the variable request last. This reads cleanly and helps prefix caching cut cost.
Prompt engineering is empirical. You try a phrasing, check the output, and adjust. That tight loop is also why evaluation matters: without a way to measure, you're guessing whether a change helped.