All posts by Code Curmudgeon

I've been working in Software Development at Parasoft since 1992 - which in my opinion is before the epoch (my measure being the first real use of the web). I've been involved deeply in creating software, creating software tools, and helping customers address their software problems including automotive, cybersecurity and embedded. The views and opinions expressed herein are those of the author and do not necessarily reflect the views of anyone else on the planet. Caveat lector. You can follow me on twitter @CodeCurmudgeon, Google+, Static Analysis for Fun and Profit, Facebook, and LinkedIn.

AI Smackdown – Siri vs Eliza

John McCarthy © by eschipul
John McCarthy, creator of LISP, and father of modern artificial intelligence (AI) died today. He was one of the first guys to work seriously on getting computers to do things that you wouldn’t normally have expected computers to do, like play Chess or have a conversation.

One of the most common AI applications programmers have played with over the years is Eliza. Like others at the time, one of my first attempts at writing an interesting piece of software in my youth was to alter an Eliza program written in BASIC (as taken from the pages of Creative Computing, for all you old-timers). Eliza is a simple software psychoanalyst created in the 60’s by Joseph Weizenbaum. While Eliza wasn’t written by McCarthy, she was certainly a product of his inspiration on the industry.

Ever since the new iPhone came out with Siri, the digital assistant, I’ve been thinking about comparing her to Eliza. I don’t often get to play with AI here at Parasoft and the death of McCarthy brought the topic to my mind again. I’ve put together a small comparison of questions and answers from Siri and Eliza. Note that with Siri, your mileage may vary, she doesn’t always answer the same way. I’ve obviously skipped most of the “useful” things that Siri can do, as it would be an unfair comparison for poor old Eliza, who doesn’t have all the modern advantages that Siri does.

It’s interesting because while they share a common logical bond, their personalities are very different. Siri was designed to be helpful and amusing. Eliza was specifically designed not to be helpful, in that she’s supposed to be a therapist and lead you to your own conclusions rather than give you answers. Eliza isn’t an assistant, she’s an attempt to play the “imitation game” also known as the turing test.

For the samples below I used a java version of Eliza that you can try for yourself on the web.

Samples:
Q: Can you help me?
E: You believe I can help you don’t you ?
S: You can say thinks like… (A list of sample queries)

Q: What are you doing?
E: Why do you ask ?
S: Just thinking

Q: Who is your favorite composer?
E: Why are you concerned over my favorite composer?
S: I guess I don’t have one.

Q: Are you married?
E: Why are you interested in whether I am married or not ?
S: We were talking about you, not me.

Q: What is your name?
E: I am not interested in names.
S: My name? It’s Siri.

Q: You are beautiful
E: What makes you think I am beautiful?
S: Oh, Stop.

Q: I love you
E: Perhaps in your fantasies we love each other.
S: Oh, Stop.

Q: How are you?
E: Does that question interest you?
S: I am well ____ (name)

Q: What do you think?
E: What is it you really wanted to know?
S:It’s nice of you to ask, but it doesn’t really matter what I think
or I think differently.

Q: Good night
E: I’m not sure I understand you fully.
S: Ah… it’s still only _____ (fill in the time)
or other answers depending on the time of day.

Q: Can you send a message to my brother?
E: Tell me more about your family.
S: I don’t know who your brother is, To whom shall I send it, I need a contact name, phone number, or email address.
orWhat do you want to say to ____ (your brother)?

I’m not sure about all of the reasons they’re so different. Sure, the state of the art in AI has come a long way since the 60’s. Or is it just that men’s expectations of women have changed? I was tempted to write that perhaps people are more friendly or helpful now than in the 60’s but that’s ridiculous. Perhaps it’s only that computers are now more helpful and friendly than they were. Is it possible that Eliza’s seeming bad mood had something to do with her obvious handicaps in memory and CPU. Maybe she was aware of this, and it caused her to be ill-tempered? In any case, Eliza comes across as a bit cynical, while Siri is much more light-hearted most of the time. Siri’s mood can definitely change as you can see from some of the answers.

It occurs to me that it would be funny to get Siri to talk to Eliza – would Eliza help Siri, or would Siri end up making Eliza more friendly?

So if your computer was nice to you today, thank John McCarthy.

[Update I added a few more links and minor clarification as well as AI resources]

Here’s a list of my favorite fiction books about killer AI.

Some resources on AI artificial intelligence:

Artificial Intelligence: The Basics

Artificial Intelligence for Humans, Volume 1: Fundamental Algorithms

Artificial Intelligence in the 21st Century (Computer Science)

The Artificial Intelligence Revolution: Will Artificial Intelligence Serve Us Or Replace Us?

Books on AI at Amazon

Your Two Cents About What Went Wrong With Static Analysis

I’ve gotten a lot of interesting feedback on the What Went Wrong with Static Analysis? post. So many people had their ideas about what was working, what wasn’t, and how to address it, that I thought I’d give people a chance to give their two cents.

I’ve created a poll which some basic issues as listed in the post and in various comments on it. Feel free to vote – there is a place if you have something not already on the list. After it’s been up for a bit I’ll post some results and commentary as is applicable.

Resources

Dennis Ritchie… Father of C, UNIX, and Much, Much More

I just posted a brief note about Dennis Ritchie at the Parasoft Blog. You can read about this amazing man who helped create C and Unix. Our thanks to him.

Reprinted below:


Dennis Ritchie - The creator of Unix and C
Dennis Ritchie – The creator of Unix and C

Dennis Ritchie, co-creator of the C programming language and UNIX operating system, died this week (2011). Back in the early days of Parasoft, we used to refer to “C” as “K&R C” (for “Kernighan and Ritchie C”). In fact, like lots of other long-time C programmers, many Parasoft veterans still have the classic C Programming Language book sitting on their bookshelves today.

Although he’s hardly a household name, Ritchie has had a tremendous influence on the software development community. Where might we be today if we didn’t have the luxury of building on his foundations?
On the language side, consider all the languages that were derived from C. Without C, there’s no C++…without which there’s no Java, no C#, and no Objective C. An enourmous amount of the software that we use everyday was built on those languages.

And on the OS side, think of all the things that stemmed from UNIX. Without UNIX, there’s no Linux. No Mac OS X. No Solaris. And without Linux, where would the open source community be? Would we have Android? What would the mobile device market look like? The server market?

In many ways, his vision was eerily similar to that of Steve Jobs: have it do what you really need it to do… and no more. It’s the epitome of elegant engineering.

If you compare C to Java, one of the defining differences is that Java is a very rich language. It has a built-in library that will cover pretty much anything you can think of. C has none of this—but it’s fantastically fast. It takes a lot less code to do something in C than it does in Java, VB, C# and the like. That’s really why C is still so popular. It’s a great balance between being close to the computer (and thus efficient) and being human understandable. The newer languages are more human understandable, but the trade off is that they’re rather inefficient compared to C.

The UNIX kernel is the same way. Amazingly, Thompson and Ritchie’s UNIX kernel was only 64K—smaller than the current Linux keyboard driver! UNIX truly respects the concept of having layers in an operating system. At the core, there’s just a kernel that runs the computer. Services lay on top of that. Networking is separate. Hard drives are an add-on (not core to the OS). And the GUI is a very high-level layer. This separation enables extreme efficiency. For example, while moving Windows to a new chip tends to open a can of worms, it’s actually quite simple with UNIX.

A few remarkable quips from Ritchie:

“I am not now, nor have I ever been, a member of the demigodic party.”

“UNIX is very simple, it just needs a genius to understand its simplicity.”

“C is quirky, flawed, and an enormous success.”

As Jon “Maddog” Hall, executive director of Linux International, tweeted: “…all programmers owe him a moment of silence.”

For a nice tribute to Ritchie, see the special Dr. Dobb’s newsletter.

Lies, Damn Lies, and Hardware Specs

Twitter Statistics © by ©aius
With the plethora of new mobile devices constantly coming out, consumers are bombarded with geek-speak on which ones are best. From the geeks perspective it’s all about the hardware specs. And geeks buy new things all the time just to keep up with the latest.

For everyone else, you buy something to fill some need or desire. If it does it the way you want, then good. If not, don’t buy, get rid of it, upgrade it, etc.

The funny thing about the geek method is that they mistakenly think they’re getting the best thing, because the numbers are there, and as we all know, numbers don’t lie! And there’s the rub – hardware specs are not an indication of system performance.

Luckily for much of the public they don’t fall for such nonsense. It’s like saying that one car is faster than the other simply based on how many cubic inches or centimeters the engine has. Such a number will tell you that one engine is bigger than the other, nothing else. What it doesn’t tell you is which vehicle is faster, which is stronger, which is more responsive, which has better mileage, or anything else useful in and of itself.

Add to this the fact the the market for computing devices has changed. It used to be common for people to have machines that were simply underpowered for their daily needs. That hasn’t been true for years now, most computers you can buy will do what you want them to today, and for the next couple of years or even longer.

A recent article in Wired says it well:

Processor speed, disk size and RAM matter a lot less in tablets or post-PC devices than they did in the classic PC era, when they were expensive and scarce. Design, good software, slick interactivity and good media availability matter more, because that’s what’s scarce today.”

Or as they put it in Information Week’s iPhone Vs Android: It’s The Sum, Not The Specs:

“Comparing individual specs between smartphones is like opening up the hood of a Ford Mustang and the hood of a BMW M3 and pointing out why one is better than the other based on its innards. The Mustang’s engine displacement alone doesn’t make the Mustang better than the M3, any more than the M3’s suspension alone doesn’t make the M3 better than the Mustang.”

Such comparisons blind one to the important issues about a particular product. Questions like “Will it do what I want?” and “How fast will it do what I want?” are more important than “What is it’s PassMark rating?” Some people DO need a faster device for what they are doing, others do not. Some devices will be fast at some things and slow at others. Knowing how they perform for your needs is what’s important.

This was all very much at play last week and Apple (AAPL) released a new iPhone which not only failed to have a new shape, but didn’t have the latest important specs as declared by the geekocracy.

This is a fine example because it’s real, tangible, and recent. Should you buy an iPhone? Should you upgrade? What’s different about the new one? The breakdown is fairly simple.

First, what the new iPhone 4S doesn’t have (the “disappointing” part)

  • A new number – iPhone 5. Does this really matter to consumers?
  • A new shape – again, so what. Unless the shape is a real problem for you, this is a non-issue.
  • Bigger screen – a minor bummer, would have been nice. But bigger screens also carry a cost in battery life and portability. I’m pretty much at the limit for what can fit comfortably in my pocket. Some would have you believe that bigger=better.
  • NFC – stores don’t have it yet, so I don’t need it yet. It’s an early-adopter thing.
  • LTE – AT&T (ATT) isn’t ready, so I don’t mind, especially since I happen to live and work in what should be a good area for HSPA+. For Verizon users this is a major letdown. For Sprint (S), well hey, WiMax iPhone wasn’t going to happen anyway. In either case, you need either a bigger phone or less stuff inside to accommodate it, not to mention lousy battery life. I’m not interested in LTE until I know I can get an unlimited plan for it, otherwise I’ll stick with what I have.

What the iPhone 4S does have:

  • Radically better camera, especially for low-light. If you were going to buy a new point-and-shoot camera, this might do the job.
  • Dual-core – not sure if any apps will actually be faster – maybe not necessary depending on what you do with your phone. This does included a better GPU – great for certain things, maybe not noticeable for others. If your phone is slow, this is a good upgrade. If your phone doesn’t seem slow, then don’t worry about it.
  • Faster network for some AT&T users – This isn’t 4G, it’s HSPA+ and it’s hard to say yet who this will affect. Obviously if you’re not on AT&T this is a worthless feature. If you’re in an area that gives you faster service, this might be a good thing. Again, it depends on whether you’re experiencing slower than desired network performance, like web pages loading slowly.
  • Cloud-syncing – if you have a lot of iTunes content like movies, music, etc. this is nifty. If not, it’s another non-feature.
  • Voice assistant – this appears to be interesting in the videos they show but it’s still considered a beta feature. Great fun for geeks, probably not ready for prime-time yet.
  • More storage space – up to 64 GB. If you’re out of space and you actually need more space this is great. As opposed to being out of space because you don’t delete things you don’t need. This is a classic spec example – some would automatically say it’s a better phone, but the reality is 64GB is going to cost more. If you are happily living with a 16GB phone, why would you upgrade to this? It makes no sense. (disclosure – I’m a space hog – I’m on the edge with my current 32GB phone. But at least I recognize that my personal usage model is abnormal.)

See how easy it is to break things down to real issues? Very few actual hardware specs involved, and no simple assumption that bigger is faster, or that bigger/faster is better.

Luckily the geeks influence is waning over the public at large. A recent article in Beatweek gives a great history and breakdown – give it a read.

A prime example of the waning influence is the ill-fated WebOS. From it’s inception, WebOS was something the geeks loved. I’ve read countless articles about it being better, most without any substance as to why it’s better for me. But it’s new and it smells better – everyone will love it. The rest of the world hated WebOS – and the geeks still love it.

As for me, I’m going to judge things on how they work for me. For those who are only interested in the numbers – good luck with that.

[Update 2011-10-11]
Some people have received their iPhone early and already spec reports are coming in. The funny thing – the A5 CPU on the iPhone 4S appears to be running at 800 MHz, but still outperforms other phones with “faster” processors.

Dropping a CPU’s core voltage, yields a greater-than-linear decrease in power consumption, making the marginal loss in clock speed a good choice.

[/Update]

[Update 2011-10-17]
This one was too funny to pass up. From SlashGear:

Siri was Apple’s middle-finger gesture to the hardware arms-race that epitomizes the Android smartphone market today. Don’t just make a phone that runs 1-percent faster, make one that actually works better with users’ needs.

[/Update]