Reverse engineering processors and brains

Published on March 15, 2015

In October 2014, Joshua Brown published an interesting opinion piece in Frontiers of Neuroscience. He told a parable about a group of neuroscientists who come upon a computer, and having no idea how it works, they set about applying the techniques of cognitive neuroscience, neurophysiology, and neuropsychology to try to understand the computer's magic. They use EEG, MRI, diffusion tensor imaging, and lesion studies to learn the different functions of the hard drive, the RAM, the processor, and the video card. They learn about its interdependencies and even how to make crude repairs, but they never truly understand how the computer works.

The moral of the story is that neuroscience needs a strong mechanistic theory that can be used to understand how observed effects arise from the systems at work. The author advocates that computational modeling should be as foundational to a neuroscience education as neuroanatomy. But while it was only an analogy, the story about trying to reverse engineer a computer made me really wonder - could we even reverse engineer one of our own processors?

To get an idea of how hard reverse engineering would be, I turned to my friend Warren. He was the TA for my semiconductors class and is about to graduate with his doctorate in electrical engineering. When I asked him about the feasibility, he wrote:

For simple devices and circuits on silicon, it’s trivial- we have the equipment, the SEMs, the TEMs, the AFMs; you can get surface images of components, cross-sectional images no problem. People are also starting to use X-rays to look inside chips... Once you understand what the 20 or 30 different layers of the chip are, you can start to hack down through the layers (destructively) to try and identify layout. Scaling up though it becomes infinitely more complicated.

The latest chips have thousands of pins and not knowing what any of them do, there’s an infinite number of tests you could do. Now, if you have some previous knowledge of, say, how a simpler chip is built, you might start to be able to identify functional regions e.g. a region on a chip with a highly repetitive, dense, pattern will invariably be memory. A region that is repeated, a few times on a chip will, in a modern processor, likely be cores. But I think for the complex chip it’s simply the scale of the number of devices- millions and millions of transistors, and isolating and disentangling them non-destructively is simply unviable, let alone without having any idea of the function that the circuits/devices do!

In a nutshell, you would need many, many chips to test destructively in order to even come close to understanding the basic functionality. If I were to hazard a guess, I’d say deconstructing a chip of the complexity found in a modern computer, without some sort of map would be close to impossible.

Building this map of the physical architecture is akin to the work undertaken by connectomics researchers to digitally reconstruct circuits of neurons. But the physical layout is only a small component of a computer's magic - the hardware, without any of the software running on it. Many neuroscientists that employ a mechanistic, model-focused approach actually record the spiking patterns of individual neurons, either by measuring cell voltages with miniscule metal probes, or by inducing mutations that cause the neurons to glow when their voltage spikes. They add a stimulus, measure the behavior of the network, and try to model it. Imagine doing that with a processor. Measuring would be a nightmare - while brain currents are carried by micron scale neurons, processor currents run on wires and gates only nanometers thick, scarcely probe-able. Perhaps infrared imaging could reveal areas with high current density, but you'd need a system that could read the values in less than a nanosecond, as a two gigahertz processor changes them two billion times per second.

If you could somehow read the binary numbers in the processor registers, you would have the foundation to reverse engineer the processor's binary instruction set. But the layered abstraction so key to complex ideas like programming would make it almost impossible to understand functionality from byte code. Even a simple program written in an interpreted language like Python involves a complex multi-layered program (the interpreter) building data structures and shuffling values. A model that attempts to explain the behavior of bytecode based on the inputs and outputs of a Python application would need to account for so many layers of abstraction that the probe readings could very well appear chaotic.

Reverse engineering a modern processor would clearly be a herculean task. In fact, I would venture it would take more years of academic study and research to reverse engineer a processor than to engineer your own new architecture. Rather than trying to puzzle out the nuances of arbitrary decisions made along the way (endianness, anybody?), engineers would be free to make their own arbitrary decisions and move on. If the goal were to re-create something with the same abilities as a modern computer within a few decades of research, it seems far easier to simply take the big picture ideas revealed by the curious specimen (transistors can be made from silicon, transistors an be used to make hierarchical logic systems, many classes of problems can be solved with the same generalized architecture) and uses those as the foundation for creating a new theory and system.

So where does that leave neuroscience? The processor is the product of generations of engineers trying to find the most efficient, elegant, and consistent solutions. The brain is the product of orders of magnitude more generations of trial and error that went with whatever happened to work first. No doubt reverse engineering the brain would be dramatically more difficult than a computer, so the same heuristic above applies - rather than puzzle out the intricate machinations of the curious specimen, take the big picture ideas it reveals (networks with learned weights can encode high level ideas, many classes of problems can be solved with the same generalized architecture) and use those as the foundation for creating a new theory and system.

Parallel engineering can yield useful understandings of the system under study, but recreating the abilities of the brain is a goal in itself of artifical intelligence research. Neural networks that apply some of the big picture ideas have been around for decades, but the recent explosion of success with convolutional neural networks has been driven by newly engineered architectures and mathematical formulations, not by neuroscience breakthroughs. Other neural network paradigms, like spike-driven and recursive networks, are still in their relative infancy because they're more difficult to get a handle on. However, they are founded on big picture properties of the brain that are known to be effective, so I'm confident that as they receive more engineering attention, they will yield spectacular new results.