# What were ELIZA and the first expert systems?

Date: 2019-05-06 · Author: Robert Scales · https://guidetoartificialintelligence.com/en/learn/what-were-eliza-and-the-first-expert-systems/

**Answer:** ELIZA was a 1966 MIT program by Joseph Weizenbaum that held typed conversations by spotting keywords and turning the user's words into a reply, most famously in the role of a psychotherapist. Expert systems, which spread in the 1970s and 1980s, captured a specialist's knowledge as if-then rules so a computer could diagnose infections, identify molecules or configure computers.

Two of the best-known programs of early AI took very different paths. ELIZA, described by Joseph Weizenbaum of MIT in January 1966, made people feel they were having a conversation, even though it understood nothing. Expert systems, which grew out of Stanford research in the mid-1960s and became a business in the 1980s, did real work in narrow fields by following hundreds of rules written down with the help of human experts.

Both are worth knowing because they show the two big strengths of rule-based AI, and the two walls it kept running into.

## How ELIZA worked

ELIZA ran on MIT's time-sharing system, where people typed to it at a terminal. The program looked through each sentence for keywords. Each keyword came with rules: one rule split the sentence into parts, and another rebuilt those parts into a reply. When no keyword matched, ELIZA fell back on a neutral prompt to keep things moving.

The rules sat in a separate "script," so the same program could play different roles and even speak other languages; Weizenbaum mentions scripts in Welsh and German as well as English. The famous script made ELIZA act like a Rogerian psychotherapist, a style of therapy where the therapist mostly reflects the patient's words back. Weizenbaum chose it because a therapist can seem to know almost nothing about the world without anyone finding it strange.

Here is a simplified exchange in the spirit of his examples, with the rule behind each reply:

| You type | ELIZA's rule | ELIZA replies |
|---|---|---|
| My boss makes me work late. | Keyword "my": reflect the phrase back | Your boss makes you work late? |
| I am tired all the time. | Keyword "I am": ask about the feeling | How long have you been tired all the time? |
| It rained today. | No keyword: use a neutral prompt | Please go on. |

The name came from the character Eliza in *Pygmalion*, because the program could be "taught" to seem more polished. Weizenbaum's own point was the opposite of hype: once you see how a program like this works, its magic disappears.

## How expert systems worked

Expert systems tried something more ambitious: real competence in one field. They had two parts. A knowledge base held facts and rules, mostly in if-then form. An inference engine applied those rules to the facts of a case to reach new conclusions, and could often explain its reasoning by listing the rules it had used.

Early examples came from Edward Feigenbaum's group at Stanford. Dendral helped chemists identify unknown organic molecules, and Mycin suggested diagnoses for infectious diseases. In the 1980s the approach went commercial. XCON, built at Carnegie Mellon for Digital Equipment Corporation to configure computer orders, was estimated to save the company 40 million dollars over six years, and two-thirds of Fortune 500 companies reportedly used expert systems in daily work.

A tiny rule base shows the idea:

```prompt
RULE 1: IF the engine will not start AND the lights are dim THEN suspect the battery.
RULE 2: IF suspect the battery AND the battery is older than five years THEN recommend replacing it.
FACTS: engine will not start; lights are dim; battery is six years old.
CONCLUSION: recommend replacing the battery (because of rules 1 and 2).
```

> **Try it:** Write five if-then rules for a decision you know well, such as choosing what to wear for the weather. Then invent an odd situation your rules never imagined, like a sunny day with hail, and see what your system would conclude.

## What the two had in common

Both depended entirely on rules that people wrote by hand. ELIZA's rules were shallow, so it sounded fluent but knew nothing. Expert systems' rules were deep but narrow, so they knew a lot about one task and nothing outside it. Neither learned from experience the way people do.

## Why did early AI keep hitting walls?

The first wall was the gap between promises and results. In 1966 a US advisory committee known as ALPAC reported that machine translation was slower, less accurate and more expensive than human translators, and funding was cut. In 1973 the Lighthill report in Britain criticized AI for failing to meet its grand aims and pointed to "combinatorial explosion": the number of possibilities grows so fast that many methods only work on toy problems. Funding dried up in both countries, the first of two periods now called "AI winters."

The second wall was knowledge itself. Getting experts to spell out everything they know as rules is slow and expensive, a difficulty known as the knowledge acquisition problem. By the late 1980s and early 1990s, early expert systems such as XCON had become costly to maintain. They were hard to update, could not learn, and were "brittle," meaning they could make absurd mistakes when a case fell outside their rules. The market for specialized LISP machines, built to run AI software, collapsed in 1987, opening a second AI winter.

The common thread is that hand-written rules do not scale to the messiness of the real world. That is why so much current research, including this year's language models, learns patterns from large amounts of data instead. Learned systems have their own weaknesses, but the lesson of ELIZA still applies: fluent output is not the same as understanding, and it pays to ask how a system produces its answers.

## Sources

- ELIZA: A Computer Program for the Study of Natural Language Communication Between Man and Machine: https://web.stanford.edu/class/cs124/p36-weizenabaum.pdf
- Expert system: https://web.archive.org/web/20190501000000/https://en.wikipedia.org/wiki/Expert_system
- AI winter: https://web.archive.org/web/20190501000000/https://en.wikipedia.org/wiki/AI_winter
