liveBook · Manning

Rule-based system

As explained in Introduction to Generative AI, Second Edition

A rules-based AI system produces outputs by applying explicitly authored rules or response mappings rather than generating them probabilistically from learned model parameters.

A rule-based system responds by applying rules written in advance. In a chatbot, it might detect a word, phrase, or type of problem and select a prepared reply. This differs from a large language model (LLM), which generates responses probabilistically rather than selecting only from authored messages. section 1.1 section 9.5

Two kinds of chatbot

ELIZA used simple pattern matching, often asking open-ended questions or giving generic replies when it did not recognize a phrase. Woebot could identify a user's challenge and respond with a message written by its team and reviewed by clinicians. Neither example means the system understands a person as a therapist would: people attributed empathy to ELIZA despite its simple mechanism. section 1.1 section 9.5

Authored responses offer a reason to consider rule-based chatbots for sensitive settings: their available messages can be reviewed before use. That does not establish that they are suitable mental health treatments. Their conversations are also less flexible and may feel less engaging than conversations with LLM-based chatbots. Conversely, even when an LLM is trained to respond in particular ways, ensuring that every reply follows mental health guidance is difficult. section 9.5

Rule-based approaches have a broader history in natural language processing. Building them for language tasks required extensive if-then logic and linguistic expertise, and the results could be brittle. By the 1990s, statistical methods were achieving strong machine-translation results by learning patterns from translated documents instead of relying on people to specify grammatical rules. section 1.1

How Introduction to Generative AI, Second Edition covers it

How deep it goes
Explains pattern matching and authored response selection at a high level, without implementation steps.
Examples
Contrasts ELIZA's pattern-matched replies with Woebot's clinician-reviewed messages.
What you can do after
Evaluate/understand it as a choice between reviewable prepared replies and greater conversational flexibility, without assuming review alone establishes clinical suitability.
How it connects
Connects rule-based systems to natural language processing, statistical machine translation, large language models, and mental health chatbots.

Also explained in

Compare how 6 books explain rule-based system →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Introduction to Generative AI, Second Edition. The section links point to the parts of the book it draws on.