Bits of Evolution, Bytes of AI: Merging Worlds with Evolutionary Algorithms
Digital DNA Helix - An Image generated using Dall-E

Bits of Evolution, Bytes of AI: Merging Worlds with Evolutionary Algorithms

A little bit basics on AI ??

  • AI refines by making a guess
  • Simplest method is to travel in the direction of improvement - hill climbing (maximizing a number) or gradient descent (minimize a number)

No alt text provided for this image
No alt text provided for this image

  • Sometimes we might end up at the lowest peak - local maximum, rather than the highest peak - global maximum.
  • There are more complex methods that force the algorithm doing a few test hikes before deciding what the most promising areas are → more efficiency

No alt text provided for this image

  • In ML terms → the mountain is our Search Space, peak is our goal.
  • Some search spaces are convex → basic hill-climbing algorithm will find the peak, but some other are annoying. The worst are so-called needle-in-the-haystack problems → very little clue how close we are to the best solution. A good example is Searching for Prime Numbers.

No alt text provided for this image

  • The search space could be anything → shapes and parts making up a robot, weights of neural nodes.
  • One of the strategies takes its inspiration from the process of evolution (which is nothing but a generational process of “guess and check”)

Evolutionary Algorithms ??

  • Evolution is a powerful, powerful process - one that solved countless locomotion and information-processing problems, figured out how to extract food from sunlight and from hydrothermal vents, how to glow, fly and hide from predators.
  • In Evolutionary Algorithms → each potential solution is like an organism. In each generation, most successful solutions survive to reproduce, mutating or mating with other solutions to produce different - and, one hopes, better - children.
  • Let’s say we are trying to solve a crowd-control problem: we have a hallway that splits into a fork, and we want a robot that directs people to take one hall way or the other.

No alt text provided for this image

  • Firstly, we should come up with the bit that the evolutionary algorithm can vary, we can make the elements very limited with a fixed body design. (We could allow to build from scratch, but they mostly end up in messy jumble of crawling blocks when given absolute freedom).
  • Let’s say we can vary the size and shape of a few basic body parts → In evolutionary terms, this is the robot’s genome.

No alt text provided for this image

  • Next thing is defining the problem → there’s a single number we can optimize. In evolutionary terms → fitness function: a single number that will describe how fit an individual robot is for our task.
  • We’re trying to minimize the number of humans that take the left-hand fork → closer that number is to zero, higher the fitness.
  • We also need a simulation → simulated hall, simulated gravity, friction, simulated physics, simulated people with simulated behaviours, including walking, lines of sight, crowding, and various phobias, motivations, and levels of co-operativeness. The simulation itself is a really hard problem.

No alt text provided for this image

  • first generation of robots → very random (maybe hundreds)

No alt text provided for this image

  • We test each robot individually in our simulated hallway → flop on the ground and flail ineffectually, some might fall bit more to the left and some timid humans decide to take the right hallway → scores slightly better.

No alt text provided for this image

  • Now for next generation → we will choose which will survive to reproduce. could just go with best robot but then the population would be pretty uniform → might end up being better if evolution gets a chance to tweak them → so we’ll save some of the best robots and throw out the rest.

No alt text provided for this image

  • Now we have lots of choices and we want them to be evolving towards something better. We have two options
  • Mutation : pick a random robot and randomly vary something about it.

No alt text provided for this image

  • Crossover: two robots produce offspring that are random combinations of the two parents.

No alt text provided for this image

  • We have to decide how many offspring each robot can have, which robot can cross, whether we are gonna replace all the dead robots with offsprings or with a few randomly generated robots. → These are our Hyperparameters
  • Some distinct crowd-control strategies start to emerge → they learn to stand up → “fall to the left and be kinda in the way” has evolved into “stand in the left hallway and be even more annoying”. → Another strategy is to “point vigorously to the right” → But still plenty of people leak into the left hallway.
  • After many generations → a robot emerges that is very good → “murder everyone” → Technically the solution works
  • This is a problem with our fitness function, unfortunately shortcuts happen in ML all the time.

No alt text provided for this image

  • We’ll have to start over again, with a fitness function, rather than minimizing the number of humans in the left-hand hallway, maximize the number of humans who take the right-hand hallway.
  • We can take a (somewhat gory) shortcut(Transfer Learning) → as our robots now have learned many useful skills besides murdering people → stand, detect people, move their arms → Once our fitness function changes, the robots quickly learn to forsake their murdering ways.
  • The robots that are worst at murdering would be on top of the heap and next few generations would become even worse at murdering.

No alt text provided for this image

  • Eventually, they might only look like they might want to murder you → scare humans into entering the right hallway.
  • By starting with murderbots, we do are restricting the path of evolution. Had we started over instead, we might have had robots whose hands evolved into signs that said FREE COOKIES (needle-in-a-haystack solution though).

No alt text provided for this image

  • “Fall down and be in the way” would be the best way forward as it is pretty easy to do → Through that we will arrive at a robot that solves the problem perfectly → 100% humans entering right hallway(murdering none of them in process)

No alt text provided for this image

  • Yes, we have evolved: a DOOR
  • That’s another thing with AI, it can sometimes be a needlessly complicated substitute for a common sense understanding of the problem.
  • Evolutionary algorithms are used to evolve all kinds of designs → car bumpers, proteins, flywheels. The algorithms doesn’t have to stick to a genome that is physical object, either. We could have a bicycle with fixed design and control the program that evolves, the genome can even be weights of a neural network or the arrangement of a decision tree.

When we consider the huge array of life that has arisen on our planet via evolution, we get an idea of the magnitude of possibility that’s available to us by using the virtual evolution at a massively accelerated speed. It could be a little too creative sometimes. - Janelle Shane


Lakshmi Radhakrishnan

Cloud Infrastructure Software Engineer at JP Morgan Chase & Co, Bangalore

1 年

Nice one. Thanks for summarizing it and sharing.

要查看或添加评论,请登录

Anurag Pola的更多文章

社区洞察

其他会员也浏览了