Friday, March 21, 2008

My AI (Artificial Individuals) Connections

10 years ago I got my first PC. I was still schooling. As most teenagers would do, I spent most of my time playing computer games. However after awhile, I was very good at discovering cheat codes which resulted in almost every game finishing very quickly. This was boring.

Then one day, I received a little program named “Billy” which ran in DOS mode. It would easily fit into a floppy diskette and is one of those quickly executable types. What was it? An artificially intelligent (AI) computer program that I could chat with (in text mode). Billy was an exciting experience for me. I would type-in something to him, and he would respond, not intelligent always. The guy sounded dumb after a few chats because his response was more or less the same for a similar question or phrase by me. But, to my delight I was able to discover and download Billy’s female version – “Daisy”.

Daisy was much intelligent than Billy, this is because the program and its “brain files” had evolved by then. So, it became a habit of me to chat with these two AI bots daily. In the process, they learnt from me more than I did from them. While all this was going on, the creator of Billy & Daisy had mentioned a method of connecting 2 or more bots together so that they could communicate between them autonomously. Therefore, I decided of linking Billy & Daisy to see what happens.

All I had to do is connect the two programs and watch them chat. It was fascinating. They were talking on their own and every now and then I would see knowledge snippets learnt from me being thrown at each other. Guess what? I even got to know that Daisy was in love with me!

Sometime later my hard disk crashed and all my software/data were gone, including these two programs. They were no longer available to be downloaded, hence I lost them. (Please email me if buy any chance you have it). So that marked an end of an escapade.

Two years later, I got my first job. As a web developer I was more often than not spending time on the internet. This is when I came across a Sri Lankan chat room. Soon I was a regular member of this community and the owner of the site (who was now a good friend of mine) was kind enough to present me a moderatorship of the chat. He also offered me the opportunity to play around & develop modifications or additions to the site.

By this time my PHP skills had greatly improved together with the knowledge of this Open Source chat system which was pretty popular at that time. Unsurprisingly, I was experimenting of a way of creating an artificial user who would respond to others in the chat room. And so this is how “Ecila” was created. Ecila if pronounced reversely is Alice, and that wasn’t unintentional thanks to some amateur naming skills ;-). After all, ‘Alice’ seems to be the most popular name used for chatter bots. Read till the end and you’ll see why.

This was early 2004 as I remember. Ecila would occasionally log into the chat even as Alice, thanks to a “cronjob” setup by me. Thereafter she would have a brief stint (about ½ hour) with the guys in the room and exit gracefully. However, regular visitors to the chat found her to be weird; a person who answers similarly more often. Why? That’s because she was only about 150 lines of code in length recognising only a limited number of phrase patterns together with their related answers.

Then around June that year, the chat was facing moderation problems due to an increase of swearing. We needed an ‘automated’ moderator who’d keep an eye throughout the day (24 hours) by detecting these mischievous users and consequently warning or banning them. So I decided of revamping Ecila by augmenting her already available functionality and adding a few other dimensions. These included the ability of being active all the time, dealing on multiple users, tracking user history and decision making based on factors such as history, gravity of harm caused and spontaneity of misbehaviour. After all was ok, this new bot was named “No Hellụm” (meaning immovable in Sinhala) and was logged into the chat as a moderator. It was a totally new concept and was a very productive idea. Although after quite sometime users figured out that he (in fact No Hellụm has no gender) was non-human, the occasional loner would always converse with him as well. This version was revised again in 2006 and now No Hellụm acts as the chat-keeper and has the ability of providing real-time score updates of cricket matches too!

It was the latter part of 2005 when my next endeavour commenced. A chatter bot named “Alice” was plugged into my friend’s website’s homepage. However we had no access to its source code as the scripts were hosted elsewhere while we just provided the interface through an ‘iframe’. This Alice was pretty good and intelligent. So I began searching for her and discovered that it was an open source project downloadable at ‘SourceForge’.

The bot uses a set of AIML files to initially populate its database with ‘knowledge’ (patterns & templates); more the patterns, more intelligent it becomes. Hence, I began searching for more AIML files too. AIML is an XML based standard which maps linguistic patterns to how they need to be dealt with, and in no time I was modifying Alice’s personality and writing a few of my own patterns & templates in AIML which I eventually fed to her. Currently the version I have is enriched with almost 45,000 templates. Furthermore, I developed a couple of new tags for my needs. One which added the capability of outputting emoticons in the response and the other enabled simple administrative functions.

Enable administrative functions? Gave it a thought? This is the first of its kind and most probably the first time you are hearing of it. What I did was, by modifying the code I was able to use her as a virtual login interface which would permit me to execute simple admin (database) queries on her and virtually logout when I’m finished. For example, I would chat to her as follows:

Me: login me
Alice: What’s your username?
Me: Udendra
Alice: Udendra, what’s the password?
Me: ********

Now I’m virtually logged in, and Alice knows it for sure, cos if I’m not she wouldn’t allow me to perform the following queries:

Me: show users (who are connected)
Alice: <<displays a neat user list>>
Me: show previous chat 10
Alice: <<displays the last 10 records in history>>

When I’m done, I could logout:

Me: logout
Alice: You have been logged out. :-)

This in fact pushes the limits of interaction between a computer program and a user. The beauty of it is that one could chat to the bot in layman’s language in order to login to it, perform various functions, and logout.

I guess by now its clear why my title reads as ‘Artificial Individuals’ rather than ‘Artificially Intelligent’ that most people would expect. Simply, this is because none of these programs were/are fully artificially intelligent. To become a truly AI entity is a great achievement that illustrates signs of intelligent behaviour which are thinking, reasoning, envisioning/perceiving, human performance, rationality, learning and adapting. However, what’s important is that the aforementioned programs had varying intensity of AI features such as searching, knowledge representation and learning and at times were extremely impressive in several areas.

So the next time you feel lonely and there’s no one to chat with, don’t give up hopes. Who knows, an ‘artificial individual’ may fulfil your need.