Self-Aware programs

Anything related to software

Self-Aware programs

Postby edepot on Fri Feb 13, 2009 8:59 am

One of the major challenges facing programmer is the ability to create programs that are self-aware, or sentient. There are many requirements for self-awareness, one is a feedback loop, and another is a way to self-modify its own code or create a different copy of its own code for execution. These, of course, or not the only requirements, but they are a prerequisite. However, a major missing piece of the equation is allowing for programs to be aware of itself while it is executing instructions. This allows for easy changing of behavior during execution so that the right corrections can be made (feedback), and it also allows for self-awareness during execution (thinking). Virtual machines are a way to allow this to happen.

The progress of computer programming in the beginning was dictated by the hardware. If the hardware can only add and subtract, then programs can basically have a sequence of addition and subtraction to derive at an answer. Of course, you needed a way to progress to the next calculation, so instructions were created into the CPU chip to allow for going through a list of instructions (program counter) and loading and storing data and answers at certain memory locations (registers and loading storing). As the CPU got more advanced, it allowed for simple decision making instructions like if certain variables met certain values, then you should go to another set of instructions and do those tasks (branching and comparisons). Even more advanced CPU designs allowed for doing subtasks and coming back to finish up the original task (jumping to subroutines, stacks). The majority of the design of CPUs were catered to fast execution of numbers (binary values). As CPU got faster and faster, it became feasible to create programs that kind of broke free from the hardware constraints. It became possible to create a virtual machine, emulating the hardware in software, and this allowed one hardware to run software built for a different machine.

This virtual machine is the first step in self-aware code, as in order to execute external instructions, it needs take care of executing a lower level instruction set that emulates the hardware for those external instructions. If you compare this to a person, it can be analogous to a person satisfying a pre-condition before doing tasks. In order for a person to do something, he needs to have a body that can execute it, and this body needs food and water and other necessities in order to work. So in the similar sense, a computer that is self-aware needs to take care of running the emulator so it can run the instructions (the tasks it needs to do). A self-aware code needs to know it is thinking itself, and the process of thinking is being aware of the decision making process, rather than just simply executing instructions via the hardware. A virtual machine provides this abstract layer allowing for the virtual machine to be the thinker, separating the hardware (analogous to a person's body that needs to be fed) that needs a power supply.

Could you simply get rid of the emulator and let the machine have instructions that take care of feeding itself power from the power outlet? Yes, but then again you relegate this task to the operating system. So in a sense a virtual machine could be thought of as an operating system. However, an operating system is not self-aware, as it can be split up into modules that simply gets alloted time on the hardware (cpu) to handle communication with other parts of the body (peripherals, harddrives, etc). This gets complicated if you wish to get deeper into possibilities, as you can have a kernel be a virtual machine. But lets just say that operating systems are currently dumb and are just instructions like regular programs that are not self-aware, even if it is actually running as a virtual machine.

So in order to have self-aware programs you need a decision making part separate from the body (like out brains). This decision part can be thought of as the emulator or virtual machine that interprets instructions. If there were no decision part, then we can say we run purely on instinct and there is no possibility for deviations of instructions, and so we cannot "think". Now that we have satisfied the possibility for thinking (the virtual machine or emulator of instructions), it is important that this virtual machine have a feedback loop and possibility for modifying its own behavior. A feedback loop is like a person getting new information from the environment and changing and adapting to allow for different behavior. For example, today you fell down a hole and injure yourself, so next time you are around holes you are more cautious or go around it, etc. If you put this in the same analogy to a self-aware program, you would need the virtual machine to be able to modify the normal instructions it executes. This is an important factor that needs separation of layers of consciousness. A virtual machine normally runs a set of instructions that can handle a second set of instructions. This second set of instructions (behavior instruction set) is the normal daily activity of a person (going to the water hole to drink water). When crisis happens (the person fell down the hole), this normal daily activity needs to be modified (be more cautious, etc). However, in a self-aware program, you cannot always have external programmers tweaking the code to satisfy every problem that comes up. So the self-aware program (our virtual machine) needs a way to modify its second set of daily activities instructions. And in order for it to know when the second set of instructions needs to be modified, it needs a feedback loop on the environment of the second set of instructions to allow itself to know when there is a problem or behavior that needs modified (recoding).

Now it gets to the meat of the problem. Should the virtual machine be able to modify its own instruction set? (not the second "behavior" set of instructions). Modifying the virtual machine instruction set allows itself to create new abilities and thus allowing new commands in the second instruction set. This would help in "learning" and "growing". Also, how does the virtual machine go about creating or modifying this second instruction set (or even harder, changing the instructions of itself, the virtual machine instructions that run on the actual hardware). And to answer these questions, you need to know what is the goal of the virtual machine. Just like you need to know the goal of every sentient being... to survive. Because animals and humans needs to survive, they need to find food and water and shelter. After they satisfy these possibilities they can choose to do things provided by the environment or internal stimulus (nurtured/learned behavior and instincts). It is thus important that in self-aware programs that it is provided with an environment (hardware with CPU) and an initial set of tasks allowing it to keep running (command peripherals that puts power to the CPU, and location of CPU's where it can run its own virtual machine/brain). It needs good feedback loop on the environment (knowledge of where it is run, the CPU types available for it to run on, ability to create a copy of itself to run on a different CPU architecture, how to propagate to another machine, how to seek out peripherals that it can control, etc). Ability to keep running and propagate would seem like a very simple virus, and is analogous to meeting the basic food and water of humans.

To get back to the meat of the issue... In order to allow for changes in behavior (don't want to fall into the hole again), you can either change the virtual machine (instructions run on the actual hardware) to add new abilities and also change the second set (behavior) of instructions, or only just change the behavior instructions (the second set of instructions run by the virtual machine). If the virtual machine does not have the ability to modify the second instruction set, then this second instruction set must have the ability for self-modifying its own code. This is very difficult to do, and requires intimate knowledge of the virtual machine, asking it permission to change itself. An easier way is to build the modifying part into the virtual machine, which will have internal and external stimulus while running the program (think of it as a pipeline). When during the execution of the behavior instruction set, it encounters problems (a peripheral signal says we lost contact with another machine: we fell down a hole), it can insert initial code to call another set of instructions that allows for gathering better data on external machines (be more cautious around holes). Next time this program runs again, it will check for external machines to prevent triggering disconnect in this behavior instruction set. This is a very simple case of self-awareness, and it requires pre-built set of modules that tie into the virtual machine to allow for modifying code.

This gets into the nature versus nurture debate. Someone needs to come in and design the virtual machine itself and provide it with a set of modules to "use". It is similar to our genes: someone had to come along and program them to grow a body and provide instincts and initial behavior allowing for us to survive. We are not at the point of knowing how to change our genes, and similarly it is quite difficult for a virtual machine to change its own instructions using the behavior instructions (changing its own instructions allows for a different or better virtual machine). Our sensory organs and body were created for us initially when we are born, and similarly the CPU and peripherals needed to be there initially for the virtual machine. A designer needs to be there initially to provide for the mechanism for self-aware programs, as it is difficult or impossible for programs to instantaneous become self-aware.

One thing is for sure, we are currently not able to put our brain into another body, so we are unlike a virtual machine that can hop onto another CPU. However, we are able to create another body by mating, while virtual machines needs machines pre-built by others, unless it has access to CPU design and computer building peripherals. One day when we can create better genes for ourself (create a bigger brain size, etc) maybe virtual machines can start modifying its own instruction set, or have access to building better CPUs for itself to run on.
edepot
Site Admin
 
Posts: 379
Joined: Sat Mar 01, 2008 9:26 pm

Return to Software

Who is online

Users browsing this forum: No registered users and 1 guest

cron