# Writes prompts that get reliable results

> Competency concepts/prompts-reliably

Page: https://schubergphilis.github.io/ai-training/competencies/concepts/prompts-reliably/
License: CC BY-SA 4.0, https://creativecommons.org/licenses/by-sa/4.0/

*Concepts* · competency `concepts/prompts-reliably`

**Taught in:** the [Concepts](https://schubergphilis.github.io/ai-training/concepts/) course

**Draws on:** [Prompting](https://schubergphilis.github.io/ai-training/topics/concepts/prompting/), [How language models work](https://schubergphilis.github.io/ai-training/topics/concepts/how-models-work/)

## Learning objectives

### Turns a vague request into instruction, context, example and format (base)

| Claim | Why | Example |
| ----- | --- | ------- |
| A prompt separates the instruction (what to do) from the context (what to work on) and marks the boundary between them. | When instruction and material run together, the model treats parts of the material as orders or parts of the order as material. | "Summarize the text between the triple quotes for a sales manager" with the pasted email inside the quotes, rather than the email followed by "summarize". |
| The prompt names the audience and the purpose of the output. | The same content for a customer and for a colleague differs in length, tone and what may be left out, and the model cannot guess which. | "Write the release note for end users who do not read code; skip internal ticket numbers" replaces "write a release note". |
| When the wanted output is hard to describe, the prompt shows one example of it. | One good example fixes format, length and tone at once, where a paragraph of rules leaves room for interpretation. | The learner pastes one past meeting summary in the house format and writes "produce the same for these notes". |
| The prompt states the output format, including length. | Left to its default, the model picks a length and format for a general reader, which is rarely what the next step needs. | "Five bullets, each under 15 words, no introduction" instead of "keep it short". |

Served by: [Show one example](https://schubergphilis.github.io/ai-training/concepts/one-example/), [Instruction, context and format](https://schubergphilis.github.io/ai-training/concepts/prompt-anatomy/), [The prompt before the conversation](https://schubergphilis.github.io/ai-training/concepts/system-prompt/)

### Improves a result by changing the prompt, not by retrying (base)

| Claim | Why | Example |
| ----- | --- | ------- |
| When the output is wrong, the learner names what is wrong with it and changes the prompt to address that, instead of rerunning the same prompt. | Rerunning draws another sample from the same distribution, and the same gap in the instructions produces the same class of mistake. | The summary skipped the decisions made, so the learner adds "list every decision as its own line" instead of pressing regenerate. |
| The learner changes one thing at a time and compares the result with the previous one. | Changing five things at once shows whether the total worked and hides which change did it, so the next prompt cannot build on it. | The learner first adds the audience, sees the tone fix, and only then works on the length. |
| A correction the learner had to make twice moves into the prompt or into a saved template. | A fix typed in the chat is gone with the session, but a fix in the prompt is there for every run. | After twice asking for "dates in ISO format", the learner adds the line to the prompt they keep for the weekly report. |

Served by: [Change the prompt before you retry](https://schubergphilis.github.io/ai-training/concepts/iterating-on-a-prompt/)

### Asks for output in a shape the next step can use (base)

| Claim | Why | Example |
| ----- | --- | ------- |
| The learner asks for output in the format the next step consumes: a table, a list of named fields, JSON, or a file in a known layout. | Prose has to be reformatted by hand or by another prompt, and each reformatting is another place for mistakes. | For action items that go into a tracker, the learner asks for "one line per item: owner, task, due date, separated by tabs". |
| The requested format names its fields and the allowed values as well as its type. | "Return JSON" gives a different set of keys every run, and naming the keys makes runs comparable and parseable. | "Return a JSON object with keys `sentiment` (one of positive, neutral, negative) and `reason` (one sentence)". |
| The learner checks the first structured result against its consumer before scaling up. | A format that looks right can still fail on the detail the consumer cares about, such as a date format or an empty field. | The learner pastes the first generated CSV into the spreadsheet import and fixes the column order in the prompt before running the other 200 rows. |

Served by: [Output the next step can use](https://schubergphilis.github.io/ai-training/concepts/structured-output/)

## Alignment

| Framework | Code | Asks | Objectives here |
| --------- | ---- | ---- | --------------- |
| AI Fluency 4D (Dakan and Feller) | Description | State the goal, context and wanted output clearly, and refine it | structures-a-prompt, iterates-on-output, asks-for-structure |
