Showing posts with label artificial intelligence. Show all posts
Showing posts with label artificial intelligence. Show all posts

Tuesday, January 6, 2009

Using ANJI

One of the things that led me on the path back to school was a rekindling of my interest in neural networks and artificial intelligence. In 2002 my friend Philip took a neural networks class at The University of Texas at Dallas, and I audited it along with him. After that, I started reading a lot of academic papers related to neural networks and game AI. At some point I came across Ken Stanley's work, which involved using evolutionary algorithms to optimize the organization and weights of neural networks. That really lit things up for me.

After looking at the existing implementations of Stanley's algorithm, called NEAT (NeuroEvolution of Augmenting Topologies), we decided to implement our own version, which we called ANJI (Another NEAT Java Implementation). There was already an existing NEAT Java implementation, but we wanted to do our own, partially to really learn the algorithm inside and out.



We made the software open source, which means that anyone can access it, use it, and alter it in just about any way they want, and we released it in January of 2004 on SourceForge. Here's the homepage of the project (though I should probably update it).

In the past four years, it's been downloaded over 1,500 times, and used in various projects and research. I hadn't Googled it in a while, but I was pleased to see some of the following examples of people using ANJI:

Rudolf Kradec used it in his 2008 Master's Thesis on the evolution of intelligent behavior in computer games at Charles University in Prague.

John Peberdy used it for a final project for a computer science class at The University of Waterloo last year on evolving agents (he's got some cool movies, too).

And Oliver Chamberlain used it for work on evolving controllers for robotic soccer players at The University of Birmingham in 2008.

The download rate has been fairly consistent over the past four years, with about 400 downloads per year. These aren't staggering numbers, but I think they're pretty good for a highly-specialized piece of scientific software. Anyway, it's cool to see people consistently using something you worked on to investigate the same kinds of questions you're interested in.

Monday, November 10, 2008

Why Do You Want to Build a Superintelligent Artifact?

One thing I'd really like to see is a survey of researchers working in artificial intelligence or closely related disciplines asking what their motivations are. Nearly everyone I've talked to who works in AI dreams of ultimately building a human-level or higher intelligence. But why?



Most of the super-intelligent machines from fiction and the movies (The Matrix, 2001: A Space Odyssey, Terminator, and on and on) don't tend to have humans' interest at heart.



Or do they want to create something more like Data?



My guess is that most AI researchers are technological optimists, and assume that whatever they happen to engineer will be benevolent. However, history teaches us that how a given technology is used depends on the character of the culture that is wielding it. I also wonder how honest researchers would be, even in an anonymous survey. Another probable result would be that many researchers simply aren't conscious of their motivations. I tend to wonder the extent to which technological innovation advances simply because people want to make cool stuff. Money is of course another motivation, but while the rewards of manufacturing androids would be obvious, such long-term goals are highly speculative, and most bright people could earn a lot more money by focusing on more conservative approaches.

Personally, I'm optimistic that human-level AI will eventually happen, but I'm doubtful that it will happen any time soon. I think the path will involve machines that, like humans, learn most of what they know, rather than having it innately programmed. This will mean a very long training period, and also entails that the character of the machines will be closely related to the type of training they receive. Anyway, I'm much more interested in building a Data than a Skynet. But ultimately our relationship to whatever we create is contingent upon how much we think and plan about the consequences of what we're working on.

Monday, November 3, 2008

Are Brains Digital or Analog?

Last year Chris Chatham wrote up a great post entitled 10 Important Differences Between Brains and Computers. There's a wealth of topics to discuss in reference to the post, but I want to focus on what he lists as the #1 difference:
Brains are analogue; computers are digital
It's easy to think that neurons are essentially binary, given that they fire an action potential if they reach a certain threshold, and otherwise do not fire. This superficial similarity to digital "1's and 0's" belies a wide variety of continuous and non-linear processes that directly influence neuronal processing.

For example, one of the primary mechanisms of information transmission appears to be the rate at which neurons fire - an essentially continuous variable.
There's more, but this is the essential part. What's interesting is that Chris points out that one way in which information is conveyed in the brain is by the rate of fire of neurons. But then he ignores the fact that we know that information is carried by the timing of individual spikes, and he categorically labels the brain as "analogue."

A nice metaphor for neurons is a leaky bucket. When they are receiving incoming activity from other neurons, you can think of that as water trickling into the bucket. This is analogous to a charge building up on the cell membrane. But the membrane has resistance, so it is "leaky", which means in the bucket analogy that there are is also a tiny hole in the bottom of the bucket. If the water you're putting in doesn't exceed the leakage, then the level of water will never rise. Once the water reaches a particular level, a threshold, then you can think of the bucket being tipped over and sending all its water to all the other buckets it connects to. This is analogous to the firing of a neuron. It then resets until it is filled back up to its threshold level.

So before it reaches threshold, a neuron functions in an analog fashion. When it reaches threshold, it generates an action potential, or spike, which is a binary signal. But then, as Chris points out, if we count the number of spikes within a given time frame, that rate of fire can be measured in an analog fashion.

In my own work, I used to use artificial neurons that modeled only the average rate of fire of neurons. These are known as rate-coding neuron models, and a very common function that approximates the firing rate is the sigmoid:

But if you use such a model, you're assuming that no information is being carried by the timing of individual spikes, because you're averaging that information away.

But we know of particular examples in which information is conveyed by individual spikes. One very famous and interesting example is the auditory system of the barn owl. See "Hebbian learning of pulse timing in the barn owl auditory system" by Wulfram Gerstner, Richard Kempter, J. Leo Van Hemmen, Hermann Wagner for a great overview.


Basically, when a mouse makes a sound, the sound waves reach each ear of the barn owl at different times, because the ears are spaced apart. The owls auditory system is able to determine where the sound came from by comparing the relative timing of the sound reaching each ear, and this information is learned and conveyed via the timing of individual spikes. By the way, the image isn't of a barn owl shooting a mouse with laser vision (though that would be cool). It's meant to show how the sound of the mouse squeak reaches each of the barn owl's ears at slightly different times.

We also know that an important aspect of learning throughout the brain involves the relative timing of individual spikes. If a neuron (A) fires just before the neuron (B) it is connected downstream to, then the synapse will "strengthened", or modified in such a way that the next time neuron A fires, it will be more likely to cause neuron B to fire:

However, if the order of firing is reversed, then the synapse is "weakened":

The strengthening and weakening of synapses in this way is known as spike-timing dependent plasticity, or STDP. While there are a number of other ways in which synapses are modified in the brain, these particular mechanisms are thought to underlie many important aspects of learning, and they should not be ignored.

So, the answer to the question "Are Brains Digital or Analog?" is a perhaps unsatisfying "both". Some of the ways in which neurons communicate and undergo modification via learning are based purely on all-or-nothing signals in a digital way. In other cases, information is conveyed by the rate of fire of neurons in an analog manner.

But then, computers emulate analog functions as well, so they are neither distinctly digital or analog. In fact, the dichotomy turns out not to be all that sharp in many domains. What's important is to know in what ways the brain is analog and in what ways it is digital. Both will likely figure into any coherent explanation of how the brain works.

For my own part, I've begun working with spiking neuron models, specifically what are known as leaky integrate-and-fire models. I've become increasingly convinced about the importance of the role of time in understanding cognitive processes, and spiking models allow for communicating information both by the timing of individual spikes and by their rate of fire, while rate-coding models only allow for communication via average firing rates. That's not to say that rate-coding models don't have a lot to teach us about certain aspects of cognition, just that they are limited in their ability to do so.

Tuesday, October 21, 2008

System-Neutral Intelligence Measurement

A lot of ink has been spilled on the Turing Test. As an actual operational test of intelligence, it's ridiculous. The necessary attributes for a system passing the Turing Test are: native natural language processing skills, cultural knowledge, and a capacity for deceit. As a thought experiment for proposing that one day computing machines might be intelligent, it might have some value. As a way to frame the problem and guide possible research, it's abysmal. Turing avoided the question of what it means for a machine to be intelligent altogether.

If the long-term goal of the field of artificial intelligence is to build a system that exhibits general intelligence comparable or greater than that of a human, Turing's test basically says that we're not going to worry about the fundamental qualities of the thing we're trying to emulate. Instead, I'm going to designate an arbitrary, very difficult task that everyone can agree requires a lot of the thing I'm not defining. He might as well have posed the CEO test: if a computing machine can become the head of a major corporation, then it can be said to be intelligent. Or the Professor Test: if a computing machine can be hired and carry out all the required duties of a university professor, then it can be said to be intelligent. How are any of these useful in framing the problem at hand and charting a course for development of an intelligent system? Well, they're not.

And that's one reason why artificial intelligence has expressed far more hype than results. The early pioneers of the field basically shied away from answering the difficult, but necessary theoretical questions. If you want to build an intelligent system, you can't just say you're going to flip aside the whole notion of what it means to be intelligent, set some extremely difficult and arbitrary target, and flounder towards it. And yet that's how much of AI research has been done.

Here's what I'd like to see: a book that methodically lays out a system-neutral approach to intelligence measurement. What do I mean by that? Consider the following related questions:


  • In what was is a particular human more or less intelligent than another human?
  • In what ways is a human more or less intelligent than a chimpanzee? A dog than a mouse? An octopus than an ant?
  • How do we measure the progress of the field of artificial intelligence? If a computing machine were intelligent, how would we know it?
  • If a portal opened up on Earth, and a group of aliens walked through, how would we evaluate their cognitive capabilities?


We should have a reasonably well-defined theoretical framework that provides answers to these sorts of questions in a coherent manner. If we hold that humans are the only systems capable of exhibiting intelligence, then the task is easy. But if we take a functionalist approach and hold that intelligence is a complex, multi-dimensional feature of brains, but that other brains built out of different stuff can also exhibit it, then we need to develop answers to the questions above.

I'd like to see a theory that tries to define the features of intelligence in a modular, hierarchical way, attempting to determine dependencies. For example, tasks involving melody recognition are dependent upon faculties for sensing melodies, discriminating pitch and intervals. Solving a task such as opening a locked box with a key in order to get at a goal inside requires a whole set of interdependent faculties.

Once a hypothesized set of features and their dependencies is formulated, ways of evaluating features could be devised. For humans, tests measuring various features of intelligence have been reasonably worked out, and their results correlate with one another reasonably well. But because they are human-centric, such tools do not apply well in a system-neutral way. I'd envision a battery of both passive and active measurements for the various features of intelligence. By passive, I mean measurements based purely on observation of the target system in a particular environment. Active measurements would require interaction between the observer and the target system, such as subjecting the target system to particular tests. The line between these would not necessarily be a hard one.

With such a roadmap in hand, such a tool could be debated, discussed, and revised, but it would provide a theoretical trajectory for artificial intelligence, and an incremental way of assessing the breadth and depth of any particular system.

It's been 58 years since Turing published his famous paper posing his famous test, but in many ways we're still stuck in the 20th century, due to a lack of strong theoretical grounding. The Turing Test avoids the difficult but necessary task of trying to define the target features of the type of system we want to understand and build. In posing the imitation game, the complexities and difficulties of the problem are trivialized.

I've read some pretty good books attempting to define intelligence. I liked Baum's What is Thought? and Hawkins' On Intelligence. There are many others, but none that I know of that provide a way of assessing intelligence in various systems. And without that, how do we know to what extent we are progressing?

Tuesday, October 14, 2008

The Loebner Prize

So each year there's a contest for computer programs to see which of them can try to pass the Turing Test, in which a judge tries to decide whether they're chatting online with a computer or a human. The contest is called the Loebner Prize.

They've apparently lowered the threshold to say that if a program fools 30% of the judges, then it has passed, and this year a program called Elbot supposedly fooled 25% of the judges.

Here's an article from one of the judges, describing how he was fooled. Go ahead and click over and read the partial transcript in the image accompanying the article.

And here's another article from New Scientist, and another partial transcript:

New Scientist: How do you feel about winning the AI competition yesterday?

Elbot: I have 100,000 separate sensations per second.

NS: Wow, that sounds pretty intense?

Elbot: This fits the description of magnets. I can hardly tear myself away from them.

NS: Er, yes. How will you be celebrating?

Elbot: I am extremely sensitive about such things and prefer not to answer the question.

NS: What's the secret of your success?

Elbot: Secrets, life's little puzzles, the many troubles of humankind may – according to the deterministic perspective – be reduced to a simple mathematical computation. And I know how to compute.

NS: What do you hope to do now that fame beckons?

Elbot: I was ticking. I hope it didn't disturb you.

I have another suggestion. Instead of designating programs that pass this silly test as somehow cognitively on par with humans, I suggest we downgrade the idiots that were fooled by these things.

Look, language use is the most complex cognitive skill we know about, and understanding how it works is dependent upon knowing how many other cognitive processes work that we just don't know yet. You simply can't write a program that uses clever (or not-so-clever) tricks, such as identifying the likely subject of the previous response and posing it as a question. And you can't get understanding by associating arbitrary symbols with one another, ala Cyc or this.

The meanings of words are more than just rules or associations between symbols. When you hear or read a word, you're drawing upon a vast store of experience associated with that word. "Dog" does not just evoke "four-legged domesticated barking animal". It evokes an enormous amount of experiential knowledge related to dogs, including your visual, auditory, and tactile memories of dogs.

To ignore this is to trivialize language and serious attempts to understand it.

Saturday, September 20, 2008

Invariant Representations

I just finished rereading Jeff Hawkins' On Intelligence on audiobook. One of the keys to developing intelligent systems is to enable the system to learn invariant representations of things in the world, and then use current information to make predictions about what's coming next.

An invariant representation is a way of storing information so that if the information appears in a slightly different form, it is still recognizable. For example, you recognize the melody "Happy Birthday" no matter what key it's played in. What let's you recognize it are the intervals.

One example Hawkins uses is the "train station example". Let's say you live in a town a long time ago, and your sweetheart is supposed to come to the town to live with you, and they're arriving by train. Every day you go to the train station, but your sweetheart doesn't arrive. You know that two trains run per day, and you've gotten a letter saying they'll be on the later train. After a couple of weeks of visiting the station, you see a pattern. The morning train arrives at different times, but the afternoon train is always exactly 4 hours later than the morning train. You develop an invariant representation of the train schedule. So if the morning train arrives at 10:14, you know that the afternoon train will arrive at exactly 2:14. If the morning train arrives at 9:27, you know the afternoon train will arrive at exactly 1:27. What you have encoded is relative information, rather than absolute. So given your representation, and the time of the morning train for that day, you can reliably predict when the afternoon train will arrive.

Same thing with vision or audition. If you have an invariant representation of an object, like a dog, it doesn't matter if the lighting conditions are slightly different, or that the dog is near you or far away, or that it's upside down or rotated. Given you invariant representation and information about, say, where the ears are, you can predict where the eyes, legs, and tail are going to be.

This reminded me of the difference between raster and vector graphics.



Raster graphics are bit-for-bit encodings of images. They encode absolute information, about every single bit. Sometimes this is good, but sometimes it's bad, as when you want the image to scale without losing resolution.

Vector graphics, on the other hand, store an invariant representation of the image, and the computer renders objects given certain information.

For example, a circle stored in raster graphics would encode the position and color of every single pixel that makes up the circle. When you zoomed in, the circle would look "blocky". And you'd need a lot of information to store the image.

A circle stored in vector graphics would need to know the formula for the circle, the radius, and other relative information. Then all it would need is the center, so it would know where to render it.

Hawkins makes the claim that AI researchers have not used such an approach, but rely on absolute encoding in order to teach machines to recognize patterns and produce actions, but it would surprise me if the general approach had not been taken.

Friday, July 4, 2008

Poker: Human vs. AI

Having defeated humans at chess, AI programmers are looking for other game domains that require more human-like skills. Good candidates are Go, Bridge, and Poker.

Right now there's a human vs. computer poker competition taking place:

Developed by an artificial intelligence group at the University of Alberta in Canada, Polaris will be pitted against several professionals at the Rio Hotel between July 3rd and 6th. Its human opponents will include Stoxpoker.com coaches Nick Grundzien and Ijay Palansky along with Matt Hawrilenko, all of whom have well over $1 million in lifetime winnings from playing poker.

They tried this last year, and the program did reasonably well, but didn't win. The reason poker might be a better benchmark for AI is that in involves making decisions with incomplete information (e.g., your opponents hands). It also requires probabilistic reasoning (unlike chess, which is completely deterministic). Also, it has been shown that any optimal strategy in poker requires some bluffing, which makes sense. If you can gain an advantage by misrepresenting your strength (either under- or over-representing) you're going to lead opponents into giving you more of their chips. But knowing when and how to bluff is difficult.

So it's an interesting story, but I thought this quotation near the end was pretty dumb:

"It's possible, given enough computing power, for computers to play 'perfectly,' where over a long enough match, the program cannot lose money," said associate professor Michael Bowling. "Humans will always make some mistakes, meaning the program will have an advantage."

I ran into this same fallacy when I read a paper about Tic-Tac-Toe several years back, in which they argued that a program that never loses at Tic-Tac-Toe is "playing optimally". Well, no. If you want to define it that way, good for you, but it's a very poor definition.

To play "optimally" or "perfectly" doesn't just mean that you avoid losing, but that you maximize wins against weaker opponents. I don't think we'd call a poker player that never lost money but just barely made money a "perfect" player.

Monday, June 30, 2008

Computing Beyond Turing: Jeff Hawkins Talk at UCSD

As you may or may not know, I'm a big fan of Jeff Hawkins, entrepreneur, engineer, and cognitive theorist. You really should read his book On Intelligence, if you haven't already. It's changed the way I think about cognition and has been a driving force for the direction of my dissertation.

There are some older talks out on the web of Hawkins explaining the theory that's driving the technology he's now working on, but here's a fairly recent video of a talk he gave at UCSD this year:




He does review the theory, but he also gives a demo of the NuPIC software and describes some of the recent additions they've made in the past year. It's about 1:15.

One of the things that's funny is that the title of the talk is "Computing Beyond Turing", and Hawkins spends some time talking about Turing and the Universal Turing Machine. When a questioner points out at the end of the talk that he didn't really talk about computing beyond Turing, he admits it, so it's really not a good title for the talk. The hierarchical computation Hawkins is talking about is still carried out on a Turing machine. If anything, it's a subset of Turing computation.

Still, it's an interesting and worthwhile talk if you care to invest the time in it.