Chatbot History: The HeX Chatbot and MegaHAL

Last Updated on November 10, 2020 by Sean B

The HeX chatbot was developed by Jason Hutchens in 1996. It was based on ELIZA, which was a computer program capable of processing natural language and was active from 1964 to 1966. It worked by using “pattern matching” technology and was able to generate natural speech.

Hutchens took part in the 1996 Loebner Prize with HeX and won. He was awarded a cash prize of $2,000 for scoring the highest in terms of the overall score. Jason then changed the name of Hex to MegaHAL in 1998, but it was also based on the same principle, and the two names can be used interchangeably.

A tin robot toy.

Mechanism of Operation for The HeX Chatbot

The basic working of HeX depends on Shampage. In this model, the input sentence is examined for keywords. The keywords are then used to look up a reply from a list of hardwired replies. If the software finds a reply suitable for the entered sentence that has not yet been used in that conversation, it will be served to the user.

In case there is no reply to the user’s sentence in the database, HeX would recheck the sentence and examine it to determine whether or not it is a trick sentence. This is done by looking for the tell-tale signs of trick sentences, like impossible mathematical problems or sentences that do not make any sense at all. If it classifies a sentence as a trick, it would reply with an equally witty response.

If the program fails to generate a response using this approach, it would call the MegaHAL module. This module would generate a reply and then that reply would be matched with the input sentence. We’ll go deeper into the workings of this module later.

If the generated reply fulfills the criteria set by the developer, such as containing at least two keywords, it will be presented to the user. If even the MegaHAL module fails to produce a satisfactory response for the input, the HeX chatbot would rephrase the sentence and give it back to the user, emphasizing that their input was as an illogical combination of words. It is the same technique that ELIZA used to flip sentences beyond its comprehension.

After giving a reply to such a problematic subject, the program would subtly change the topic to one of those it has hardwired replies for. If the user does not reply to the newly introduced topic, the bot would automatically come up with a humorous reply in the answer of their silence. In case all of these methods fail, the program will tell the user that they are not grammatically correct or are not making sense.

On the odd chance of all of the above options failing, the MegaHAL module will be called in for the second time, and any gibberish produce by it would be presented as a reply to the user trying to outwit the bot.

The problem with the HeX chatbot, when seen as a chatbot outside of the Loebner Prize scenario, was that it focused too much on the Loebner Prize. As the 1996 Loebner Prize, the one in which Jason contested, was held in Australia, HeX tended to generate responses centered around Sydney and referred to the user as a judge. However, it won the prize by being relevant enough to the topic in question, but don’t expect the level of conversation from the HeX chatbot, as is seen in many other winners of the prize.

A friendly robot

The Evolution of HeX Into MegaHAL

Jason entered the 1998 Loebner Prize again, this time with MegaHAL. Like any other chatbot, the intention of this bot was the same. It was designed to look as near to a human in natural language conversation as possible. In the contest, however, it was determined that the bot sometimes responded to the entered sentence in the form of a very well-made answer, but at times, it failed to understand the input and came up with absolute gibberish.

MegaHAL is equipped with a machine learning algorithm. It can learn from the ongoing conversation and remembers the new words and sentence structures it comes across. It is even capable of learning how to substitute new words and phrases for old ones. Judging with the current standards, MegaHAL was a primitive form of artificial intelligence. The most important thing to note is that MegaHAL can neither comprehend the conversation nor the sentence structure. It just comes up with responses based on mathematical and sequential relationships.

MegaHAL does use outdated technology, but it is known for its humorous response to various inputs. It comes up with completely random responses sometimes, and they are amusing for the users. You can see a sample of MegaHAL’s conversation here.

Example chat with the MegaHAL version of the HeX chatbot.

Mechanism of Operation for the MegaHAL Chatbot

The MegaHAL chatbot is somewhat based on the famous Hidden Markov Model, and the first thing it does in its learning phase is that it makes text fragments spanning over 4 to 6 words from the provided text or script. For example, if MegaHAL is trained on the Declaration of Independence, it would generate a database consisting of text fragments like “When in the course”, “in the course of”, “the course of human”, “course of human events”, “of human events, one”, “human events, one people”, and more.

After this learning phase, if a user asks about anything related to the text it has learned, the bot would match the user’s query with the response from its database. After scanning the text fragments, a matched response would be adapted and presented to the user.

In Summary

Looking into the details of the HeX chatbot and its successor MegaHAL, it can be seen that winning a Loebner Prize is one thing and being a natural language conversation chatbot is another. HeX did use an advanced algorithm and was adequately capable by 1996 standards, but it did have its own limitations. However, we cannot forget that all these “not-so-capable” chatbots are the reason we today have chatbots that are actually witty enough to trick humans into believing that they are talking to an actual human and not a bunch of lines of code.

Website | + posts
Share this:

2 thoughts on “Chatbot History: The HeX Chatbot and MegaHAL”

  1. I always enjoy your articles, because they are about a subject I know nothing about. But at times you confuse me. 🙂

    Is the hexbot a toy? I suppose not, but because of the picture of that toy robot I was wondering.

    If I understand all the articles I have read so far, chatbots consist only of 0 and 1 A.K.A. computer language? So I can imagine it’s difficult to find good illustrations with that. And it’s probably my own ignorance that I get confused.

    Never mind, I am learning from your articles, as you know, so in time I won’t ask silly questions anymore. At least, I hope so, ROFLOL.

    • Hannie,

      Some of the chatbots I cover in the history section aren’t around anymore, so finding images of them is impossible. So I try and find something to represent the chatbot the best I can. Since HeX was a witty and sometimes sarcastic chatbot, I figured the toy was fitting. In any case, I’m glad you find the articles interesting and thank you for the comments!



Leave a Comment