ELIZA: The Chatbot Who Revolutionised Human-Machine Interaction [An Introduction]

There are now over 300,000 chatbots (on Facebook). 55 years ago, there was only 1.

Sundown Sessions
Jan 18 · 6 min read
Photo by Priscilla Du Preez on Unsplash

ELIZA: How do you do. Please tell me your problem.
YOU: I have trouble keeping my houseplants alive.
ELIZA: Your houseplants alive?
YOU: Yes, I forget to water them sometimes.
ELIZA: You are sure.
YOU: I am sure.
ELIZA: Do you know anyone else who is sure?
YOU: My plants are sure.
ELIZA: Why do you say your plants are sure?
YOU: Because they suffer the direct consequences of me not watering them.
ELIZA: Does that reason seem to explain anything else?

How do you do? Illustrated above is one example of a conversation I had with ELIZA. ELIZA is the first chatbot and early contender of the Turing Test*.

In this article, I’ll talk about why ELIZA is important, who ELIZA is, how ELIZA works, and answering one of the (in my opinion) most important questions about ELIZA.

Let’s get started.

Why Is ELIZA Significant?

The idea of artificial neurons was introduced not too long ago, in 1943. In 1950, Alan Turing proposed the Turing Test, a ground-breaking test that would influence AI researches in years to come.

Personal computers do not exist. Interactive computing is very new — Sketchpad was just invented in 1963. Natural language processing? Not well known to the masses.

Then, boom — ELIZA shows up and blows the minds of experts, much less lay people. A bot that could respond smoothly to user inputs? Unheard of.

Today, the invention of ELIZA is considered an important milestone in the field of AI.

Surprisingly, her inventor did not intend for it to be that way.

Who Is ELIZA?

NLP is a branch of AI that deals with linguistics and human language.

Her most famous script, DOCTOR, simulates the role of a Rogerian psychotherapist (more specifically, Carl Rogers). Rogers was known for reflecting whatever patients’ said back at them, in the form of a question.

A short example would be:

PATIENT: I’m feeling down today.
ROGERS: Why do you think you’re feeling down today?

Does that seem familiar? Yes, probably because that sounds exactly like what ELIZA would say.

Weizenbaum originally intended to build a ‘chatbot’ (the term wasn’t coined then) to demonstrate the superficiality of the interaction between human and machine.

Imagine his shock when he saw people believing ELIZA to be able to really feel and understand!

In his words,

“I had not realised that extremely short exposures to a relatively simply computer program could induce powerful delusional thinking in quite normal people.”

Obstacles In Creating An Interactive Program Like ELIZA

NLP is complex because human language is complex. Human language is complex because it is arguably a reflection of human thinking. So how did ELIZA overcome this insurmountable problem? Did Weizenbaum somehow manage to train her using loads of large datasets? No.

This is where the concept of psychotherapy fits.

By only asking questions, she had control over the direction of the conversation without having to contribute any real content.

She doesn’t have to know what’s going on, she only had to appear to know.

You may be thinking, even then, how does she know what questions to ask?

This is where pattern matching comes in. There are a few considerations:

  • ELIZA would need to be able to identify important words in the user’s input.
  • ELIZA would need to know how to act when there is more than one keyword or phrase.
  • ELIZA would need to know how to manipulate those words to produce an output.
  • ELIZA would need to know how to act when there are no keywords identified.
  • And of course, ELIZA would need to know when to stop the conversation.

How Does ELIZA Work?

Some simple terms:

  • Input refers to whatever the user types into the program.
  • Output refers to whatever ELIZA responds with.

Decomposition

When the user enters an input, the input text is checked for syntactical patterns that will allow the program to break the text down into smaller parts.

e.g. input: I am feeling down."I" is the pronoun.
"feeling down" is the action.
"am" connects the action to the pronoun.

The program then scans the text for keywords and assigns different numerical values to them, based on their ‘level of importance’. This is their rank.

e.g. input: I am feeling down."feeling down" might get a rank of 1 as it contains actual content.
"I" might get a rank of 2 as it is a pronoun that specifies who the user is referring to.
"am" might get a rank of 3.

ELIZA also looks out for certain words that are deemed useful to respond to, such as “alike” or “same”. See how she responds to these below.

The keywords will be placed in a ‘keystack’. The word or phrase with the highest rank is placed on top.

"feeling down"
"I"
"am"

Reassembly

ELIZA decides on a series of transformations, which is dependent on the rule that applies to the keyword type. Priority is given to keywords with a higher rank.

"feeling down" will be the main content in her output, such as "How long have you been feeling down?"
"I" becomes "You" (first person pronouns are changed to second person pronouns).
If input text contains words like "alike" or "same", the output text will respond to this claim of similarity, such as "In what way?"

How are ranks decided? Statements generally follow certain patterns, or contain certain types of words, no matter the content. Words that relate to these general patterns have higher ranks. Specific words (patterns and word types) that ELIZA was programmed to look out for also get higher ranks.

After the transformation is complete, ELIZA pieces the transformed keywords back together, including ‘filler words’ or ‘question words’ that are appropriate to the input. Finally, she produces her output response.

e.g. input: People are rude.
output: Possibly they are rude.
"Possibly" is the 'filler word'.
"People" was probably transformed to "they".
"are rude", the main content, was copied over to be the main content of the output too.

To stop the conversation, ELIZA looks out for words like “Bye.” or “Goodbye.”

What if there are no keywords identified?

If ELIZA sees something she doesn’t understand, she will make a vague comment, like “I see.” or “Please go on.” or “Please continue.”

Another possibility is ELIZA would use her ‘Memory’ to ‘recall’ previous inputs, and use those inputs to generate responses that reference previous parts of the conversation.

Pretty clever.

Asking The Most Important Question

*cue suspenseful music*

Excitingly, ELIZA was named after the protagonist in Pygmalion, a play written by George Bernard Shaw in 1912.

The protagonist, Eliza Doolittle, starts out as a poor flower girl. Until Higgins and Colonel Pickering sort of took her under their wings, to teach her to speak ‘upper-class English’, with the ultimate aim of getting her to pass as a duchess.

Similarly, ELIZA was trained to improve her speech to pass as a human psychotherapist.

This is probably a stretch, but do what you will with this information: Pygmalion, in ancient Greek mythology, fell in love with one of his sculptures, somehow causing it to come to life. ELIZA …carved her success by mimicking being ‘alive’.

Alright, I’ll leave you with one final nugget. Remember that conversation I had with ELIZA about houseplants? Her first prompt was “How do you do. Please tell me your problem.”

What’s the phrase Higgins has been teaching Eliza to pronounce, that Eliza repeats four times at Mrs Higgins’ at-home day, the phrase she was remembered for at the Embassy by the Hostess?

“How do you do?”

*For a brief introduction to the Turing Test, check out this article.

Thank you for reading. Please clap 👏 for this story to let me know if it was valuable to you. Have a great day!

Nerd For Tech

From Confusion to Clarification

Sundown Sessions

Written by

After hours.

Nerd For Tech

NFT is an Educational Media House. Our mission is to bring the invaluable knowledge and experiences of experts from all over the world to the novice. To stay up to date on other topics, follow us on LinkedIn. https://www.linkedin.com/company/nerdfortech

Sundown Sessions

Written by

After hours.

Nerd For Tech

NFT is an Educational Media House. Our mission is to bring the invaluable knowledge and experiences of experts from all over the world to the novice. To stay up to date on other topics, follow us on LinkedIn. https://www.linkedin.com/company/nerdfortech

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store