{'fraction_non_alphanumeric': 0.015699658703071672, 'fraction_numerical': 0.0, 'mean_word_length': 5.515555555555555, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Ecological conditions alter cooperative behaviour and its costs in a chemically defended sawfly

The evolution of cooperation and social behaviour is often studied in isolation from the ecology of organisms. Yet, the selective environment under which individuals evolve is much more complex in nature, consisting of ecological and abiotic interactions in addition to social ones. Here, we measured the life-history costs of cooperative chemical defence in a gregarious social herbivore, Diprion pini pine sawfly larvae, and how these costs vary under different ecological conditions. We ran a rearing experiment where we manipulated diet (resin content) and attack intensity by repeatedly harassing larvae to produce a chemical defence. We show that forcing individuals to allocate more to cooperative defence (high attack intensity) incurred a clear cost by decreasing individual survival and potency of chemical defence. Cooperative behaviour and the magnitude of its costs were further shaped by host plant quality. The number of individuals participating in group defence, immune responses and female growth decreased on a high resin diet under high attack intensity. We also found some benefits of cheating: non-defending males had higher growth rates across treatments. Taken together, these results suggest that ecological interactions can shape the adaptive value of cooperative behaviour and maintain variation in the frequency of cooperation and cheating.