We learn about the world in two basic ways: directly and indirectly. When it comes to figuring out who wants to eat you, indirectly has the edge.

Many aquatic species such as fish rely on chemosensory information to communicate with each other. When a fish is wounded, it releases chemicals that act as an alarm call to other fish in the area: swim for cover, or you could be next. But these chemical signals can do much more than warn of immediate danger.

In one study, published last year in Animal Cognition, researchers at James Cook University in Australia exposed damselfish to chemical secretions from a distressed (okay, dead and sliced) fellow damselfish. At the same time, fish were also exposed to the scent of a second, unknown fish. If the damselfish was capable of forming an association between the distress signal and the scent of the other fish—of learning, that is, that the unknown fish was probably a predator—then in the future the predator’s scent alone should inspire fear. (In this study fear was measured by inactivity and reluctance to venture far from shelter.) Indeed, this was exactly what the researchers found.

More interesting, however, is the fact that naïve damselfish—fish that had never gotten a whiff of their wounded brethren, nor linked the slaughter to the second fish—nonetheless learned to be afraid simply by watching how other, more experienced fish responded to the scent. In this manner, a single witness to a hapless encounter can teach an entire school a long-lasting lesson about the difference between friend and foe.

Long-lasting, but not necessarily forever. Given that animals’ environments change over time (as food sources, predators, and even the animals themselves change), forgetting a fearful association can sometimes be a good thing. Consider a study recently published in the open-access journal PLOS ONE.

A tadpole’s growth is affected by the temperature of its water: it will grow much more quickly in warm water than cool. Researchers placed a group of woodfrog tadpoles in cool water and a second in warm water for eight days. They then taught both groups of tadpoles to fear a predator—a tiger salamander—by simultaneously exposing them to salamander scent and crushed tadpole. Subsequently, half of each group of tadpoles was plunged into warm water and the other half into cool.

After another eight days, all four groups of tadpoles (warm-warm, warm-cool, cool-warm and cool-cool) were again exposed to the salamander’s scent. The warm-warm tadpoles, which had grown the largest, responded least to the salamander scent. The cool-cool tadpoles, which had grown the least, responded most fearfully. The other two groups fell somewhere in between.

Though it’s impossible to rule out the possibility that the fast-growing tadpoles were simply less afraid of the salamander than the slower-growing tadpoles were (perhaps due to increased power and swimming speed), the researchers actually suspect that differences in memory were the cause.

The relatively high temperatures, the researchers believe, shortened memory spans. Eight-day-old memories (or at least the extent to which they drove behavior) may have become increasingly less relevant to the tadpoles as they—literally—outgrew their old fears.