When Is a Rule Enough?
7 min read
Lesson objectives
- Decide which parts call for a written rule, learned classification, or a draft checked against a source.
Please sign in to use all the tools
Once you sign in, the reading tools are yours: larger or smaller text, typeface, line spacing, focus mode, highlighting and bold, and notes saved to your account and gathered in My study.
Where the decision comes from
In the previous lesson we separated a system's suggestion from the action a member of staff takes. Now ask where the suggestion came from. If booking closes one hour before an event, any employee can calculate the last eligible booking time. If someone sends a free-text message to the service desk, an employee may have to read the message in context to work out what the person wants. Those jobs call for different ways to produce an output.
Here, a rule-based system applies conditions and actions that people have specified in advance. It receives a value and checks it against a known condition. The service owner can inspect the condition in the policy and change its effective date. The person testing the system can try values on either side of the boundary. For a room that seats ten, try bookings for nine, ten, and eleven people. Those three requests help you check how the rule handles the boundary without collecting a history of past bookings.
Some AI systems themselves use explicit rules and representations of knowledge to infer results. Certain expert systems are examples. The comparison in this lesson is between simple automation of a known service rule and a model that learns a pattern from data. When a product combines several parts, ask which component follows the policy directly, which component makes an inference, and what happens when the two outputs disagree.
Who specifies the pattern?
Machine learning adapts model parameters or structure using data or experience. For the library classifier, staff label varied requests and check whether the system generalizes to expressions they never wrote rules for.
A model can learn a shortcut the team never intended. If many training examples containing the word “time” are about opening hours, it may route “What time is my book due back?” to the wrong desk. The people testing the model have an important role here. Testing it on a stock list of opening hours questions does not reveal how often it confuses opening hours with due times. Include requests whose wording is similar and whose meanings differ.
Deep learning uses neural networks with several layers that learn useful representations. The same method can support classification or generation. Test the resulting system on requests representative of the service.
When the output is new text
Generative AI can produce text, images or audio. A drafted library reply needs checking for unsupported claims and omitted exceptions. Drafting is useful when writing plus review takes less work than answering directly.
One workflow can combine these methods. A rule checks whether the start time allows a room booking. A classifier proposes a suitable staff queue from the wording in a message. A generator can draft a sentence for the employee to read before sending. Each component has a scope defined by its input and output. The written explanation needs to get the booking result from the approved record. If the generator guesses what the booking system will decide, the message to the reader can contradict what the booking system actually did.
There are three different questions to ask when you compare the methods. With an approved policy condition, test the rule at the boundary. When an inquiry can be expressed in many ways, test whether the classifier recognizes the same issue across different wording. When you need a newly composed explanation, verify every factual claim against a source. A large number of sensible-looking replies will not answer the question of whether the underlying rule handles a request exactly one hour before the event.
| Source of the output | What the system receives | What to check |
|---|---|---|
| Booking rule | Time of request and booking start time | Compare decisions before, at, and after the cutoff |
| Question classifier | The reader's wording | Try similar wording about different topics |
| Draft generator | Booking result and policy excerpt | Check the explanation against the result and excerpt |
Worked example
Guided practice
Independent practice
Summary
Check your understanding
Lesson summary
A rule applies a condition people have specified. Machine learning adapts a model from examples or other experience so it can respond to new cases. Deep learning uses networks with multiple layers, which can support different tasks, including classification and generation. Generative AI produces content such as a drafted reply. In a combined workflow, let the known policy drive the eligibility rule, let a classifier propose a route for unfamiliar wording, and have a person check any new explanation. Test the rule at its limits, the classifier on similar wording with different meanings, and the draft against its source. Keep an approved result available to the drafting system so it does not guess the decision for itself. Next, use the type of output to identify which task is being performed.