Wednesday, August 27, 2008

The Pinocchio Function, Part 5: Amazing Technicolor Dreamcode

The story I'm telling here is true. The dates are approximate and the events are summarized, but I'm not making this shit up. This is part five and the final part of the recap of the story so far. You can find part 1 here, part 2 here, part 3 here, and part 4 here.

So there I was, having written enough code to really wet my appetite.

Once I had gotten the concept down, and flexed my muscles a little, I got to thinking about how the instruction set was really just a metaphor for what was really happening, which was this complex interaction and eventual abstraction of functionality into larger functionality. This in turn lead me to think more about how to model the true interaction for what it was I'm trying to do. So I set aside the old code, and started fresh in a completely different language (Java, if you're interested), and started to focus more on the way in which behavior was encapsulated. This lead to the eventuality of what I now call the Abstraction Engine.

The Abstraction Engine took a wholly different approach to it's design, because right from the get-go it was never designed to 'solve problems', rather it was designed to explore the way that code executing in parallel can interact and build off their own abilities by leveraging other aspects of what their neighbors were doing, where neighbors was this loosely defined concept that had no bearing on their spatial relationship to each other.

And it was watching how one piece of code would poison another to death with clever tricks of encapsulation and a little magic that it had invented on it's own when I finally had the ultimate confirmation of what I had always dreamed of, and found a new and profound understanding of the nature of life itself.

It was surely by no accident that I finally obtained these understandings, any more than a bee's flight to a flower is no accident; neither are pre-destine, and yet destiny still prevails due to the serendipitous nature of our universe. To deny it requires denying all of existence, which leaves me but a clever rook in some much larger game of multi-dimensional chess; my moves are unknown, but my methods are constrained, and so my destiny is predictable. I recognize now that the answers I have searched for are every bit as complex and profound as I imagined them to be.

The moment of enlightenment happened when I was stepping through a particularly treacherous pieces of code that had evolved the ability to seemingly defy boundaries that I had put in place to prevent it from replicating too fast. In particular I was looking at how the code had happened upon a sequence of events that actually allowed it to change the equivalent of it's digital fingerprint to masquerade as another piece of code, yet retain a sense of it's original identity. In theory this should have been impossible, but I had managed to allow a bug to slip through in a seemingly unrelated piece of code, and the code had figured out how to manipulate that bug in a very complex sequence to do what would have otherwise been impossible to do.

The end result was that now I had code that was breaking the boundaries of my framework by exploiting a bug that I hadn't 'told' it how to exploit, AND that same code was, at critical moments, changing it's appearance to pass by my security undetected. It did so though a highly unlikely set of interactions involving collusion between multiple disparate pieces of code, and in repeats of the scenario, eventually similar conspiracies of masquerading identity would form.

It wasn't until I actually got my mind wrapped around the highly unlikely set of circumstances and the path that they took in forming that I saw the profound truth reveal itself before me, like a butterfly's wings unfolding as it emerges from it's cocoon: These complex interactions form not out of randomness like I had initially thought and designed them to do, or out of the design of some intelligence, but from co-evolution inter-operating on multiple scales of force, much like our own forces of gravity, weak, electro-magnetic, and strong do. Each piece of code... each organism if you will... plays it's specific role at it's specific time, but in doing so enables other aspects of the system in subtle and complex ways in this symphony of orchestration which surpasses the complexity of the silicone on which it exists, and steps firmly into the domain of emergent process modeling, or more to the point what we often call biology when applied to organics. What may seem like a benign change or even a sophisticated one in one aspect of the system in one piece of code has profound and lasting effects that don't become clear until the whole of time and space as it's defined within my simulation is examined, and the forces of natural selection have taken their toll. Evolution works a lot like my favorite quote from Bill Cosby: "I told you that story, so I could tell you this one." in that it reuses it's previous accomplishments and breakthroughs as a foundation for it's further feats in this grandiose act of self-organization, but does so in a way that's very subtle and even highly suggestive.

Erich Jantsch has talked about this extensively in his book, "The Self-Organizing Universe" which in turn draws heavily on the work of Nobel Prize winner Ilya Prigogine concerning dissipative system and nonequilibrium states. The physicist Hermann Haken in 1978 suggested the label of "synergetics" for the field that studies the collective patterns emerging from many interacting components, as they are found in chemical reactions, crystal formations or lasers. Another Nobel laureate, Manfred Eigen has focused on the origin of life, the domain where chemical self-organization and biological evolution meet. He has introduced the concepts of hypercycle, an autocatalytic cycle of reactions containing other cycles, and of quasispecies, the fuzzy distribution of genotypes characterizing a population of quickly mutating organisms or molecules.

I'd like to think that if they took a look at what I was doing today to reproduce these behaviorism in the digital domain instead of the chemical or biological one, they would be proud.

So now the question from the final line in Ghost in the Shell begs, "Where does the newborn go from here? The net is vast and infinite." and surely this must be my answer: The net. The internet is a perfect place for such experiments because it provides an ever increasing amount of resources, and allows for emergence of complex behavior on a grand scale, one we've already realized on our own image; when a blogger posts a juicy story, the population reacts in complex and unforeseeable ways which in turn pushes other forces to bear, and it happens at the speed of humans who are instantly connected. When computers can perform the same feats... and I have them doing the equivalent on a microbe scale... they will do it at the speed of the internet minus the humans.

What will happen when the equivalent of wild bacteria are released into the otherwise sterile and static cleanroom that is our world of the digital domain, provided with an unlimited supply of food, and left to grow? I can't know for sure, but I have my guesses: It will likely follow our own planetary evolution, which is to say that the first thing that will happen is a layer of the digital equivalent of pond scum will form and cover everything that it can reach, and be wholly uninteresting. And that's where it's likely to stay for a while, happy and content to exist and reproduce, until the conditions are right for it to make the leap from the equivalent of a single-celled-single-minded organism to something more complex. That is, at the very least, what it would do if I just stuck it up there right now. However, I think I can improve upon that situtation, by stacking the metaphorical deck if you will.

You see the trick here isn't in creating the ultimate code which gives rise to life, rather it's in creating a framework which allows for increasingly complex interaction in multiple fields like our universe does with the different forces which hold our existence in a relatively stable yet ever changing way. From a 10,000 foot looking down view the forces of gravity, weak, electro-magnetic, and strong combined with sufficient mass/energy provide enough complex interaction to account for some really interesting behaviors. The theory is to abstract that same complex interaction into something entirely different, and you should be able to produce some of the same results, and the code I'm working on demonstrates it can be done.

Digital intelligence is still outside of our abilities, but life as a science has officially reached a new plateau as it's forced to expand and cope with reaching new domains to exist within. What I have done is simply the proof of concept that demonstrates when sufficient pressures exist within the domain to enable the right changes, profound results can be accomplished, just like in biology and chemistry. This is in no way new, as many people have proven the same thing many many times before me. I've just demonstrated it in a potentially exciting way, and when I'm confident enough that it's sufficiently proven as a system, I hope to use it to enable all kinds of things.

Labels: , , , , , , , ,

Tuesday, April 08, 2008

The Pinocchio Function, Part 3: Standing On The Shoulders Of Giants

The story I'm telling here is true. The dates are approximate and the events are summarized, but I'm not making this shit up. This is part three of the recap of the story so far. You can find part 1 here, and part 2 here.

Tom Barbalet of Biota.org once said in a podcast, "The Artificial Life industry doesn't exactly have founding fathers so much as dead beat dads.", mostly due I think out of his frustration with getting the early pioneers of the industry on his podcast.

But that isn't to say they didn't leave a legacy.

The first in a long series of breakthroughs came for me when I met an evolutionary biologist who was also a computer hacker. Adam is a genius of a rare sort, both incredibly insightful and well versed, while also possessing a genuine passion and ability to make rubber meet road and write code. He spent one night, hoarse and unable to speak from a very bad cold, literally whispering passionately in my living room until the wee hours of night about how biology worked like a possessed Mozart composing his dying symphony, and I dutifully made down notes in my head about the scientific processes of evolution, and their applications with genomes and ribosomes and chromosomes and how nature basically accomplished it's miracle.

You see he knew what he was doing: He was Prometheus stealing the secrets of life from mother nature and giving them to the masses in a form they could understand. That knowledge genie had been out of the bottle for a long time... I just never properly understood how it really worked.

Adam sure did though. He had made his own version of some earlier work that was explicitly headed down that path by trying to find emergent properties in evolutionary systems in things he called a "Nanopond", similar to "Avida" or "Tierra".

I studied the code for these a bit, and often found them to be again full of assumptions, and brittleness in the design which made them very hard to change. But when I ran them, something was very obvious: These guys had figured out how to make code behave more like life. Of course just undergoing evolutionary processes towards a static fitness goal still isn't going to produce something that springs forth and declared "I'm REAL!" of it's own violation, because eventually you reach the "best" solution for that fitness function. What I was really impressed with was the way these programs brought a very specific order from a stream of chaos in what clearly was a very novel and effective way.

These programs were designed to solve problems by evolving solutions for them. All you had to do what define for it what it was supposed to accomplish, and it will use an evolutionary process to arrive at the solution.

Someone had beat me to the punch on the Program Understanding Program, and I have to say I was never more excited about an idea for code than when I learned someone else had figured out what had eluded me for so long. Finally my idea could actually get legs and move forward!

And move forward it did. I took my new found knowledge, and I set about applying it to my own passion.

I studied Tierra and found that while there were things that I really liked about it like the evolvable instruction set, it really had a more singular focus of trying to find one specific solution, or one set of code that would always solve the given problem.

I studied Avida-ED but saw that it was just a beginning at what I had envisioned, and really wasn't meant to support more emergent behavior than what could live beyond a simple "petri dish" model.

So I started hacking away in C++, like all those before me had, chasing that elusive idea of creating a living organism by supplying the Pinocchio Function to something so complex that it actually could produce an emergent behavior as complex as life itself.

Coming up in part 4: Two Steps Forward, Two Parts Chaos

Labels: , , , , , , ,

Saturday, December 08, 2007

The Genesis of Design

I met a neat guy the other day.

This guy had a pretty crazy claim. He said had created a program which did for computing what evolution does for life: It adapts to what ever problem it faces.

And he challenged me to test it out. So I did. Over the next few weeks I'm going to blog what I find out.

So just imagine for one second you had a time machine, and you traveled into the future 2000 years, and you purchased a kid's biology teaching toy, an Insta-Biomatic 3000. It allowed you to create little populations of simple organisms that you could evolve into different things by telling them what you wanted them to do, and feeding the ones who work towards your goal, while starving the ones who rebel. Now imagine for a second this product exists today, and I own one. Yeah, sounds like crap, right? Wait and see...

So I decide I'm gonna start out simple. The claim is it can be trained to do any task from image recognition to signal processing, but I need to understand it first. I start by seeing if it can figure out how to multiply a number by itself. Easy to express, easy to know when it's right. I create a new set of organisms, and I give them all random numbers to work with, and I let it run for a bit, and at first it's just fail fail fail across the board. I smile to myself and think, "Oh sure. It's gonna do what now?" and the best part it I'm not telling it the right answer at all, I'm just telling it, "Nope, you got it wrong." It's a bit like asking 10,000 people "The question is: 8485832451, what's the answer?" and then telling them they're all dead wrong, thanks for playing, no you don't get to know what the answer was.

But after about a minute and a half of just completely random guessing, one of them got it right just by sheer luck. Then a few seconds later he got it right again. And then he missed, but his neighbor got it. On the next try they both got it, and soon after that it was a small chorus of consistently right answers. After 3 minutes I had a small population of organisms whom 90% of them would consistently get the answer right, no matter what number I handed them.

Ok, big deal. It can multiply a random number by itself consistantly. More to the point it can evolve a solution where 90% of the population arrives at the right answer 100% of the time. Multiplying 64 bit integers isn't exactly super amazing, let's do something harder.

So I start over with a new population who's never solved any problem, and I change the problem from "n times n" to "n times (n plus 1)". So now they have to add 1 to the number before multiplying. The problem is harder, and it takes them a little longer to arrive at a solution, but they do.

So then I figure I'm gonna get tricky on them, and change the problem in mid stream. I make it so once we've played the game 150 times, I'm going to add one to the number I'm adding. So it starts "n times (n plus 1)" but goes to "n times (n plus 2)" after 150 tries.

Well, just like before, they all arrive at a consensus and are quite pleased with themselves, until all of the sudden the 151st time happens, and I go, "No. You're all wrong.". Well they kept trying, and pretty quick one of guesses the new number and spreads the word around, and soon enough we're back up to 90% of the population getting it right... until the 301st time comes around and I do it again, and they all have to guess the new number again. And wouldn't you know it, they find it much quicker too! In fact by the 7th time I've played this number changing game, they've figured out that I change the number every 150 times, and they've accounted for this in their DNA so they start guessing the new number right away. Ok, this was the promise, right? It adapts to it's environment, even while it's in mid-stride. Pretty neat, but I still think I can trick it.

So I change the game again. This time I add one to the number when they've arrived at a 60% consensus. I figure right around the time word is starting to spread around, I'm gonna switch it out on them. But this doesn't deter them; the carefully play the game until 60% of them are also incrementing the number every time, and therefore staying in step with my guess. Clever!

Alright, well how about this: Every time they grow the consensus of right answers more than 0.003% in a single round of guesses, I change the number to something completely random.

Well, this does stump them a bit more because they're unable to come up with a really solid solution for how the number is changing, since it's changing at random.

But after about 10 minutes, I realize they've devised a way to cheat: They've evolved a completely stable population that gets the answer right a low enough percentage of the time, and gives wrong answers the rest of the time that it doesn't tip the consensus and change the number any more! In this way they stay the most happy, because they've learned that growing the consensus too fast means they won't be rewarded until they guess the new random number. Meanwhile they slowly grow the number getting it right, but keep this conspiracy amongst them to keep giving wrong answers most of the time, until 90% are doing exactly the same thing, yet the size of the consensus never grows by more than 0.003% in a single round.

Clearly Orgel's Second Rule is hard at work here: Evolution is cleverer than you are.

Stay tuned for more, because this is just the very beginning of what this thing is capable of.

Labels: , ,