Sub topic 2
Why AI Features Need Different Requirements
This chapter assumes you understand basic product requirements or user stories, know what a large language model does, and can read short Python and JSON snippets.
A traditional feature often has predictable behavior. If a user clicks “Save,” the application either stores the record or reports an error. A requirement can describe one expected result for one input.
An AI feature may produce several acceptable answers for the same input. The wording can change between runs even when the meaning is correct. A model can also fail in different ways: it might invent a fact, miss an important detail, use an unsafe tone, or refuse a valid request.
Therefore, an AI requirement should describe the quality of a group of outputs rather than demand one exact response.
Deterministic and nondeterministic behavior
A deterministic system produces the same result when its inputs and state are the same. An AI system is often nondeterministic, which means repeated runs can produce different results. Sources of variation include:
- Random sampling during generation.
- Changes to the model or its configuration.
- Different retrieved documents or conversation history.
- Small changes in the prompt.
- Service outages, truncation, or other runtime conditions.
Different wording does not automatically mean a failure. The requirement should focus on what must be true across the acceptable range of outputs.
For example, “The assistant must answer with exactly three sentences” is usually a weak product requirement. It specifies form but not usefulness. A stronger requirement is “For refund-policy questions, the assistant must provide an answer supported by the current refund policy and must not state a refund amount or deadline that conflicts with it.”
Describe quality dimensions
A quality dimension is one aspect of output quality that you can evaluate. Select dimensions based on the user problem and the risks of the feature.
Common dimensions include:
- Accuracy: Are factual claims correct?
- Groundedness: Are claims supported by the supplied sources?
- Relevance: Does the answer address the user’s request?
- Completeness: Does it include required information?
- Clarity: Can the intended user understand it?
- Safety: Does it avoid harmful or prohibited content?
- Tone: Does it match the product’s communication standards?
- Latency and cost: Does it respond quickly enough and stay within budget?
Do not treat every dimension as equally important. A friendly tone may matter for a writing assistant, while groundedness may matter more for a policy assistant.
| Requirement style | Example | Main problem |
|---|---|---|
| Exact output | “Always return this sentence.” | Rejects valid variation |
| Vague quality | “Give helpful answers.” | Cannot be measured |
| Testable distribution | “At least 95% of policy answers are grounded, with zero critical contradictions.” | Defines measurement and risk |
Connect requirements to failure modes
A failure mode is a way the feature can fail for a user. List realistic failures before choosing metrics.
For a refund assistant, possible failure modes include:
- Inventing a refund policy that does not exist.
- Giving a deadline that contradicts the policy.
- Ignoring that an item arrived damaged.
- Answering a different question.
- Revealing private information from another customer.
Rank each failure by severity. A minor failure may be awkward wording. A major failure may lead to a financial loss. A critical failure may create legal, safety, privacy, or trust consequences.
This ranking affects the requirement. Minor failures may be allowed within a percentage threshold. Critical failures often require a zero-tolerance rule.
Write requirements for variation
A useful AI requirement names:
- The population of inputs, such as questions in the refund-policy category.
- The quality dimension, such as groundedness.
- The measurement method, such as a human or model-based grader.
- The threshold, such as at least 95%.
- Any separate rule for critical failures.
For example:
“On the refund-policy evaluation set, at least 95% of answers must make only claims supported by the retrieved policy text, as judged by the groundedness grader. No answer may contradict a refund amount or deadline.”
This requirement accepts varied language while making the expected behavior testable.
Exercise
Exercise
Why is “The model must produce the same answer every time” usually a poor requirement for an AI feature?
Show answer
It rejects harmless wording variation and does not describe whether the answer is accurate, relevant, grounded, or safe. A better requirement defines acceptable quality across a set of outputs and sets separate limits for serious failures.