In episode eight of Westworld, Dr. Robert Ford offers a grief-stricken Bernard an escape route that has eluded real-world scientists for decades: The ability to forget instantly. Bernard, who has just committed murder, is wracked with guilt, but Ford has the ability to wipe his memory clean, freeing him of his emotional pain. The same option might be available in real life sooner than we think.

A new study, published in the inaugural issue of Nature Human Behavior by researchers from Japan, the United States, and the University of Cambridge describes a technique for erasing bad memories and replacing them with new ones using a combination of artificial intelligence and neuroimaging. Their method isn’t as instantaneous as clearing a hard drive, but it sidesteps the need to cause fear as part of the process. This is a huge step up from older techniques for clearing phobias and bad memories, which often require people to confront their fears head-on, not unlike Bruce Wayne and his cave full of bats.

 In 'Trace Decay,' Ford offers to wipe Bernard's memory from his painful memories.
 In 'Trace Decay,' Ford offers to wipe Bernard's memory from his painful memories.

In their process, they used brain imaging techniques to visualize what the brains of volunteers looked like when they were recalling specific fearful memories — in this case, a small electric shock administered to them after they looked at a computer image. The pattern of activity that flashes across their brains when they recall this scary event is captured by A.I., which uses that snapshot to detect in the brain when that memory arises again.

Surprisingly, those patterns did show up again, but not necessarily when patients were recalling the scary memory. Partial features of the fear pattern, the researchers found, occasionally flickered through the brains of the volunteers when they were at rest, but their appearance didn’t mean the volunteers were feeling fearful at the time. Taking advantage of this fact, the scientists reasoned that they could override the association between the brain pattern and fear with a better, more positive association, like a cash reward.

Every time the volunteers’ brain scans showed a part of the fear-based pattern, the researchers gave them money. Doing this allowed their previous associations to slowly erode and make way for new, positive ones — without ever having to actively remember the fearful memory.

“In effect, the features of the memory that were previously tuned to predict the painful shock, were now being re-programmed to predict something positive instead,” Ai Koizumi, Ph.D., who led the research, said in a statement.

The fearful memory of the shock-causing photograph was confirmed to be erased when the researchers showed the photograph to the participants, only to find no fear-based physiological responses, like skin sweating or high activity in the amygdala.

While this particular technique was only tested on 17 people and is specific to one particular phobia, its theoretical basis could soon turn neuroscientists into Dr. Fords, giving them the ability to rewrite memories in humans crippled by PTSD or phobias. As Ford says in Westworld, it’s often “best to move forward with clear eyes.”