Focus On: Elmer the Naive AI

by Stephen Fluin 2009.03.14

I want to introduce you to Elmer. He is a small Artificial Intelligence I created. He is able to respond well to small amounts of phrases, but as more users interact with him, he builds up his phrase index further.

I understand this is a very naive implementation of artificial intelligence, but at the same time it has roots related to the way humans learn. Human infants and children begin by making simple connections such as happy=giggle, happy=smile, Face of Mother = Mom, Face of Father = Dad, Urgency = now. These relationships are much more complex, and have a lot of attributes and context that Elmer doesn't have, but the concept is similar for learning to interact with human society.

The basic logic loop is as follows:

  1. Wait for user input
  2. Have I seen this input before?
    • If yes, provide response random response previously provided by user.
    • If no, ask the user the question, and store their response with the input.
  3. Even if he has seen a phrase before, there is also a built in chance to answer the question, and ask the user the same question. This was built so that he could build up multiple responses to questions and statements.

If his phrase database ever becomes too large, I may have problems because the total number of language phrases is infinite, but I will cross that bridge if I ever come to it.

Future Development Ideas

The key thing that will make Elmer more "intelligent" would be for a large number of users to interact with him and build up his database, but there are additional changes I could make that would accelerate this process and improve the quality of his responses.

  1. Random question trails - Instead of always asking the same question he was asked, he could ask a random question that either he doesn't know the answer to, or would like another answer for.
  2. Phrase context - Remember the past few phrases to build up trains of phrases to implement conversations
  3. Bayesian associations - Instead of recognizing entire phrases, tie individual words in a question or statement to responses. This would enable Elmer to have a chance of correctly answering a question or statement, even if the user users words or syntax he hasn't seen before.
  4. Language detection - Have users provide the language they would like to use so that Elmer can learn multiple languages independently.

permalink