Showing posts with label AI. Show all posts
Showing posts with label AI. Show all posts

Thursday, July 2, 2015

Can AI 'experience' emotion?

Emotions are often portrayed in sci-fi as the last realm of humans, the only aspect of thought unavailable to most machines. Think of Data’s long quest for emotional experience on Star Trek, or the hard questions faced by Decker in Do Androids Dream of Electric Sheep? (Or Blade Runner, if you're more a film person) . For all their apparent unmarred rationality in stories, robots in real life can’t seem to escape from the emotional attachments and influences of humans. From military troops mourning their lost mechanical comrades to apps like Siri that depend on conversational interaction, humans tend to anthropomorphize AI as having the same feelings they do to some extent. But when asked directly if a computer can have feelings, many people would argue no, because of the inherent rationality assumed of mechanical systems. Is it possible? Could AI ever feel emotion?




As humans, we define our emotions categorically - we feel happy, or sad, or angry, or so on.  How is “happy,” as a category containing who knows how many subcategories of semantics - pleased, content, euphoric - defined?  There are a few different ways you could approach a definition - 

Emotion as a pre-determined response - The way I feel after I get something I want is “happy.” 
Emotion as a physical state - Elevated serotonin and endocannabinoids are “happy.”
Emotion as derived from desire - Not needing or wanting to change anything about my current state is “happy.” 

Woman? Salad? Definitely happy.

To most people these definitions probably seem roundabout and strange. Humans have a unique gift of language that allows happiness to encompass all of these things, it’s typical definition boiling down to the abstract “feeling good.” But when exploring the concept of emotion in an artificial system, one without the convenient crutch of human consciousness and understanding, we have to look for more concrete rules. 

By using any of these definitions I’ve listed above, I’d argue that yes, an artificially intelligent system could feel emotion. It’d be easy for an event of lip a switch in an AI’s programming, setting “mood = ‘happy.’” Bit-and-byte facsimiles of the chemical changes in the human brain that correlate with emotional response would be simple to measure and categorize. And for a system that monitors its goals constantly, the third definition of emotion would be quite useful - I’m reminded of THIS STUDY, in which humans with a damaged center of emotion in their brain were rendered incapable of simple decisions like picking a pen to write with, because there was no “rational” distinction between the choices. Emotion could be defined in this way as a wash of small influences in each of our desires and decisions based on current circumstances. AI can have emotions defined in these ways. But, as I’m sure many of you are shouting at your computers right now, that’s not the real question. 

A better question is: Could AI ever experience emotion the same way that humans do? 


This is also a much harder question because we have no reference point. We don’t know what turns a chemical highway into an emotional experience for humans, but we can at least see the same correlation between stimulus in response in dogs, mice, apes, babies, etc. One prime example is the tongue-extended expression that comes with liking a taste - replicated by different species as an instinctive reaction that seems to prove that emotion is not a solely human experience. With AI, there’s no such connection. To assume any would be to anthropomorphize a machine to a dangerous extent. We can program the classification of emotion. We can program the physical qualities of emotion. We can program decisions and goals for an AI that rely on a self-perception of emotion. 

But can we program emotion itself? 
Or is it really necessary to? 

One of the beautiful things that comes from consciousness is the shared experience. We all agree that the sky is blue, the arctic is cold, and the live action Avatar the Last Airbender movie would’ve been terrible, had it ever been created. 

Really dodged a bullet there. 

Through language we are able to connect the personal to the universal in this way. But it’s a flawed system. There’s no way to prove, for example, that the blue I see is the same blue you see. Or that the happy I feel is the same one you do. Each of these things are entirely subjective, impossible to measure, and impossible to share without the shaping force of language. If the true, pure essence of my “happy” was your experience of “sad,” who would ever know? We could only define happiness in a truly universal manner as a measurable response, physical, behavioral, or cognitive, to whatever experiences we had shared. 


So it doesn’t matter whether the emotions an AI experiences are the same as ours, because we’d never know. It would only matter whether these objective, concrete definitions of emotion held true. These are the only things we can measure. Anything further is an argument on consciousness, humanity, and the ineffable, and their definitions, which have been debated for centuries. These concepts too will need concrete restrictions as AI becomes more and more prevalent in our human world. AI means a new era of philosophy in which questions are no longer enough. We can debate the existence of qualia or the Chinese Room experiment all day (and in a later post.) But beyond philosophical misgivings, does it matter if an AI’s blue is the same as yours, if you can both tell me the color of the sky? In such abstract terms, an AI can experience emotion - but only as much as we’re willing to attribute to it.

Questions? Comments? Arguments? Please add below,  I'd love to see what you have to say. 

Tuesday, March 31, 2015

Review: How to Create a Mind by Ray Kurzweil

Hello again! Finally I can get back to business now that the Spring musical is over and most of the teachers have recovered from their post-break assignment panic. I read this book a few weeks ago, over my Spring break. It was an interesting book, though very different from Barrat's pessimistic analysis of the state of AI research.


In How to Create a Mind, Kurzweil focuses on trying to predict AI's next step through a mix of neuroscience, mathematical analysis, and philosophy. I picked this book over some of Kurzweil's more famous works, like The Singularity is Near, because I wanted something a little more technical than I assumed those books would be, and I wasn't disappointed.
But the great things about the book are: a) it's easy to read, and b.) fairly well cited. I've seen lots of criticism online about Kurzweil "dumbing down" the theories he talks about in the book, which range from discussions of Hidden Markov Models and the Pattern Recognition Theory of Mind,  to thought experiments like the Chinese Room. I think these critics miss the point of the book - it's not meant to be a textbook. It's meant for the masses, the people looking to understand more about AI and how it works, and in that respect it works very well.

I do have some doubts about Kurzweil's qualifications as a neuroscientist. (Not that I'm any more qualified.) He spends a good portion of the book talking about his Pattern Recognition Theory of Mind (PRTM), where he theorizes that the neocortex of the brain is made up of multi-neuron "pattern-recognizers" that are arranged hierarchally to allow for the recognition of more and more complex patters. Kurzweil does a LOT of guessing in these chapters, from the number of neurons in each pattern recognizers to how they would be structured in the brain, that he almost stipulates as fact. His explanation of the theory is convincing, at least to someone like me; Plus the inspiration has created several useful AI tools, such as the Hidden Markov Model and Hidden Temporal Model. But I'd have to do more of my own research to say anything substantial about the validity of the theory.
Kurzweil's thoughts on consciousness and the mind, the focus of the second half of the book, match up pretty well with my own, and I enjoyed reading his justifications for them. They make for good argument fodder, and, as I'm sure you know, argue I do. And more than anything else, this second half is a place of argument: Kurzweil goes out of his way to defend his predictions and disprove his detractors and their positions. In some cases it seems almost a little desperate, and one chapter late in the book becomes quite tedious as Kurzweil tries to defend his Singulatarian movement (On which my views haven't changed. See my review of Barrat's Our Final Invention).


But you shouldn't let this criticism stop you from checking out the book. It tends toward overstatement and futuristic optimism, but, so does Kurzweil. The information is well cited, inspiring, interesting, and a great base for further research. I would wholeheartedly recommend the book to anyone interested in AI - So long as they know nothing there, or anywhere else, is the final word.




Wednesday, February 25, 2015

AI and Tic-Tac-Toe -

If you've seen any of my posts in the past, you know about my clearly negligible interest in artificial intelligence. I also mentioned in my review of James Barrat's Our Final Invention that I wanted to take the next step, and bought myself an Artificial Intelligence Textbook at Half Price Books (this one, to be exact, although only the 2nd edition.) I'll be short about it - SO. COOL. I've talked my family's ears off about every chapter so far, which is about a third of the way through. However,  I have one major complaint about the textbook - it doesn't feature any actual programming exercises. It refers to possible problems to solve - games, like chess; mathematics problems and solving theorems; P vs NP problems; but the book doesn't offer any exercises that let you try out the methods for solving them in real time. And for me, that just isn't good enough.

So, I decided to take matters into my own hands, and try out the first problem mentioned by the book: Tic -Tac-Toe.

WARNING: THE FOLLOWING SECTION IS EDUCATIONAL, BUT ALSO REALLY LONG
SKIP TO THE PROGRAM PICTURES IF YOU JUST WANT TO HEAR ABOUT MY SOLUTION

The book uses Tic-Tac-Toe to introduce the concept of a heuristic search. A heuristic is a way of gauging whether or not a potential solution to a problem is a good one. For example, if you were trying to walk downtown in a foreign city, a good heuristic would be to take a path that goes toward the tall buildings. This might not always be a perfect method(some cities are more labyrinthian than others), but it will usually do a good job of finding a solution for your problem. Our thinking is completely tied up in heuristics - they're the rules you make up about how you run your life, whether it's how much money you save each month, or the lucky socks you wear to every test.

In the context of Artificial Intelligence, a heuristic search is one way a program can do its thinking.
Let's look at this in terms of Tic-Tac-Toe
The program looks at a problem as a series of states. These are possible states of a Tic-Tac-Toe problem.

Pretty simple, right? You can perform an action on a state to change it to another state - like making a move on the board. Now a solution to this particular type of problem is a progression of actions and states that ends in the program either getting a three-in-a-row, or tying with the opposite player - a "winning" state.

In order to find a solution, the program takes a state, performs an action on it to create a new state, and checks if it's a winning state. If it is, it returns the action it took. Otherwise, it tries a different action.

The most basic kind of thinking is trial-and-error. You generate a random possible action to solve a problem, and if it doesn't work, discard it and try another. This WILL get you a good solution... eventually. For small problems, this might not be an issue. But for big problems with millions upon billions of possible solutions, there's no way.



This is where the heuristic part comes in. I find it useful to imagine an AI as on a map, starting on a base state, with paths to every other possible state representing every possible action it could take. When the AI tries an action, it moves along the path to the new state, which has paths connecting to all of IT'S possible states, and so forth. And every state has an elevation - the higher up it is, the better is fits a heuristic (with the highest being winning states, of course). Your AI's goal then is to find the action from the state it's at that will get it to a higher state (one that better fits the heuristic).  This means a lot of heuristic search techniques have funny names like Hill Climbing. The program's  ultimate goal is to get to higher (or highest, when possible.) ground.

For example, your Tic-Tac-Toe playing program (assuming computer plays X) might decide that a good state is one that has the most possible, shortest paths to a winning state for X, or, in other words, the most rows, columns, and diagonals with only Xs in them. From a base state, a program with this heuristic will make a move in the middle space as it's action, because the state created is the "highest" state - it gives you 4 possible ways to win. It's the best possible action.

At this point it's important to note, however, that finding a best possible action isn't always possible - for problems where you can take a lot of different actions, it might take too much time. For problems where states can be far away from the winning state, you can get stuck on a 'ridge' or a 'plateau' where you've found the best possible state for your local area, but there's one much better many, many actions away. This is the reason heuristic search algorithms can get so complicated, and why so many different ones exist. AI's greatest achievement and it's greatest challenge is dealing with situations where 'best' isn't possible.

However, Tic-Tac-Toe is a relatively simple problem - one small enough that it COULD be solved through trial and error, we just want it to be solved faster. For my programs, I decided to combine two different heuristic techniques - Steep Ascent Hill Climbing and Minimaxing.

Steep Ascent Hill Climbing is a heuristic search method where you evaluate all the possible states you could reach from your given state and pick the best one. Because of this, it can take longer for your computer to complete than plain old vanilla hill climbing, which just finds any state that's better than the current one. But it will typically take fewer steps to get to a winning state, and, in the case of a game like Tic-Tac-Toe, a 'good' move really isn't good enough.



Minimaxing is a a method more specific to game theory. You assume that, for every move each player makes, they are going to try and maximize their own gains and minimize their own losses - while maximizing the losses and minimizing the gains for the opposing player. In true minimaxing, you estimate the number of moves it will take for you to win the game from a given state, and use that to assign the state a score. I combined this approach with a different heuristic to make my program as fast and effective as I could




 I actually built the first two iterations of this program back in mid-October, but I was then hit in quick succession with the Girl Scout National Convention and GSLI conference, my Gold Award Project, make-up work, then school, and it's just been crazy ever since.

The first draft took about a week to build.  I coded everything in Ruby.


Basically, the computer takes the tic tac toe board, uses is to test all the possible moves it can make, and picks the one that gets it the highest score. 

It played Tic Tac Toe, for sure! It just... didn't play very WELL. I used a heuristic that scored the board on the number of open rows, columns, and diagonals, but it just didn't give the weight needed to winning states. So I tried again.

I found a promising looking heuristic here. This one made use of an array to store all the possible ways to win, and another to score the state based on how many ways X and O can win on the board. But even better, I gave the computer the ability to look one move further ahead, and try to guess how the opponent would respond to its move.  This was minimaxing - the computer assumed the opposing player would play their best, and could then use its move to put the opponent in the worst possible position.

This program worked GREAT! It was almost unbeatable!

But, it had one weakness.



It could only look two moves ahead, and beating THIS trap required the program to look ahead 4.

In the end, I found it was easier to adjust my heuristic than to double up on the moves my program watched. I made sure it treated getting these traps - the three corners, or this triangle - as winning when scoring the boards, but NOT when checking for a win. In this way, the program finally worked.


Next, I'm working on trying to make a program that can learn the game on it's own from repeated trials - but that's a whole other ball game. For now, I'm just happy with how my first foray into AI programming worked out!

If you have questions/or comments don't hesitate to ask! I'm always happy for feedback.

Thursday, November 27, 2014

Why Artificial Intelligence IS Real Intelligence



One of the most common arguments I've seen in the face of AI research is that computers aren't REALLY intelligent. They merely emulate intelligence, something that is inherent to biological life, or , in some views, only humans. In his article "Artificial Intelligence, Really, Is Pseudo-Intelligence," Alva NoĆ« argues that computers lack 'drive': they can't attach meaning to things, and therefore they can't have wants like biological beings do.

Lets say, right now, I want a chocolate bar. "Want" is a pretty complex term. Does it refer to the lack of calories, calcium, sugar, magnesium, or even serotonin that my body's sensors detect in my bloodstream? Does it refer to the physical symptoms that manifest in my stomach and mouth that my brain recognizes, or the memory of how a chocolate bar negated these symptoms a week ago? Does it refer to my memories of having a chocolate bar while at the computer that have taught me chocolate is the "right" choice in this situation, just one of many learned behaviors? Does it refer to an emotional component, a combination of learned behavior and brain chemical levels that tell me that chocolate makes me 'happy'?

"Want" encompasses all of these things. It's complex, and it's more complex than anything AI can do right now as a whole. But when you break it down this way, what up there can we do that computers can't? We can create programs that take information from sensors. We can create programs that can access memories and find patterns, and determine a course of action based on that pattern. That's all intelligence is. The human mind, our meanings and desires, are only complex derivatives of very basic mechanical things, in the same way that the leaves on a vine create a beautiful spiraling pattern simply as a way of maximizing the sun coverage each leaf gets. Biological machines aren't inherently different from artificial machines. They've just had a head start. 



Another argument he uses is that of understanding. Computers can't understand, they can only perform the actions they are told to. One example is that of the Translator's Room. A human is locked in a room with nothing but a pen, and dictionaries that translate one foreign language into another. The human knows neither of these languages. However, every day, they receive papers with writing in one of the languages. Using the books, they are able to perfectly translate the writing into the other language before passing the paper back out of the room. They can complete this task despite not 'understanding' either language. 

This argument doesn't negate the possibility of artificial intelligence. It shows that a system can only do so much with limited information. If the books in the Translator's Room scenario had a picture for each word they translated, the human would be able to understand another component to the sentences they wrote. What if they were familiar pictures? Just like Helen Keller, with her hand underneath the spigot, the human could recognize water in any language if they just had another reference point. Another piece of information. Could that be considered understanding? A computer can store associations and memories just as a human mind can, and the more data a computer has access to, the more associations can be made. Isn't that all that understanding is? A summary of our experiences and the patterns we've derived from them? 



The Jeopardy-Playing robot, Watson, which the article cites as an example of a lack of understanding THRIVES on those summaries. It doesn't have any visual or physical references, which make up most of our human understanding. But it knows a river is a flowing body of water. It knows water is a compound in a liquid state that is common on Earth, and necessary for human life. It knows flowing is a type of movement only fluids, like liquid, can achieve. Even without visual reference, how is this not understanding? Watson can induct. It can deduct. And it can use those abilities to answer questions.

I'd argue that's what intelligence is. Our ability to derive patterns from information and act using those patterns. That ability is just as real in computers as in any biological creature. It's just our job to prepare computers to use it.

Wednesday, August 20, 2014

Review: Our Final Invention by James Barrat


There are many different books about the robot apocalypse, but few are so well researched, or as urgent, as Our Final Invention, by James Barrat. I have a passion for Artificial Intelligence, probably born from too many Sci-Fi movie marathons. The philosophy mixed with the science and the unknown excites me. But Barrat doesn’t exactly come from a pro - AI viewpoint. He believes that AI will be the last technology developed by the human race. Our Final Invention is a book about the dangers of Artificial Superintelligence, when machines surpass human capability to predict or control them. It aims to educate readers about the most current AI research, while moving them to act on the dangers that could appear if the research continues unchecked. Was it successful? 


The first thing I noted about this book was that it was very easy to read. Even though the material covered is sometimes complicated and advanced, the analogies and writing style is easy to comprehend. Some of the ideas are a little harder to digest once you understand them, and I think part of that has to do with the reverse-chronological path Barrat takes through the topic. He starts with something called the "Busy Child" scenario: a situation where a super-advanced AI decides it can't achieve its goal in confinement, tries to escape it's human captors. For this chapter, and the next two or three, I was rampantly annoyed. Every few sentences I found myself saying "Yes! But..." See for yourself! The chapter can be read online here.


The problem is that Barrat makes his claims in a sensational, provocative tale BEFORE he gives you the facts he has to back them up. And facts he has. His research covers the political, technological, and social ramifications of AI, from futurists to researchers to what's already here. Late in the book, he has a chapter comparing future advanced AI to the current rising problem of malware, and it is brilliant and terrifying. Once I read the rest of the book, I had to go back and reread the first few chapters. What I hadn't seen before was this: When Barrat says AI, he doesn't mean the kind that controls industrial machinery, or even government drones. The kind that has built in safety precautions from a savvy engineer. He is talking about the hundreds of researchers trying to skip the middle step, who are only concerned with developing human level intelligence as fast as they can. With that precinct, the "Busy Child" scenario becomes much more real. 




Now this is not a perfect book. One thing that annoyed me was Barrat's claims that we shouldn't anthropomorphize AI, shouldn't assume it would appreciate us, or even consider us worthy, when a few chapters later he was discussing the four basic drives of AI, which seemed rather anthropomorphic to me. (And don't even get me started on the gross oversimplification that is "friendly AI") And only the last chapter of the book is focused on ways to stop this impending doomsday. I wish there had been more discussion of prevention, of precaution, not just an afterthought, because I do believe that this isn't just going to become relevant in five years - it's relevant NOW. Back to government drones - or even worse, Amazon's proposed domestic drones - what happens if one of these drones is captured, and destructively reprogrammed? If it becomes slave to a botnet? These are the concerns Barrat feels moved to act on. Does his book succeed at moving others too? I'd say... yes, but not how you'd think.


Because it's worth noting that immediately after finishing this book, I went out to the nearest bookstore and bought an AI Textbook and a Lisp coding primer. Our Final Invention is a great introduction to real-world AI. And even more than it made me want to try and save the world, it kind of made me want to destroy it. I desperately want to be one of those hundreds of researchers on the cusp of tomorrow. I want to help Artificial Super-Intelligence come into being. I want to ask all the hard questions about consciousness and intelligence. And now I want to consider, and prepare for, the consequences of doing so. If Our Final Invention has done anything, it's made me more conscious of what we're creating. That's why anyone interested in AI, even just in passing, should read Our Final Invention. It gives everyone the knowledge to make their own decisions about AI, and the risks involved. Because, while I'm not saying your Roomba's going to challenge you, someday soon, who knows? It might be able to.