The model

We developed an individual-based evolutionary simulation model consisting of 1000 individuals per generation, who each have ten repeated social interactions with different interaction partners in their lifetime. Each of these interactions lasts for ten interaction rounds, in which both interaction partners simultaneously decide whether to cooperate or not. Cooperating results in a fixed benefit b for the interaction partner (b = 2 in all simulations) but can have varying consequences c for the acting individual. At the start of each repeated interaction, these consequences are randomly drawn from a uniform distribution ranging from a severe cost (c = −3) to a direct benefit (c = 1) (Fig. 1a). If c < −2, the cost of cooperating exceeds the benefit to the interaction partner. This means that defection does not only pay off better than cooperation regardless of the action of the interaction partner (i.e., defection is dominant), but mutual defection also pays off better than mutual cooperation. If −2 < c < 0, defection is still dominant, but mutual cooperation pays off better than mutual defection. Interactions in this range can be classified as variations of the prisoner’s dilemma game. If c > 0, cooperation is dominant, and mutual cooperation ensures the best possible payoff.

In our simulations, individuals cannot directly observe what are the consequences of cooperating (c) in the interaction they are facing. Instead, they have a subjective perception of what the consequences of cooperating are (this perception is denoted as c p ). This perceived value is drawn from a beta distribution with mode c (Fig. 1b). Between simulations, we systematically vary the degree of uncertainty by varying the variance of this beta distribution. If uncertainty = 0, the distribution is so narrow that individuals know exactly what kind of interaction they are facing (c p = c); if uncertainty = 1, the distribution is equal to a uniform distribution over the entire range (hence, individuals have no reliable information at all about the consequence of cooperating). Between these extremes, we ran simulations for various degrees of intermediate uncertainty (in steps of 0.1), where uncertainty is directly proportional to the variance of the beta distribution from which c p is drawn.

In our model, all individuals have a genotype determining the strategy that they use in social interactions (see Fig. 1c for a schematic overview). Individuals can either implement a context-dependent strategy, which allows the individual to implement different substrategies (C1 or C2) depending on the perceived consequences of cooperation (c p ) of the current interaction, or a heuristic strategy, which is insensitive to the individual’s perception of the interaction type at hand (always implementing substrategy H). Both the context-dependent and the heuristic strategies are coded in the individual’s genotype, and a single Boolean locus (S) determines which of the strategies is used (acting as a switch). Another continuous locus (T) determines which of the context-dependent substrategies the individual implements, depending on the perceived consequence of cooperation of the present interaction. Specifically, if c p < T, the individual implements substrategy C1; otherwise, the individual implements substrategy C2. Each substrategy (C1, C2 and H) consists of four loci prescribing whether the individual cooperates or defects depending on the outcome of the previous interaction round (i.e., we only allow pure strategies with memory one), and an additional locus prescribing the probability that the individual cooperates in the first interaction round. Individuals occasionally make mistakes in the implementation of their strategy (with probability ε = 0.01).

After all ten repeated interactions finish, individuals reproduce asexually, proportionally to the payoffs they have accumulated (‘roulette wheel selection’). New individuals inherit the genes of their parent, with a small chance of mutation (μ = 0.001). To ensure that our results are robust with respect to the specifics of mutation, we ran 50 replicate simulations for each of 100 different matrices determining the probabilities with which the mutation of each strategy produces each other strategy (see Methods for details). We ran all simulations for 10,000 generations, and report the outcomes (cooperation level, percentage of individuals using heuristics and strategy frequencies) in the last generation.

Simulation outcomes

As expected, our results show that uncertainty about the nature of social interactions leads to the evolution of social heuristics (Fig. 2a). Specifically, for high uncertainty (u > 0.6), heuristic decision- making strategies were used by on average 83.3% of individuals at the end of the simulations, whereas this was only the case for 10.3% of individuals under low uncertainty (u < 0.4). For intermediate values of uncertainty (0.4 < u < 0.6), the probability that evolution leads to a population dominated by heuristic strategies rather than context-dependent strategies was considerable, and gradually increased with uncertainty. Higher uncertainty did not only lead to more heuristic decision making, but also to higher mean levels of cooperation (Fig. 2b). Under high uncertainty, simulations reached an average cooperation level of 0.87, whereas they reached a cooperation level of only 0.46 under low uncertainty.

Fig. 2 Uncertainty about the nature of social interactions leads to the evolution of cooperative heuristics. a The fraction of individuals using heuristic strategies and b the average cooperation rate at the end of evolutionary simulations that impose varying levels of uncertainty about social interactions. Grey lines show separate results for 100 different random mutation matrices that determine the probability with which a mutation of each strategy gives rise to each other strategy (every point shows an average over 50 replicate simulations per mutation matrix). The red line and shading provide the estimate of the mean and 95% confidence interval of (a) heuristic decision making and (b) cooperation for the average mutation matrix (modelled as a four-parameter logistic function, see Methods for details) Full size image

Why does high uncertainty lead to more cooperation in our simulations? To obtain more insight into this, we investigated which strategies most commonly emerged (Fig. 3). Under low uncertainty, the four most commonly evolved strategies were all context-dependent strategies that combine a tendency to defect when cooperation is relatively costly with a tendency to cooperate if a single act of cooperation is directly beneficial or carries a low cost. As a consequence, populations that mostly consisted of individuals following any of these strategies reached intermediate cooperation levels (between 0.24 and 0.53). Under high uncertainty, the most commonly evolved strategy (by far) was grim, which only cooperates if both interaction partners cooperated in the previous round, and otherwise defects. Because this strategy also evolved a high probability to cooperate in the first round (on average 0.99), an interaction of two individuals employing this strategy likely results in sustained cooperation, until one of the individuals makes a mistake (since the repeated interaction only lasts for ten rounds, this is relatively unlikely). Consequently, a population consisting only of individuals following this strategy reached an average cooperation level of 0.90. The only other heuristic strategy that commonly evolved under high uncertainty was tit for tat with an average initial cooperation probability of 1.00, which led to even higher cooperation levels (0.94). In sum, high uncertainty led to the evolution of heuristic strategies that achieved high cooperation levels when common in the population.

Fig. 3 The most common context-dependent and heuristic strategies that evolved for various levels of uncertainty about social situations. Each bar shows the fractions of 5000 replicate simulations that were dominated by the strategies shown below (a strategy was considered to dominate if it constituted more than 80% of the population by the end of the evolutionary simulation). The most common context-dependent strategies are shown in orange. These strategies are defined by two substrategies and a threshold (T; if the individual perceives c to be below this value, substrategy 1 is implemented; otherwise, substrategy 2 is implemented). Each substrategy is defined by five genes, which determine whether the individual cooperates (C) or defects (D) given the outcome of the four possible outcomes of the previous round (Fig. 1), and by a locus that determines the probability that the individual cooperates in the first interaction round. The last column gives the cooperation rate in a population that consists only of individuals implementing the given strategy. The most common heuristic strategies are shown in blue (these implement the same strategy independent of specifics of the social interaction at hand). Black bars show simulation runs in which no single strategy achieved a frequency above 0.8 Full size image

Why does evolution tend to produce the strategies described above? It is not that straightforward to answer this question; the strategy space in our simulations is quite large and the process of social evolution can be highly intricate23,24. However, there are some ways in which we can obtain some more insight into why we see these specific strategies emerging. First, we performed a simple version of an invasion analysis in which we assess the fitness of the most commonly evolved heuristic strategy and the most commonly evolved context-dependent strategy against each other for various levels of uncertainty (Supplementary Note 1; Supplementary Fig. 1). This analysis shows that the invasion fitness of the heuristic strategy increases with uncertainty, whereas the opposite is true for the context-dependent strategy. In fact, the heuristic strategy can invade a population of the context-dependent strategy if uncertainty is high enough, whereas neither strategy can invade the other for lower values of uncertainty. Although this gives only a limited picture (only a very small fraction of the strategy space is considered), it does give a rough idea of how uncertainty affects the fitness of the strategies that evolved in our model. Second, we compared our simulation results with the outcomes of benchmark simulations in which we keep the value of c constant (hence, there is no heterogeneity nor uncertainty in social interaction types; Supplementary Note 2). In these simulations, high cooperation levels evolve for values of c as low as −1.2 (Supplementary Fig. 2). Also, we observe that evolution produces similar cooperation levels and strategies in a world where individuals always face interactions in which c = −1 (i.e., the ‘average game’ in our original setup) as under maximal uncertainty in our original simulations (Supplementary Fig. 3). This suggests that evolution under maximal uncertainty produces strategies that are tuned to the average social interaction context that individuals face.

It has previously been shown that the specifics of the mutation process can dramatically alter the outcome of social evolution23,25. For this reason, we replicated our simulations 100 times, every time randomising the probabilities with which each strategy gives rise to each other strategy in the event of a mutation. Even though this did lead to some differences in the frequencies with which the different strategies emerged as the outcome of evolution, the overall picture remained virtually the same regardless of the mutation probabilities, with uncertainty about the nature of social interactions consistently leading to the evolution of cooperative heuristics (see grey lines in Fig. 2).