Can a virtual machine be implemented as a neural network?

Disclaimer: I am not a math genius and I have no experience writing neural networks. So, please excuse any idiotic things I might say here.;)

I've always read about neural networks used for machine learning, but as I experimented with writing simple virtual machines, I started to wonder if they could be applied differently.

In particular, can a virtual machine be created as a neural network? If so, how does it work (feel free to use an abstract description here if you need to)?

I have heard about the Joycean machine, but I cannot find any information other than very, very vague explanations.

EDIT: I'm looking here for an explanation of how a neural network based virtual VM will interpret an assembly. How do I handle input data, etc.? Will every single input be a memory address? Let it brainstorm!

+2


source to share


3 answers


You really made my buddy ...

Since an already trained neural network will not differ much from a normal finite machine, it makes no sense to write a neural network VM for a deterministic instruction set.

It might be interesting to provision such a virtual machine with multiple instruction sets or an unknown set. However, I doubt it would be practical to do this kind of training, and even the correct% 99 interpreter would be used for regular bytecode.

The only virtual virtual network use I can think of is the execution of a program containing a fuzzy logic construct or AI algorithm heuristic.



An example of some silly stacks to demonstrate the idea:

push [x1]
push [y1] ;start coord
push [x2]
push [y2] ;end coord
pushmap [map] ;some struct
stepastar ;push the next step of A* heuristics to accumulator and update the map
pop ;do sth with is and pop
stepastar ;next step again
... ;stack top is a map
reward ;we liked the coordinate. reinforce the heuristic
stepastar
... ;stack top is a map
punish ;we didn't like the next coordinate. try something different

      

There is no heuristic explication here. Suppose we save all state on the map, including the heuristic algorithm.

You can see it looks silly and is not completely context sensitive, but a neural network doesn't matter if it doesn't learn online.

+2


source


Sure. With a rather complex network, no doubt about it.



Much of the analysis of bytecodes / opcodes is pattern matching, in which neural networks excel.

+1


source


You could do this with a neural network - I could easily learn how to correctly transition state for a given piece of bytecode.

The input might look something like this:

  • Value at the top of the stack
  • The value in the current accumulator
  • Bytecode at current instruction pointer
  • Byte value at current data pointer
  • Previous flags

The output might be something like this:

  • Change instruction pointer
  • Change data pointer
  • Switch to battery
  • Stack operation (push, pop or nothing)
  • Memory operation (read to battery, write to battery, or nothing)
  • New flags

However - I'm not sure why you would want to do this in the first place. A neural network will be much less efficient (and possibly wrong if you haven't trained it well enough) compared to just executing the bytecode directly. You will probably need to write an accurate bytecode evaluator, one way or another, to generate enough training information ....

Also, in my experience, neural networks tend to be good at pattern recognition, but are very poor at learning logical operations (like binary addition or XOR) once you go beyond a certain scale (i.e. more than a few bits). Thus, depending on the complexity of your instruction set, the network can be very time consuming to learn.

0


source







All Articles