Sub topic 3
Try the non-AI baseline first
This chapter assumes you have read the earlier chapters on defining the user problem and on deterministic versus probabilistic behavior. You should also be able to read short Python snippets. The goal is to make a non-AI baseline a required step before any AI decision, and to show how to build and measure one.
What a baseline is
A baseline is the simplest approach that could plausibly solve the user problem. You build it, measure it, and treat its score as the number the AI option has to beat. It has two jobs.
- It may solve the problem outright. Many features that look like AI work turn out to be a lookup, a filter, or a clearer screen.
- If it falls short, its failures show what the AI would have to fix. Those failures become your first test cases and your first evidence of real need.
Skipping the baseline causes a common mistake. A team builds an AI feature, sees that it "works", and ships it. Nobody knows whether a 20-line rule would have worked as well, at a fraction of the cost and with predictable behavior. Without a baseline, "it works" has nothing to be compared against.
The four baseline families
Non-AI approaches fall into four groups. Try them roughly in this order, because the earlier ones are cheaper and easier to change.
| Family | What it is | Typical fit |
|---|---|---|
| UI change | Change the interface so the user supplies the information or makes the choice directly | Picking a category, filling a field, choosing from a short list |
| Rules | Explicit if/then logic written by people | Policies, thresholds, validation, routing by known fields |
| Heuristics | Approximate shortcuts that work most of the time | Ranking by recency or popularity, keyword matching, scoring formulas |
| Search | Indexing and retrieval over existing content, with filters and sorting | Finding help articles, products, or past tickets |
UI changes
A UI change is the most overlooked option. If the problem is "we need to know what category this support request belongs to", ask the user to pick one. A dropdown with five choices gives you a label with no model, no error rate to tune, and no latency. The cost is a little friction for the user, so you must check that the friction is acceptable.
Other examples:
- Replace free-text entry with structured fields when you need the data in a known shape.
- Offer defaults or templates rather than generating text from scratch.
- Add filters and sort controls rather than predicting what the user wants to see.
- Show the answer the user needs at the point of need, rather than building a system to answer a question about where it is.
Rules
Rules are deterministic. The same input gives the same output, and you can explain every decision by pointing at a line of logic. They work well when the conditions are known and stable, and they get hard to maintain when the cases multiply. A rule set that grows past a few dozen interacting conditions, or that needs constant edits for new phrasing, is a sign the problem may be fuzzier than rules can handle. That is a signal to record, not yet a reason to switch.
Heuristics
A heuristic is a rule of thumb that is not guaranteed correct but is right often enough. Examples are "show the most recently used items first", "flag messages containing the word 'refund' as billing", and "rank by number of matching terms". Heuristics are cheap and transparent. Their weakness is that they fail silently on cases you did not think of, so you must measure them on realistic data rather than judge them by how sensible they sound.
Search
Much of what is described as "AI-powered assistance" is retrieval: the answer already exists in a document, a database, or a past record, and the user needs to find it. A good search engine, with keyword matching, filters, synonyms, and sensible ranking, often solves this. Search also keeps a property that generated text lacks. Every result points to a real source the user can open and check.
A decision path for the baseline
You do not need to build all four. Work down the list and stop when one meets the success outcome you defined earlier.
The phrase "meets the success outcome" matters. Each question needs a measurable answer, not an opinion. That is why the baseline has to be scored.
Scoring a baseline
Suppose the feature routes incoming support messages to either billing or bug. The simplest heuristic is a keyword check. Here it is, scored on a tiny labeled set with an accuracy function that you can reuse unchanged for any later AI model, since both only need to be callables that take text and return a label.
def accuracy(predict, examples):
correct = sum(1 for text, label in examples if predict(text) == label)
return correct / len(examples)
examples = [
("please refund my order", "billing"),
("the app crashes on launch", "bug"),
("my invoice amount is wrong", "billing"),
]
def keyword_baseline(text):
if "refund" in text or "invoice" in text:
return "billing"
return "bug"
print(accuracy(keyword_baseline, examples))This prints 1.0, and that result should make you suspicious rather than pleased. Three examples written by the person who wrote the rule are not a test. They only show that the rule matches the cases its author had in mind. A baseline is only useful when the examples come from real traffic, include awkward phrasing, and are numerous enough that a few mistakes change the score visibly.
Use realistic data and look at the errors
Add examples that a real user might send, and print the misses as well as the score.
def accuracy(predict, examples):
correct = sum(1 for text, label in examples if predict(text) == label)
return correct / len(examples)
def misses(predict, examples):
return [
(text, label, predict(text))
for text, label in examples
if predict(text) != label
]
def keyword_baseline(text):
if "refund" in text or "invoice" in text:
return "billing"
return "bug"
examples = [
("please refund my order", "billing"),
("the app crashes on launch", "bug"),
("my invoice amount is wrong", "billing"),
("I was charged twice last month", "billing"),
("cannot log in after update", "bug"),
("how do I get my money back", "billing"),
]
print(accuracy(keyword_baseline, examples))
for text, expected, got in misses(keyword_baseline, examples):
print(f"expected {expected}, got {got}: {text}")The output is:
0.6666666666666666
expected billing, got bug: I was charged twice last month
expected billing, got bug: how do I get my money backTwo things are now visible. The baseline scores about 67%, and the misses share a pattern: billing messages that use words the rule does not list. That tells you two different things.
- Some failures are cheap to fix. Adding "charged" and "money back" to the rule may lift the score at once. Do that and re-measure before you conclude the rule is inadequate.
- If you keep adding words and new phrasings keep appearing, the problem has the long-tail variety that suggests AI fits. You now have evidence for that, not a hunch.
Fix the cheap failures first. A baseline that has not been improved with reasonable effort is a weak baseline, and beating it proves little.
Fair comparison rules
When you later compare an AI approach with the baseline, keep the comparison honest.
- Use the same test set for both. Never tune either option on it.
- Use the same metric, defined before you look at results.
- Give the baseline a fair amount of effort. A few hours of improvement on the rules is reasonable.
- Compare more than accuracy. Include cost per request, latency, and how often the system fails in ways users notice.
- Include maintenance. A rule set needs edits when the product changes. A model needs monitoring and retraining or prompt updates.
A small accuracy gain does not automatically justify AI. If the AI scores 88% and the improved baseline scores 85%, ask whether three points are worth added cost, slower responses, and less predictable behavior. The answer depends on the cost of errors, which the next chapters cover.
Common errors
- Straw-man baselines. Comparing AI against a deliberately weak rule makes the AI look necessary. Improve the baseline first.
- Testing on the rule author's examples. The score reflects the author's imagination, not user behavior.
- Treating "complex" as "needs AI". Complex logic written clearly is still deterministic and testable.
- Ignoring the UI option. Asking the user can beat predicting for them, especially when the user knows the answer.
- Skipping measurement because the baseline "obviously" fails. If it fails, measure how, so you know what the AI must improve.
What to carry forward
By the end of this step you should have a baseline implemented, a labeled test set drawn from realistic inputs, a score with a list of its failures, and a decision: ship the baseline, or move on to the next question with evidence of exactly where it falls short. The next chapters assess whether the problem fits AI and what wrong answers would cost.
Exercise
Your keyword baseline for routing messages scores 0.67 on six hand-picked examples. A teammate says "AI is clearly needed." Name two things you would do before agreeing, and one observation that would support the teammate's claim.
Show answer
First, improve the baseline with cheap fixes, such as adding the missed keywords ("charged", "money back"), and re-measure it on a larger test set drawn from real traffic rather than six hand-picked examples. Second, check whether a UI change, such as asking the user to choose billing or bug, would solve the problem without any model. Evidence that supports the teammate: after reasonable effort, the baseline still misses many messages, and each fix reveals new phrasings, so the long tail of wording keeps growing. That pattern shows that rules cannot keep up, and the measured failures become the test cases the AI option must beat.