A scientist and a seafood chef walk into a bar. “We have a mutual interest,” says the scientist. “I study crustaceans and you cook them.” But the chef wanted to know just one thing: Do the animals feel pain?

Robert Elwood had been working with crabs and prawns for the better part of three decades when Rick Stein confronted him with this question in a pub on the coast of Northern Ireland. Elwood was stumped. “It was the first time I ever considered the question,” he says.

Although some people are horrified by the idea of cooking lobsters alive or the practice of tearing claws from live crabs before tossing them back into the sea, such views are based on a hunch. We know very little about whether these animals — or invertebrates in general — actually suffer. In Elwood’s experience, researchers are either certain the animals feel pain or certain they don’t. “Very few people say we need to know,” he says.

The global food industry farms or catches billions of invertebrates every year. But unlike their vertebrate cousins, they have virtually no legal protection. “Early on in my career I realized that when the law speaks of animals, it does not mean invertebrates,” says Antoine Goetschel, an international animal law and ethics consultant based in Zurich. “As long as the common opinion is that invertebrates do not suffer, they are out of the game.”

Pain is an awkward thing to test. It can’t be measured directly or pointed at; it’s not even easy to define. How can we tell when an animal is suffering? We have come a long way since Descartes, who argued that all non-human animals were merely automata, without self-awareness and incapable of feeling. But much of what we think we know still involves a lot of guesswork.

So how do we answer Stein’s question? Elwood has been looking for ways to do so since running into Stein eight years ago. For a start, arguments by analogy are silly, he says. “Denying that crabs feel pain because they don’t have the same biology is like denying they can see because they don’t have a visual cortex.”

Elwood and his colleagues at Queen’s University Belfast are instead tackling the question by looking at how these animals behave. Most organisms can respond to a stimulus that signals a potentially harmful event. Special receptors called nociceptors — which sense excessive temperatures, noxious chemicals or mechanical injuries such as crushing or tearing — are found throughout the animal world, from humans to fruit flies. When a parasitic wasp jabs its egg-laying ovipositor into a fruit fly larva, for example, the larva senses the needle and curls up, which can make the wasp pull out.

But when an animal responds to something we would consider painful, it does not necessarily mean the animal is in pain. The response might be a simple reflex, where signals do not travel all the way to the brain, bypassing the parts of the nervous system connected with the conscious perception of pain. When we scald our hand, for example, we immediately — and involuntarily — pull it away. Pain is the conscious experience that follows, once the signals have reached the brain. The key for Elwood was to look for responses that went beyond reflex, the crustacean equivalents of limping or nursing a wound.

He started with prawns. After so many years of working with them, he thought he knew what to expect, which was that he would see nothing more than reflex reactions. But to his surprise, when he brushed acetic acid on their antennae, they began grooming the treated antennae with complex, prolonged movements of both front legs. What’s more, the grooming diminished when local anesthetic was applied beforehand.

He then turned to crabs. If he applied a brief electric shock to one part of a hermit crab, it would rub at that spot for extended periods with its claws. Brown crabs rubbed and picked at their wound when a claw was removed, as it is in fisheries. At times the prawns and crabs would contort their limbs into awkward positions to reach the injury. “These are not just reflexes,” Elwood says. “This is prolonged and complicated behavior, which clearly involves the central nervous system.”

He investigated further by placing shore crabs in a brightly lit tank with two shelters. Shore crabs prefer to hide under rocks during the day, so in this situation they should pick a shelter and stay there. But giving some of the crabs a shock inside one of the shelters forced them to venture outside. After only two trials, the crabs that had received shocks were far more likely to switch their choice of shelter. “So there is rapid learning,” Elwood says, “just what you would expect to see from an animal that experienced pain.”

Finally, Elwood looked at how the need to escape pain competed with other desires. For humans, pain is a powerful motivational driver, and we go to great lengths to avoid it. But we also can override our instincts and choose to endure it if the rewards are great enough. We suffer the dentist’s drill for the long-term benefit, for example. What would a crustacean want badly enough to make it endure pain?

For hermit crabs, it turns out to be a good home. These animals take up residence in abandoned seashells, but they can be made to give up their home if given a shock inside the shell. Elwood found that the likelihood of a hermit crab’s dumping its shell when given a shock depends not only on the intensity of the shock but also on the desirability of the shell. Crabs in better shells took bigger shocks before they were willing to move out. This suggests that the crabs are able to weigh different needs when responding to the noxious stimulus. Once again, this behavior goes far beyond reflex, Elwood says.

And it is not just crustaceans. Robyn Crook, an evolutionary neurobiologist at the University of Texas Health Science Center in Houston, is asking many of the same questions of cephalopods, such as squids and octopuses. “We are learning things we never expected to find,” she says.

Crook and his colleagues have only recently shown that cephalopods have nociceptors at all. She also has found that octopuses show much of the pain-related behavior seen in vertebrates, such as grooming and protecting an injured body part. They are more likely to swim away and squirt ink when touched near a wound than elsewhere on their body.

Squids, though, may feel pain very differently. Shortly after a squid’s fin is crushed, nociceptors become active not only in the region of the wound but across a large part of its body, extending as far as the opposite fin. This suggests that if it feels pain, rather than being able to pinpoint the location of a wound, an injured squid may hurt all over.

Crook is not certain why this would be. But it makes sense from a squid’s point of view, she says. Unlike an octopus, a squid’s tentacles can’t reach many parts of its body, so it couldn’t tend a wound even if it knew where the injury was. Squids also have a fast metabolism that forces them to stay on the move and keep hunting. An all-over heightened sensitivity may keep a squid generally more alert and wary. For example, Crook has found that an injured squid will be more sensitive than others to touch and visual stimuli. “Its long-term behavior changes,” she says. “This fulfils one important criterion for pain.”

Despite this work, the topic remains controversial. One concern is where to redraw the line if the backbone no longer marks a boundary. After all, roughly 98 percent of all animal species are invertebrates; Elwood and Crook may be only scratching the surface. The differences between octopus and squid show how diverse the experiences of the rest of the invertebrates might be, Crook says. A crustacean’s neurons number in the low hundreds of thousands. If they feel pain, she says, what about fruit flies? They have a similar-size nervous system.

Fruit flies are known to have nociceptors, and it is likely that other insects do, too. Bees also respond differently to electric shocks given with and without anesthetic. And insects, generally, seem capable of learning to avoid noxious stimuli. But can they suffer?

Hans Smid, who studies the brains and learning behavior of parasitic wasps at Wageningen University in the Netherlands, dismisses the possibility. “I am absolutely convinced that insects do not feel pain,” he says.

Like Elwood’s, Smid’s interest in pain began with a simple question. A few years ago, a visiting journalist was surprised at how casually Smid squashed a wasp that had escaped from its cage. Why hurt an animal you are so enthusiastic about, the journalist wanted to know.

Yet Smid is confident that insect behavior is best understood in terms of a relatively simple series of reflexes and innate responses. Unlike crustaceans, insects seem to have no pain-related behaviors. If an insect’s leg is damaged, for example, it does not groom or try to protect the limb afterward. Even in extreme cases, insects show no evidence of pain. Imagine a praying mantis eating a locust, Smid says. With its abdomen opened up, the locust will still feed even while being eaten.

In terms of relative brain size, fruit flies and the parasitic wasps that Smid studies are the masterminds of the insect world. But neurons consume a lot of energy, and there is evolutionary pressure to keep brains as compact as possible. In short, there need to be good reasons to have enough brain for pain. Smid thinks that insects simply do not have the need. “I don’t see the evolutionary advantage for insects to sustain such a complex system as emotion, of which pain would be just one component,” he says.

Elwood agrees this is a useful way to frame the question. “From an evolutionary perspective, the only reason for pain that makes sense to me is that it enables long-term protection,” he says. Pain may provide an animal with an additional, and memorable, means of focusing on a source of harm that helps it avoid it in future. If an animal’s life span is not long enough to benefit from that — as is the case with most insects — then pain has no use. Similarly, some animals may simply be unable to avoid noxious stimuli in the first place. “Is a barnacle going to benefit from a bad experience?” Elwood says. “I doubt it.”

Ultimately, we are up against the problem of consciousness. Like all subjective experience, pain remains private to each individual, leaving us only with educated guesses. But both Elwood and Crook have changed how they treat the invertebrates in their labs. They now use as few animals as possible and keep the potential for suffering to a minimum. And they are pushing others to do the same.

There are signs of change, too: Cephalopods at least now get some protection, in some parts of the world. “We are broadening our understanding of both pain and nociception,” Crook says. “How can this not be interesting, even to the skeptics?”