Passing the Turing Test

I don’t know when I first learned of ELIZA the primitive chatterbot written by Joseph Weizenbaum back in the 60s. I’ve known about her specifically in her manifestation as DOCTOR, the psychoanalyst computer, for as long as I can remember. ELIZA used simple pattern matching to produce responses to typed questions, responses which seemed startlingly human like at times in those early days of Artificial Intelligence research.

Looking back through my reading I suspect I first came across ELIZA either in Carl Sagan’s The Dragons of Eden (1977), chapter 8, “The Future Evolution of the Brain”, or in Arthur C. Clarke’s Report on Planet Three (1972), chapter 12, “The Mind of the Machine”. I’m not sure which I read first, but I’m certain I read The Dragons of Eden shortly after it came out in paperback in April 1978. So, I probably learned of ELIZA a little more than a decade after she was developed. Within another decade, I had my own computer in my home! It was time for me to do some AI work of my own!

I still have that Tandy 1000sx down in the basement. It has trouble booting these days, sadly. But on that machine I conducted an experiment which I think shows that the Turing Test may cut both ways.

In my first year of university (1978-80) I took a Computer Science course. In those days a Computer was a Mainframe. I learned a version of Fortran and APL. I did a little programming. Somehow the Fortran actually stuck with me so when I sat down at my Tandy I was able to quickly puzzle out how to code in BASIC and I wrote the first version of a stupidly simple program I pretentiously called “DIOGENES”. Some time later I rewrote it in Qbasic and last night I dug up that version from an old hard drive and ran it.

It’s still stupidly simple. Maybe just stupid.

The idea I wanted to investigate was what a program would look like if it simply collected everything ever said to it and responded to each input statement by regurgitating a random line of its constantly growing file of old inputs. The program is absurdly simple. There’s the actual program, consisting of twenty-seven short lines of code, and a text file called “mind” which stores all inputs, appending line after line. Each time the user hits RETURN, the program appends the user’s input to “mind” and then picks a random line from “mind” and outputs it. In the old days, DIOGENES very quickly bogged down in slow processing which may have made the thing look like it was actually pausing to think.

What most surprised me about DIOGENES is that one evening when I had friends over I showed the program to them, explaining how it worked. One friend remained in front of the Tandy while the rest of us wandered away in conversation. About forty-five minutes later, Mike pulled himself away from the computer, came into the living room and shouted “That thing is amazing!”

I can’t help but think that DIOGENES hadn’t pass the Turing Test so much as Mike had failed it.

For the record, here’s the code of DIOGENES, my one and only, and perplexingly successful, attempt at creating artificial intelligence.

CLS
PRINT “Please type ‘goodbye’ when you are finished.”
DO
RANDOMIZE 42
OPEN “mind.txt” FOR APPEND AS #1
LINE INPUT ; a$
IF a$ = “goodbye” THEN PRINT ” “
IF a$ = “goodbye” THEN PRINT “see you”
IF a$ = “goodbye” THEN END
PRINT #1, a$
CLOSE #1
PRINT ” “
Numoflines = 0
OPEN “mind.txt” FOR INPUT AS #2
DO UNTIL EOF(2)
Numoflines = Numoflines + 1
LINE INPUT #2, lin$
LOOP
CLOSE #2
OPEN “mind.txt” FOR INPUT AS #3
linenum = INT(RND * Numoflines) + 1
FOR i = 1 TO linenum
LINE INPUT #3, lin$
NEXT i
PRINT lin$
CLOSE
LOOP

If you can find a machine to run it on, have at it!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s