Estimating Cognitive Ability in the Wild: Validation of a Detour Test Paradigm Using a Cichlid Fish ( Neolamprologus pulcher )

: Cognitive abilities vary within and among species, and several hypotheses have been proposed to explain this variation. Two of the most prominent hypotheses regarding the evolution of cognition link increased social and habitat complexity with advanced cognitive abilities. Several studies have tested predictions derived from these two hypotheses, but these were rarely conducted under natural conditions with wild animals. However, this is of particular importance if we aim to link cognitive abilities with fitness-relevant factors to better understand the evolution of cognition. The biggest hurdle to assessing cognition in the wild is to find a suitable setup that is easy to use under field conditions. Here, we set out to evaluate an extremely simple test of cognitive ability for use with a broad range of aquatic animals in their natural habitat. We did so by developing a detour test paradigm in which fish had to detour a clear obstacle to reach a food reward. By altering the difficulty of the task, we confirmed that this setup is a valid test of cognitive abilities in wild groups of a Lake Tanganyika cichlid, Neolamprologus pulcher . Subsequently, we probed specific predictions from the two major hypotheses regarding cognitive evolution using the most difficult test configuration. Specifically, we tested the variation in cognitive abilities among groups of different sizes occupying habitats of varying complexity. We find mixed support for both hypotheses, but we hope that our work inspires future investigations on the evolution of cognition in Lake Tanganyika cichlids.


Introduction
Cognitive abilities vary widely across the animal kingdom [1].The quest to explain this variation, together with the wish to better understand the roots of our own cognitive evolution [2] and explain the more astonishing examples of animal cognition (e.g., spatial memory [3] or communal hunting [4]), has inspired a large body of work [5].From this literature, certain factors are indicated as interacting with the evolution and development of cognitive abilities [6].Across species, ecological factors are emphasised [7,8], particularly sociality [9,10], habitat complexity [11], and diet [12].Within species, early-life effects, particularly those relating to the social environment, and an individual's current condition have received special attention in studies of cognitive ability [13][14][15][16].Together, these intraand interspecific studies suggest general trade-offs between the costs (e.g., the development and maintenance of a larger brain [17]) and benefits (e.g., increased success in contests [18]) of enhanced cognitive abilities [1].
Despite the consensus that cognitive ability is an evolved trait worth studying [19], there exists a wide range of approaches on how to actually do so [1,20].A key issue in this regard is the fact that 'cognitive ability' is differentially expressed in different species [21].It may, for example, be shown by enhanced spatial memory [3], improved group coordination [4], or sophisticated tool use [22].It is, thus, not trivial to compare the cognitive abilities of species with very different ecologies and phylogenetic histories [23].One suggestion for unifying the different ways of estimating cognitive ability is to use 'behavioural flexibility' as a general expression of cognition [24].In this view, the exact form that cognitive ability takes is not important, but the fact that one species (or individual) is more behaviourally flexible than another is an indicator of its greater cognitive ability (by virtue of showing more different and/or more appropriate behaviours in a given context [24]).A paradigm that has proven useful in this regard is the 'detour task', a behavioural assessment of an animal's ability to circumvent a (partly) invisible barrier that blocks the direct route to a reward [25].This ability is then typically interpreted as a form of 'inhibitory control', itself a form of 'behavioural flexibility', which signifies greater cognitive ability in those animals that are better at detouring [25][26][27].
A second issue in the study of cognitive ability across the tree of life pertains to taxonomic biases in the taxa under investigation [23].Much of the now classic work in animal cognition has focused on birds and mammals, with other taxa being relatively underrepresented [5,8,20,28].This is now rapidly changing as the literature on the cognitive abilities of nonavian and nonmammalian systems is steadily growing, especially for aquatic organisms (for recent reviews, see [29][30][31][32][33][34]). What this brings with it, however, is an increased need to resolve the above issue of making cognitive research 'comparable'.In other words, we require new ways of assessing cognitive ability in ecologically relevant contexts that allow for comparisons not just within a given species (or small set of species with similar ecologies) but across a wide range of species and ecologies [23] and that are, ideally, compatible with past work [21].Researchers working on birds and mammals have long identified this issue and, thus, have made progress in that direction (e.g., [8,22,35]), but cognition studies of other animals are somewhat lagging behind in this regard.For example, feeding tasks have been used to great success to study cleaner fish cognition with regard to the variation among related species [36], in comparison to other vertebrates [37], and to unravel the neurological and ecological underpinnings of the variation in cognitive ability [38].However, it is difficult to translate such tests for studying organisms with different feeding ecologies, e.g., those feeding on plankton or grazing on algae.
Here, we set out to develop an extremely simple test of cognitive ability for use with a broad range of aquatic animals in their natural habitat.We did so by using the aforementioned paradigms of detour behaviour as a test of behavioural flexibility [25], and behavioural flexibility, in turn, as an indicator of general cognitive ability [24].Our current work focuses on using this test to study variation in cognitive ability in response to differences in the social and structural environments of the cooperatively breeding Lake Tanganyika cichlid Neolamprologus pulcher.These fish offer great opportunities for studying cognition; this is because they are part of a large radiation of closely related species comprising a wide range of ecologies [39], they themselves constitute the pinnacle of fish sociality [40], and there already exists a large body of literature on their behavioural and cognitive responses to environmental stimuli ( [15,41,42]; see Section 2 (Methods) for additional details on the study species and why it is a suitable subject for our work).In addition, our test requires low monetary and logistic investments, it can be used to target specific focal animals (provided they show sufficient site fidelity) or as an ad libitum test station offered to a range of species and individuals at a given location, and it is functional with any type of food that may serve as motivation for animals to interact with the test.As such, we believe that we here present an easy-to-adapt cognitive test for use in aquatic field work.To prove the suitability of this approach, we conducted field experiments to probe two specific hypotheses about cognitive evolution that have previously found some support in studies of cichlids: First, the sociality and cognition hypothesis posits that animals that experience a more complex social environment show enhanced cognitive abilities [9].While there is currently no indication that more social cichlid species have larger brains [43] or are better learners [44], effects of social rearing conditions [15,42] and current social status [45] on cognitive ability have been suggested in cichlids.In other taxa, the sociality and cognition hypothesis is also discussed controversially [12,46,47], with support coming from comparative work on primates and ungulates [9,48].Many studies use group size as a proxy for social complexity, with the idea that cognitive demands increase with the number of group members [49,50].In this regard most fish species are believed to be unsuitable study systems, because most fish shoals are considered a product of selection for predator avoidance (risk dilution, safety in numbers, predator confusion, etc.) without the need for direct interactions among shoal mates and, thus, no selection for higher cognitive abilities [51].Nevertheless, there are studies in fish finding support for links between group size (or local density) and cognition [38,52].Cichlids, particularly those from Lake Tanganyika, with their complex social behaviours, are an ideal taxon to test predictions derived from the sociality and cognition hypothesis [53].We tested whether N. pulcher differed in their performance in our detour test in relation to their social environment, predicting that individuals from large groups would do better.
Second, the habitat complexity and cognition hypothesis states that animals that experience a more complex habitat show enhanced cognitive abilities [11].There is comparative evidence that the structural environment shapes the brains and behaviour of cichlids [54], and other work suggests the role of changes to the environment during development in shaping the cognitive abilities of these fish [55].In general, fish have a highly plastic brain, even as adults, and environmental factors are known to determine brain morphology and cognitive abilities in many fish species [56,57].We tested whether N. pulcher differed in their performance in our detour test in relation to the structural complexity of their habitat, predicting that individuals from rockier locations would do better.Together, this study, thus, provides guidance on how to potentially test the cognitive abilities of aquatic organisms from a wide range of species and ecosystems and uses this setup to test two popular hypotheses about the evolution of cognitive ability.

Study Species
N. pulcher is a small (<10 cm maximum standard length) cichlid fish endemic to Lake Tanganyika, where it inhabits rocky habitats [58].It is notable for its social system, being one of only a handful of fish species that exhibit truly cooperative brood care [40].Both ecological constraints (in the form of predation [59]) and benefits of philopatry (in the form of enhanced survival and reproduction [60]) have been shown to select for the obligate sociality of this species [58].Within each cooperative group, fish are organised in a size-based hierarchy [61] with the largest individuals of either sex largely monopolising reproduction [62].As such, the benefits of sociality are size-specific: large individuals mainly profit from group-size effects on reproduction [63], while small individuals benefit from enhanced survival [59].However, to reap these benefits, individuals are in a constant negotiation process over group membership and cooperative investment, the outcome of which is, at least partly, impacted by broader social and ecological factors [64][65][66][67].These fish, thus, live very socially complex lives [53], making them a prime target for investigating the link between sociality and cognition [51,68].In addition, the fish have a wide distribution across Lake Tanganyika [69], facing habitats of diverging complexity with regard to physical structure, predation risk, and competition [67,70].N. pulcher groups can be found in habitats with a complete rock cover, including crevices in and between massive boulders, and in areas mostly covered by sand with sparse rock cover [67].The fish use crevices and holes as shelters for breeding and hiding and will actively build such structures by digging where sand is plentiful.This makes them also highly suitable for investigations of the links between habitat complexity and cognition [11].

Field Work
We conducted field work from 15 April 2022 to 2 May 2022 in two distinct localities in southern Lake Tanganyika: one located at the eastern shore of Mutondwe (Crocodile) Island, in front of Chikonde village (locality 1, at approximately 8 • 42 ′ 43 ′′ S, 31 • 07 ′ 33 ′′ E), and one located at the southwestern tip of Kumbula (Mbita) Island (locality 2, at approximately 8 • 45 ′ 15 ′′ S, 31 • 05 ′ 06 ′′ E).We did not observe any major differences in visibility among the localities, but visibility varies daily in Lake Tanganyika.However, the visibility conditions were unlikely to affect the detection of the food reward, because the experimental setups were placed within territorial boundaries (see below).At both localities, groups of N. pulcher could readily be found.We subsequently identified 5 m × 5 m plots of different structural complexities in each locality [70] and marked them with a grid of thin nylon threads.The plots in locality 1 were located at 11 m (Plot 1A) and 5 m (Plot 1B) depths and those in locality 2 at 7 m (Plot 2A) and 8 m (Plot 2B).Note that these plots were chosen on the basis of our subjective assessment of the structural complexity during field work, and we aimed to select areas that differed substantially in structural complexity (but that also included sufficiently large numbers of N. pulcher groups).However, the actual measurement of this was conducted later in silico (see below), and some plots (particularly in locality 2) proved to be more similar in structural complexity than we had assumed during our initial subjective assessment of the habitat (see Figure 1).This underlines the importance of using an objective measure of habitat complexity, ideally during the selection of field sites.Following the realisation that our plots were more similar than we had aimed for them to be, we decided not to group the plots into low-and highcomplexity habitats and instead we chose to statistically compare the observed behaviours among all plots individually.Although we can confirm that the chosen plots differed in several characteristics simultaneously, comparing plots individually still allowed us to present the differences in cognitive performances among the plots which might have been influenced by habitat complexity.In and around these plots, we then sought groups of N. pulcher of varying sizes, aiming for those at the extremes of the group-size distribution at either locality (on average 10 (min-max: 3-21) group members).To be able to revisit the experimental groups, we placed numbered stones within their territory.In total, we tested 24 groups: 10 at the first locality and 14 at the second locality.One group was only tested twice (with the Petri dish and the long cylinder; see below) reducing the overall number of trials to 71.For each plot, we also conducted a single survey of the cichlid community found within, focusing on species with ecological relevance for N. pulcher groups.We, thus, counted potential space competitors (Eretmodus cyanostictus, Julidochromis ornatus, Neolamprologus pulcher, Telmatochromis temporalis, and Variabilichromis moorii) and predators (Altolamprologus compressiceps and Lepidiolamprologus elongatus [70]).

Video Analyses (Structural Complexity)
Using a structure from motion approach (SfM) [71], we produced 3D reconstructions of the lake bottom for a small area at each plot (6 m × 6 m, i.e., extending by 0.5 m in each direction past the grid), representative of the structural make-up in the area (Figure 1).For the full details see [70], but, in brief, we swam slowly across each grid, pointing a camera (GoPro Hero 5) downwards at a distance of approximately 0.5 m from the ground, ensuring that the whole area was filmed.We then extracted overlapping video frames at a rate of 1.5 Hz.These images were used to obtain a high-resolution 3D mesh for each plot with Meshroom (version 2023.1.0,[72]), an open-source 3D reconstruction software program.Subsequently, we imported the 3D meshes into Blender (version 3.6 [73]), where we cropped the reconstructions to the 6 m × 6 m squares.Finally, we calculated the rugosity of these areas as the surface area divided by the surface area of a flat plane of the same size.

Video Analyses (Structural Complexity)
Using a structure from motion approach (SfM) [71], we produced 3D reconstruc of the lake bottom for a small area at each plot (6 m × 6 m, i.e., extending by 0.5 m in direction past the grid), representative of the structural make-up in the area (Figure 1 the full details see [70], but, in brief, we swam slowly across each grid, pointing a ca (GoPro Hero 5) downwards at a distance of approximately 0.5 m from the gro ensuring that the whole area was filmed.We then extracted overlapping video fram a rate of 1.5 Hz.These images were used to obtain a high-resolution 3D mesh for each with Meshroom (version 2023.1.0,[72]), an open-source 3D reconstruction soft program.Subsequently, we imported the 3D meshes into Blender (version 3.6 [73]), w we cropped the reconstructions to the 6 m × 6 m squares.Finally, we calculated rugosity of these areas as the surface area divided by the surface area of a flat plane o same size.

Experimental Setup
To test the detour ability of wild N. pulcher, we used white tiles (14 cm × 14 cm were placed next to a target group.Each group was exposed sequentially in the order to three experimental conditions that varied in the difficulty to reach the rew which was either placed on a Petri dish, inside a long cylinder, or inside a short cyl (see below).The rational for the three experimental conditions was to initially use a co condition to test the motivation of fish to consume an easily accessible food re followed by two inhibitory control conditions to test the ability to detour two obst with different difficulties to reach the reward.We chose to present the inhibitory co

Experimental Setup
To test the detour ability of wild N. pulcher, we used white tiles (14 cm × 14 cm) that were placed next to a target group.Each group was exposed sequentially in the same order to three experimental conditions that varied in the difficulty to reach the reward, which was either placed on a Petri dish, inside a long cylinder, or inside a short cylinder (see below).The rational for the three experimental conditions was to initially use a control condition to test the motivation of fish to consume an easily accessible food reward followed by two inhibitory control conditions to test the ability to detour two obstacles with different difficulties to reach the reward.We chose to present the inhibitory control conditions always in the same sequence because we did not know beforehand if fish would find the food reward attractive enough to detour the cylinder and, if so, whether repeated testing of the same groups would be possible.This way we hoped to ensure the largest possible sample size for at least one of the test conditions.For all groups, we aimed to place the tile as close to the territory centre as possible without blocking access to any shelters.Once we had determined such a spot for a given group, the tile was always placed at that same location for that group.For this, we drew a sketch of the territory including the positions of all stones together with the location of the breeding shelter used by the dominant breeder pair.This allowed us to place the tile at the same location for each of the following visits.
During the first visit, the tile was equipped with a Petri dish containing one commercially available food tablet (River aqua food, Ground Tabs).At the same time, an underwater camera (GPro (San Mateo, CA, USA), Akaso Action Cam (Frederick, MD, USA)) was mounted on a tripod and placed facing towards the tile at a distance and angle that allowed for recording all activity on and close to the tile.After starting the recordings, Fishes 2024, 9, 50 6 of 18 the observer placed the food reward on the Petri dish and quickly left the group.The group was left undisturbed for 1 h, and, upon return, the observer collected the setup, as well as the camera.
During the second visit (on average 17 h (min-max: 2.5-264 h) later), we presented a tile containing a Petri dish with a long cylinder (14 cm × 12 cm (height × diameter); inhibitory control condition: long cylinder) placed on top.The cylinder was arranged in a way that fish could only enter the inside from the top.This contrasts with the 'standard' detour paradigm [25], in which cylinders are arranged with the openings on each side.Arranging the cylinder with the opening on top ensured that fish could not accidentally enter the cylinder.A few pilot trials at the Konrad Lorenz Institute of Ethology showed that cylinders with the openings on the sides did not prove difficult enough for the fish, and they easily accessed (sometimes seemingly accidentally) the reward.The observer placed the tile at the same location, arranged the camera, and inserted a food tablet inside the Petri dish.Again, the group was left undisturbed for 1 h, and, upon return, the observer collected the setup and the camera.
During the third visit (on average 51 h [4-264 h] after the second visit), we presented a tile with a Petri dish and a short cylinder (7 cm × 12 cm (height × diameter); inhibitory control condition: short cylinder) placed on top.Again, the cylinder was arranged with the opening on top.After placing the tile at the same location and starting the recordings, the group was left undisturbed for 1 h, at the end of which all equipment was again retrieved.

Video Analyses (Behavioural)
From the behavioural videos we recorded three timestamps: the timestamp when the food was placed on the Petri dish or inside the cylinder (i.e., start timestamp); the timestamp when the first N. pulcher interacted with the setup (i.e., interacting timestamp); and the timestamp when the first N. pulcher fed on the reward (i.e., feeding timestamp).An interaction with the setup consisted of either (i) physical contact between a fish and the apparatus or (ii) the full immersion of a fish inside the cylinder.With these timestamps, we could calculate the latency to interact (i.e., interacting timestamp minus start timestamp) and the latency to feed (i.e., feeding timestamp minus start timestamp), as well as the difference, in seconds, between the first interaction and the first successful feeding (i.e., feeding timestamp minus interacting timestamp).Furthermore, we recorded the number of individual N. pulcher interacting with the setup and the number of individual N. pulcher successfully feeding on the reward.In the two inhibitory control conditions we also recorded every failed attempt when a N. pulcher tried to reach the reward directly and touched the cylinder, i.e., when it failed to detour the obstacle.We stopped recording behaviours after 45 min had passed since the food had been placed on the Petri dish, except in one trial (control condition) where we stopped recording behaviours earlier because the food was entirely depleted after 22 min.

Statistical Analysis
Statistical analyses were conducted using R 4.3.1 [74] with the packages lme4 [75] and afex [76].To analyse whether the experimental setup created a cognitive challenge, we used linear mixed models (LMMs) and generalised linear mixed models (GLMMs) with a binomial error distribution.To quantify the motivation of fish, we used the latency to interact, and to quantify the ability of fish to solve the cognitive challenge, we used the latency to feed after the first interaction with the setup.To compare both in terms of the inhibitory control conditions, we used a LMM and included the factor 'Inhibitory control condition', with two levels, 'long cylinder' and 'short cylinder', as an independent variable and 'Group ID' as a random effect to control for repeatedly using the same groups in different conditions.To analyse the number of individuals feeding on the reward relative to the number of individuals interacting with the setup, we included the total counts of the number of individuals feeding on the reward and the number of individuals interacting with the setup as the dependent variable in a GLMM with 'Inhibitory control condition' as the independent variable and 'Group ID' as a random effect.
To analyse whether habitat complexity or group size determined the performance of individuals during the control or the inhibitory control conditions, we used linear models (LMs) and generalised linear models (GLMs) with a binomial error distribution.
To analyse the latency to feed in the control condition, the latency to feed after the first interaction with the setup, and the number of failed attempts, we used LMs and included the factor 'Location' with four levels-'1A', '1B', '2A', and '2B'-and the continuous variable 'Group size' as the independent variables.To analyse the number of individuals feeding on the reward relative to the number of individuals interacting, we included the total counts of the number of individuals feeding on the reward and the number of individuals interacting with the setup as the dependent variable in a GLM with 'Location' and 'Group size' as the independent variables.
The residuals and Q/Q plots of all LMs and LMMs were visually inspected, and the distributions of the residuals were compared to a normal distribution using Kolmogorov-Smirnov and Shapiro tests.If the residuals were non-normally distributed, a log transformation was applied and the residuals, again, checked.All GLMs and GLMMs were checked for overdispersion, but none required a correction.
To obtain p-values, we used the drop1() function to perform a type II ANOVA, and the reported p-values in the tables refer to the full models.In 19 out of 24 groups, at least one N. pulcher reached the reward and successfully fed within 45 min in the control condition (groups in which no fish fed in the control condition: plot 1A-two groups (group sizes: 3 and 7); plot 1B-one group (group size: 4); and plot 2B-two groups (group sizes: 20 and 6)).The first fish reached the reward between 2.8 and 38 min (average: 20.2 min), and there were always between 1 and 5 (average: 2.4) individual N. pulcher feeding on the reward.Only those 19 groups that successfully reached the reward in the control condition were used for the analyses of the inhibitory control conditions.

Inhibitory Control Conditions
Overall, N. pulcher were similarly motivated to interact with the experimental setup, and there was no significant difference in the latency to interact with the short or long cylinder in the inhibitory control conditions (Table 1a, factor 'Inhibitory control conditions' (F 1,18 = 1 × 10 −3 , p = 0.97)).Nevertheless, N. pulcher were faster at reaching the reward after the first interaction with the experimental setup when the food was placed inside the short cylinder (Table 1b, factor 'Inhibitory control conditions' (F 1,18 = 14.91, p < 0.01), Figure 2).Furthermore, the number of fish feeding from the reward relative to the number of fish interacting with the setup was significantly higher when the food was placed inside the short cylinder (Table 2, factor 'Inhibitory control condition' (χ 2 = 8.81, p < 0.01), Figure 3).Surprisingly, although more individual N. pulcher successfully reached the reward when the food was placed in the short cylinder, they also showed more failed attempts on an individual basis (Table 1c, factor 'Inhibitory control condition' (F 1,18 = 4.9, p = 0.04), Figure 4).0.01), Figure 2).Furthermore, the number of fish feeding from the reward relative to the number of fish interacting with the setup was significantly higher when the food was placed inside the short cylinder (Table 2, factor 'Inhibitory control condition' (χ 2 = 8.81, p < 0.01), Figure 3).Surprisingly, although more individual N. pulcher successfully reached the reward when the food was placed in the short cylinder, they also showed more failed attempts on an individual basis (Table 1c, factor 'Inhibitory control condition' (F1,18 = 4.9, p = 0.04), Figure 4).the setup.Shown is the relative number of fish feeding on the reward, with values ranging from 0 to 1, where a number closer to 1 indicates that most (or all) fish interacting with the setup also successfully reached the reward.Presented are groups that successfully fed on the reward during the control condition and each box represents data for 19 groups presented either with a long cylinder (dark grey) or with a short cylinder (light grey).Thick horizontal lines indicate the median, boxes span the interquartile range, whiskers extend to the minimum and maximum values, and dots represent outliers.The location and group size did not influence the latency to reach the reward in the control condition (Table 3a, factor 'Location' (F 3,19 = 0.01, p = 0.99); factor 'Group size' (F 1,19 = 3.33, p = 0.08)).When food was presented inside the more challenging long cylinder, location had a significant influence on the latency to feed on the reward after the first interaction with the cylinder (Table 3b, factor 'Location' (F 3,14 = 5.88, p < 0.01), Figure 5).Here a post hoc analysis using orthogonal contrasts revealed that the latency to feed on the reward after the first interaction with the setup was not different between the two locations (Table 4a, factor '(Plot 1A, Plot 1B) vs. (Plot 2A, Plot 2B)' (t = −1.25,p = 0.23)) but differed among plots in each of the two localities.Within locality 1, groups in 'Plot 1B' had a significantly longer latency to feed compared to groups in 'Plot 1A' (Table 4b, factor 'Plot 1A vs. Plot 1B' (t = 3.02, p = 0.01)).In contrast, within locality 2, groups in 'Plot 2A' did not have a significantly different latency than groups in 'Plot 2A (Table 4c, factor 'Plot 2A vs. Plot 2B' (t = 1.95, p = 0.07)).In contrast, group size did not influence the latency to feed on the reward after the first interaction with the setup (Table 3b, factor 'Group size' (F1,14 = 3.67, p = 0.07)).Location and group size did not determine the number of fish feeding relative to the number of fish interacting when food was presented in the long cylinder (see Table 5a, factor 'Location' (χ 2 = 5.53, p = 0.15); factor 'Group size' (χ 2 = 0.09, p = 0.76)).

Factors
Table 5. Comparisons of the number of fish feeding on the reward relative to the number of fish interacting with the (a) long or the (b) short cylinder.Estimates are shown on a logit scale and as the difference from the reference level 'Plot1A' for factor 'Location'. F-values and p-values refer to comparisons of models with or without the factor of interest.N = 19 groups.The difference between the first interaction with the long cylinder and the first successful feeding.Shown are the differences, in seconds, for each plot (see Section 2-Methods).Presented are groups that successfully fed on the reward during the control condition, and each box represents data for 19 groups in 'Plot 1A' (green, N = 3), 'Plot 1B' (red, N = 4), 'Plot 2A' (light blue, N = 6), and 'Plot 2B' (light orange, N = 6).Thick horizontal lines indicate the median, boxes span the interquartile range, whiskers extend to the minimum and maximum values, and dots represent outliers.For each plot, three habitat characteristics are presented below the x-axis labels.Habitat: a plot's rugosity, i.e., its total surface area as calculated on the basis of the SfM reconstructions (see Section 2-Methods) divided by the surface area of a flat plane of the same size.Predators: a count of predatory species found in the plot during our survey (see Section 2-Methods).Competitors: a count of space competitors found in the plot during our survey (see Section 2-Methods).

Factors
Table 4.The latency to feed on the reward after the first interaction with the long cylinder.Orthogonal contrasts are presented, which were performed after confirming that the factor 'Location' in Table 3b was significant.The intercept estimate represents the grand mean of all treatments.First, we set the contrast of the model to compare the mean of both plots in locality 1 to the mean of both plots in locality 2 ((a); (Plot 1A, Plot 1B) vs. (Plot 2A, Plot 2B)).Second, we compared the two plots in locality 1 ((b); Plot 1A vs. Plot 1B), and third, we compared the two plots in locality 2 ((c); Plot 2A vs. Plot 2B).Note that the mean values of the treatments, presented in round brackets, were used in the comparisons.The direction of the comparison within a contrast is left to right, and the estimate value always refers to the location(s) to the right.N = 19 groups; p-values < 0.05 are highlighted in bold.Further details on the statistical analysis are provided in Section 2 (Methods).In contrast, group size did not influence the latency to feed on the reward after the first interaction with the setup (Table 3b, factor 'Group size' (F 1,14 = 3.67, p = 0.07)).Location and group size did not determine the number of fish feeding relative to the number of fish interacting when food was presented in the long cylinder (see Table 5a, factor 'Location' (χ 2 = 5.53, p = 0.15); factor 'Group size' (χ 2 = 0.09, p = 0.76)).

Contrast
Table 5. Comparisons of the number of fish feeding on the reward relative to the number of fish interacting with the (a) long or the (b) short cylinder.Estimates are shown on a logit scale and as the difference from the reference level 'Plot1A' for factor 'Location'. F-values and p-values refer to comparisons of models with or without the factor of interest.N = 19 groups.When food was presented inside the less challenging short cylinder, location and group size did not influence the latency to feed on the reward after the first interaction with the cylinder (Table 3c, factor 'Location' (F 3,13 = 0.28, p = 0.84) or the number of fish feeding on the reward relative to the number of fish interacting with the cylinder (Table 5b, factor 'Location' (χ 2 = 1.33, p = 0.72).

Discussion
The results of our field experiment using wild N. pulcher groups show that the detour paradigm is a valid concept to test behavioural flexibility in wild cichlid fish.We show that the difficulty of the task was influenced by the length of the obstacle that needed to be detoured, with the shorter cylinder allowing for faster times to successfully feed and more individuals doing so (Figures 2 and 3) but also resulting in more mistakes made (Figure 4).This suggests that the setup indeed poses a cognitive challenge and opens the possibility of adjusting the difficulty to fit a given research question's needs.In our case, most of the interesting variations among the groups from different locations were observed when using the long cylinder, indicating that using a more difficult setup is likely to be most beneficial for such broad comparisons.
We used this experimental paradigm to test predictions derived from two major hypotheses that link sociality, habitat complexity, and cognition.We find no strong statistical evidence that larger groups showed improved behavioural flexibility (Table 3), which would support the sociality and cognition hypothesis (see below).In contrast, we do find that habitat features influenced behavioural flexibility, but the direction of this effect was dependent on the habitat's locality (Table 4, Figure 5).
The sociality and cognition hypothesis predicts enhanced cognitive abilities for individuals that live in a more complex social environment, such as larger groups or fission-fusion societies [9].Individuals living in more complex social environments are predicted to be in need of more advanced cognitive abilities to navigate their daily social lives.This line of argument is also used to explain the advanced cognitive abilities in humans who have sophisticated social relationships compared to most other taxa [77].Evidence in support of this hypothesis has come largely from primate studies, whereas in other animal groups support for the sociality and cognition hypothesis has been mixed [9].Specifically, comparative studies using fish found no evidence that more social species have larger brains (as a proxy of advanced cognition) or are better learners [43,44].The results of our study also provide no clear evidence in support of the sociality and cognition hypothesis.On a broader geographical scale, N. pulcher groups are organised in colonies [63] and other indices of social complexity, such as the group's nearest neighbour distance or the location of the group within the colony, could have played a role in determining cognitive performances, but assessing broadscale social complexity was beyond the scope of the current study.Of course, working under field conditions comes with certain trade-offs, especially as we first had to validate a novel test paradigm before we were able to assess predictions from the sociality and cognition hypothesis.As such, we only tested a limited number of groups that varied in their number of group members, and we were not able to assess individual performances within each group.Using visible implant elastomer markings [78] would allow for the tracking of individual performances and would also allow for the incorporation of potentially confounding variables in the analysis, such as social rank, body size, or the sex of the individual [79].Additionally, although we found that reaching the food inside the long cylinder was more challenging, this level of difficulty might still have been too simple to reveal the fine-graded cognitive differences between individuals living in large and small groups.Nevertheless, our results are in line with other studies finding little support for the sociality and cognition hypothesis in fishes [43,44,80].
The habitat complexity and cognition hypothesis predicts enhanced cognitive abilities for individuals that live in more complex environments [11].The underlying idea is similar to the one concerning sociality: a more complex habitat requires individuals to process a wider range of stimuli and produce a greater number of corresponding responses, which, in turn, necessitates more flexibility in and finetuning of their behaviour, resulting in greater cognitive abilities in general [8].Our comparisons among groups found in different localities (and plots within localities) yielded a somewhat complicated picture: while groups from the two localities did not differ from one another in their ability to solve the task, differences within each locality exist (Table 4, Figure 5).In other words, we did not observe variation across large geographical distances (both localities are more than 6 km apart) but rather across small distances (plots within each locality are less than 100 m apart).This suggests that cognitive abilities are, indeed, more shaped by local conditions than by broad geographical proximity [11], a pattern already observed in the social structure of N. pulcher [67].This view is further supported by the fact that dispersal would theoretically be possible for these fish among plots within a locality, but is extremely unlikely between the localities [60].Our sample size of four different plots (and the differences between them; Figure 5) is too small to truly statistically probe which differences between the habitats best explain the differences in fish behaviour we observed.Nevertheless, it is striking that the pattern is such that in each locality the groups in the less structurally complex plot with more potential predators outperformed the ones in the more complex, less threatening plot (Figure 5).Habitat complexity alone is thus unlikely to explain intraspecific cognitive differences in cichlids (in contrasts to interspecific observations in this taxon [11]).
In line with previous work, we employed a detour test as a means to test cognitive ability by measuring behavioural flexibility and, by extension, cognitive ability [25].Behavioural flexibility generally refers to adaptive changes in behaviour in response to environmental changes [81].The flexible adjustment of behaviour is thought to involve several cognitively demanding components including the ability to seek alternative solutions [82].Inhibitory control, the ability to control and supress a predisposition for a behavioural response to show a more appropriate behaviour, is a core executive function that allows animals to successfully seek alternative solutions in a changing environment [83].Detour tests have been used since the early 20th century to test inhibitory control [25] and have been applied in several species to assess behavioural flexibility [84][85][86][87], including fish [79,88]; see [89] for a critical assessment of the relationship between inhibitory control and behavioural flexibility).Most studies assessing behavioural flexibility have been conducted in laboratory conditions [90], and this is particularly true for work on fish [79,88,91].This makes it harder to draw general conclusions about the underlying evolutionary drivers of the observed variability in behavioural flexibility.To link behavioural flexibility (and cognitive abilities more broadly) to actually fitness-relevant factors, it has to be assessed under natural conditions [92].However, there is still a lack of studies trying to tackle this [34].Notable exceptions come from the bird literature [93][94][95][96] and, very recently, also from a study using a cichlid fish from Lake Tanganyika [97].This latter study highlights the difficulties that come with field work and with the undertaking to assess cognitive abilities in the wild.
In the present study we used a modified version of the classic detour test paradigm where the reward could only be accessed by detouring an upright cylinder, thus accessing the reward from the top and not from the sides.On the basis of pilot experiments, we believe that this is more appropriate for our study species, but it can be easily adapted to other fish species in Lake Tanganyika, and we have no reason to believe that results would not be comparable.Our study confirms, for the first time in a fish species, that (i) inhibitory control can be measured under field conditions using a simple and easily adaptable test paradigm and (ii) the performance in solving the cognitively more challenging setup can be used to probe specific predictions about cognitive evolution.A caveat about our experimental design is the fact that we always presented the short cylinder after the long cylinder to the groups.This might have caused a habituation effect resulting in shorter times to approach the cylinder and more individuals reaching the reward (Table 1).However, we did not find that the motivation to interact with the setup was different between the short and the long cylinders, which is in contrast to what would be expected if fish showed signs of habituation (Table 1a).Nevertheless, to truly rule out any habituation effects in our experiment, further investigations are needed that vary the sequence of presenting the short and the long cylinder to the groups.Surprisingly, although individuals were faster at reaching the reward, with more individuals doing so, when food was placed in the short cylinder, they also had more failed attempts.There are several nonmutually exclusive explanations for this: (1) When food was placed in the short cylinder, individuals might have shown a more persistent response to swim against the cylinder until finding the opening by chance and reaching the reward.This could be a successful strategy for the short cylinder but might have proven difficult when food was placed in the long cylinder.(2) Because of the fact that we always presented the short cylinder after the long cylinder, individuals might have been more motivated to reach the reward and, thus, experienced more failed attempts, as they had already associated the setup with an attractive reward.(3) Individuals might have smelled the food more when placed in the short cylinder compared to the long cylinder, making them more prone to failed attempts.Sensory cues to solve a task are an important confounding variable when trying to estimate cognitive abilities within or among species [27] and might have also played a role in our experimental setup.Controlling for these possible causes of variation in the fish's ability to complete the task will be necessary in future uses of the setup.

Conclusions
In summary, our study validated, for the first time in a fish species, a detour test paradigm, which can be used under natural conditions with wild groups or individuals, using one cichlid species from Lake Tanganyika.The simple setup and the minimal logistic requirements make this an ideal cognitive test for a range of species, particularly in Lake Tanganyika.We used this setup to probe two major hypotheses about cognitive evolution that link habitat and social complexity to improved cognition.Our results show mixed support for the predictions derived from both hypotheses, but we hope to have inspired future investigations on the evolution of cognition in Lake Tanganyika cichlids.Lake Tanganyika represents an ideal place to use this setup and probe several other hypotheses about the evolution of cognition because many species are territorial and show site fidelity, and they are closely related but differ in key aspects of their ecology or sociality.Thus, we believe that our setup opens up a whole avenue of research questions that will, ultimately, help to better understand the evolution of cognitive abilities in the wild.
Author Contributions: A.J., Conceptualisation, funding acquisition, investigation, writing-original draft preparation, and writing-review and editing; A.H., Investigation and writing-review and editing; P.N., Data analysis and writing-review and editing; S.F., Conceptualisation, funding acquisition, investigation, data analysis, writing-original draft preparation, and writing-review and editing (categories based on Contributor Role Taxonomy (CRediT)).All authors have read and agreed to the published version of the manuscript.
Pose a Cognitive Challenge to the Fish?3.1.1.Control Condition

Figure 2 .
Figure 2. The difference between the first interaction with the setup and the first successful feeding when groups were presented with food placed inside the long or the short cylinder.Shown are groups that successfully fed on the reward during the control condition.Each box represents data for 19 groups presented with either the long cylinder (dark grey) or the short cylinder (light grey).Thick horizontal lines indicate the median, boxes span the interquartile range, whiskers extend to the minimum and maximum values, and dots represent outliers.

Figure 2 .
Figure 2.The difference between the first interaction with the setup and the first successful feeding when groups were presented with food placed inside the long or the short cylinder.Shown are groups that successfully fed on the reward during the control condition.Each box represents data for 19 groups presented with either the long cylinder (dark grey) or the short cylinder (light grey).Thick horizontal lines indicate the median, boxes span the interquartile range, whiskers extend to the minimum and maximum values, and dots represent outliers.

Fishes 2024, 9 , 19 Figure 3 .
Figure 3.The number of fish feeding on the reward relative to the number of fish interacting with the setup.Shown is the relative number of fish feeding on the reward, with values ranging from 0 to 1, where a number closer to 1 indicates that most (or all) fish interacting with the setup also successfully reached the reward.Presented are groups that successfully fed on the reward during the control condition and each box represents data for 19 groups presented either with a long cylinder (dark grey) or with a short cylinder (light grey).Thick horizontal lines indicate the median, boxes span the interquartile range, whiskers extend to the minimum and maximum values, and dots represent outliers.

Figure 3 .
Figure 3.The number of fish feeding on the reward relative to the number of fish interacting with the setup.Shown is the relative number of fish feeding on the reward, with values ranging from 0 to 1, where a number closer to 1 indicates that most (or all) fish interacting with the setup also successfully reached the reward.Presented are groups that successfully fed on the reward during the control condition and each box represents data for 19 groups presented either with a long cylinder (dark grey) or with a short cylinder (light grey).Thick horizontal lines indicate the median, boxes span the interquartile range, whiskers extend to the minimum and maximum values, and dots represent outliers.

Figure 4 .
Figure 4.The number of failed attempts per interacting individual.Shown is the total number of failed attempts divided by the number of interacting individuals.Presented are groups that

Figure 4 .
Figure 4.The number of failed attempts per interacting individual.Shown is the total number of failed attempts divided by the number of interacting individuals.Presented are groups that successfully fed on the reward during the control condition and each box represents data for 19 groups presented either with the long cylinder (dark grey) or the short cylinder (light grey).Thick horizontal lines indicate the median, boxes span the interquartile range, whiskers extend to the minimum and maximum values and dots represent outliers.

Table 1 .
Comparisons of behaviours for the two inhibitory control conditions.(a) The latency to interact, (b) the latency to feed on the reward after the first interaction with the setup, and (c) the number of failed attempts of N. pulcher when presented with food placed inside the long or the short cylinder.All groups used in this analysis successfully fed on the reward in the control condition.Estimates are on a log scale and presented as the difference from the reference level 'Long cylinder' for factor 'Inhibitory control condition'.F-values and p-values refer to comparisons of models with or without the factor of interest.To obtain normally distributed residuals, the dependent variables of all models were log transformed.N = 38 observations in 19 groups; p-values < 0.05 are highlighted in bold.

Fishes 2024, 9 , 19 Figure 5 .
Figure 5.The difference between the first interaction with the long cylinder and the first successful feeding.Shown are the differences, in seconds, for each plot (see Section 2-Methods).Presented are groups that successfully fed on the reward during the control condition, and each box represents data for 19 groups in 'Plot 1A' (green, N = 3), 'Plot 1B' (red, N = 4), 'Plot 2A' (light blue, N = 6), and 'Plot 2B' (light orange, N = 6).Thick horizontal lines indicate the median, boxes span the interquartile range, whiskers extend to the minimum and maximum values, and dots represent outliers.For each plot, three habitat characteristics are presented below the x-axis labels.Habitat: a plot's rugosity, i.e., its total surface area as calculated on the basis of the SfM reconstructions (see Section 2-Methods) divided by the surface area of a flat plane of the same size.Predators: a count of predatory species found in the plot during our survey (see Section 2-Methods).Competitors: a count of space competitors found in the plot during our survey (see Section 2-Methods).

Figure 5 .
Figure5.The difference between the first interaction with the long cylinder and the first successful feeding.Shown are the differences, in seconds, for each plot (see Section 2-Methods).Presented are groups that successfully fed on the reward during the control condition, and each box represents data for 19 groups in 'Plot 1A' (green, N = 3), 'Plot 1B' (red, N = 4), 'Plot 2A' (light blue, N = 6), and 'Plot 2B' (light orange, N = 6).Thick horizontal lines indicate the median, boxes span the interquartile range, whiskers extend to the minimum and maximum values, and dots represent outliers.For each plot, three habitat characteristics are presented below the x-axis labels.Habitat: a plot's rugosity, i.e., its total surface area as calculated on the basis of the SfM reconstructions (see Section 2-Methods) divided by the surface area of a flat plane of the same size.Predators: a count of predatory species found in the plot during our survey (see Section 2-Methods).Competitors: a count of space competitors found in the plot during our survey (see Section 2-Methods).

Funding:
This study was supported by a research grant from the Association of the Study of Animal Behaviour (ASAB).S.F. was also financially supported by the Vienna Science and Technology Fund (awarded to Sabine Tebbich, CS18-042).Institutional Review Board Statement: All field work reported here complied with local regulations for the work with wild animals and was conducted under the Memorandum of Understanding between the Department of Fisheries in the Ministry of Fisheries and Livestock of the Republic of Zambia; the Department of Biological Sciences of the University of Lusaka, Zambia; the Institute of Biology of the University of Graz, Austria; the Department of Behavioural Ecology of the University of Bern, Switzerland; and the Zoological Institute of the University of Basel, Switzerland, for the timeframe of January 2019 to December 2023.

Table 2 .
Comparison of the number of fish feeding on the reward relative to the number of fish interacting with the setup in the inhibitory control condition.Estimates are on a logit scale and presented as the difference from the reference level 'Long cylinder' for factor 'Inhibitory control condition'.F-values and p-values refer to comparisons of models with or without the factor of interest.N = 38 observations in 19 groups; p-values < 0.05 are highlighted in bold.Do Habitat Complexity and/or Group Size Influence the Motivation to Find Food and the Ability to Solve a Cognitive Challenge?

Table 3 .
Comparisons of the behaviours shown by N. pulcher to test whether the location of the group or total group size determined the performances during the control or the inhibitory control conditions.Estimates are shown on a log scale (a) and as the difference from the reference level 'Plot 1A' for factor 'Location' (a-c).F-values and p-values refer to comparisons of the models with or without the factor of interest.(a) N = 24 groups; (b,c) N = 19 groups; p-values < 0.05 are highlighted in bold.
Number of fish feeding relative to the number of fish interacting (short cylinder)