At the turn of the twentieth century, Ivan Pavlov conducted the experiments that turned his last name into an adjective. By playing a sound just before he presented dogs with a snack, he taught them to salivate upon hearing the tone alone, even when no food was offered. That type of learning is now called classical—or Pavlovian—conditioning. Less well known is an experiment that Pavlov was conducting at around the same time: when some unfortunate canines heard the same sound, they were given acid. Just as their luckier counterparts had learned to salivate at the noise, these animals would respond by doing everything in their power to get the imagined acid out of their mouths, each “shaking its head violently, opening its mouth and making movements with its tongue.”

For many years, Pavlov’s classical conditioning findings overshadowed the darker version of the same discovery, but, in the nineteen-eighties, the New York University neuroscientist Joseph LeDoux revived the technique to study the fear reflex in rats. LeDoux first taught the rats to associate a certain tone with an electric shock so that they froze upon hearing the tone alone. In essence, the rat had formed a new memory—that the tone signifies pain. He then blunted that memory by playing the tone repeatedly without following it with a shock. After multiple shock-less tones, the animals ceased to be afraid. Now a new generation of researchers is trying to figure out the next logical step: re-creating the same effects within the brain, without deploying a single tone or shock. Is memory formation now understood well enough that memories can be implanted and then removed absent the environmental stimulus?

At the forefront of this project is the University of California, San Diego, neuroscientist Roberto Malinow. Ever since he was a medical student at N.Y.U., Malinow has been fascinated by the synapse, the small space between nerve cells that controls their communication. How, he wondered, could something so tiny control such complex, precise processes, with hundreds of molecules coming together to determine whether and how a memory will form? After finishing medical school, Malinow went on to complete a Ph.D. in neurobiology at the University of California, Berkeley, to better understand the nature of the neural process that had so captured his mind.

As far as scientists understand it, memory is formed by a process of synaptic modification: connections between synapses become either stronger (long-term potentiation, or L.T.P.) or weaker (long-term depression, or L.T.D.). In the first case, we learn something new—for example, that Malinow was born in Argentina. In the second, we forget something old, like the name of an elementary-school substitute teacher. Understand that process finely enough and, in theory, you might be able to affect how it unfolds. After twenty years, that’s the point that Malinow believes he and his fellow researchers have reached. “We’re finally getting close to understanding a lot of it,” Malinow told me. “It’s exciting to be able to start from synapses and synaptic manipulations and apply that to an animal and see how it changes its behavior.”

By combining his understanding of synaptic modification with the increasingly sophisticated technology being developed and refined by neuroscientists and neurophysiologists, Malinow believes that he has the potential to do something revolutionary: erase a memory or reactivate it at will. In a series of studies published in July in Nature, Malinow and his colleagues have shown how to do exactly that—in a rat, at least.

The underlying approach of Malinow’s work is modelled on the familiar paradigm of learning through conditioning, something that Pavlov and LeDoux both had experimented with decades earlier. What Malinow and his colleagues decided to do was simulate this process directly in the brain of rats, using a new technology, optogenetics, that allowed them to control the synapses that connect the hearing centers (the parts of the brain that respond to and learn about the tone) to the fear centers (the parts that respond to the electric shock). Optogenetics relies on the ability to insert a protein into nerve cells that will make them sensitive to light. Researchers can then activate the cells by exposing them to a light pulse: each time the light hits the cells, the nerve fires. The procedure is an invasive one: not only do researchers need to insert the biomarkers into nerve cells—in this case, ones in the brain—but they need to perform extensive surgery to be able to stimulate those markers with a light. In this study, for instance, Malinow implanted an optical fibre into the brain, securing it in place with screws and attaching it to the skull with dental cement.

First, Malinow’s team used Pavlovian conditioning to teach the rats to fear a tone: each time the tone sounded, they would feel an electric shock in their feet. Soon, as predicted, they froze at the tone itself. Then, the U.C.S.D. scientists did away with both the tone and shock. Instead, they stimulated the relevant nerve cells—the route between the hearing centers and the fear centers—by shining a blue light pulse. The rats froze, as though they had heard the tone. Not only had the researchers created a memory but they could trigger it without making any environmental changes.

They then went a step further: if they could use light to make a rat react as though it were recalling a painful shock, perhaps they could also use it to make the memory of the shock go away. The idea is closely related to the notion of modifying memory—reconsolidation, the process in which we recall a memory and, often, subtly change it as we do. (It’s described in detail in Michael Specter’s recent piece for the magazine.) However, instead of working at the level of the stimulus (desensitizing a rat’s memory by playing a tone repeatedly without a shock), you would do it at the level of the synapse. For fifteen minutes, the researchers stimulated the nerve cells that had been responding to the tone and shock in a pattern that has previously been shown to cause L.T.D., the rough equivalent of playing the tone repeatedly with no ill effect. By the end of those fifteen minutes, the rats had forgotten their fear: they no longer froze. Using light stimulation alone, Malinow’s team had been able to extinguish the memory completely.

Then the researchers went even further: if they could extinguish a memory, could they also reactivate it? They re-stimulated the cells in the pattern they had used before to form the memory. The animals froze again. A memory that had seemed to vanish was once again front and center—and no sounds or shocks had been used to recover it. “We could turn this memory off and turn it on and turn it off again, pretty much at will, by modifying synapses in very predictable ways,” Malinow said. “For tens of years, people had been studying synapses with the idea that they were the building blocks of memory. This was a fairly straightforward way of showing that’s the case.” In other words, scientists had long thought that they knew how memories were formed and weakened, and now they had clear, cell-level proof of it, as well as a way of strengthening and weakening memories directly.

The ultimate goal, of course, is to move from rats to humans. Could this technique eventually be used to erase painful memories, depressing memories, and even happy memories that are no longer wanted in an “Eternal Sunshine”-like process? Human memories, of course, are more complex than rats’, and a single recollection can be stored across multiple parts of the brain, but Malinow believes that modification may one day be possible. “The way we think of complicated memories is that they activate a circuit of different nerve cells,” Malinow said. “But they’re all connected by synapses that are very similar to the ones we study. If you were able to weaken some of those synapses in a complicated memory, you would be able to inactivate it in the exact same way.” To him, it’s a question of quantity, not quality: no matter how nuanced the memory, if we can correctly target all of the synapses that it activates, we can cause it to grow weaker or stronger. The findings are not so much about promoting optogenetics as the method of choice—a difficult prospect in humans because of its invasiveness and the need to know precisely which cells to stimulate—but about the possibilities that the success of this approach suggests for memory alteration more broadly.