There really isn't a whole lot you can do to avoid being eaten when you're trapped inside an egg and your parents are nowhere to be found.

Still, the embryo of the pharaoh cuttlefish (Sepia pharaonis) gives it everything it's got. Researchers have found that when faced with a common predator, the unborn cephalopod does its best to avoid detection – including holding its breath.

Not only is it pretty incredible behaviour, it's also the first evidence that invertebrates can learn while in utero, just like humans and other vertebrates.

Researchers have known for a while that cuttlefish can respond to light and other stimuli while they're still developing inside an egg.

So scientists from the University of Caen Normandy in France and National Tsing Hua University in Taiwan searched for clues that the embryos could not only sense visual and chemical clues, but use them to identify and respond to threats.

Since dad dies soon after copulation, and mum follows once the eggs are laid, there's really not much the kids can do when faced with danger.

As if nature has a bad sense of humour, the egg casings of the pharaoh cuttlefish also turn transparent enough for their occupants to see their surroundings in the days before hatching, giving them a front row seat and no way to escape.

All they can do, it seems, is hold their breath, stay still, and hope it all goes away.

In fact, the researchers showed that even before hatching, the embryos were able to see a threat and alter their breathing rate in response.

To figure this out, batches of these see-through eggs were placed inside clear containers, which were in turn dunked into a larger tank containing a natural predator – a pufferfish.

Sure enough, their ventilation rate in the cuttlefish fell to the equivalent of 'freeze and hope it's your sister that gets chomped'.

Adding cuttlefish ink to the tank got a similar response. Adults also notice when their cousins have inked themselves to avoid trouble, so it's unsurprising that the response is wired in from before birth.

Just to make sure it's a predator thing, the team popped the egg containers into a tank with clownfish, which aren't known to have a taste for baby cuttlefish. In response, the cuttlefish barely changed their breathing rate, suggesting that it's only predators that have them holding their breath. 

Interestingly, the team found they could combine the ink with the clownfish to 'teach' them to react to a non-predator.

After being exposed to both the clownfish and ink for four days, the cuttlefish's ventilation rate started to slow down on sight and smell of the harmless fish alone.

Yes, essentially the researchers made cuttlefish terrified of clowns.

Whether they're noticing the visual patterns or something more general, like movement, is not yet clear.

Vertebrates, such as humans, are commonly understood to learn while in utero, but this is the first evidence that invertebrates can do this as well.

The research was published on the pre-print site, bioRxiv.org, so is yet to have the thumbs up from reviewers.

But given the potential intelligence of cephalopods, maybe this advanced education isn't all that shocking.

It does make these awesome aquatic animals all the more amazing. 

You can read the full study on bioRxiv.org.