Search code examples
neural-networkvm-implementation

Can a virtual machine be implemented as a neural network?


Disclaimer: I'm not a mathematical genius, nor do I have any experience with writing neural networks. So, please, forgive whatever idiotic things I happen to say here. ;)

I've always read about neural networks being used for machine learning, but while experimenting with writing simple virtual machines, I began to wonder if they could be applied in another way.

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

I've heard of the Joycean Machine, but I can't find any information other than very, very vague explanations.

EDIT: What I'm looking for here is an explanation of exactly how a neural network-based VM would interpret assembly. How would inputs be handled, etc? Would each individual input be a memory address? Let's brainstorm!


Solution

  • You really made my day buddy...

    Since an already trained neural network won't be much different than a regular state machine, there is no point writing a neural network VM for a deterministic instruction set.

    It might be interesting to train such a VM with multiple instruction sets or an unknown set. However, I doubt it will be practical to execute such a training and even a %99 correct interpreter will be of any use for conventional bytecode.

    The only use of a neural network VM I can think of is executing a program that contains fuzzy logic constructs or AI algorithm heuristics.

    Some silly stack machine example 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 explict heuristic here. Just assume we keep all state in *map including the heuristic algorithm.

    You see it looks silly and not completely context sensitive but a neural network is of no value if it doesn't learn online.