A Memory That Exists Between Cockroaches

Groups of American cockroaches can continue occupying a shelter after environmental cues change, even though isolated individuals quickly move elsewhere.

Experiments and simulations suggest that no cockroach needs to remember the original choice. Instead, each insect follows simple rules: prefer suitable shelter and remain longer where others have gathered. Once the group becomes large enough, social attraction outweighs the changed environmental signal, storing a persistent collective state in the network of interactions rather than in any individual.

https://www.sciencealert.com/a-cockroach-collective-memory-emerges-from-their-social-networks-study-suggests