There is [some evidence that butterflies and moths can retain memories](https://theconversation.com/despite-metamorphosis-moths-hold-on-to-memories-from-their-days-as-a-caterpillar-29859) from their caterpillar stages. The best explanation as far as I’m aware is that the caterpillars don’t *completely* dissolve as scientists once thought but instead parts of the brain (and probably some other stuff) remain intact throughout.
Latest Answers