Sub topic 13
Prototype and Validate Against the Baseline
Start with a falsifiable decision
Assume you understand basic software delivery, machine learning, and large language models. You should also be comfortable reading short Python snippets.
A prototype is a small implementation used to test a product decision. It should answer a specific question, such as:
- Can an AI classifier assign support messages to the right queue?
- Does a generated reply save agents enough time to justify review?
- Does the AI approach improve the user outcome over a rule-based feature?
Do not prototype “AI” in general. Define the outcome, the comparison, and the threshold before building.
For example:
> We will ship the AI classifier only if it reaches at least 90% accuracy, reduces manual routing time by 30%, and does not increase high-severity routing errors.
This statement makes the decision testable.
Build a baseline first
The baseline is the simplest credible approach to the same problem. It might use:
- A rule or keyword match
- A search result
- A form with clearer choices
- A fixed template
- Manual handling
- An existing product workflow
The AI prototype must be compared with this baseline. Otherwise, you cannot tell whether its extra cost and risk create useful value.
Use the same examples, labels, and evaluation method for both approaches. A small labeled set is enough to expose obvious weaknesses during an early prototype.
def accuracy(predict, examples):
correct = sum(
1 for text, expected in examples
if predict(text) == expected
)
return correct / len(examples)
examples = [
("please refund my order", "billing"),
("the app crashes on launch", "bug"),
("my invoice amount is wrong", "billing"),
("the screen freezes when I log in", "bug"),
]
def keyword_baseline(text):
text = text.lower()
if "refund" in text or "invoice" in text:
return "billing"
return "bug"
def prototype_classifier(text):
text = text.lower()
billing_words = ("refund", "invoice", "payment", "charge")
bug_words = ("crash", "freeze", "error", "broken")
billing_score = sum(word in text for word in billing_words)
bug_score = sum(word in text for word in bug_words)
if billing_score > bug_score:
return "billing"
return "bug"
print("baseline:", accuracy(keyword_baseline, examples))
print("prototype:", accuracy(prototype_classifier, examples))The evaluation function is deliberately simple. You can later replace prototype_classifier with a hosted model or a trained model without changing the comparison.
Design the validation
Separate examples used for development from examples used for evaluation. If you repeatedly adjust the prototype after seeing every evaluation result, the score becomes optimistic. A holdout set is data kept aside until the test.
For a user-facing feature, offline accuracy is only one measure. Include the measures that represent the product outcome.
| Measure | What it tells you |
|---|---|
| Accuracy or task success | Whether the output is correct |
| High-severity error rate | How often dangerous mistakes occur |
| Completion time | Whether the feature saves effort |
| Review or correction rate | How much human work remains |
| Cost per request | Whether the feature is economical |
| Response latency | Whether users receive results quickly enough |
Run a controlled pilot when possible. Give some traffic or tasks the baseline and some the prototype. Keep the groups comparable. Record failures, not only averages. An average score can hide a small group of severe errors.
Inspect failure modes
Read incorrect cases one by one. Classify each failure:
- The input was ambiguous.
- The needed data was missing.
- The model misunderstood the request.
- The baseline was already sufficient.
- The output was correct but unusable.
- The error required escalation or human review.
This analysis often changes the design. You might narrow the feature, add a confirmation step, route uncertain cases to a person, or decide that a UI change is safer than AI.
Common validation errors
Avoid these mistakes:
- Comparing the AI prototype with no baseline
- Changing the success metric after seeing results
- Testing only examples selected by the prototype author
- Reporting accuracy while ignoring severe errors
- Using a small demo as evidence of scale
- Counting generated output without measuring user effort
- Shipping without a fallback when the model is uncertain
The final decision should state what was tested, what the baseline achieved, what the prototype achieved, which errors remain, and what evidence would change the decision.
Exercise
A prototype reaches 92% accuracy, while the rules-based baseline reaches 88%. However, the prototype causes twice as many high-severity errors. What should you do?
Show answer
Do not ship it as-is. Investigate the high-severity failures, add safeguards or human review, and compare the revised design against the baseline using a risk-aware threshold.