# Pain in invertebrates

Whether invertebrates can feel pain is a contentious issue. Although there are numerous definitions of pain, almost all involve two key components. First, nociception is required. This is the ability to detect noxious stimuli which evokes a reflex response that moves the entire animal, or the affected part of its body, away from the source of the stimulus. The concept of nociception does not necessarily imply any adverse, subjective feeling; it is a reflex action. The second component is the experience of "pain" itself, or suffering—i.e., the internal, emotional interpretation of the nociceptive experience. Pain is therefore a private, emotional experience. Pain cannot be directly measured in other animals, including other humans; responses to putatively painful stimuli can be measured, but not the experience itself. To address this problem when assessing the capacity of other species to experience pain, argument-by-analogy is used. This is based on the principle that if a non-human animal's responses to stimuli are similar to those of humans, it is likely to have had an analogous experience. It has been argued that if a pin is stuck in a chimpanzee's finger and they rapidly withdraw their hand, then argument-by-analogy implies that like humans, they felt pain. It has been questioned why the inference does not then follow that a cockroach experiences pain when it writhes after being stuck with a pin. This argument-by-analogy approach to the concept of pain in invertebrates has been followed by others.
The ability to experience nociception has been subject to natural selection and offers the advantage of reducing further harm to the organism. While it might be expected therefore that nociception is widespread and robust, nociception varies across species. For example, the chemical capsaicin is commonly used as a noxious stimulus in experiments with mammals; however, the African naked mole-rat, Heterocephalus glaber, an unusual rodent species that lacks pain-related neuropeptides (e.g., substance P) in cutaneous sensory fibres, shows a unique and remarkable lack of pain-related behaviours to acid and capsaicin. Similarly, capsaicin triggers nociceptors in some invertebrates, but this substance is not noxious to Drosophila melanogaster (the common fruit fly). Criteria that may indicate a potential for experiencing pain include:
* Has a suitable nervous system and receptors
* Physiological changes to noxious stimuli
* Displays protective motor reactions that might include reduced use of an affected area such as limping, rubbing, holding or autotomy
* Has opioid receptors and shows reduced responses to noxious stimuli when given analgesics and local anaesthetics
* Shows trade-offs between stimulus avoidance and other motivational requirements
* Shows avoidance learning
* Exhibits high cognitive ability

## Suitable nervous system
### Central nervous system

Brain size does not necessarily equate to complexity of function. Moreover, weight for body-weight, the cephalopod brain is in the same size bracket as the vertebrate brain, smaller than that of birds and mammals, but as big or bigger than most fish brains.
   Charles Darwin wrote of the interaction between size and complexity of invertebrate brains:
Invertebrate nervous systems are very unlike those of vertebrates and this dissimilarity has sometimes been used to reject the possibility of a pain experience in invertebrates. In humans, the neocortex of the brain has a central role in pain and it has been argued that any species lacking this structure will therefore be incapable of feeling pain. However, it is possible that different structures may be involved in the pain experience of other animals in the way that, for example, crustacean decapods have vision despite lacking a human visual cortex.
Two groups of invertebrates have notably complex brains: arthropods (insects, crustaceans, arachnids, and others) and modern cephalopods (octopuses, squid, cuttlefish) and other molluscs. The brains of arthropods and cephalopods arise from twin parallel nerve cords that extend through the body of the animal. Arthropods have a central brain with three divisions and large optic lobes behind each eye for visual processing. The brains of the modern cephalopods in particular are highly developed, comparable in complexity to the brains of some vertebrates (See also: Invertebrate brains). Emerging results suggest that a convergent evolutionary process has led to the selection of vertebrate-like neural organization and activity-dependent long-term synaptic plasticity in these invertebrates. Cephalopods stand out by having a central nervous system that shares prime electrophysiological and neuroanatomical features with vertebrates like no other invertebrate taxon.

### Nociceptors

Nociceptors are sensory receptors that respond to potentially damaging stimuli by sending nerve signals to the brain. Although these neurons in invertebrates may have different pathways and relationships to the central nervous system than mammalian nociceptors, nociceptive neurons in invertebrates often fire in response to similar stimuli as mammals, such as high temperature (40 °C or more), low pH, capsaicin, and tissue damage. The first invertebrate in which a nociceptive cell was identified was the medicinal leech, Hirudo medicinalis, which has the characteristic segmented body of an Annelida, each segment possessing a ganglion containing the T (touch), P (pressure) and N (noxious) cells. Later studies on the responses of leech neurones to mechanical, chemical and thermal stimulation motivated researchers to write "These properties are typical of mammalian polymodal nociceptors".
There have been numerous studies of learning and memory using nociceptors in the sea hare, Aplysia. Many of these have focused on mechanosensory neurons innervating the siphon and having their somata (bulbous end) in the abdominal ganglion (LE cells). These LE cells display increasing discharge to increasing pressures, with maximal activation by crushing or tearing stimuli that cause tissue injury. Therefore, they satisfy accepted definitions of nociceptors. They also show similarities to vertebrate Aδ nociceptors, including a property apparently unique (among primary afferents) to nociceptors—sensitization by noxious stimulation. Either pinching or pinning the siphon decreased the threshold of the LE cells firing and enhanced soma excitability.
Nociceptors have been identified in a wide range of invertebrate species, including annelids, molluscs, nematodes and arthropods.

## Physiological changes

In vertebrates, potentially painful stimuli typically produce vegetative modifications such as tachycardia, pupil dilation, defecation, arteriole blood gases, fluid and electrolyte imbalance, and changes in blood flow, respiratory patterns, and endocrine excretions.
At the cellular level, injury or wounding of invertebrates leads to the directed migration and accumulation of haematocytes (defence cells) and neuronal plasticity, much the same as the responses of human patients undergoing surgery or after injury. In one study, heart rate in the crayfish, Procambarus clarkii, decreased following claw autotomy during an aggressive encounter.
Recording physiological changes in invertebrates in response to noxious stimuli will enhance the findings of behavioural observations and such studies should be encouraged. However, careful control is required because physiological changes can occur due to noxious, but non-pain related events, e.g. cardiac and respiratory activity in crustaceans is highly sensitive and responds to changes in water level, various chemicals and activity during aggressive encounters.

## Protective motor reactions

Invertebrates show a wide range of protective reactions to putatively painful stimuli. However, even unicellular animals will show protective responses to, for example, extremes of temperature. Many invertebrate protective reactions appear stereotyped and reflexive in action, perhaps indicating a nociceptive response rather than one of pain, but other responses are more plastic, especially when competing with other motivational systems (see section below), indicating a pain response analogous to that of vertebrates.

### Mechanical stimulation

Rather than a simple withdrawal reflex, the flatworm, Notoplana aticola, displays a locomotory escape behaviour following pin pricks to the posterior end. Touching the larvae of fruit flies, Drosophila melanogaster, with a probe causes them to pause and move away from the stimulus; however, stronger mechanical stimulation evokes a more complex corkscrew-like rolling behaviour, i.e. the response is plastic. When a weak tactile stimulus is applied to the siphon of the sea-hare Aplysia californica, the animal rapidly withdraws the siphon between the parapodia. It is sometimes claimed this response is an involuntary reflex (e.g. see Aplysia gill and siphon withdrawal reflex); however, the complex learning associated with this response (see 'Learned Avoidance' below) suggests this view might be overly simplistic.
In 2001, Walters and colleagues published a report that described the escape responses of the tobacco hornworm caterpillar (Manduca sexta) to mechanical stimulation. These responses, particularly their plasticity, were remarkably similar to vertebrate escape responses.
   A set of defensive behavior patterns in larval Manduca sexta is described and shown to undergo sensitization following noxious mechanical stimulation. The striking response is a rapid bending that accurately propels the head towards sharply poking or pinching stimuli applied to most abdominal segments. The strike is accompanied by opening of the mandibles and, sometimes, regurgitation. The strike may function to dislodge small attackers and startle larger predators. When the same stimuli are applied to anterior segments, the head is pulled away in a withdrawal response. Noxious stimuli to anterior or posterior segments can evoke a transient withdrawal (cocking) that precedes a strike towards the source of stimulation and may function to maximize the velocity of the strike. More intense noxious stimuli evoke faster, larger strikes and may also elicit thrashing, which consists of large, cyclic, side-to-side movements that are not directed at any target. These are sometimes also associated with low-amplitude quivering cycles. Striking and thrashing sequences elicited by obvious wounding are sometimes followed by grooming-like behavior.

### Autotomy

Over 200 species of invertebrates are capable of using autotomy (self amputation) as an avoidance or protective behaviour including:
* land slugs (Prophysaon)
* sea snails (Oxynoe panamensis)
* crickets
* spiders
* crabs
* lobsters
* octopuses
These animals can voluntarily shed appendages when necessary for survival. Autotomy can occur in response to chemical, thermal and electrical stimulation, but is perhaps most frequently a response to mechanical stimulation during capture by a predator. Autotomy serves either to improve the chances of escape or to reduce further damage occurring to the remainder of the animal such as the spread of a chemical toxin after being stung, but the 'decision' to shed a limb or part of a body and the considerable costs incurred by this suggests a pain response rather than simply a nociceptive reflex.

### Thermal stimulation

A heated probe (»42 °C or 108 °F) evokes a complex, corkscrew-like rolling avoidance behaviour in Drosophila larvae which occurs in as little as 0.4 seconds; a non-heated probe does not cause this avoidance behaviour. In contrast, cold stimuli (≤14 °C or 57.2 °F) primarily elicit a bilateral full-body contraction along the head-to-tail axis; larvae might also respond by lifting their head and/or tail, but these responses occur less frequently with decreasing temperatures. Land snails show an avoidance response to being placed on a hotplate (»40 °C or 104 °F) by lifting the anterior portion of the extended foot. A 2015 study found that crayfish (Procambarus clarkii) respond adversely to high temperatures, but not to low temperatures.

### Chemical stimulation

Crustaceans are known to respond to acids in ways that indicate nociception and/or pain. The prawn Palaemon elegans shows protective motor reactions when their antennae are treated with the irritants acetic acid or sodium hydroxide. The prawns specifically groom the treated antennae and rub them against the tank, showing they are aware of the location of the noxious stimulus on their body rather than exhibiting a generalised response to stimulation. In Carcinus maenas, the common shore crab, acetic acid induces a number of behavioral changes, including movement of the mouthparts, rubbing with the claws, and increased attempts to escape from an enclosure.
Under natural conditions, orb-weaving spiders (Argiope spp.) undergo autotomy (self-amputation) if they are stung in a leg by wasps or bees. Under experimental conditions, when spiders were injected in the leg with bee or wasp venom, they shed this appendage. But if they are injected with only saline, they rarely autotomize the leg, indicating it is not the physical insult or the ingress of fluid per se that causes autotomy. Spiders injected with venom components which cause injected humans to report pain (serotonin, histamine, phospholipase A2 and melittin) autotomize the leg, but if the injections contain venom components which do not cause pain to humans, autotomy does not occur.
Drosophila melanogaster larvae respond to acids and menthol with a stereotyped nociceptive rolling response, identical to the behavior seen in response to high-temperature and mechanical insult. The electrophilic chemical allyl isothiocyanate causes nociceptive sensitization in larvae. Adult flies find menthol, AITC, capsaicin, and a number of other chemicals to be aversive, affecting both the proboscis extension reflex and egg-lay site preference.
Acids are also known to activate nociceptors in the nematode Caenorhabditis elegans and in Hirudo medicinalis, commonly known as the medicinal leech.

### Electrical stimulation

The sea-slug, Tritonia diomedia, possesses a group of sensory cells, "S-cells", situated in the pleural ganglia, which initiate escape swimming if stimulated by electric shock. Similarly, the mantis shrimp Squilla mantis shows avoidance of electric shocks with a strong tail-flick escape response. Both these responses appear to be rather fixed and reflexive, however, other studies indicate a range of invertebrates exhibit considerably more plastic responses to electric shocks.
Because of their soft bodies, hermit crabs rely on shells for their survival, but, when they are given small electric shocks within their shells, they evacuate these. The response, however, is influenced by the attractiveness of the shell; more preferred shells are only evacuated when the crabs are given a higher voltage shock, indicating this is not a simple reflex behaviour.
In studies on learning and the Aplysia gill and siphon withdrawal reflex, Aplysia received an electric shock on the siphon each time their gill relaxed below a criterion level. Aplysia learned to keep their gills contracted above the criterion level—an unlikely outcome if the response was due to a nociceptive experience.
Drosophila feature widely in studies of invertebrate nociception and pain. It has been known since 1974 that these fruit-flies can be trained with sequential presentations of an odour and electric shock (odour–shock training) and will subsequently avoid the odour because it predicts something "bad". A similar response has been found in the larvae of this species. In an intriguing study, Drosophila learned two kinds of prediction regarding a 'traumatic' experience. If an odour preceded an electric shock during training, it predicted shock and the flies subsequently avoided it. When the sequence of events during training was reversed, i.e. odour followed shock, the odour predicted relief from shock and flies approached it. The authors termed this latter effect "relief" learning.
Many invertebrate species learn to withdraw from, or alter their behaviour in response to, a conditioned stimulus when this has been previously paired with an electric shock—cited by Sherwin—and include snails, leeches, locusts, bees and various marine molluscs.
If vertebrate species are used in studies on protective or motor behaviour and they respond in similar ways to those described above, it is usually assumed that the learning process is based on the animal experiencing a sensation of pain or discomfort from the stimulus, e.g. an electric shock. Argument-by-analogy suggests an analogous experience occurs in invertebrates.

## Opioid receptors, effects of local anaesthetics or analgesics

In vertebrates, opiates modulate nociception and opioid receptor antagonists, e.g. naloxone and CTOP, reverse this effect. So, if opiates have similar effects in invertebrates as vertebrates, they should delay or reduce any protective response and the opioid antagonist should counteract this. It has been found that molluscs and insects have opioid binding sites or opioid general sensitivity. Certainly there are many examples of neuropeptides involved in vertebrate pain responses being found in invertebrates; for example, endorphins have been found in platyhelminthes, molluscs, annelids, crustaceans and insects. Apart from analgesia, there are other effects of exogenous opiates specifically being involved in feeding behaviour and activation of immunocytes. These latter functions might explain the presence of opioids and opioid receptors in extremely simple invertebrates and unicellular animals.

### Nematodes

Nematodes avoid extremes of temperature. Morphine increases the latency of this defensive response in the parasitic Ascaris suum. In a study on the effects of opiates in Caenorhabditis elegans, 76% of a non-treated group exhibited a rapid, reflexive withdrawal to heat, whereas 47%, 36% and 39% of morphine, endomorphin 1 and endomorphin 2 treated worms (respectively) withdrew. These effects were reversed with the opioid receptor antagonists naloxone and CTOP, leading the authors to conclude that thermonocifensive behaviour in C. elegans was modulated by opioids.

### Molluscs

Slugs and snails have an opioid receptor system. In experiments on different terrestrial snails, morphine prolonged the latency of the snails' raising their foot in response to being placed on a hot (40 °C) surface. The analgesic effects of the morphine were eliminated by naloxone as is seen in humans and other vertebrates. There was also habituation to morphine. Snails administered with morphine for four days did not differ from the control ones in tests on pain sensitivity and analgesia was achieved only at a higher dose.

### Crustaceans

Evidence of the capacity for invertebrates to experience nociception and pain has been widely studied in crustaceans. In the crab Neohelice granulata, electric shocks delivered via small holes in the carapace elicited a defensive threat display. Injection of morphine reduced the crabs' sensitivity to the shock in a dose-dependent manner, with the effect declining with increasing duration between morphine injection and shock. Naloxone injection inhibited the effects of morphine, as is seen in vertebrates. Morphine also had inhibitory effects on the escape tail-flick response to electric shock in the mantis shrimp, Squilla mantis, that was reversed by naloxone, indicating that the effect is found in crustacean groups other than decapods. When the irritants acetic acid or sodium hydroxide were applied to the antennae of grass prawns, Penaeus monodon, there was an increase in rubbing and grooming of the treated areas which was not seen if they had previously been treated with a local anaesthetic, benzocaine, however, the benzocaine did not eliminate the level of rubbing seen in response to mechanical stimulation with forceps. There was no effect of benzocaine on the general locomotion of the prawns, so the reduction in rubbing and grooming was not simply due to inactivity of the animal. Another local anaesthetic, xylocaine, reduced the stress of eyestalk ablation in female whiteleg shrimps, Litopenaeus vannamei, as indicated by levels of feeding and swimming.
It has not always been possible to replicate these findings in crustaceans. In one study, three decapod crustacean species, Louisiana red swamp crayfish, white shrimp and grass shrimp, were tested for nociceptive behaviour by applying sodium hydroxide, hydrochloric acid, or benzocaine to the antennae. This caused no change in behaviour in these three species compared to controls. Animals did not groom the treated antenna, and there was no difference in movement of treated individuals and controls. Extracellular recordings of antennal nerves in the Louisiana red swamp crayfish revealed continual spontaneous activity, but no neurons that were reliably excited by the application of sodium hydroxide or hydrochloric acid. The authors concluded there was no behavioural or physiological evidence that the antennae contained specialized nociceptors that responded to pH. It could be argued that differences in the findings between studies may be due to responses to extreme pH being inconsistently evoked across species.
It has been argued that the analgesic effects of morphine should not be used as a criterion of the ability of animals, at least crustaceans, to experience pain. In one study, shore crabs, Carcinus maenas received electric shocks in a preferred dark shelter but not if they remained in an unpreferred light area. Analgesia from morphine should have enhanced movement to the preferred dark area because the crabs would not have experienced 'pain' from the electric shock. However, morphine inhibited rather than enhanced this movement, even when no shock was given. Morphine produced a general effect of non-responsiveness rather than a specific analgesic effect, which could also explain previous studies claiming analgesia. However, the researchers argued that other systems such as the enkephalin or steroid systems might be used in pain modulation by crustaceans and that behavioural responses should be considered rather than specific physiological and morphological features.

### Insects

Morphine extends the period that crickets remain on the heated surface of a hotplate. One study has found that fruit flies can experience chronic pain. Some insects have been observed grooming their injuries.
A 2022 review found strong evidence for pain in adult insects of two orders (Blattodea: cockroaches and termites; Diptera: flies and mosquitoes) and found substantial evidence for pain in adult insects of three additional orders (Hymenoptera: sawflies, wasps, bees, and ants; Lepidoptera: moths and butterflies; and Orthoptera: grasshoppers, crickets, wētā and locusts), in addition to some juvenile insects. The authors identified significant evidence gaps particularly around juvenile insects and called attention to a need for more research to be undertaken on insect pain. Based on these findings, the authors also considered the welfare implications of human activities such as insect farming and pest control.

## Trade-offs between stimulus avoidance and other motivational requirements

This is a particularly important criterion for assessing whether an animal has the capacity to experience pain rather than only nociception. Nociceptive responses do not require consciousness or higher neural processing; this results in relatively fixed, reflexive actions. However, the experience of pain does involve higher neural centres which also take into account other factors of relevance to the animal, i.e. competing motivations. This means that a response to the experience of pain is likely to be more plastic than a nociceptive response when there are competing factors for the animal to consider.
Robert Elwood and Mirjam Appel at the Queen's University of Belfast argue that pain may be inferred when the responses to a noxious stimulus are not reflexive but are traded off against other motivational requirements, the experience is remembered and the situation is avoided in the future. They investigated this by giving hermit crabs small electric shocks within their shells. Only crabs given shocks evacuated their shells indicating the aversive nature of the stimulus, but fewer crabs evacuated from a preferred species of shell demonstrating a motivational trade-off. Most crabs, however, did not evacuate at the shock level used, but when these shocked crabs were subsequently offered a new shell, they were more likely to approach and enter the new shell. They approached the new shell more quickly, investigated it for a shorter time and used fewer cheliped probes within the aperture prior to moving in. This demonstrates the experience of the electric shock altered future behaviour in a manner consistent with a marked shift in motivation to get a new shell to replace the one previously occupied.

## Learned avoidance

Learning to avoid a noxious stimulus indicates that prior experience of the stimulus is remembered by the animal and appropriate action taken in the future to avoid or reduce potential damage. This type of response is therefore not the fixed, reflexive action of nociceptive avoidance.

### Habituation and sensitization

Habituation and sensitisation are two simple, but widespread, forms of learning. Habituation refers to a type of non-associative learning in which repeated exposure to a stimulus leads to decreased response. Sensitization is another form of learning in which the progressive amplification of a response follows repeated administrations of a stimulus.
When a tactile stimulus is applied to the skin of Aplysia californica, the animal withdraws the siphon and gill between the parapodia. This defensive withdrawal, known as the Aplysia gill and siphon withdrawal reflex, has been the subject of much study on learning behaviour. Generally, these studies have involved only weak, tactile stimulation and are therefore more relevant to the question of whether invertebrates can experience nociception, however, some studies have used electric shocks to examine this response (See sections on "Electrical stimulation" and "Operant conditioning").
   Other researchers working with Aplysia were sufficiently impressed by the similarity between invertebrate and mammalian responses to write:
   – Walters, E.T. and Moroz, L.L. (2009)

### Location avoidance

Avoidance learning was examined in the crab Neohelice granulata by placing the animals in a dark compartment of a double-chamber device and allowing them to move towards a light compartment. Experimental crabs received a shock in the light compartment, whilst controls did not. After 1 min, both experimental and control crabs were free to return to the dark compartment. The learned outcome was not a faster escape response to the stimulus but rather refraining from re-entering the light compartment. A single trial was enough to establish an association between light and shock that was detected up to 3 hours later.
Studies on crayfish, Procambarus clarkia, demonstrated that they learned to associate the turning on of a light with a shock that was given 10 seconds later. They learned to respond by walking to a safe area in which the shock was not delivered. However, this only occurred if the crayfish were facing the area to which they could retreat to avoid the shock. If they were facing away from the safe area the animal did not walk but responded to the shock by a tail-flick escape response. Despite repeated pairings of light and shock the animals did not learn to avoid the shock by tail-flicking in response to light. Curiously, when the animals that had experienced shocks whilst facing away from the safe area were subsequently tested facing towards the safe area they showed a very rapid avoidance of the shock upon the onset of the light. Thus, they seemed to have learned the association although they had not previously used it to avoid the shock - much like mammalian latent learning. These studies show an ability in decapods that fulfils several criteria for pain experience rather than nociception.

### Conditioned suppression

Honeybees extend their proboscis when learning about novel odours. In one study on this response, bees learnt to discriminate between two odours, but then learned to suppress the proboscis extension response when one of the odours was paired with an electric shock. This indicates the sensation was aversive to the bee, however, the response was plastic rather than simply reflexive, indicating pain rather than nociception.

### Operant conditioning

Operant studies using vertebrates have been conducted for many years. In such studies, an animal operates or changes some part of the environment to gain a positive reinforcement or avoid a punishment one. In this way, animals learn from the consequence of their own actions, i.e. they use an internal predictor. Operant responses indicate a voluntary act; the animal exerts control over the frequency or intensity of its responses, making these distinct from reflexes and complex fixed action patterns. A number of studies have revealed surprising similarities between vertebrates and invertebrates in their capacity to use operant responses to gain positive reinforcements, but also to avoid positive punishment that in vertebrates would be described as 'pain'.

#### Snail

It has been shown that snails will operate a manipulandum to electrically self-stimulate areas of their brain. Balaban and Maksimova surgically implanted fine wire electrodes in two regions of the brains of snails (Helix sp.). To receive electrical stimulation of the brain, the snail was required to displace the end of a rod. When pressing the rod delivered self-stimulation to the mesocerebrum (which is involved in sexual activity) the snails increased the frequency of operating the manipulandum compared to the baseline spontaneous frequency of operation. However, when stimulation was delivered to the parietal ganglion, the snails decreased the frequency of touching the rod compared to the baseline spontaneous frequency. These increases and decreases in pressing are positive reinforcement and punishment responses typical of those seen with vertebrates.

#### Aplysia

To examine the gill and siphon withdrawal response to a putatively painful stimulus, Aplysia were tested in pairs. During the initial training period, the experimental animal received a siphon shock each time its gill relaxed below a criterion level, and the yoked control animal received a shock whenever the experimental animal did, regardless of its own gill position. The experimental animals spent more time with their gills contracted above the criterion level than did the control animals during each period, demonstrating operant conditioning.

#### Drosophila

A fly-controlled heat-box has been designed to study operant conditioning in several studies of Drosophila. Each time a fly walks into the designated half of the tiny dark chamber, the whole space is heated. As soon as the animal leaves the punished half, the chamber temperature reverts to normal. After a few minutes, the animals restrict their movements to one-half of the chamber, even if the heat is switched off.
A Drosophila flight simulator has been used to examine operant conditioning. The flies are tethered in an apparatus that measures the yaw torque of their flight attempts and stabilizes movements of the panorama. The apparatus controls the fly's orientation based on these attempts. When the apparatus was set up to direct a heat beam on the fly if it "flew" to certain areas of its panorama, the flies learned to prefer and avoid certain flight orientations in relation to the surrounding panorama. The flies "avoided" areas that caused them to receive heat.
These experiments show that Drosophila can use operant behaviour and learn to avoid noxious stimuli. However, these responses were plastic, complex behaviours rather than simple reflex actions, consistent more with the experience of pain rather than simply nociception.

## Cognitive abilities

It could be argued that a high cognitive ability is not necessary for the experience of pain; otherwise, it could be argued that humans with less cognitive capacity have a lower likelihood of experiencing pain. However, most definitions of pain indicate some degree of cognitive ability. Several of the learned and operant behaviours described above indicate that invertebrates have high cognitive abilities. Other examples include:
* Social transmission of information during the waggle dance of honeybees.
* Idiothetic orientation by spiders, i.e. they memorize information about their previous movements.
* Detour behaviour in which spiders choose to take an indirect route to a goal rather than the most direct route, thereby indicating flexibility in behaviour and route planning, and possibly insight learning.
* Conceptualisation in the honeybee, Apis mellifera.
* Problem solving in leafcutter ants, Atta colombica.
* Numeracy in the yellow mealworm beetle, Tenebrio molitor, and honeybee.

### Non-stereotyped behavior

Charles Darwin was interested in worms and "how far they acted consciously, and how much mental power they displayed." In The Formation of Vegetable Mould through the Action of Worms, Darwin described complex behaviors by worms when plugging their burrows. He suggested that worms appear to "have the power of acquiring some notion, however crude, of the shape of an object and of their burrows" and if so, "they deserve to be called intelligent; for they then act in nearly the same manner as would a man under similar circumstances."
   Charles Darwin:
Donald Griffin's 1984 Animal Thinking defends the idea that invertebrate behavior is complex, intelligent, and somewhat general. He points to examples in W. S. Bristowe's 1976 The World of Spiders detailing how spiders respond adaptively to novel conditions. For instance, a spider can eat a fly held in front of it by an experimenter, bypassing the usual step of moving toward an insect caught on its web. A spider may adapt the shape of its web to abnormal circumstances, suggesting that the web is not just built with a fixed template. Griffin also considers leaf-cutter ants, with central nervous systems "less than a millimeter in diameter", and asks: "Can the genetic instructions stored in such a diminutive central nervous system prescribe all of the detailed motor actions carried out by one of these ants? Or is it more plausible to suppose that their DNA programs the development of simple generalizations [...]?"
In other instances invertebrates display more "dumb", pre-programmed behavior. Darwin himself cites examples involving ants, sphexes, and bees. Dean Wooldridge described how a sphex wasp brings a paralyzed cricket to its burrow and then goes inside to inspect the burrow before coming back out and bringing the cricket in. If the cricket is moved slightly while the wasp is away making its first inspection, the wasp upon returning from the burrow reorients the cricket to its proper position and then proceeds to check the burrow again, even though it was already checked just before. If the cricket is moved again, the routine repeats once more. This process has been repeated up to 40 times in a row. Based on this example, Douglas Hofstadter coined the term "sphexish" to mean deterministic or pre-programmed.

### Social interaction

Social behavior is widespread in invertebrates, including cockroaches, termites, aphids, thrips, ants, bees, Passalidae, Acari, spiders, and more. Social interaction is particularly salient in eusocial species but applies to other invertebrates as well.
Jeffrey A. Lockwood, citing previous authors, argues that awareness of how other minds operate may be an important requirement for social interaction. Social behavior indicates that insects can recognize information conveyed by other insects, and this suggests they may also have some self-awareness. Lockwood asserts: "it is rather implausible to contend that through sensory mechanisms an insect is aware of the environment, other insects, and the needs of conspecifics but through some neural blockage, the same insect is selectively unconscious of sensory input about itself."

## Protective legislation

In the UK from 1993 to 2012, the common octopus (Octopus vulgaris) was the only invertebrate protected under the Animals (Scientific Procedures) Act 1986. In 2012, this legislation was extended to include all cephalopods, in accordance with a general EU directive, which states that "there is scientific evidence of their [cephalopods] ability to experience pain, suffering, distress and lasting harm."

## Public perception

A 2021 representative poll of 4,446 Americans found that 65 percent of people in the US believe that honeybees can feel pain, while 56 percent believe that ants can feel pain. A similar poll conducted in the UK (n=1963) likewise found that "the vast majority of participants agreed that lobsters (83.03 %), octopuses (80.65 %), and crabs (78.09 %) can feel pain", and a majority also thought that "honey bees (73.09 %), shrimp (62.20 %), caterpillars (58.06 %), and flies (54.23 %) could feel pain."