Prompt Engineering
Aussi : Prompting, Prompt Design, LLM Prompting
Prompt engineering is the practice of designing and refining text inputs to guide large language models toward accurate, relevant, and reliable outputs.
What It Is
Prompt engineering is the practice of crafting, structuring, and iterating on the instructions (prompts) given to a large language model (LLM) or other generative AI system to obtain useful, accurate, and consistent results. A prompt can be a simple question, a detailed set of instructions, examples, or a combination of context, constraints, and formatting rules. Because models respond to the exact wording, order, and structure of input, small changes in a prompt can produce very different outputs.
Why it matters
Generative models do not read minds: they predict text based on patterns and the input they receive. Good prompts reduce ambiguity, lower the chance of incorrect or fabricated answers (hallucinations), and make outputs reproducible. For professionals, this matters because:
- It improves output quality without retraining or fine-tuning a model.
- It is cost effective: better prompts often replace expensive custom development.
- It supports consistency across teams when prompts are templated and version controlled.
- It is vendor neutral: the core skills transfer across models and providers.
How it is used in practice
Common techniques include:
- Role and context setting: telling the model who it is and what audience to write for.
- Few-shot prompting: providing example input and output pairs to demonstrate the desired pattern.
- Chain of thought: asking the model to reason step by step for complex tasks.
- Output formatting: requesting JSON, tables, or bullet lists for downstream use.
- Constraints: setting limits on length, tone, or sources to use.
- Iteration and testing: comparing variations against real cases and measuring results.
In applied settings, prompts are often stored as reusable templates with variables, evaluated systematically, and integrated into products or workflows.
Concrete Example
A weak prompt: *"Summarize this report."*
An engineered prompt: *"You are a financial analyst. Summarize the quarterly report below in 5 bullet points for an executive audience. Highlight revenue change, key risks, and one recommendation. Use plain language and avoid jargon. Report: [text]."*
The second version specifies role, audience, length, structure, focus, and tone, producing a far more usable result.