Monday, February 11, 2008

ELIZA, or The Doctor that Started It All

One of the most successful (and misunderstood) products of MIT's AI laboratory, ELIZA is the precursor of modern chatterbots and virtual assistants. Its performance is surprising, especially considering the simplicity of its architecture – a stimulus-response circuit that recognizes keywords in user entries, and either returns pre-defined responses, or uses "assembly rules" to throw its input back at the user as a question. Despite this apparent precariousness, the fact that an alternative model has yet to match its performance is a powerful evidence that its creator, Weizenbaum, was on the right track – even though he himself was the first to disagree.

One side effect of ELIZA's simplicity was the emergence of many alternative implementations over the years. Even Java versions can be found today, some of which allegedly based on a previous version written in BASIC. And what a surprise was it to find, among the source for one of those modern versions, the original BASIC listing of a 1981 implementation!

For those who like history, the package is almost a programming Rosetta Stone. Those who know BASIC from the bad old days will get to check how programs used to be more concise (the listing has only one file, and about half of the total size of the Java version), but not any more readable. Highlights for the DATA instruction, which went to posterity as one of the most barbaric solutions (in this case, for array initialization) of all time.