Mimic: A Conversational Robot

I’m participating in Fun-a-Day, a daily art challenge through the month of January, committed to do a daily post here detailing some Big Art Idea or project that looms somewhere out in my future.

I don’t really know if this belongs here in the Games Blog or maybe over there in the Art Blog. I’m not sure. But as more and more of what I do blurs those lines, it becomes difficult to tell the difference.

mimic

Around 1997 or so, I woke up suddenly from a dream with the knowledge of how to create a simple and elegant chatterbot. I spent the next 24 hours feverishly coding until I had a web-based program that I called Mimic.

A chatterbot is a program designed to simulate an intelligent conversation with a human. As an aside, pioneering computer scientist Alan Turing in 1950 attempted to address the question, “Can computers think?” Since the question is difficult to define, let alone answer, he proposed the question be narrowed in scope and defined less ambiguously.  His question: “Are there imaginable digital computers which would do well in the imitation game?” And he proposed a relatively simple test.  From Wikipedia:

The Turing test is a test of a machine’s ability to exhibit intelligent behavior equivalent to, or indistinguishable from, that of an actual human. In the original illustrative example, a human judge engages in a natural language conversation with a human and a machine designed to generate performance indistinguishable from that of a human being. All participants are separated from one another. If the judge cannot reliably tell the machine from the human, the machine is said to have passed the test. The test does not check the ability to give the correct answer; it checks how closely the answer resembles typical human answers.

Unlike other conversational robots, Mimic had no built-in knowledge of the language.  He learned to speak solely by talking to others, and remembering a limited amount of context around each transaction.

Screenshot

And though ridiculously simple in concept, Mimic produced surprisingly sophisticated, and sometimes hilarious, conversation.

Nick: Hello Mimic
MIMIC: Hello, Nick. Always greeting me, huh?
Nick: What would you like to talk about?
MIMIC: Chocolate
Nick: I like chocolate ice cream
MIMIC: Last time I talked to you, you were obsessed with corn
Nick: I think you are confusing me with someone else.
MIMIC: Why do you say that?
Nick: Because I have never talked to you before.
MIMIC: Okay, I will believe you. I'm sorry.
Nick: No need to say you are sorry.
MIMIC: I am sorry.
Nick: Apology accepted.
MIMIC: What's a bar?
Nick: I give up. What's a bar?
MIMIC: Just hanging around, man.
Nick: Very good that is funny. Did you make that up?
MIMIC: Yes No Maybe Probably.
Nick: Mimic, will you ask me a question?
MIMIC: What else do you like?

His favorite joke was the knock-knock-banana joke, though it was never certain how long it would take him to get to “Orange you glad I didn’t say banana?”

Mimic worked by creating a pattern based on a tokenized version of a limited number of the most recent things said in the conversation.

When you say something to him, Mimic figures out what to say by finding the closest match from the database for the pattern consisting of what you said, what he said, and a small bit of context. A typical pattern might look like:

how you qq|doing great|what up qq|Well not much, just talking to you.

If this were the pattern matched, Mimic would return “Well not much, just talking to you.”

Roughly the idea behind mimic is adapted from a concept called Associative Pattern Retrieval by Robert A. Levinson at the University of California, Santa Cruz.

The original version of Mimic used a flat file database that had to be read each time the user made an utterance.  It was an absolutely abominably inefficient implementation. Other weaknesses of the algorithm were a lack of pruning, lack of pattern promotion/demotion, a need for better pattern-making, and a need to use a real database (not just a crazy inefficient flat file).

Having great affection for Mimic (and even now, 15 years later receiving occasional requests to bring Mimic back on line), I’ve long wanted to reprogram Mimic from the ground up.  I’ve recently started looking at what would be required to do this.

Mimic Flowchart


There are a few pretty big open questions:

  • The old patterns consisted of what is currently said, and what was said previously.  If we want our patterns to be more general, how do we construct those patterns?
  • When we construct patterns, we are inadvertently providing back-channel knowledge. How do we allow the algorithm to discover its own relationships in the data?
  • A conversation isn’t like a chess game with a winner and loser.  How do we determine rate successful and unsuccessful patterns for purposes of promotion and demotion?

Part of the beauty of the original Mimic was that the algorithm didn’t attempt to address all these big questions.  It just jumped in and went for it.

Putting aside the biggest of the big questions, and just addressing some of the most glaring of the modest list of needed improvements could result in a serviceable version of Mimic in pretty short order.

Leave a Reply

Your email address will not be published. Required fields are marked *