During his disastrous naval assault on the city of Santa Cruz de Tenerife, Lord Nelson lost hundreds of men, and was driven from the coast in defeat. He was also shot in the arm, and had to have part of it amputated. This being 1797, the amputation was done by knife without anesthetic. He seems to have been a good sport about the accident, especially since, in a sense, he never lost the arm. For the rest of his life he could sense it, as though the appendage were extending invisibly from the stump. He supposedly claimed that he now knew there had to be an afterlife because if his arm could have a ghost, then so could he.

Lord Nelson’s arm is a particularly famous example of a phantom limb. Almost all people who have an amputation experience a phantom. Usually the effect fades within days, but in some cases it can remain for a lifetime.

The reason for the phantom is both simple and profound. The brain constructs a model of the self that neuroscientists call the body schema. The body schema is a simulation. It takes in touch, vision, and baseline information about what’s connected to what, and builds a virtual model of your body. The body schema is not a literal description of the human body. It contains no information about bones, tendons, or the biochemical basis of muscle contraction. The brain doesn’t need to know those details in order to control movement. Instead, it generates a surreal description of magic segments connected by hinges. It’s a phantom body.

As a child grows up, the body schema adjusts to the changing body, but its adaptability has limits. A phantom limb is a stark reminder of the errors that the body schema can make. The truth is, we all have phantom limbs superimposed on our real ones. Lord Nelson lost the real one but kept the phantom.

After studying the body schema for many years, I became interested in how the brain models another part of the self. Not a physical part like an arm, but a computational part. If the brain describes the physical body in ghostly, incomplete terms, how much more mystically would it describe a non-physical trait like computation?

One of the most crucial computational processes in the brain is attention. The word “attention” has many colloquial connotations, but in neuroscience it has a specific meaning. Attention is the selective enhancement of some signals over others, such that the brain’s resources are strategically deployed. In some ways attention is like a computational hand—it’s how the brain grasps things.

The brain needs to control its attention, just as it controls the body. To understand how, we can gain some insight from control theory, a well-developed branch of engineering theory that deals in the optimal ways for complex systems to work—whether those systems dictate the airflow in a building, traffic patterns in a city, or a robot arm. In control theory, if a machine is to control something optimally, it needs a working model of whatever it’s controlling. The brain certainly follows this principle in controlling the body. That’s why it computes a body schema. Since the brain can control its attention exquisitely well, it almost certainly has an attention schema, a simulation of its own attention.

But what kind of information is in that attention schema? How would it describe something as hard to pin down as attention? Presumably it would describe abstracted properties, not precise or microscopic details. It might describe attention as a kind of mental grasp, a personal experience, something located inside me that seizes on the things around me and empowers me to react to them. But it wouldn’t contain information about neurons or synapses. It wouldn’t describe the actual physical mechanisms of attention. Just as the body schema is a surreal description of the body, so the attention schema would be a surreal description of attention.

Here’s how a brain with an attention schema might behave. First, it would have a nuanced control of attention. Second, if it had an ability to translate internal information into words, it might make some strange, physically incoherent claims based on that attention schema. It wouldn’t claim, “Well look at that, my cerebral cortex has an attentional enhancement of the visual signal of that sandwich in front of me.” Instead, going off the incomplete information in its attention schema, it might say, “I’ve got a non-physical, subjective experience of that sandwich. You know, the feely thing inside me. Consciousness.” That’s the brain’s caricature of attention. Of course the process is not limited to sandwiches. The same logic applies to consciousness of any object in front of you, consciousness of a memory that you’ve just recalled, or consciousness of yourself as a person.

This is called the attention schema theory, a theory that my lab has been developing and testing experimentally for the past five years. It’s a theory of why we insist with such certainty that we have subjective experience. Attention is fundamental. It’s present in almost all animals. To help control it, the brain evolved an attention schema. Because of the quirky information contained in the attention schema, the brain-machine claims to have a conscious experience of things. Consciousness is phantom attention. Without resorting to magic, mysticism, hard problems, or spooky soul energy, the theory explains the behavior of us humans who claim—who swear up and down and get testy when challenged—that we have a ghost in the machine.

Lord Nelson may have been right when he said that a phantom arm is made of the same stuff as the soul. It’s all information in the brain.