Rule-based system

A rule-based system is software that reaches decisions by applying explicit if-then rules written by people, rather than by using patterns learned from data.

In a rule-based system, knowledge about a subject is written down as rules: if a customer is under 18, refuse the application; if the temperature passes a limit, shut the valve. General-purpose reasoning software then applies those rules to the facts of each case. Two families emerged in AI research in the 1970s: production systems, which use if-then rules to trigger actions, and logic programming systems such as Prolog, which use rules to derive conclusions.

A classic production system has three parts. The rule base holds the rules. The working memory holds the facts about the current case. The inference engine runs a cycle: it finds every rule whose conditions match the facts, chooses one, carries out its action, which may add new facts, and repeats until no rule applies. Reasoning can run forwards, from facts to conclusions, or backwards, starting from a goal and working out which facts would be needed to prove it.

MYCIN, built at Stanford University in the early 1970s as Edward Shortliffe's doctoral project, is the best-known example. It used about 600 rules, reasoned backwards, and identified bacteria causing severe infections such as meningitis before recommending antibiotics. It attached certainty factors to its rules and could explain why it was asking a question and how it reached a conclusion. In a Stanford evaluation, infectious disease specialists rated its recommendations acceptable 65 per cent of the time, comparable to the 42.5 to 62.5 per cent scored by five faculty members. It was never used in hospitals, partly over questions of legal responsibility and partly because every patient detail had to be typed into a time-shared computer.

The strengths of rule-based systems are transparency and predictability. Every decision can be traced to the rules that produced it, the same input always gives the same output, and a rule can be changed directly when a policy changes. The weaknesses are the mirror image. Someone has to write every rule, the system has no answer for situations its authors did not foresee, and large rule sets become hard to maintain.

Rule-based systems never went away. Eligibility checks, tax calculations, compliance controls and many business workflows still run on explicit rules, because the rules are known and must be followed exactly. They are often combined with machine learning: a model scores how risky a payment looks, and fixed rules decide what happens at each score.

Common questions

What is a rule-based system in AI?

It is a system that makes decisions by applying if-then rules written by human experts to the facts of a case. It consists of a set of rules, a store of facts and an inference engine that works out which rules apply. Expert systems of the 1970s and 1980s were the most famous examples.

What is the difference between rule-based systems and machine learning?

In a rule-based system, people write the rules explicitly. In machine learning, the system learns its own patterns from examples. Rule-based systems are easier to explain and change but cannot handle cases the rules miss, while machine learning handles messy data better but is harder to inspect.

Is a rule-based system AI?

Historically, yes. Rule-based expert systems were a central part of AI research and industry from the 1970s onwards and are often called symbolic AI. Today the term AI is more often used for machine learning, but rule-based reasoning remains part of the field and is often combined with learned models.

What is an example of a rule-based system?

MYCIN, developed at Stanford in the 1970s, used about 600 rules to identify bacterial infections and recommend antibiotics. Modern examples include loan eligibility checks, tax software and fraud controls that apply fixed thresholds.

Finding more

Search for "rule-based system", "production system", "expert system" or "business rules engine" to learn how they work. Reliable sources include computer science textbooks on AI, histories of expert systems such as MYCIN, and documentation for rules engines used in industry. Be wary of products that present simple if-then logic as advanced AI.

  • Rule-based systemReferenceThe two families of rule-based systems and how an inference engine applies rules.
  • MycinReferenceHistory of the Stanford medical expert system, its rules, evaluation and why it was not deployed.

Working out what this means for your business?

Aileron Shift builds the systems behind this site: AI newsrooms that research, write and publish on their own, marketing automation and WordPress hosting for companies that need to move faster than their competitors.