Veltos.Tech

AI and ML

Prompt engineering

Also known as: prompt design, prompting, system prompt

Definition

Prompt engineering is the design of instructions for a language model: role, context, task, output format and constraints are written so the result is reproducible, and quality is judged against a set of test cases rather than by impression.

A working prompt almost always consists of the same blocks. Role and framing: who is answering and in what situation. Context: the materials to base the answer on, with an explicit ban on inventing beyond them. Task: what exactly to do, stated as concretely as possible. Format: the structure of the response, and for integrations a strict JSON schema that code can validate afterwards. Constraints: length, language, tone, forbidden topics, and what to do when the data is insufficient. A separate technique is a few input-output examples, which fix the format more reliably than any verbal description.

What separates engineering from phrase-hunting is measurement. A prompt that seems to answer well cannot be improved or maintained: any change may fix some cases and break others, and there is nothing to notice it with. The working practice is simple: a set of thirty to a hundred real queries with reference answers or at least acceptance criteria, an automatic run after every edit, and a recorded share of correct outputs. Without that set, switching model or version becomes a lottery and the quality debate becomes an exchange of screenshots.

The limits of the method deserve honest statement too. A prompt cannot add knowledge the model does not have, which is what RAG exists for. A prompt cannot guarantee arithmetic accuracy, which is what code is for. And a prompt cannot reliably defend against a user rewriting the instructions: production systems need separate input and output checks, a restricted set of available actions and logging. The practical conclusion is that a prompt is an important part of the system rather than the system, and solving a product problem with one long prompt tends to hit a ceiling quickly.

Related terms

Related services

Read more

Need this done, not just defined?

We do this work, not only write about it. Describe the task and we will scope it and send a staged estimate.