For decades, my father taught biology at Middlebury College in Vermont. One of his signature courses focused on invertebrates and, as a kid, I’d often tag along on class field trips to the Maine coast. Students would fan out across the rocky shore at low tide and count as many spineless creatures as they could—which, as it turns out, was pretty easy. There were dozens of invertebrate species to be found, including snails, crabs, starfish and, of course, lobster.

I didn’t lay eyes on an octopus, however, until I was about 8. My dad sporadically hosted a lunch for his class, to which he brought an assortment of invertebrates. Students would discuss each specimen, identify its various parts, and then eat it. That year there happened to be leftovers, which my dad brought home for dinner. He reached into a plastic bag, pulled out a greyish-pink gelatinous blob, and put it on our kitchen table.

My sister and I took note of the eight arms covered in dozens of tiny suckers, slowly realizing what was happening, as my dad fought to cut the meat, which had been poorly cooked, into manageable portions. It tasted like salty bubble gum, and my sister and I spat it out.

In early 2017, some 20 years after first encountering an octopus, I went to Mexico’s Yucatán peninsula to meet Carlos Rosas, a biologist who aims to revolutionize how those gelatinous blobs wind up on dinner tables.

People are now eating more octopus than ever: annual global production has more than doubled since 1980, from roughly 180,000 tons to about 370,000 tons. But overfishing has already caused the collapse of multiple wild-octopus fisheries around the world, and current populations likely face similar threats. Rosas believes inland aquaculture—raising the animals from birth to adulthood in captivity—could be one way to meet increased demand without devastating the wild population. The approach has been tried with a variety of other marine animals, such as shrimp, salmon and tilapia, but octopuses have remained a stubbornly vexing puzzle. However, as the stability of wild populations has become more uncertain and the economic stakes have risen, teams in Spain, Japan and elsewhere around the world have also made significant progress on the surprisingly complex science behind octopus rearing.

Critics find the prospect of cultivating such sentient animals for food barbaric. They point out that research shows the animals are highly intelligent, exhibiting complex behaviors incompatible with the enclosed environments of aquaculture. Rosas argues that it may actually be the best way to protect the species over the long term. And, hovering between a prototype and commercial scale, he’s at the forefront of the increasingly intense quest to build the world’s first octopus farm.

Rosas’ lab is perched at the edge of the Gulf of Mexico, on the National Autonomous University of Mexico (UNAM) campus in the Yucátan town of Sisal. It’s in a white-and-blue cinder block rectangle building about a quarter the size of a football field, with 55 PVC pipe-ends sticking out of the wall facing the sidewalk. They don’t serve a purpose, said Rosas. The architect just thought they resembled octopus arms.

Dr. Carlos Rosas by one of the 24 octopus containers at his lab in Mexico's Yucatán Peninsula. Jake Naughton for TIME

Rosas immediately brought me to the egg incubation room, pausing momentarily to fetch a headlamp. The room was dark and cool, lit with a dim red light. “This was designed to imitate a cave,” said Rosas. “We maintain more or less the temperature and the light that the animals experience in the ocean.” Inside was the product of nearly 20 years work of scientific research: 24 plastic containers filled with seawater and hundreds of octopus eggs.

Rosas pointed his headlamp toward the eggs, which resembled tiny bunches of white grapes on the vine. In the wild, spawning females attach these egg-strings to the roofs of their dens, where they dangle like extremely fragile stalactites.

“They’re hatching,” said Rosas, who, despite having seen this hundreds, if not thousands, of times, still sounded giddy. “You’re a lucky man.” At the end of the headlight beam, I could see a gaggle of baby Octopus maya. Their bodies were only about the size of a fingernail and translucent; hardly the softball-sized, intelligent beings they would grow into. Little arms wisped out behind them as they squirted around the enclosure. A few were even taking their cautious first steps up the plastic sides.

The Yucatán octopus-fishing season runs from August to December. When the weather is calm, thousands of fishermen leave their houses before dawn and head for the water. To reduce costs, the men form groups, lash their individual alijos—small boats—together into a makeshift pontoon and share one motor per team.

Once they arrive at the day’s fishing spot, the fishermen disperse. Each of their alijos is equipped with at least two (and sometimes more than a dozen) long wooden sticks called jimbas, to which the fisherman attaches his lines. He then ties a soft-shell crab to the end of the line and drops it into the water. The alijo drifts with the current, dragging the bait along the ocean floor. When a hungry octopus catches sight of the passing crab, it attacks, wrapping its arms tightly around its prize. Alerted by the jerk of his jimba, the fisherman starts reeling in the string. The octopus, focused on its meal, hangs on to its catch until it lands in its captor’s hands. If the fisherman can’t immediately wrest the octopus off the line, he pokes it in the eye with his finger.

Cob Reyes and Plata Diaz scout the waters for octopuses to catch. Jake Naughton for TIME

The chief merit of the jimba technique, whether by accident or design, is its built-in ecological safeguard. When a female octopus is ready to lay her eggs, she first finds a place to hide—caves, coral or some other ocean cavity will suffice. Sometimes she decorates her lair with stones and shells. Here she deposits her eggs for the only time in her one-to-two-year life, and protects them fiercely. She doesn’t come out, and doesn’t eat. The eggs are her only concern. A passing jimba-drawn crab, then, is of no interest to her. The mother’s selflessness, and the inherently selective nature of the jimba method, save both her and her babies from human hands.

Fishing with jimba is the only legal way to catch octopuses in the Yucatán, but the industry is unevenly regulated. While the government prescribes a quota, understaffed authorities can’t keep accurate count or do much to prevent illegal fishing, leaving the fishermen to more or less regulate themselves. Given the immediate financial pressures, many locals fear that Mexico’s octopus fisheries could go the way of the rest of the world—where massive trawling nets sweep through the ocean, indiscriminately hauling up octopuses of all genders and ages without regard for the ecological fall out.

Morocco, for example, was once the largest octopus supplier in the world. In 2000, the country caught 99,400 tons of octopus, more than twice the haul of Japan, its nearest competitor. By 2004, it had dropped to just 19,200 tons. The Moroccan government has since tried to better regulate the industry by imposing quotas and fishing moratoriums, but despite some modest success, it’s doubtful the country’s octopus fishing industry will—or should—ever return to their previous heights.

Other countries have since taken up the octopus-production mantle. According to the latest reliable data, from 2014, China had far and away the largest octopus catch—a whopping 120,000 tons (as recently as 2000, the country produced a mere 4.6 tons). Japan and Mexico, 2014’s second- and third-largest producers, hauled in 35,000 tons and 34,000 tons, respectively.

No one knows exactly how much more global octopus production can grow before the industry all comes crashing down. Moreover, overfishing’s deleterious effects will potentially be exacerbated by climate change. In the short term, warming waters may benefit cephalopods, but some experts, including Rosas, worry that current octopus haunts will ultimately become uninhabitable, leading to mass migrations or population declines.

Commercial farming, Rosas says, could be the solution. But to date, no one has cracked it.

When Rosas was a teenager in the early 1970s, he built his first aquarium in his parents’ garage. “We produced a lot of guppies,” he remembers of the endeavor, which he undertook with his friend from down the block. They sold their small crop as pets to other children in their Mexico City neighborhood.

Within a few years, Rosas’ love of sea creatures had lured him into a biology program at the national university. Those studies led to a doctorate, and a dissertation on rearing crabs—a practice still in its nascent stages at the time. He looked into raising them in floating cages, but before he could make much headway the country’s scientific attention, and resources, shifted to shrimp, which the government saw as the next frontier of Mexican aquaculture. Rosas and his colleagues duly switched their focus to shrimp, and on a shoestring budget, created what Rosas called a “very primitive laboratory” with second-hand equipment in a dirt-floor building. They gathered water for the lab by paddling an already rickety boat out into the ocean, allowing it to sink slightly, and hauling back whatever the vessel could carry.

The makeshift operation, he says, produced some of Mexico’s first captive-raised shrimp. But the triumph was short lived, as bigger and better-funded operations quickly blew past their relatively limited production capabilities. Bored and in search of a new project, it wasn’t long before Rosas found one. The local government on the Yucatán peninsula was apparently looking for someone to explore octopus aquaculture.

In 2003, a reinvigorated Rosas moved his operations to the lab at Sisal and began reading everything he could about the subject. Progress was slow, but he was captivated. “For me, it was a new girlfriend,” Rosas says. Jose Iglesias, a Spanish octopus expert and a long-time leader in the aquaculture community, remembers an early visit to the lab with a laugh: “He didn’t know anything.”

In all fairness, scientists have long struggled with octopus farming.

The difficulties with raising octopuses begin at birth. Many species, including Octopus vulgaris, the common octopus, hatch into what is called a paralarval stage, a phase of development unique to certain octopus, cuttlefish and squid. Paralarval octopuses have stubby, almost non-existent arms and float around like plankton. They drift through the water column, completely at the whim of the currents, and suck up whatever microscopic food they can as they grow toward adulthood, when they will eventually settle on the bottom of the sea. Replicating these early phases of life in a laboratory is a monumental undertaking—but not impossible.

Claudia Patricia Caamal Monreal, 36, who helps in Dr. Rosas' lab, shows off an octopus in one of the lab’s rooms where they lay eggs. Jake Naughton for TIME

What is widely considered the first closure of the octopus lifecycle came in 1962, when a Japanese scientist named Kouzo Itami and his team raised vulgaris hatchlings until the larvae grew old enough to settle on the tank floor. There were 200 hundred animals to start the study; by about 40 days in, when those that remained reached that adult stage, there were fewer than 20. The rest, the researchers wrote, succumbed to “cannibalism and creeping out of their rearing water.” The study was a success in many ways, but the abysmal 9% survival rate was far from commercially promising.

Starting in 1975, much of the world’s cephalopod research came out of the National Resource Center for Cephalopods, in Galveston, Texas. Scientists there were able to reliably raise their own cuttlefish across generations and their findings offered invaluable insight into how octopuses could be reared as well.

The work suggested that the Japanese success was not a fluke, and by the 1990s, researchers in octopus-hungry Spain had also taken up aquaculture. In 2004, Iglesias announced arguably the largest advancement since Itami, when his lab in Spain also closed the lifecycle of Octopus vulgaris, this time with a survival rate of 31.5%. While more than triple Itami’s rate, it was still far from marketable. The animals were just too finicky. Even small fluctuations in temperature, dissolved oxygen levels or salinity—among a multitude of other factors—can be deadly (not to mention the cannibalism problem). And controlling these variables only gets more difficult at scale. But Rosas says that given enough resources, the challenges are surmountable. “With money,” he says, “in one year it could be solved.”

One of Rosas’ crucial advantages is that he works with Octopus maya, rather than the Octopus vulgaris. This species of octopus, endemic to the Yucatán, skips the paralarval stage and is born as essentially a miniature adult, making them significantly hardier.

Regardless, raising octopuses—maya or otherwise—from egg to harvest turns out to be exceedingly difficult.

Back in Sisal, Rosas took me to a room adjacent to the incubator to show me his then-latest solution to what is arguably the largest remaining hurdle in octopus aquaculture: how to efficiently feed the babies.

He opened the top of a large cooler: inside, sitting on red lunch trays, were rows and rows of white half-shells, each about the size of a quarter, filled with a dollop of pink paste that Rosas identified as a mix of squid and crab. Workers assemble these shell-paste combinations by hand, one by one, and feed them to the octopuses individually. Three shells in the morning, three in the afternoon and each baby usually enjoys a few more in between. The lab can go through thousands of shells a day. The babies, as Rosas put it, are “voracious.”

The shells are labor-intensive and expensive. But, Rosas says, they’re highly nutritious, and once on the diet, the octopuses grow exponentially. Born at only 100 milligrams, after a month they’re already 10 times that size. After a few months, an Octopus maya weighs one to two kilograms, or 10,000 to 20,000 times what it weighed at birth.

Rosas says his survival rate hovers around 60% to 70% percent; double Iglasias’ from the early 2000s. As his octopuses mature, Rosas moves them to either large tanks in the main research area at the center of the building, or to the six-meter diameter pools just outside, depending on space. He took me to the interior tanks first. The water in the black, rectangular tubs was a few inches deep and littered with small shells and rocks, under which the octopuses like to hide. Peering down, I saw an octopus no bigger than my palm poking out of the shell it had chosen to occupy. In its clutches was another, smaller, octopus. “If you don’t feed them well,” Rosas said, “they will prefer their half-brother.”

A lab-grown baby Octopus maya takes shelter under a shell in its tank. Jake Naughton for TIME

Rosas tries to combat cannibalism with ample food and space. But his facility has steadily grown in size, and is at capacity. Science funding in Mexico is hard to come by, Rosas says.

He has long toiled on the low-cost road. In the late 2000s, Rosas approached a local women’s cooperative to ask for help tending his octopuses. He offered a trade: if they helped raise the babies to adolescence, they could sell them and keep the proceeds. One of the four women who agreed, Silvia Canul, told me her husband, Antonio Cobb, a local fisherman, was against the idea at first. “He thought I was wasting my time,” she says.

The cooperative cropped its first batch of octopuses in 2012, and the market quickly scooped them up. Chefs bought up the 200-gram juveniles—whose tenderness is coveted—for 80 pesos apiece, four times the market price for wild-caught adults. With the proceeds, Canul bought a white pedal-powered cargo tricycle. When Cobb saw the new bike, he developed a sudden interest in the cooperative. He now works farming octopuses at Rosas’ lab too.

The learning curve was steep, even for Cobb, a fisherman who has spent most of his life around the animals. The simplest sounding tasks, like figuring out the sex of octopus, for example, require inordinate patience. (Cobb says you have to look for a thin, vein-like ridge running along the third right arm of a male octopus. This tube carries sperm out the tip of the arm and into the female.)

Canul finds handling the octopuses difficult as well; the animals like to latch on to human arms and hands with their suckers. Initially she had to soak the octopuses in a rubbing alcohol solution to make them “drunk” and more controllable. She’s getting better; the trick, she says, is to keep them submerged in the water. But neither Canul nor Cobb has found a solution to inking. “Straight to the face,” he grumbles. “You look at them and they ink.”

The cooperative’s success can’t, however, solve Rosas’ inability to secure additional real estate for his venture. At one point the government granted the cooperative a new plot of land in Sisal, along with 1.5 million pesos (about $79,000) to build a pilot farm, but a local politician in the property-scarce town announced he had already allocated the parcel for a housing development, dooming the project. A few years later, one of Rosas’s former graduate students approached him about trying to build a farm in a city called Hunucma, about 15 miles inland. They initially made great progress—finding land (the student’s backyard), clearing it, drilling two wells, and even buying six of the 12 tanks (each with a capacity for up to 3,000 octopuses) that they would need.

There were certainly challenges. It was unclear, for example, how they were going to harvest octopuses en masse. The most humane method is apparently to lower the temperatures in the tanks. But when you do that, the octopuses suction themselves to the floor by the hundreds and have to be removed one by one. Sucker by sucker.

Still, all seemed on track until one investor lost his job. The others soon grew weary of the endeavor as well. While they recently installed a few tanks on the property to raise tilapia, any octopus ambitions are decidedly on hold.

Octopus cultivation is an incredibly labor intensive process, and the octopus must be fed by hand. Here, Caamal Monreal displays the food they feed the octopuses, which is a combination of ground-up crab and other sea creatures. Jake Naughton for TIME

Aside from Aristotle, who called the octopus “a stupid creature,” humans have long been captivated by the cephalopod. The Minoans, a seafaring Mediterranean civilization, celebrated the creatures on vases and frescos. Roman naturalist Pliny the Elder gushed about their clever method of wedging open mussel shells with pebbles in order to get to the food inside. In Japan, the tentacle has taken on sexual connotations; from 18th-century woodcarvings of octopus erotica to a modern form of animated pornography featuring the tentacle called tentai.

More recent years have seen an explosion of octopus celebrity. Hank was a sullen but heroic octopus in the kids’ movie Finding Dory. Paul, an ostensibly clairvoyant Octopus vulgaris, accurately predicted the results of all of Germany’s games during the 2010 soccer World Cup, including the final. Inky, a Pinnoctopus cordiformis, escaped from the national aquarium in New Zealand by shimmying through 164 ft. of drainpipe to freedom. A quick search on YouTube brings up endless footage of other octopus ingenuity: walking on two legs, opening jars and playing with Legos.

Despite their cultural ubiquity, octopuses have remained relatively niche scientific research subjects. A 1992 study in Science purportedly found that octopuses are “observational learners,” meaning they can figure out tasks just by watching another octopus perform it. In the animal kingdom, it’s a pretty high-level skill. But the article drew criticism from other researchers and has yet to be replicated.

There are, however, a few things we know more concretely about octopuses. Their nervous systems, for instance, are more decentralized that humans’: in addition to one main brain in their head, they have eight smaller neural centers in each arm. An octopus is also capable of recognizing another member of its species as an individual. They are known to be associative learners as well, meaning they can link new behaviors or responses to certain stimuli. “If an animal is shown a lever that results in a food reward, the animal will learn to press the lever and will do so progressively more rapidly and efficiently,” writes neuroscientist Eric Kandel in his 2016 book Reductionism in Art and Brain Science. In the lab, some octopuses have even been able to learn these kinds of responses after just one try.

In his 2016 book Other Minds: The Octopus, the Sea, and the Deep Origins of Consciousness, philosopher of science Peter Godfrey-Smith notes the high amount of variability between individual octopuses. For instance, in one lever-pulling study he highlights, two octopuses performed the task quite delicately, while the third yanked on the handle so hard it bent and, by the 11th try, broke.

There’s still a lot we don’t know about octopus intelligence, says Peter Tse, a neuroscientist at Dartmouth College in New Hampshire. Tse’s lab has been experimenting with mirrors to explore the octopus brain. When he first puts an octopus in front of one, they either run away or try to attack it, he says. Pretty quickly, though, they realize it isn’t another octopus.

“Some will sit in front of the mirror and groom,” says Tse. Pretty quickly, though, they realize it isn’t another octopus. They also seem to be able to use the mirror as a tool. Tse found that, with practice, the octopuses can recognize that a reflection of a crab in the mirror is just a reflection—­and can use the mirror to find the crab elsewhere in the tank. That, he says, implies that they have “pretty complicated three-dimensional representation of their tank.”

A baby octopus from Dr. Rosas' lab. Jake Naughton for TIME

In recent years, my father has been studying octopus behavior, and not long ago, he took me to meet his then current cohort of research octopuses. We put on white lab coats as we entered the octopus room, barely larger than a walk-in closet. There were two rows of four 30-gallon tanks containing the lab’s tenth batch of California two-spot octopuses (Octopus bimaculoides, aka “bimacs”). Each tank was labeled with the octopus’ ID number, date of birth, and name: Charlie, Piper, George, Mighty Joe Young, Franklin, Muh-Shell, Vader, Boo, and Swimmy.

It wasn’t feeding time, so most of the octopuses were tucked away in shells or flowerpots. But Mighty Joe Young, a 10-month-old female, was awake and bouncing around her tank. She met us at the glass as we approached, seemingly curious, so we gave her an orange Ping-Pong ball to play with. “She’s intrigued,” my dad commented as the octopus crept slowly closer to the ball floating on the surface. Mighty Joe stretched out one of her eight arms and touched the intruding object, cautiously exploring its surface with her suckers.

We watched as she backed away and came at the ball from another angle. Then again. For the next few minutes she moved to and fro, trying to figure out what had invaded her space. My dad laughed. “She’s wondering where the hell the crab is,” he said. “Okay, I’ll give her a crab.” He grabbed a fiddler crab from the stash on the counter behind him, and dropped it into the tank. As the crab floated down a few inches from Mighty Joe’s face, she sprung into action. The crab was gone in seconds.

Mighty Joe’s fluid movements were mesmerizing and it was easy to see how authors like Sy Montgomery are so fond of these creatures. Montgomery is the author of the best-selling book The Soul of an Octopus: A Surprising Exploration into the Wonder of Consciousness, which explores both the biology and personality of octopuses. Each chapter is named after an octopus she met at the New England Aquarium: Athena, Octavia, Kali. “I often had the feeling that the octopus I was watching was watching me back,” she writes. “How could that be?”

My dad has always been a bit wary of anthropomorphizing animals. “We infer all these things in the animal,” he says, “and that’s a dangerous thing to do in animal behavior research.” But, watching Mighty Joe Young, even he slipped up, wondering aloud, “what are you thinking, huh?”

The question of octopus intelligence is central to debates surrounding aquaculture. A January 2019 paper by New York University professor Jennifer Jacquet, for instance, argued that their smarts render farming an ethical cul-de-sac. One issue, she says, is that octopuses are carnivorous—meaning that farming would likely require “exploit[ing] wild animals to feed the farmed animals.” The other problem is that they are sentient beings. “Even the best intentioned octopus farming would not satisfy the necessary conditions to make an octopus’ life meaningful,” says Jacquet, adding that consumers have a rare opportunity to say no to the farming of an animal before it’s viable. “If we don’t, I think [this] will be a case where economic interest will win over moral imperative.” In a recent open letter Jacquet co-authored, over 100 academics signed on to the notion that octopus farming is unethical. “A life in solitary confinement for a curious mind is ethically wrong,” says Jacquet.

My dad, for one, gave up eating octopuses shortly after he began studying them—they’re too smart, he says. Rosas is less conflicted. He’s always loved to eat pulpo, and remembers his mom cooking it for him as a kid. She’d bring home the octopus, and it was his job to tenderize the meat. “I spent a lot of time hitting the octopus,” he says. Even after almost two decades of work with the octopuses, he’s never really found himself emotionally attached. The animals in his lab have numbers, not names.

It’s not that Rosas denies their intelligence, but rather questions whether they are really that much more unique than the multitude of other animals that we already eat for food. “Humanity is in a contradiction,” he says. “Many people are interested in the evolution of cephalopods but many people are also interested in cooking those animals.”

How we resolve this contradiction will shape the future of Rosas’s farming gamble: will octopuses remain acceptable as food, like other intelligent creatures such as pigs? Or will they be considered off-limits, like primates?

Rosas doesn’t see his taste for octopus changing any time soon, and thinks global demand will only continue to soar. He also believes it’s just a matter of years before a farm for the animals will be ready to help meet that growth—hopefully in Mexico.

But Rosas’ delays have given teams elsewhere in the world a chance to close the gap. Groups in Spain and Japan say they’ve developed new tank setups and rearing techniques that have boosted survival rates to over 50% as well—and that’s with the trickier paralarval octopuses. “We think we passed the bottleneck stage,” one Spanish team told me.

These developments don’t worry Rosas, who sees collaboration rather than competition as the path forward. Last November, he invited scientists from around the globe to Sisal to discuss octopus aquaculture. He’s also working with colleagues in Europe and South America to develop a better, more cost effective, way to feed the octopuses than his squid-paste-filled-shells. They’re trying to design a pellet or flake (like conventional aquarium fish food) that can easily be tossed into the tank, and Rosas says they have something “almost ready to send to the market.”

Rosas is also looking for new investors. Given his past experiences, Rosas errs on the side of caution when it comes to timing. “It’s very difficult for us to predict,” he says. But he rarely says no to a tour; this year, Rosas says he’s hosted groups of potential investors from not only Mexico, but also Spain and Italy, and the United Nations Development Programme as well. Guests are often treated to an octopus meal prepared by the cooperative.

“We eat them,” Rosas says. “We make a feast.

Contact us at letters@time.com.