As for where these memories are coming from, the researchers don’t really know. They speculate that the memories might be stored elsewhere in the body, perhaps in the neurons that make up the worm’s nervous system (see the network diagram in the image above). It is possible that the nervous system also learns something during training, and then somehow these neurons play a role in the recreation of old memories when the brain is regenerated.
A lot more research will need to be done to work out exactly what’s going on here — and more importantly, whether other animals, including humans, also store memories outside of the brain.