Does cognitive performance predict contest outcome in pigs?

Losing aggressive contests may impact survival, reproductive success and animal welfare. Previous experience plays an important role in shaping contest behaviour, but less is known about how individual variation in learning abilities in ﬂ uences contest dynamics and resource-holding potential. Here, we investigated whether learning performance (acquisition learning and reversal learning) in domestic pigs, Sus scrofa , predicts the outcome of a contest against an unfamiliar opponent. While acquisition learning speed did not predict contest outcome, pigs that successfully learned the reversal were more likely to win the contest than pigs that failed to learn the reversal. As expected, weight difference between opponents was also an important factor in predicting contest outcome. Our results suggest that cognitive ﬂ exibility may confer an advantage in contests, unless pigs already have a substantial weight advantage over their opponent. These ﬁ ndings advance our understanding of the role of cognitive processes in animal contests and suggest that promoting cognitive ﬂ exibility may reduce the potential welfare impacts arising from stressful social defeat. Further research is required to determine whether cognitive ﬂ exibility in ﬂ uences assessment strategy and allows pigs to resolve contests with fewer costs. © 2024 The Author(s). Published by Elsevier Ltd on behalf of The Association for the Study of Animal Behaviour. This is an open access article under the CC BY license

Losing aggressive contests may impact survival, reproductive success and animal welfare.Previous experience plays an important role in shaping contest behaviour, but less is known about how individual variation in learning abilities influences contest dynamics and resource-holding potential.Here, we investigated whether learning performance (acquisition learning and reversal learning) in domestic pigs, Sus scrofa, predicts the outcome of a contest against an unfamiliar opponent.While acquisition learning speed did not predict contest outcome, pigs that successfully learned the reversal were more likely to win the contest than pigs that failed to learn the reversal.As expected, weight difference between opponents was also an important factor in predicting contest outcome.Our results suggest that cognitive flexibility may confer an advantage in contests, unless pigs already have a substantial weight advantage over their opponent.These findings advance our understanding of the role of cognitive processes in animal contests and suggest that promoting cognitive flexibility may reduce the potential welfare impacts arising from stressful social defeat.Further research is required to determine whether cognitive flexibility influences assessment strategy and allows pigs to resolve contests with fewer costs.
© 2024 The Author(s).Published by Elsevier Ltd on behalf of The Association for the Study of Animal Behaviour.This is an open access article under the CC BY license (http://creativecommons.org/licenses/ by/4.0/).
Animal contests govern access to resources that enhance fitness, and the outcomes of these interactions can impact population level ecological and evolutionary processes (Briffa et al., 2015;Hardy & Briffa, 2013).Identifying the mechanisms underlying variation in contest behaviour is therefore of considerable research interest (Ashton et al., 2020;Reichert & Quinn, 2017;Wascher et al., 2018).During contests, animals gather information to make decisions about when to fight, how to fight and when to withdraw (Arnott & Elwood, 2009).Variation in how individuals gather, retain and use information is likely to play an important role in contest decision making.Cognitive processes such as categorization, transitive inference, learning and memory may help animals to recognize and evaluate opponents, assess the value of the resource they are fighting over and adjust their fighting tactics (Elwood & Arnott, 2012;Reichert & Quinn, 2017).In particular, individual differences in learning abilities may affect how previous experience informs future behaviour, and how individuals update their decision making in light of new information (including within an ongoing contest).In this way, variation in cognitive performance may form an important component of resource-holding potential (RHP), in addition to more well-studied morphological components such as size and weaponry (Reichert & Quinn, 2017;Stuart-Fox, 2006).Learning performance has been linked to social status (reviewed in Wascher et al., 2018), with some studies showing that dominant animals outperform subordinate individuals in learning tasks (mice, Mus musculus, Barnard & Luo, 2002;European starlings, Sturnus vulgaris, Boogert et al., 2006; mountain chickadees, Poecile gambeli, Heinen et al., 2021; eastern water skinks, Eulamprus quoyii, Kar et al., 2017;common pheasants, Phasianus colchicus, Langley, Van Horik, et al., 2018), while other studies show subordinate animals outperforming dominants (crab-eating macaques, Macaca fascicularis, Bunnell et al., 1980; Arabian babblers, Argya squamiceps, Keynan et al., 2015;mice, Matzel et al., 2017; crab sp.Neohelice granulata, Santos et al., 2021).In-depth studies of contest dynamics also suggest an important role for learning (reviewed in Reichert & Quinn, 2017): animals use prior experience to assess the value of resources (McCallum et al., 2017), recognize former opponents (Carazo et al., 2008;Casey et al., 2015), anticipate the behaviour of rivals (Hollis, 1999;Losey & Sevenster, 1995) and decide how to engage in a contest (Trannoy et al., 2016;Yasuda et al., 2014).However, less well studied is how learning ability influences RHP and contest dynamics, which may directly affect fitness and welfare.
As part of a wider study examining the effects of cognitive ability and affective state on contest behaviour, we investigated whether individual learning abilities form a component of RHP in domestic pigs, Sus scrofa.The domestic pig has previously been used as a model system to address a number of fundamental questions related to animal contest behaviour, including the influence of personality and early life experience on contest dynamics (e.g.Camerlink et al., 2015Camerlink et al., , 2019;;Weller et al., 2019a).As highly social mammals known for their learning capabilities, pigs are an ideal species for proximate and applied behavioural research (Gieling et al., 2011;Held et al., 2010;Marino & Colvin, 2015;Mendl et al., 2010).In the wild, groups of related adult females establish stable dominance relationships where disputes are mainly settled through nondamaging threat displays.Solitary adult males engage in escalated fights over access to females during the breeding season, and these encounters can be costly and highly injurious (Barrette, 1986;D'Eath & Turner, 2009;Graves, 1984).Like many farmed species, domestic pigs have largely retained the qualitative behavioural repertoire of their wild ancestors, despite changes in quantitative response thresholds (Collarini et al., 2022;Fraser et al., 1995;Price, 1984Price, , 1999)).Domestic pigs also show sexual dimorphism in agonistic behaviour, and both males and females are motivated to fight unfamiliar opponents (Camerlink et al., 2019(Camerlink et al., , 2022;;Meese & Ewbank, 1973;Turner et al., 2017).These interactions involve transitions through defined stages of escalation, from nondamaging display through to mutual fights which often end in a clear signal of retreat (Camerlink et al., 2016(Camerlink et al., , 2019)).These complex contests offer extensive opportunities for learning abilities to play an important (but currently understudied) role in decision making.Moreover, as aggression is a major concern in pig farming (Coutellier et al., 2007;Marchant et al., 1995;Morrow-Tesch et al., 1994;Tan et al., 1991;Turner et al., 2006), understanding the causes and consequences of aggression in pigs may also help to address a widespread animal welfare problem.
To determine whether learning ability contributes to RHP, we quantified pigs' performance in an acquisition learning and reversal learning task, alongside their performance in a staged dyadic contest with an unfamiliar individual.It is extremely difficult to assess individual cognitive performance directly during an ongoing contest, and an individual's behaviour may be influenced by the behaviour and characteristics of their opponent.Therefore, we quantified pigs' acquisition learning and reversal learning performance in a nonsocial foraging task under controlled experimental conditions, before examining the relationship between cognitive performance and contest outcome.In both learning tasks, correct behavioural decisions were rewarded and incorrect decisions resulted in a mild punishment.An ability to quickly learn about the outcomes of behavioural actions, such as the consequences of choosing to initiate or persist in an escalated fight, may allow pigs to make informed contest decisions based on their likelihood of winning (Reichert & Quinn, 2017).Consequently, we predicted that faster learners would have a higher probability of winning contests (Reichert & Quinn, 2017), after accounting for variation in body weight, which is a well-known component of RHP (Rushen, 1987).We also quantified pigs' cognitive flexibility, using a reversal learning task based on the original association.The ability to update prior knowledge in light of new information allows animals to adapt to changing ecological conditions, and is likely to be useful during social interactions (Ashton et al., 2018;Reichert & Quinn, 2017).This may be particularly important for pigs, where opponents engage in dynamic and costly contests against a rival (Camerlink et al., 2016(Camerlink et al., , 2019)).Being able to update and adjust behaviour in response to a rival's behaviour may confer an advantage by allowing pigs to tailor their fighting tactics according to information gathered during these interactions, where the optimal fighting strategy may change even over the course of a single contest (Chapin et al., 2019).For example, an individual that initiates and persists in a contest against an opponent with lower RHP may reap the rewards of this behavioural strategy; but when later faced with an opponent of higher RHP, it may be beneficial to inhibit their previously learned response and alter their behaviour if they are sustaining injuries from persisting in the contest.As for acquisition learning performance, we also predicted that reversal learning performance would be positively associated with winning contests after controlling for body weight, if learning ability forms a component of RHP in this species.
In wild pigs, the outcome of dominance interactions influences access to resources, particularly for breeding males (D'Eath & Turner, 2009).While it may not be advantageous for all individuals to engage in costly contests in order to win, overt fighting is rare in female groups of wild boar which still maintain a clear dominance hierarchy (D'Eath & Turner, 2009).Similarly, male and female domestic pigs can resolve contests without escalation to an injurious fight (Camerlink et al., 2017), although they maintain a strong motivation to engage in dominance interactions even in the presence of adequate resources (Collarini et al., 2022;Turner et al., 2009).While subordinate pigs generally avoid conflict, individuals may struggle to avoid agonistic interactions under the confines of most farm environments, particularly when pigs are mixed into new groups (D'Eath & Turner, 2009).Engaging in any aggressive behaviour can result in injury and impact the welfare of both participants, but these costs appear to be higher for the individual that loses the interaction (Camerlink et al., 2017;Otten et al., 2002).This study represents a starting point for investigating the role of learning as a potential component of RHP in this species (including in contests that are resolved without a damaging fight), and further research will determine whether learning abilities also allow pigs to resolve contests with fewer costs.

Ethical Note
This study was conducted under licence from the U.K. Home Office (PPL: P3850A80D/PP1403242) and with ethical approval from the SRUC (Scotland's Rural College) Animal Experiments Committee (AWERB).Behavioural tests were conducted with clear welfare endpoints in place, in line with relevant guidelines (ASAB Ethical Committee & ABS Animal Care Committee, 2023); regulated procedures were carried out under the Animals (Scientific Procedures) Act 1986 (ASPA; UK Home Office, 2014).This study formed part of a wider project investigating how cognitive ability and affective state influence contest behaviour (N ¼ 226 pigs).The sample size was informed by previous work on postmixing aggression in pigs (BBSRC: BB/L000393/1; e.g.Camerlink et al., 2015;Camerlink et al., 2016).As refinements were made to the wider study following Batch 1, here we focused on directly comparable data from Batches 2e8 (N ¼ 195; 102 females and 93 males; aged 1e14 weeks).Animals were born on-farm in PigSAFE loose-farrowing pens (4.5 Â 2.2 m), designed to provide sows with more freedom to engage in natural behaviours without compromising the welfare of piglets (Baxter et al., 2015).After weaning, piglets were housed in groups of up to nine littermates under enriched conditions (11.2 m 2 , deep straw bedding, range of enrichment materials that were frequently replenished) or conditions more reflective of standard commercial environments (5.5 m 2 , minimally enriched with wood shavings and mats for thermal comfort; see Early life treatments for more details).Barren environments are associated with an increased risk of pigs developing abnormal behaviours such as stereotypies and tail biting (Gody n et al., 2019).Pigs in all pens were closely monitored for signs of abnormal behaviour, and staff would take early action to remedy any welfare issues (including adding enrichment if necessary).At 14 weeks of age, pigs were mixed and moved to ageappropriate standard commercial housing on the same farm (6.1 Â 2.35 m; maximum 16 pigs per pen).The behaviour and welfare of pigs were closely monitored after mixing, and at the end of the study pigs were returned to stock following inspection by the Named Veterinary Surgeon.All pigs had access to ad libitum food and water in the home pen throughout the study.Pigs were habituated to human presence and test arenas prior to behavioural testing and were only separated from penmates for short periods (maximum 30 min).Cognitive testing regimes were designed to minimize stress to the pigs and encourage motivation to participate, by using short testing sessions and regular food rewards (see Discrimination training).Tests were terminated early if pigs showed signs of extreme stress (including excessive vocalization, freezing behaviour and injuries beyond superficial lesions in the contests; see below).Before and after contests, a small pin-prick blood sample was taken from the ear vein to assess physiological responses as part of the wider study (data not presented here).This procedure is minimally invasive and was carried out by licensed staff following established protocols (e.g.Camerlink et al., 2015).Following all tests and procedures, pigs were monitored for adverse effects in the home pen.In the rare event that pigs showed adverse effects (e.g.bullying by penmates after returning from contests), staff would take action to improve welfare, such as by adding enrichment as a distraction.No long-term adverse effects were seen to result from any behavioural tests or regulated procedures.

Subjects and Housing
The study was carried out at SRUC's Easter Howgate farm (Midlothian, U.K.).Subjects were the progeny of crossbred Large White Â Landrace sows mated to Danish Duroc boars, tested in eight batches (N ¼ 226 pigs).As refinements were made to the study design following Batch 1, the present study focused on directly comparable data from Batches 2e8 only (N ¼ 195; 102 females and 93 males).Piglets were born in PigSAFE loose-farrowing pens (4.5 Â 2.2 m; Baxter et al., 2015), teeth and tails were left intact, and males were not castrated.Pigs were weaned at 4 weeks by the removal of the sow and, at 6 weeks, up to nine piglets per litter were selected and moved from the farrowing accommodation to postweaning housing.Approximately four pigs per litter were designated as test subjects (range 3e5).At 8 weeks of age, surplus piglets were returned to stock and test subjects remained in their pens for a further 5 weeks.The design of postweaning housing varied according to enrichment treatment (see Study design).Throughout the study, pigs had ad libitum access to water and pelleted commercial feed and were weighed at regular intervals.

Study Design
This study formed part of a wider project investigating how cognitive ability and affective state influence contest behaviour (BBSRC: BB/T001046/1; BB/T000716/1).From 5 to 14 weeks of age, subjects took part in behavioural tests assessing aspects of cognition and affective state including social preferences, response to novelty, acquisition learning, judgement bias, attention bias and reversal learning.To quantify variation in aggressive strategies, pigs also took part in dyadic contests (two per pig, only the first of which was analysed here), a mock contest (allowing visual contact with a former opponent, through a mesh barrier that prevented full physical contact), and a regrouping procedure mimicking the routine mixing of unfamiliar pigs on commercial farms.For a full timeline of behavioural testing, see Table A1.

Early Life Treatments
In a 2 Â 2 factorial design, the early life social and physical environment of pigs was manipulated to maximize variation in cognitive ability and affective state.From 2 to 4 weeks of age, some litters were given access to a neighbouring litter in the farrowing environment (socialized treatment, S) while others remained in their litter groups (as a nonsocialized control, NS).Socializing piglets in this way is hypothesized to facilitate cognitive development (Weller, Turner, Futro, et al., 2020) and influences the development of agonistic behaviour through play fighting (D'Eath, 2005;Weller et al., 2019b;Weller, Turner, Farish, et al., 2020).Moreover, it mimics the age of integration of unfamiliar litters in free-ranging feral pigs (Petersen et al., 1989).
At 6 weeks of age, socialized and nonsocialized litter groups were assigned to either enriched or barren postweaning housing, using a balanced design.Pigs were housed as litter groups and were not mixed at weaning.Enriched pens (E) were provided with more space (11.2 m 2 ), deep straw bedding and a range of enrichment materials that were frequently replenished (e.g.hessian ropes, 'Porcichew' pig toys and cardboard).By contrast, barren pens (B) provided a control group more representative of commercial conditions (5.5 m 2 , minimally enriched with wood shavings and mats for thermal comfort).Previous work has shown that physical enrichment may promote the development of working memory and positive affective states in pigs (Asher et al., 2016;Bolhuis et al., 2013;De Jong et al., 2000;Douglas et al., 2012;Grimberg-Henrici et al., 2016;Luo et al., 2020).

Novel Object Test
Participation and performance in learning tasks may be affected by noncognitive factors, such as motivation and response to novelty (Boogert et al., 2006;Griffin & Guez, 2014;van Horik & Madden, 2016).To investigate how novelty responses may have influenced performance in the acquisition learning and reversal learning tasks, we quantified pigs' latency to contact a novel object in a separate test.Briefly, pigs were individually presented with a novel object (small traffic cone) and allowed to interact with it for 1 min.The test was carried out in a familiar arena, separate from the arena used for the acquisition learning and reversal learning tasks.Pigs that did not contact the novel object within 1 min were given a maximum latency of 60 s.As the study design was changed from Batch 3 onwards to incorporate the reversal learning task, the novel object test was conducted when pigs were 10 weeks old in Batch 2, and 8 weeks old in all subsequent batches (see Table A1).

Acquisition Learning Task
As part of the wider project (see Table A1), pigs were trained on a go/no-go judgement bias task to assess affective state (Düpjan et al., 2017;Mendl et al., 2009).Pigs first learned to discriminate between a positive goal box on one side of an arena and a negative goal box on the opposite side, before being presented with ambiguous cues at intermediate locations (Fig. A1).To assess acquisition learning speed in the present study, we compared the time taken for pigs to learn the initial positive/negative discrimination, before they were presented with intermediate cues in the judgement bias stage (judgement bias responses were not the focus of this study).
Pigs were habituated to an arena and then trained to open a positive goal box on one side of the room (left or right, balanced within pens), containing a food reward (Fig. A2).Once pigs were reliably opening the positive box to obtain the reward, they progressed to the discrimination training stage.At this stage, we introduced the negative goal box containing an inaccessible food item (no reward) and a mild punishment (activation of a fan placed behind the goal box).Positive and negative goal boxes were presented one at a time, in a pseudorandomized order.Each trial ended when the pig opened the goal box (go response), or when the time limit was reached (no-go response).Pigs took part in up to five discrimination training sessions, with up to eight consecutive trials per session.The acquisition learning task began when pigs were 9 weeks of age and continued for 2 weeks (10 weeks of age for Batch 2, see Table A1).A detailed methodology for the acquisition learning task is available in the Appendix.
Sessions were terminated early if pigs showed signs of distress (loud or high-pitched vocalizations or escape attempts from the arena) in two consecutive trials.In the first experimental batch it was found that pigs were becoming distressed during negative trials by having to remain in the arena up to the time limit after refusing to open the negative goal box.For this reason, we introduced clear criteria allowing trials to be ended early when pigs made a 'clear no-go decision'.To make a clear no-go decision, pigs had to enter the arena, clearly direct their head towards the goal box, return to the start gate immediately and remain there for 5 s.These criteria were agreed by at least two trained experimenters that were present, before the pig was allowed to leave the arena.Clear no-go decisions could only be made by pigs that had previously opened the negative box, and thereafter applied to all acquisition learning trials for that pig (positive and negative).

Acquisition Learning Scores
Pigs were considered to have scored correctly if they opened the box in positive trials (go response) and chose not to open the box in negative trials (no-go response).Acquisition learning speed was quantified as the number of trials taken to score correctly in 10/12 consecutive trials, after opening the negative box for the first time.We excluded pigs that did not open the negative box within four presentations.A score of 10/12 trials correct exceeds chance expectation and pigs reaching this criterion were considered to have reliably learned the discrimination (Shaw et al., 2015).Pigs that did not reach this criterion were considered to have failed in learning the discrimination and were excluded from the analysis of acquisition learning speed (see Statistical Analysis).

Reversal Learning Task
From Batch 3 onwards, a reversal learning task was introduced to determine how cognitive flexibility relates to acquisition learning speed and contest outcome.The reversal learning task occurred when pigs were 12 weeks of age and had taken part in the judgement bias task and the contest (judgement bias data were not the focus of the present study).The reversal learning task took place in the same arena as the acquisition learning task and was almost identical in format.However, in the reversal learning task pigs were presented with two goal boxes at the same time and allowed to choose between them.
To confirm that pigs remembered their previously learned positive location, pigs first underwent 'refresher sessions' where the original positive and negative goal boxes were presented at the same time.Pigs were allowed to choose one box, before being returned to the starting area.They took part in up to three refresher sessions of six trials each (18 trials total), until they reached performance that exceeded chance expectation (10/12 or 6/6 consecutive trials correct).The majority of pigs (104/120) achieved six correct trials in their first refresher session and did not require any further refresher trials.
After passing the refresher sessions, pigs progressed to the reversal stage, where they were presented with two goal boxes in the same locations but with the positive and negative contingencies reversed.As for the acquisition learning task, trials ended when a pig opened one of the two boxes, or when the time limit was reached.If a pig chose the negative goal box or failed to choose a box, they were encouraged to the positive box before being returned to the starting area for the next trial.In total, pigs received 20 reversal trials over three sessions.

Reversal Learning Scores
As pigs had fewer opportunities to learn the reversal learning task (20 trials), it was likely to be more challenging to reach the learning criterion compared to the acquisition learning task.To allow all pigs to be included in the analysis, reversal learning performance was quantified as a binary measure of success or failure to learn the reversal.Pigs were considered to have successfully learned the reversal if they scored correctly in either 10/12 or 6/6 consecutive trials, as both criteria exceed performance expected by chance.Pigs that did not achieve either of these criteria were considered to have failed the reversal learning task.For this shorter task, a binomial measure was also chosen because pigs showed low variation in the number of trials taken to reach criterion (10/12 correct: 13e20 trials, mean ± SD ¼ 18.7 ± 1.97; 6/6 correct: 9e20 trials, mean ± SD ¼ 18.1 ± 2.64).

Dyadic Contest
Following previously developed protocols (Camerlink et al., 2015(Camerlink et al., , 2016(Camerlink et al., , 2017)), pigs took part in a dyadic contest against an unfamiliar opponent at approximately 11 weeks of age.The contest took place in a novel arena (3.8 Â 2.9 m) with water (provided via two nipple drinkers) and a light cover of wood shavings, but no food resources.Opponents were marked with livestock spray for identification, and then entered the arena from opposite gates at the same time.The outcome of the contest was recorded by trained observers, with the losing pig identified by clear 'head-tilt retreat' behaviour followed by no retaliation to aggression within 1 min of retreat (Camerlink et al., 2016).Retreat could occur at any point during the contest, including before the contest escalated to damaging aggression (e.g. during the display phase).Contests were ended after 15 min if there was no clear winner.They were also ended early if welfare endpoints were reached (excessive vocalization behaviour, repeated attempts to escape from the arena, repeated mounting behaviour; see Appendix).All contests were recorded using an overhead camcorder (Canon Legria HFG25), and any unclear outcomes confirmed from video footage.As pigs show sexual dimorphism in agonistic behaviour (Camerlink et al., 2022), all opponents were matched for sex (femaleefemale or maleemale dyads).Body weight is a major component of RHP in pigs (Camerlink et al., 2017;Rushen, 1987), and therefore opponents were either matched for body weight (within ca.12%) or not (>20% difference; Camerlink et al., 2017; Table A2).
Owing to changes made to the study design after the first batch of pigs were tested, this study focused on pigs in Batches 2e8 where data are more directly comparable (N ¼ 195).In Batch 4, one pig died for reasons unrelated to the study, giving a total sample size of 194 pigs from 48 litters.Model sample sizes varied depending on the data available (see below).

Factors affecting dropout rates from cognitive tasks
Of the 194 test pigs, 117 provided an acquisition learning score for analysis.On average, these pigs took 18 ± 5.6 trials to reach the learning criterion of 10/12 consecutive trials correct (range 12e33 trials).Acquisition learning scores could not be obtained from the remaining 77 pigs for the following reasons: ill health (3); failing to habituate to the test situation (48); completing the test but failing to open the negative box within four attempts, or failing to score 10 out of 12 consecutive trials correctly (23); failing to meet criteria within the remaining training sessions after requiring additional pretraining sessions (3).Two pigs were also excluded from the model as they did not take part in the novel object test due to health issues, giving a final sample of 192 pigs from 48 litters.
A binomial generalized linear mixed model (GLMM) was used to identify biases in the sample of pigs included in the analyses of acquisition learning speed.Model terms included a binary response for inclusion in the analysis, according to whether pigs met the criteria for learning the task or not (0/1), with fixed effects of sex (male/female), socialization treatment (S/NS), enrichment treatment (E/B), weight (at 11 weeks old) and novelty response (latency to contact novel object in the novel object test), a two-way interaction between socialization and enrichment and litter as a random effect.
An identical model was run for inclusion in the analyses of reversal learning performance.As the reversal learning test was introduced from Batch 3, this model represented a smaller sample of 170 pigs from 42 litters.Of these 170 pigs, 109 completed 20 reversal learning trials and provided a reversal learning score (succeeded/ failed to learn the reversal).Pigs varied in their performance in the reversal learning task, scoring an average of 9.4 ± 2.8 trials correct (range 2e15).In total, 55 pigs passed the reversal learning test, 54 failed to meet either learning criterion (either 10/12 or 6/6 consecutive trials correct) and 61 were excluded from further analysis for the reasons outlined above or for failing to learn the initial positive/negative discrimination sufficiently.One pig was also excluded because it did not take part in the novel object test.

Factors influencing performance in cognitive tasks
For the pigs that provided an acquisition learning score, we investigated the effects of sex, socialization treatment, enrichment treatment, weight and home pen relative bodyweight (as a proxy of social dominance: weight relative to the average weight of littermates in the home pen, hereafter referred to as 'dominance score') on task performance (speed of learning).This model included the 116 pigs (from 45 litters) that opened the negative box within four attempts, reached the criterion of scoring 10/12 consecutive trials correctly and took part in the novel object test.A negative binomial GLMM included number of trials taken to reach criterion (after opening the negative box for the first time) as the response variable.Sex, socialization treatment, enrichment treatment, weight (at 11 weeks) and novelty response (latency to contact the object in the novel object test) were included as fixed effects.As an additional fixed effect, we included dominance score.Both weight and dominance score were centred and scaled to facilitate model convergence.The model also included a two-way interaction between socialization and enrichment treatment, and litter as a random effect.
Similarly, for the pigs that completed the reversal learning task, we investigated whether sex, socialization treatment, enrichment treatment, weight and dominance score predicted a pig's likelihood of successfully learning the reversal.This model was run as a binomial GLMM with task performance (pass/fail) as a binary response variable, where pigs were considered to have successfully learned the reversal if they chose the positive goal box in 10/12 or 6/ 6 consecutive trials.As above, fixed effects included sex, socialization treatment, enrichment treatment, weight (centred and scaled), novelty response, dominance score (centred and scaled), and a two-way interaction between socialization and enrichment treatment.Litter was included as a random effect.
We also investigated whether pigs' acquisition learning score predicted their success in the reversal learning test using a binomial general linear model.Success/failure in the reversal learning test was included as the binary response variable, with acquisition learning score as the independent variable.This model included data from the 87 pigs for which an acquisition learning score and reversal learning score were available.

Factors predicting contest outcome
As many pigs only had data available for one cognitive task and there was no strong correlation between acquisition learning score and reversal learning performance (see Results), we ran separate models to investigate the influence of acquisition learning and reversal learning performance on contest outcome.
The influence of acquisition learning speed was assessed using a binomial GLMM with the outcome of the contest (win/lose) as a binary response variable.Fixed effects included sex, socialization treatment of the focal pig relative to its opponent (S/NS, S/S, NS/S, NS/ NS), relative weight difference (calculated using the formula: (focal weighteopponent weight)/average (focal weight þ opponent weight)) and acquisition learning score (number of trials taken to score 10/12 correct after opening the negative box).As sex and socialization experience have been shown to influence contest dynamics in pigs (Weller et al., 2019b), we included an interaction between sex and the socialization variable.As contests were sex matched, sex was included for its interaction with socialization and was not expected to have an independent effect on contest outcome.Further, as body weight is a major determinant of RHP, we also fitted an interaction between relative weight difference and acquisition learning score.Dyad was included as a random effect.This model included 105 pigs from 73 dyads (Batches 2e8).For 32 dyads, both opponents had an acquisition learning score and for the remaining 41 dyads, only one opponent had an acquisition learning score available.
A similar binomial GLMM investigated the influence of reversal learning performance on contest outcome.Again, contest outcome was the response variable, with sex, socialization treatment (relative to opponent) and relative weight difference as fixed effects.Reversal learning performance (pass/fail) was included as an additional fixed effect, along with two-way interactions between sex and socialization treatment, and between relative weight difference and reversal learning performance.Dyad was included as a random effect.This model included 101 pigs from 67 dyads (Batches 3e8).For 34 dyads, both opponents contributed a reversal learning score and, for 33 dyads, reversal learning scores were only available for one opponent.A supplementary model restricted to pigs in weight-matched dyads (within 12% body weight; N ¼ 51; see Appendix) was used to confirm the observed relationship and contained reversal learning score as a single fixed effect with a random effect of dyad.
Finally, there was no significant relationship between pigs' acquisition learning score and their reversal learning performance (X 2 1 ¼ 0.75, P ¼ 0.387; Fig. 1).

Factors Predicting Contest Outcome
We ran separate models to investigate the effects of acquisition learning score and reversal learning performance on contest outcome.As expected, in the acquisition learning model contest outcome was strongly predicted by the relative weight difference between opponents, with heavier pigs being more likely to win (X 2 1 ¼ 14.97, P < 0.001; Table A5).Acquisition learning score showed a weaker, nonsignificant trend, with slow learners being slightly more likely to win their contest than faster learners (X 2 1 ¼ 2.94, P ¼ 0.086; Fig. A3).The interaction between relative weight and acquisition learning score had no significant effect on contest outcome (X 2 1 ¼ 2.00, P ¼ 0.157).The socialization treatment of opponents (X 2 3 ¼ 1.60, P ¼ 0.659), and the interaction between socialization treatment and sex (X 2 3 ¼ 5.45, P ¼ 0.142) also had no effect on contest outcome.
Similarly, in the model investigating the effects of reversal learning performance, pigs that were heavier than their opponent  were more likely to win (X 2 1 ¼ 14.96, P < 0.001; Table A5).Furthermore, reversal learning performance was weakly but significantly associated with contest outcome, such that pigs that passed the reversal learning task had a higher probability of winning the contest than those that failed the task (X 2 1 ¼ 4.81, P ¼ 0.028; Fig. 2).Relative weight did not interact with reversal learning performance to influence contest outcome (X 2 1 ¼ 2.95, P ¼ 0.086).As for the acquisition learning model, socialization treatment of opponents (X 2 3 ¼ 0.34, P ¼ 0.952) and the interaction between sex and socialization treatment (X 2 3 ¼ 2.92, P ¼ 0.405) did not predict contest outcome.In a confirmatory analysis restricted to pigs from weight-matched dyads (within 12% body weight; N ¼ 51), reversal learning performance remained a significant predictor of contest outcome (X 2 1 ¼ 5.92, P ¼ 0.015; Fig. A4).

DISCUSSION
As expected, the outcome of contests was primarily predicted by a pig's weight relative to its opponent's (Rushen, 1987).However, pigs that successfully passed the reversal learning task also showed a higher probability of winning their contest compared to those that failed to learn the reversal, consistent with our original prediction.While there was no significant interaction between relative weight and reversal learning performance on contest outcome, visualization of the data suggests that pigs that passed the reversal learning task had a higher probability of winning unless they already had a substantial size advantage over their opponent.This idea was further supported when the analysis was restricted to pigs from weight-matched dyads.In this study, the short timescale for the reversal learning task (20 trials) meant that a binomial measure of success or failure to learn the task was most appropriate for capturing variation in pigs' performance.Conducting similar reversal learning tasks over a longer period would allow for a more detailed analysis of performance, including examining trials taken to reach criterion.
Pigs' success in the reversal learning task was not associated with performance in the acquisition learning task, supporting the idea that acquisition and reversal learning may be governed by distinct neuronal mechanisms (Ghahremani et al., 2010).This highlights the importance of using multiple tasks to target different cognitive processes and reveal a more complete picture of intraspecific variation in cognitive abilities.The results of the acquisition learning task showed a nonsignificant trend where slow learners had a higher probability of winning their contest, after accounting for weight differences between opponents.This effect contrasts with our prediction that acquisition learning ability forms a component of RHP, a finding that is difficult to interpret.In our case, it may be an artefact of the data, as there was also a slight (nonsignificant) trend for heavier pigs to be slower learners in the acquisition learning task.As heavier pigs within a cohort were more likely to act as the larger opponent in a weight-unmatched dyad (as opposed to the smaller opponent), this may have created a statistical confound resulting in slow learners appearing more likely to win the contest.
Overall, our results suggest that cognitive flexibility may be advantageous in contests between unfamiliar pigs.While it is well established that performance in cognitive tasks can reflect noncognitive traits such as motivation and response to novelty (Griffin & Guez, 2014;van Horik & Madden, 2016), variation in reversal learning performance was robust to the effects of sex and early life experience, and showed no correlation with pigs' latency to contact novel objects in a separate test.Moreover, as pigs were trained to criterion in the acquisition task and took part in several 'refresher' sessions prior to the reversal learning test, we can be reasonably confident that the pigs that progressed to the reversal learning stage met a minimum level of motivation required to take part.Body weight and social dominance in the home pen (as approximated by weight relative to littermates) were also accounted for as other potential factors of motivation, and neither showed a significant association with reversal learning performance.
While preweaning social enrichment and postweaning physical enrichment influenced dropout rates from the initial acquisition learning task, we did not find any effect of early life treatment on overall performance in the acquisition or reversal learning tasks for the remaining pigs.This contrasts with the expectation that physically and/or socially enriched environments promote the development of learning and memory (Ashton et al., 2018;Fischer et al., 2021;Lambert & Guillette, 2021;Leggio et al., 2005;Salvanes et al., 2013).For example, some studies have demonstrated that provision of physical enrichment is associated with improved spatial memory performance in pigs (De Jong et al., 2000;Grimberg-Henrici et al., 2016), while others have found that pigs experiencing a more physically enriched environment made more errors in a reversal learning task (Mendl et al., 1997).The effects of social enrichment on cognitive performance in pigs has received less research attention than the effects of physical enrichment, with the only study to date suggesting that preweaning socialization has no significant effect on reversal learning abilities (Weller, Turner, Futro, et al., 2020).However, the findings of these studies may also be partly explained by other noncognitive differences between pigs from enriched and less-enriched environments, including differences in food motivation (Grimberg-Henrici et al., 2016;Mendl et al., 1997), response to novelty or social isolation (De Jong et al., 2000;Jansen et al., 2009;Wemelsfelder et al., 2000) and personality (Bolhuis et al., 2013).This may partly explain why, in our study, physical and social enrichment influenced dropout rates in the early stages of the acquisition task.It has also been suggested that simple tasks, like the binary choice task used here, may not be complex enough to demonstrate the effects of early life stress on cognitive performance (Jansen et al., 2009).Furthermore, while pigs' home pens contrasted in enrichment regimes, frequent participation in cognitive tasks may have acted as enrichment for pigs in lessenriched housing and reduced any potential effects of home pen enrichment on learning rates.
Our findings suggest that cognitive flexibility may contribute to RHP, and adds to our understanding of how cognitive variation influences animal contests (Reichert & Quinn, 2017).Compared to acquisition learning, fewer studies have examined the relationship between reversal learning performance and competitive ability.During contests, cognitive flexibility may help individuals to anticipate and attend to the behaviour of rivals, assess their likelihood of winning a contest, and inhibit and update previously learned responses (Izquierdo et al., 2017;Reichert & Quinn, 2017).Reversal learning comprises several components: individuals must attend to a change in reward contingencies; inhibit their previously learned responses; overcome any aversion to the previously unrewarded stimulus and learn the new association (Aljadeff & Lotem, 2021;Izquierdo et al., 2017).Further research is needed to tease apart the relative contributions of these factors and identify which aspects of reversal learning performance are conferring an advantage in contests between unfamiliar pigs.
While few studies have investigated the influence of reversal learning performance on RHP, there is some evidence to support the benefits of reversal learning as it relates to social rank more generally (which, in some species, may be determined by the outcomes of contests).Results are currently mixed, with some studies showing that dominant individuals outperform subordinates in reversal learning tasks (Heinen et al., 2021), while others show the opposite pattern (Bunnell et al., 1980) or find no effect of reversal learning performance (Kar et al., 2017).The value of reversal learning may differ depending on the ecological conditions to which dominant and subordinate individuals are exposed.For example, cognitive flexibility may be more beneficial for subordinate animals when their access to resources is limited, either directly as a result of their low rank or if environmental conditions create high competition between conspecifics (Heinen et al., 2021).Another key question relates to whether individuals are able to attain a particular social rank as a result of their cognitive abilities (prior attributes hypothesis; Chase et al., 2002), or whether individuals develop particular cognitive abilities as a result of their social rank (social state dependent hypothesis; Langley, van Horik, et al., 2018).While it can be challenging to determine the directionality of the relationship between cognitive performance and social rank, some studies have succeeded in doing so (Garnham et al., 2019;Jaafari suha et al., 2022;Langley, van Horik, et al., 2018;Matzel et al., 2017).Overall, these studies suggest that the picture may be even more complex than previously thought, where cognitive ability can both influence and be influenced by social rank over an individual's lifetime (Jaafari suha et al., 2022).Our study does not allow us to make inferences about the directionality of the relationship between reversal learning performance and contest outcome.However, we found that a proxy score for pre-existing social dominance (represented as proportional weight relative to the average weight of littermates in the home pen) did not predict acquisition learning or reversal learning performance.As both domestic and wild pigs establish dominance at a very young age (Graves, 1984), it would be difficult to tease apart the directionality of the relationship between cognitive performance and social dominance in this species, even in controlled experimental settings.
Outstanding questions remain as to whether cognitive flexibility allows individuals to resolve contests more quickly and/or selectively choose to avoid contests that they are unlikely to win.While winning contests may influence dominance and access to resources, winning will not always be beneficial if it entails a costly contest (Maynard Smith & Parker, 1976;Parker, 1974).Rather, individuals may use various assessment strategies when choosing how and when to escalate a contest (Arnott & Elwood, 2009).Many animals use prior experience to inform their decision to engage in contests (including pigs; Oldham et al., 2020), and highly flexible individuals may be better able to adjust their behaviour in response to signals of retreat, or in response to new information about their opponent's motivation and RHP.The role that cognition plays in the assessment of RHP is not well understood, and there is debate around the potential cognitive demands associated with different contest assessment strategies (Elwood & Arnott, 2012;Fawcett & Mowles, 2013;Reichert & Quinn, 2017).Given that assessment strategies may show plasticity over an individual's lifetime, or even over the course of a single contest (Chapin et al., 2019;Hsu et al., 2008), cognitive flexibility could play an important role in influencing the costs and outcomes of contests.Further research is also needed to determine how the relationship between cognitive flexibility and contest dynamics translates beyond dyadic contests, where individuals may encounter several unfamiliar rivals at once.For example, these situations may arise when individuals join a new social group, where individuals aggregate to compete for resources (e.g.leks), or during instances of intergroup conflict (Ashton et al., 2020).Similar group-mixing scenarios are also commonly employed as part of routine management on pig farms (Peden et al., 2018;Turner et al., 2001).Establishing dominance among several unfamiliar rivals is likely to be more cognitively demanding than the dyadic interactions studied here, and information gathering and cognitive flexibility may confer benefits in addition to those associated with size and strength.Conversely, cognitively inflexible individuals may be at a disadvantage if they continue to perform the same costly behaviours, such as repeatedly initiating fights with opponents of higher RHP.It would also be interesting to examine how cognitive flexibility influences bystanders' decisions to intervene in an ongoing contest (e.g.Dugatkin, 1998;Jennings & Gammell, 2022).Another open question concerns how cognition interacts with other traits to influence contest behaviour in pigs and other animals.Personality, cognition and affective state may interact to influence how individuals gather and appraise information during contests, and integrate this information with their previous experience (Briffa et al., 2015;Crump et al., 2020;Reichert & Quinn, 2017).Recent years have seen growing interest in integrating personality and cognition research into contest theory (reviewed in Briffa et al., 2015;Reichert & Quinn, 2017), but few empirical studies have examined the interactive effects of personality, cognition and affective state on agonistic behaviour (but see Garnham et al., 2019).Further, a number of aspects of contest skill have now been defined and characterized (Briffa & Lane, 2017), yet it remains to be determined how cognitive ability contributes to variation in skill.Understanding how individual traits interact to determine the outcomes and dynamics of animal contests would give a more holistic view of behaviour, which would be valuable from a fundamental and applied perspective.

Data Availability
Data and R code associated with this paper are available in the Figshare repository: figshare.com/s/260bf30d251517400a82.

Declaration of Interest
The authors report no conflicting interests.Findings contained in this paper were presented at the 56th Annual Congress of the International Society for Applied Ethology (ISAE).
(e.g.raising feet off the ground and against a wall); injurious single escape attempts; vocalizing loudly and continuously for 2 min; freezing and hyperventilating for 1 min; (2) mounting: five full mounts; mounting continuously for 1 min; mounted animal is at risk of injury or becoming distressed (vocalizing continuously for 1 min); (3) health concerns: reddening/lesions on >75% of the body accompanied by hyperventilation; open wounds or other injuries excluding superficial scratches and surface lesions; lameness where a change in gait is detectable to the observers.V. E. Lee et al. / Animal Behaviour 214 (2024) 27e41

Figure 1 .
Figure 1.Pigs' performance in the reversal learning task (0 ¼ fail, 1 ¼ pass) according to their performance in the acquisition learning task (trials taken to reach 10/12 correct; lower score ¼ faster learners).Black circles represent data points; red circles represent mean and standard error.

Figure 2 .
Figure 2. Relationship between reversal learning performance (fail/pass) and probability of winning the contest.While the interaction between reversal learning performance and relative weight was not statistically significant, relationships are visualized according to relative weight as the most important predictor of contest outcome.(a) Predicted probability of winning the contest for pigs that passed and failed the reversal learning task, accounting for weight in relation to opponent.Predicted relationships were generated from the model using 'ggpredict' and shaded areas represent 95% confidence intervals.(b) Proportion of pigs winning the contest according to performance in the reversal learning task (fail/pass) and body weight relative to their opponent.

Figure A1 .
Figure A1.Schematic of the arena used for the acquisition learning task.The acquisition learning task also served as training for a judgement bias test conducted as part of the wider project, where pigs were presented with ambiguous goal boxes at intermediate locations between the positive and negative reference locations (P ¼ positive location, N ¼ negative location, NP ¼ near-positive, M ¼ middle, NN ¼ near-negative).

Figure A2 .Figure A3 .Figure A4 .
Figure A2.Goal box used in the acquisition learning and reversal learning tasks.Pigs were required to open the flap on the front of the box with their snout to obtain the food reward (positive location).At the negative location, goal boxes did not contain a food reward and a fan placed behind the box would be activated when the box was opened.Photo credit: M. Farish.

Table A1
Timeline of tests for each batch, as part of a wider project investigating the effect of cognitive performance and affective state on contest behaviour To assay social preference, pigs spent 3 min in an arena with two small stimulus pigs penned on one side and two large stimulus pigs on the opposite side.Subject pigs were allowed to interact with stimulus pigs through the penning before being returned to the home pen.Total 4 trials per pig (one trial per day over 4 days) Batch 3e8: 29 Novel object test (Batch 3e8) Subject pigs spent 1 min in an arena containing a novel object (traffic cone).Novel object test was conducted after the social preference test in Week 8 for Batches 3e8, Pigs trained to discriminate between goal boxes at positive and negative locations.Go/ no-go responses quantified as a measure of acquisition learning speed Subject pigs spent 1 min in an arena containing a novel object (traffic cone).Novel object test was conducted after the social preference test in Week 8 for Batches 3e8, and after discrimination training in Week 10 for Batch 2 Pigs presented with goal boxes at positive and negative locations, and three intermediate ambiguous locations.Pigs took part in one judgement bias test before the contest, and one judgement bias test after the contest Batch 2: 53e56; Batch 3e8: 46À49 Attention bias test x2 Pigs entered a familiar arena containing food, before being briefly startled by a mildly aversive stimulus.Behaviours indicative of attention bias were recorded for 1 min before pigs were returned to the home pen.Pigs took part in one attention bias test before the contest, and one attention bias test after the contest Behavioural data included in the present study are highlighted in bold.Owing to changes to study design, pigs in Batch 2 took part in some tests at a slightly later stage than pigs in Batches 3e8.Values derive from the full model before nonsignificant interactions were dropped.