The metamorphoses that caterpillars undergo rank among the most radical transformations in the animal kingdom. So it's rather amazing that a butterfly or moth can remember things from its caterpillar days.

Amazing, but true, a new study finds.

"The broadly held view of what happens during metamorphosis is that the body of the caterpillar turns into soup and gets rearranged into the flight machines that the adult turns into, and any leftovers are thrown away," said researcher Martha Weiss, a behavioral ecologist at Georgetown University in Washington.

Given the drastic nature of these changes, scientists have for a hundred years been interested in whether memory can survive metamorphosis, said researcher Doug Blackiston.

The researchers investigated close relatives of the caterpillars called tobacco hornworms, which pester tomato growers. Blackiston, Weiss and their colleague developmental biologist Elena Casey trained tobacco hornworm caterpillars to avoid a specific odor — ethyl acetate, the smell of nail polish remover — when they got a whiff at the same time as a mild electric shock.

The scientists found caterpillars that learned to avoid an odor when they were younger than three weeks did not retain this response as adult moths. However, older caterpillars remembered to avoid the odor after their metamorphoses. In other words, the more mature a caterpillar's brain was, the more memories carried over.

"It doesn't make sense to throw away a perfectly good brain, and even if a caterpillar's brain isn't quite right for a butterfly's or moth's body, it makes sense there are components in the brain that are worth preserving," Weiss told LiveScience.

Although vertebrates such as humans and invertebrates such as caterpillars are quite different, "it might be possible to look at metamorphosis, which involves an extensive reorganization of the nervous system, and maybe use those results to look at brain reorganization in vertebrates after damage such as a stroke," Weiss added. "That's going out on a limb a bit, but not beyond the realm of possibility."

Blackiston, Weiss and Casey detailed their findings in the March 5 issue of the journal PLoS ONE.