Prompt Engineering

Designing prompts so a model produces more useful, accurate, or structured responses.

Improve a room-number extraction request

“Find the room” leaves open whether a room name, a floor or a number belongs in the response. Try the revised instruction on a small test set.

  1. Revised instruction

    “Return the current room number. If the notice gives none, return unknown. Use a new assignment in place of an old one.”

  2. Two positive checks

    “Prints are in room 12” should give 12. “Moved from room 12 to room 14” should give 14.

  3. One missing-value check

    “The prints are in the west wing” should give unknown. The notice supplies a location but no room number.

What makes the revision better?

Evaluate both versions on the same notices and record the actual outputs. The three cases above are expected results for testing. Add unseen notices with different wording before generalizing from them, and decide how to handle conflicts that the instructions do not cover.

What Makes a Strong Prompt

The best prompts usually reduce ambiguity. They tell the model what role it should take, what output format is expected, what material it should rely on, and what trade-offs matter most. A strong prompt might specify audience, tone, allowed sources, required sections, or whether the answer should be concise or detailed.

Examples often help. If a model sees a couple of good input-output pairs, it can imitate the pattern more reliably. Structured prompting also becomes more important when a system has tools, workflows, or safety rules controlled by a system prompt or application logic.

Follow the idea

Prompt explains the components of an individual request.

Verification checks the actual output against the expected field.

Related concepts (5)

Examples in the AI guides

Related Yenra articles (2)

Source · Google’s prompt design guidance

Return to Prompt Engineering in the A–Z glossary