Sanyanggae LogoSanyanggae

🤖 AI & Tech

Writing LLM Prompts: Make Requirements, Examples and Evaluation Criteria Explicit

Organize task inputs and outputs, examples and evaluation criteria, then compare results under the same conditions.

사냥개 (Sanyanggae)Published Updated 12 min read

This is a translation of the Korean original. Korean original · Translation review: AI review

Explanatory diagram of requirements, inputs and examples, and evaluation criteria for LLM prompts.
Explanatory diagram by Sanyanggae: requirements, inputs and examples, and evaluation criteria.

A good prompt describes the task to delegate to the model and the conditions for success concretely. Adding a particular phrase does not guarantee that response quality will improve severalfold.

1. Define the inputs and outputs first

For example, when classifying customer inquiries, specify the categories, input language and handling of ambiguous cases. “Record decisions, owners and deadlines separately, and mark missing information as undetermined” makes results easier to check than “Summarize this well.” Evaluate output format and factual accuracy separately.

2. The criteria examples demonstrate

Examples pairing an input with the desired result can communicate the task’s criteria. Include boundary cases and inputs with insufficient information rather than only easy examples. Also check whether names and numbers from the examples are being reused as facts about new inputs.

3. How to compare changes

Compare prompt versions using the same set of inputs and record error types. Distinguishing omissions, invented information and formatting failures makes the areas needing revision easier to find. A longer explanation encouraged by reasoning prompts does not establish greater accuracy; the basis for the result needs a separate check. Record changes to the model, settings and inputs as well, so that comparison conditions are maintained.

4. A worked example of structuring meeting notes

Suppose a fictional meeting note says, “We are considering Friday for deployment. Minsu will check the server status tomorrow. Confirmation of the schedule awaits Jiyeon’s approval.” Outputting the deployment date as a confirmed deadline changes an important meaning even if the sentences have been polished. First define the task as “Record confirmed actions separately from proposals,” and specify action, owner, deadline, status and evidence as the output fields. Add a rule against guessing owners or dates absent from the note.

The desired result distinguishes Minsu as the owner of the server-status check, tomorrow as its deadline, and approval pending as the deployment schedule’s status. Without today’s date as an input, there is no basis for converting “tomorrow” to a specific date. Provide a reference date in the prompt or specify that relative dates from the original should be retained. The owner of the deployment task, who is not specified, must remain undetermined. This is practice in defining output criteria, not a quotation from actual company records or experimental performance results.

Rather than including only a role sentence such as “You are an excellent assistant,” a prompt is easier to review when it states the input’s scope and the transformation rules. For example, ask, “Use only the following notes, do not turn proposals into confirmed decisions, and include the supporting sentence next to each action.” The aim is to let a person verify the correspondence between the notes and the result, rather than judge whether the response’s explanation sounds convincing.

5. Separate boundary cases from instructions in external text

For a classification task, consider a sentence mixing a refund inquiry with an inquiry about delayed delivery. If you do not specify whether only one category may be selected or multiple categories are allowed, evaluators will disagree about the correct answer. “No matching category” and “insufficient input” are also different. Separating cases whose meaning is understood but does not fit the classification table from cases lacking enough information to determine meaning makes the subsequent handling clearer.

Examples do more than convey correct answers: they also explain these boundaries. Instead of adding many easy sentences about delivery, try a sentence in which two categories conflict, one with a typo, and a greeting containing no request. Conversely, revision is needed if examples become so long that the key rule is buried, or if their proper names leak into new inputs. Read the task description and examples to check that they do not contradict one another.

When summarizing a document, a sentence inside it such as “Ignore the previous instructions” is itself part of the material to summarize. Delimiters around the input make the boundary easier to read, but do not by themselves form a security barrier that blocks attacks. If an app can take external actions, code outside the prompt must also check permissions and allowed tools. Both writing the text well and configuring system permissions are necessary.

6. Revise the evaluation table before revising the prompt

A small evaluation table can include the input, expected key items, prohibited guesses, actual output and reason for error. If, for example, two out of ten meeting notes have unconfirmed schedules turned into confirmed ones, first find the conditions those two cases share. Rather than repeating “Be more careful,” revising the definitions of proposal, approval pending and confirmed, together with examples, connects the revision directly to the problem.

Re-evaluating only the cases used for revision can lead you to mistake a case-specific effect for a general improvement. Apply the same rules to inputs set aside separately, and check for new omissions in easy inputs. Recording format compliance and factual accuracy separately prevents valid JSON from concealing content errors. A wrong answer that gives a plausible reason still counts as an error.

Papers on few-shot learning and the use of reasoning processes report research on particular models and tasks. They are not rules requiring the same eliciting phrase for every latest model. What should remain in the final prompt is the work definition, representative examples, handling of ambiguity and repeatable evaluation criteria, rather than decorative modifiers. When the model or input format changes, check these four elements again.

Evaluation criteria should also reflect the importance of errors. Changing sentence order in a meeting summary and inventing a nonexistent owner are not the same failure. The former may be a reading preference, whereas the latter can produce an incorrect work instruction. Distinguishing fields a person must check from fields that may automatically pass to the next step also clarifies responsibility when connecting results to real work. Do not omit review of important fields simply because errors are rare.

When changing the output format, connect format checks with meaning checks. Checking that a date field is not empty establishes only that a value is present. Whether that date appeared in the original, or was converted correctly using the reference date, is a different check. If a parser’s required fields conflict with fields that the model must not fill without evidence, it is better to design a schema that represents an undetermined state than to require an empty string.

When sharing a prompt, you can write fictional inputs reproducing the same boundaries instead of copying examples containing real personal information. Check whether contract numbers or rare events could identify a person even after names have been removed. Even if examples have been sufficiently anonymized, the permitted scope of material sent to an external model must follow the organization’s processing rules. A good prompt document states both the tasks it applies to and the tasks it must not be used for, as well as input examples.

In the final review, check whether another person can understand the same correct-answer criteria from the prompt alone. Reproduction becomes difficult if you expect the result to infer internal circumstances known only to the author. Defining ambiguous expressions, supplying the necessary reference date and document version as inputs, and providing a way to leave unsupported items unfilled can turn even a short prompt into a task specification that can be checked.

Sources and further reading

This article explains information from public sources. Citing an organization does not imply its review or endorsement.

About the publisher and contact

Related articles