Whales are the biggest animals living in the ocean, and include the largest creatures ever to have lived. Within this group of giant animals, sperm whales hold a unique record: they are the largest hunting animal with teeth.

Sperm whales are powerful predators. They plunge into the freezing blackness of the deep ocean, hunting for squid - including the giant squid.

But they also have rich and varied social lives. They live in family groups and support each other.

The latest research suggests that sperm whales' extended families are just as important to them as our own. The whales' social lives are crucial to their success.

"Female sperm whales are likely able to recognize individuals and families, accumulate social knowledge, and recall their interaction histories over very long periods of separation," says Dr Shane Gero at Aarhus University in Denmark.

His team's research, published in the journal Animal Behaviour, shows that sperm whales have specific preferences for others, in the same way we might have a favourite cousin or aunt.

These preferences remain consistent for years, suggesting that the whales remember their distant friends and relatives despite spending most of their lives apart.

For ten years, Gero and his team tracked 20 families off the coast of the Caribbean island nation Dominica. In total they spent 3,500 hours monitoring them.

Each time the whales dived for food, the researchers took photos, noting which whales spent most time together. Individuals were easily identified by unique markings on their tail fins.

At night, the team followed their echolocation clicks. Sperm whales have extremely powerful sonar systems, used for hunting prey, which can be heard from 1km down.

No one has tracked families of sperm whales for so long before. It enabled the team to establish a detailed picture of their social preferences.

"Imagine if we followed you around for days taking a picture of who you were with and what you were doing every couple of hours," says Gero. "By the end of a week, we would have a good idea of who your family was, who you lived with, who your work friends were and why you avoid your boss."

"Sperm whale family life is surprisingly similar to ours," Gero says.

A typical family consists of about seven individuals and can span three generations of females. Males mostly live solitary lives.

For short periods, sperm whale groups also socialise with other families. They will typically spend just a few days together before going their separate ways.

These families must have known each other for more than the 10-year span of the study. They all live in the same seas, cut off from other sperm whale populations.

"We know that these families have lived in the Caribbean Sea for decades based on photos, and likely even centuries based on their life history," says Gero.

"Social bonds are important," says Gero. "Sperm whale life, it seems, is about building strong relationships with those around you."

For one thing, the whales find safety with their families. Living in groups offers protection from predatory killer whales, which hunt young sperm whales.

"In a vast and dark ocean, where prey is patchy and unreliable, like it is for the nomadic sperm whales, the most consistent thing in your life is your family," says Gero.

The findings suggest that losing even one whale from a family could be devastating for the rest of the group, says Gero.

"Individual whales are not interchangeable," he says. "The loss of an individual changes the social network and impacts the lives of many."

Sperm whales are no longer targeted by whalers, but before the hunting stopped hundreds of thousands were taken.

Nowadays they face other threats, including disruptive noise from ships and the danger of becoming entangled in fishing nets.

The group they belong to, the toothed whales, has lived in the ocean for longer than humans have walked upright.

"They have lived in parallel to us, mostly unnoticed below the surface, for generations," says Gero. "The weight of their shared history should greatly affect our conservation goals for the ocean."

Follow Melissa Hogenboom and BBC Earth on twitter.