Imitative Learning as a Connector of Collective Brains

The notion that cooperation can aid a group of agents to solve problems more efficiently than if those agents worked in isolation is prevalent in computer science and business circles. Here we consider a primordial form of cooperation – imitative learning – that allows an effective exchange of information between agents, which are viewed as the processing units of a social intelligence system or collective brain. In particular, we use agent-based simulations to study the performance of a group of agents in solving a cryptarithmetic problem. An agent can either perform local random moves to explore the solution space of the problem or imitate a model agent – the best performing agent in its influence network. There is a trade-off between the number of agents and the imitation probability , and for the optimal balance between these parameters we observe a thirtyfold diminution in the computational cost to find the solution of the cryptarithmetic problem as compared with the independent search. If those parameters are chosen far from the optimal setting, however, then imitative learning can impair greatly the performance of the group.


I. INTRODUCTION
Imitative learning or, more generally, social learning offers a means whereby information can be transferred between biological or artificial agents, being thus a crucial factor for the emergence of social intelligence or collective brains [1].Its relevance in this context is neatly expressed by Bloom: "Imitative learning acts like a synapse, allowing information to leap the gap from one creature to another" [2].Not surprisingly, the advantages of this learning strategy were perceived and exploited by nature well before the advent of the human species as attested by its widespread use in the animal kingdom [3][4][5][6].We note that imitation as a mechanism of social learning in humans was extensively studied by Bandura in the 1960s [7,8].
Social learning has inspired the design of several optimization techniques, such as the particle swarm optimization algorithm [9,10] and the adaptive culture heuristic [11,12].Despite the success of these heuristics in producing optimal or near optimal solutions to combinatorial optimization problems, we know little about the factors that make cooperation effective, as well as about the quantitative improvements that results from it [13].The reason is probably that those heuristics and the problems they are set to solve are too complex to yield to a first-principle analysis.In this contribution we address these issues by tackling a simple combinatorial problem and by endowing the agents with straightforward search strategies in which the strength of collaboration is controlled by a single parameter of the model.In particular, we solve a cryptarithmetic problem using a group of N agents which, in addition to the capacity to carry out random local searches, can learn from (or imitate) a model agent -the best performing agent in their influence networks at a given trial.The frequency of the imitative or cooperative behavior is determined by the imitation probability parameter p ≥ 0. Hence our model exhibits two critical ingredients of a collective brain, namely, imitative learning and a dynamic hierarchy among the agents [2].
We find that imitative learning can greatly improve the performance of the group of agents provided that the control parameters are not too distant from their optimal values.For instance, in an optimal setting, say a fully connected system of N = 7 agents with imitation probability p = 0.6, we find a thirtyfold decrease of the mean number of trials necessary to find the solution of the cryptarithmetic problem as compared with the baseline case p = 0 where the N agents explore the solution space independently.Most significantly, however, we find that, for a fixed value of the imitation probability, increasing the number of agents N beyond a certain value impairs the group performance which can then perform much worse than in the case of the independent search.The following of a bad model is the culprit for the poor performance in this case.This harmful effect can be mitigated somewhat by reducing the connectivity of the agents so as to limit the influence of a model agent to only a fraction of the group.We argue that the maladaptation of imitative learning for large systems may be an alternative explanation for the group size of social animals.

II. METHODS
First we will describe the particular cryptarithmetic problem the agents must solve, explain how the digitto-letter identifications are encoded in strings and introduce the cost value associated to those strings.We will present also the elementary move that transforms any arXiv:1408.0302v1[nlin.AO] 1 Aug 2014 valid string into an adjacent valid string, allowing thus the exploration of the solution space.Once these basic elements are introduced we will describe the mechanism of imitation between agents, thus completing the specification of the agent-based model we use to evaluate the efficacy of imitative learning in solving a complex task.

A. The cryptarithmetic problem
Cryptarithmetic problems such as are constraint satisfaction problems in which the task is to find unique digit assignments to each of the letters so that the numbers represented by the words add up correctly [14].In the cryptarithmetic problem of eq. ( 1), there are 10! different digit-to-letter assignments, of which only one is the solution to the problem, namely, This type of cryptarithmetic problem, in which the letters form meaningful words, are also termed alphametics [15] and were popularized in the 1930s by the Sphinx, a Belgian journal of recreational mathematics [14].Of course, from the perspective of evaluating the performance of search heuristics on solving cryptarithmetic problems, the meaningfulness of the words is inconsequential, but in this contribution we will focus mainly on the alphametic problem (1).Nonetheless we will offer evidence to support the validity of our conclusions by considering a few randomly generated cryptarithmetic problems as well.
A non-random search heuristics to solve cryptarithmetic problems requires the introduction of some arbitrary quality measure or cost value to each possible digitto-letter assignment.For the alphametic problem of eq. ( 1) we encode a digit-to-letter assignment by the string i = (i 1 , i 2 , . . ., i 10 ) where i n = 0, . . ., 9 represent the 10 digits and the subscripts n = 1, . . ., 10 label the letters according to the convention For example, the string (0, 2, 9, 4, 8, 1, 7, 6, 3, 5) corresponds the the digit-to-letter assignment A somewhat natural way to associate a cost to a string i is through the expression [16] where R is the result of the operation (ROBERT ), F is the first operand (DON ALD) and S is the second operand (GERALD).In our example we have R = 362435, F = 967019 and S = 843019 so that the cost associated to string (0, 2, 9, 4, 8, 1, 7, 6, 3, 5) is C = 1447603.
If the cost of a string is C = 0 then the digit-to-letter assignment coded by that string is the solution of the cryptarithmetic problem.We must note that the cost value defined in eq. ( 3) applies to all strings except those for which i 3 = 0 corresponding to the assignment D = 0, i 5 = 0 corresponding to the assignment G = 0 and i 9 = 0 corresponding to the assignment R = 0.In principle, those are invalid strings because they violate the rule of the cryptarithmetic puzzles that an integer should not have the digit 0 at its leftmost position.For those strings we assign an arbitrary large cost value, namely, C = 10 8 , so that they can be considered valid strings and hence part of the solution space.
In addition to the assignment of the cost values to all 10! strings that code the possible digit-to-letter mappings for the alphametic problem (1), we introduce also an elementary move that connects two valid digit-toletter mappings.We define the elementary move as follows.Starting from a particular digit-to-letter mapping, say (0, 2, 9, 4, 8, 1, 7, 6, 3, 5), we choose two letter labels at random and then interchange the digits assigned to them.For example, say we pick letter labels 1 and 5, then the resulting mapping after the elementary move is (8, 2, 9, 4, 0, 1, 7, 6, 3, 5).Clearly, the repeated application of our elementary move is capable of producing all 10! strings starting from any arbitrary valid digit-to-letter mapping.

B. Imitative learning
The system is composed of N agents or strings which represent valid digit-to-letter assignments as described before.Each agent is connected unidirectionally to exactly M = 1, . . ., N − 1 distinct, randomly chosen agents in the system.We will refer to those agents as the 'influencers' of the target agent.More specifically, for each agent we sample M influencers from the N − 1 remaining agents without replacement.The extreme case M = N − 1 corresponds to the fully connected network.An agent has a probability p ∈ [0, 1) of copying a digitto-letter assignment from a model string in its group of influencers, and probability 1 − p of performing the elementary move.We choose the model string as the lowest cost string among the M influencers of the target agent.If the cost associated to the target string is lower than the cost of the model string then the copying process is aborted.
To illustrate the copying process let us assume for the sake of concreteness that the target agent is our already familiar example string (0, 2, 9, 4, 8, 1, 7, 6, 3, 5), whose cost is C = 1447603, and that the model string is (5, 3, 9, 4, 8, 1, 6, 2, 7, 0) whose cost is C = 1050568.In the copying process the target agent selects at random one of the distinct digit-to-letter assignments in the model string and assimilates it.In our example, the distinct assignments occur at the letter labels n = 1, 2, 7, 8, 9, 10.Say that the letter label n = 1, which corresponds to the assignment A = 5 according to our convention (2), is chosen.To assimilate this assignment the target agent needs to reassign the digit 0 to the letter label which was previously assigned to digit 5 so that the resulting string becomes (5, 2, 9, 4, 8, 1, 7, 6, 3, 0), whose cost is C = 1448608.As expected, a result of the imitative learning process is the increase of the similarity between the target and the model strings.The case p = 0 corresponds to the baseline limit where the N agents perform independent searches.The specific copying procedure proposed here was inspired by the mechanism used to model the influence of an external media [17][18][19] in Axelrod's model of culture dissemination [20].It is important to note that in the case the target string is identical to the model string, as well as in the case the cost of the target string is lower than the cost of the model string, the opportunity of update is wasted.
We may interpret the imitation (or copying) process of a model string as a blackboard cooperation system where a central control exhibits hints (i.e., the lowest cost string) in a public space [13,21], but here we prefer to use the interpretation of learning by imitation as it allows us to view the group of agents as a neural system where the agents play the role of neurons and dynamical synapses connect them to the best performing agents in the neural network [2].Nevertheless, since the process of imitation results in an effective collaboration among agents, in the sense that there is an exchange of information between them, we refer to this search strategy as collaborative search to contrast with the independent search which occurs when the copying process is turned off, i.e, the imitation probability p is set to zero.

C. Search dynamics
We begin by generating the N influence networks, i.e., a group of M influencers for each agent.These networks are kept fixed during the entire search.In this initial stage, at trial number t = 0, we also associate a random digit-to-letter assignment (a valid string) to each agent and determine its corresponding model string by evaluating and comparing the cost values of its M influencers.
A new trial begins with the choice of the update order of the N agents, so that at the end of the trial all N agents are updated.The agent to be updated -the target agent -has the possibility to imitate its model string or perform the elementary move with probabilities p and 1 − p, respectively.After update, we must re-evaluate the model string status in all groups of influencers to which the target agent belongs.After all N agents are updated we increment the trial number t by one unit and check whether any string has cost zero, in which case the search is halted.The trial number at which the search ends or, alternatively, the number of trial to success is denoted by t * .
Except for the independent search (p = 0), the update of the N agents is not strictly a parallel process since the model strings may change several times within a given trial.Nonetheless, since in a single trial all agents are updated, the total number of agent updates at trial t is with given by the product N t.

III. RESULTS
The efficiency of a search strategy is measured by the total number of agent updates necessary to find the solution of the cryptarithmetic problem (i.e., N t * ) and in the following we will refer to this measure as the computational cost of the search.Since we expect that the typical number of trials to success t * scales with the size of the solution space (i.e., 10!), we will present the results in terms of the rescaled variable τ = t * /10!.For the purpose of comparison we will consider first the baseline case of independent search for which the agents can perform the elementary move only (p = 0) and then the general case of cooperative search (p > 0).

A. Independent search
In this case there is no imitation and so the influence networks have no role in the outcome of the search.The main results of the independent search are summarized in fig. 1, which shows the probability distribution P (N τ ) of the rescaled computational cost N τ of the search for several system sizes.The data is very well fitted by the exponential distribution P (N τ ) = a exp (−aN τ ) with a = 1/1.14which is shown by the solid straight line in the figure .As expected, the mean rescaled computational cost N τ ≈ 1.14 is insensitive to the system size N , but the finding that it does not equal 1 is somewhat surprising.
In fact, if we replace our elementary move by a global move in which the entire string is generated randomly at each update then we find that this mean equals 1, as expected.The reason that our elementary move is slightly less efficient than the global move in exploring the solution space is because it is not too unlikely to reverse a change made by the elementary move.For example, the probability to reverse a change in a subsequent trial is 2/10 × 1/9 = 2/90 for the the elementary move, whereas it is 1/10! for the global move.Here τ = t * /10! is the ratio between number of trials to success and the size of the solution space.These distributions were generated using 10 5 independent searches for each N .The solid straight line is the exponential distribution P (N τ ) = a exp (−aN τ ) with a = 1/1.14.

B. Cooperative search
As pointed out before, the cooperation among agents stems from the possibility that they copy potentially relevant digit-to-letter assignments from the model strings in their influence networks.We will consider first the fully connected system where M = N − 1 and then the partially connected systems where 1 ≤ M < N − 1.

Fully connected system
Figure 2 shows how the mean rescaled computational cost is affected by varying the imitation probability p while the number of agents N is kept at a fixed value.For N = 20 and p = 0.5 we observe a twentyfold decrease of the mean cost in comparison with the cost of the independent search, which corresponds to p = 0 and yields N τ ≈ 1.14.This is a remarkable evidence of the power of imitative learning to speed up the search on the solution space of the cryptarithmetic problem.In the limit p → 1 one expects the computational cost to diverge since the solution space cannot be fully explored as the option for the elementary move is never made in this limit.This harmful effect of learning by imitation becomes more pronounced as the number of agents increases.
In the region where the mean computational cost decreases monotonically with increasing p (e.g., p < 0.5 for N = 20) we found that the probability distribution of the computational cost is well described by an exponential distribution, in the sense that the ratio between the standard deviation and the mean is always very close to 1.
(We recall that this ratio equals 1 for an exponential distribution.)However, in the region where N τ increases with increasing p we found that in the low cost regime P (N τ ) gives values significantly greater than those predicted by an exponential distribution, as illustrated in fig.3, though those values are not greater than those obtained in the case of the independent search (see fig. 1).The effect of the system size on the computational cost of the fully connected system.The symbols represent the mean rescaled computational cost N τ for the imitation probability p = 0(•), p = 0.3( ), p = 0.4( ), p = 0.5( ) and p = 0.6( ) The independent variable N is the number of agents in the system.Each symbol represents an average over 10 5 searches and the lines are guides to the eye.The error bars are smaller than the size of the symbols.
The effect of increasing the number of agents N for a fixed value of the imitation probability p is summarized in fig. 4. The mean computational cost of the cooperative system exhibits a non-monotonic dependence on N , except in the case of the independent search (p = 0) when it takes on a constant value.The benefit of cooperation is seen in this figure by the initial decrease of the computational cost as the number of agents increases.However, for all p > 0 we find that the presence of too many agents greatly harms the performance of the system and that for a fixed p > 0 there exists an optimum value of N that maximizes the search efficiency of the cooperative system.For instance, although not shown in the scale of fig. 4, the minimum computational cost for p = 0.3 occurs at N ≈ 270.The efficiency at this optimum, however, is not affected significantly by the choice of the parameters N and p.In other words, the costs corresponding to the minima shown in figs. 2 and 4 are not very sensitive to changes in N and p, respectively.In particular, for the parameter settings we have explored, the best efficiency N τ ≈ 0.041 is achieved for N = 7 and p = 0.6 and amounts to a thirtyfold speed up with respect to the independent search.
We conjecture that the reason the efficiency of the cooperative system deteriorates as N increases beyond its optimum value (e.g., in the range N > 6 for p = 0.6 as shown in fig.4) is that for N not too small there is a good chance that the cost of one of the strings is significantly lower than the cost of the other N −1 strings.Provided p is not too small too, this string may remain as the model string for a few trials thus biasing the search to the vicinity of the model string.In the (typical) case that the model string is far from the solution of the cryptarithmetic problem, imitative learning may lead to the observed impairment of the performance of the cooperative system.In sum, the following of a bad leader is likely the culprit of the poor performance of the system.To check the validity of this conjecture we calculate the mean number of consecutive trials for which a cost value stays as the lowest cost among the N strings.The procedure to obtain this quantity, which we denote by ζ, is straightforward.At trial t = 0 we evaluate the cost of the N strings and record the minimal cost among them.Then at the next trial t = 1, after the N strings are updated, we re-evaluate again their costs and record the minimal cost.If the minimal cost at t = 1 is different, i.e., greater or less, than the minimal cost at t = 0 we say that a change event has occurred.The comparison of the values of the minimal costs at consecutive trials is repeated and the cumulative number of change events is recorded until the solution is found at t = t * .The desired quantity ζ is given simply by the ratio between the total number of change events and the total number of trials t * .Hence for each search we obtain a single value for ζ, which can then be interpreted as the mean number of trials between consecutive change events or as the mean duration of the stases for that search.
In fig. 5 we present the probability distribution Q (ζ) using 10 5 searches for the imitation probability p = 0.6 and two representative values of N .Figure 5A shows this distribution for N = 6, which corresponds to a regime of low computational cost according to fig. 4. We observe a pronounced maximum at ζ ≈ 3.7 so that in most searches the model cost remains unaltered for 3 to 5 trials.This is an optimum scenario since no string stays on the top tier long enough to influence the entire system.For N < 6, we find that Q (ζ) exhibits a similar shape but the maximum becomes sharper and its location is shifted towards lower values of ζ as N decreases.Figure 5B, which shows the results for N = 17, reveals a very different scenario: the distribution Q (ζ) exhibits a plateau indicating that the model cost remains unchanged for hundreds to a few thousands trials.For very large values of ζ, the distribution Q (ζ) seems to exhibit an exponential decay to zero, namely, Q (ζ) ∼ exp (−0.003ζ).We stress that for the two cases exhibited in fig. 5 the probability that an agent will imitate the model rather than perform an elementary move is the same, namely p = 0.6, and so the qualitative differences reported in the figure are due solely to the change on the number of agents.

Partially connected system
If the poor performance of large collaborative systems based on imitative learning is due to the influence of bad models then a natural way to reduce this harmful effect is to limit the influence of those models.This was the motivation to introduce the influence networks scheme where each agent picks its model among M randomly chosen agents predetermined at the beginning of the search.In fact, fig.6 shows that the reduction of the connectivity of the agents increases somewhat the range of values of the imitation probability p for which the cooperative system outperforms the system composed of independent agents.More pointedly, for N = 20 this range is extended from p ≈ 0.57 for M = 19 to p ≈ 0.87 for M = 1.In addition, the value of the optimal mean computational cost does not seem to vary significantly with M .encers M .It shows that for small values of the imitation probability the fully connected system (i.e., M = N − 1) exhibits the best performance.However, as p increases (e.g., p > 0.4 for N = 40), the optimal performance is obtained with partially connected systems.Moreover, we found that for any fixed value of p > 0 and M the performance of the system is always impaired when the number of agents N is very large.Finally, we note that similarly to our findings for the fully connected system, the probability distribution of the computational cost P (N τ ) departs significantly from an exponential distribution only in the regions where the mean computational cost becomes an increasing function of the control parameters of the model.

Random cryptarithmetic problems
In order to verify the generality of our findings, which were obtained for the specific alphametic problem DON ALD + GERALD = ROBERT , we have considered a variety of random cryptarithmetic problems with 10 letters and a unique solution, so that the sizes of their solution spaces are the same as that of the alphametic problem.The comparison between the mean computational costs to solve four such random problems and our alphametic problem is shown in fig.8 for the fully connected system.The results are qualitatively the same, as expected.The alphametic problem, however, was somewhat easier to solve by the cooperative system than the random problems, perhaps because of the coincidence of the last three letters ("ALD") in the first and second operands.Interestingly, the independent system (p = 0) cannot distinguish between the problems but the cooperative system (p > 0) can, and this distinction is most pronounced when the parameters are set so as to achieve the optimal performance.It is as if the cooperative system had adapted to the specific task posed to it.We expect that our conclusions remain valid, in a qualitative sense of course, for any constraint satisfaction problem characterized by a rugged cost landscape.

IV. DISCUSSION
Rather than offer any novel method to solve cryptarithmetic problems, our aim in this contribution is to assess quantitatively the potential of imitative learning as the underlying mechanism -the critical connector -of collective brains [2].Here imitative learning is implemented by allowing an agent to copy clues from the best performing agent -the model agent -in its group of influencers.More pointedly, at trial t each agent has the probability p of imitating the model and the probability 1 − p of executing a random rearrangement of the digitto-letter mapping which is its guess to the solution of the cryptarithmetic problem.In an optimal setting, say a fully connected system of N = 7 agents with imitation probability p = 0.6, we find a thirtyfold decrease of the mean number of trials needed to find the solution of the problem (i.e., of the mean computational cost), as compared with the case p = 0 when the agents search the solution space independently (see fig. 4).In the optimal setting, as well as in the regions where the computational cost is a decreasing function of the control parameters of the model, the probability distribution of the computational cost is given by an exponential distribution, rather than by a lognormal distribution as predicted by a general theory of cooperative processes [13,22].In fact, the reason the cooperative scheme implemented in [13] is so efficient is that all discovered digitto-letter assignments that add up correctly modulo 10 for at least one column are permanently exposed as hints in a blackboard for use by all agents, which can pick a hint at each trial.There is no place for any kind of learning in that scenario since in the case there are no hints in the blackboard or the agent has already used the chosen one, the agent selects a new random digit-to-letter assignment which is completely uncorrelated to its previous assignment.
Most significantly, for fixed values of the imitation probability p and of the number of influencers M , we find that increasing the number of agents N beyond a certain quantity impairs the working of the cooperative system, which then performs much worse than if the agents had executed independent searches.Our analysis indicates that the following of a bad model is the culprit of the poor performance of the system in this case.In that sense, the efficacy of imitative learning could be a factor determinant of group size [23].In contrast to the cognitive load that constrains the number of individuals with whom it is possible to maintain stable relationships and leads to Dunbar's number for primates [24,25], the group size here (i.e., the value of N corresponding to the lowest computational cost) does not stem from a limitation of the neocortical processing capacity of the individuals.Rather, it is a property of the group of agents as a whole, since for any fixed non-vanishing value of the imitation probability, which may be seen as an individual trait, a too large number of agents, which is a group property, will impair the performance of the cooperative system.Of course, if p were allowed to decrease with increasing N then the system could be maintained at the highest level of perform regardless of the group size (see figs. 2  and 4).In other words, in order to perform at the optimal level a system based on imitative learning should decrease the frequency of the interactions among individuals as its size increases.
To conclude, our findings indicate that imitative learning has a great potential to improve the task-solving capability of a group of agents, provided the model param-eters -number of agents (N ), imitation probability (p) and number of influencers (M ) -are not too far from their optimal values.In the cases that N or p are too large, the imitative learning strategy leads the cooperative system astray, in a sort of maladaptive behavior that has actually been observed in fishes [26].It would be interesting to find out what new ingredients one should add to our model in order to prevent the catastrophic effect of imitative learning on large populations.

FIG. 1 :
FIG.1: Exponential distribution of the rescaled computational cost for the independent search.Probability distribution P (N τ ) that a search employing N independent agents finds the solution of the cryptarithmetic problem (1) using a total of N t * updates for N = 1(•), 5( ), 10( ) and 20( ).Here τ = t * /10! is the ratio between number of trials to success and the size of the solution space.These distributions were generated using 10 5 independent searches for each N .The solid straight line is the exponential distribution P (N τ ) = a exp (−aN τ ) with a = 1/1.14.

FIG. 2 :FIG. 3 :
FIG. 2:The effect of the imitation probability on the computational cost of the fully connected system.The symbols represent the mean rescaled computational cost τ for cooperative systems of size N = 20(•), N = 5( ), N = 3( ) and N = 2( ).The independent variable p is the probability that an agent will copy a digit-to-letter assignment from the model string, chosen as the lowest cost string in the entire system.Each symbol represents an average over 10 5 searches and the lines are guides to the eye.The error bars are smaller than the size of the symbols.
FIG. 4:The effect of the system size on the computational cost of the fully connected system.The symbols represent the mean rescaled computational cost N τ for the imitation probability p = 0(•), p = 0.3( ), p = 0.4( ), p = 0.5( ) and p = 0.6( ) The independent variable N is the number of agents in the system.Each symbol represents an average over 10 5 searches and the lines are guides to the eye.The error bars are smaller than the size of the symbols.

FIG. 5 :
FIG. 5: Probability distribution of the mean duration of the stases in a search.Probability distribution of the mean number of trials ζ for which a cost value stays as the lowest cost among the N solutions in 10 5 searches for the imitation probability p = 0.6 in a fully connected system.Panel A: N = 6 (low computational cost regime).Panel B: N = 17 (high computational cost regime).The slope of the straight line shown in the semi-log scale of panel B is 0.003.

FIG. 6 :FIG. 7 :
FIG. 6:The effect of the imitation probability on the computational cost of partially connected systems.The symbols represent the mean rescaled computational cost N τ for a system composed of N = 20 agents, each one connected to M = 19(•), M = 9( ), M = 4( ) and M = 1( ) influencers.The independent variable p is the imitation probability.Each symbol represents an average over 10 5 searches and the lines are guides to the eye.The error bars are smaller than the size of the symbols.

FIG. 8 :
FIG.8: Computational cost of the alphametic problem and of four random cryptarithmetic problems.The mean rescaled computational cost for the alphametic problem DON ALD + GERALD = ROBERT (symbol •) and for four ten-letter random cryptarithmetic problems with a unique solution (symbols , , and ).The symbols represent the mean rescaled computational cost N τ for a system composed of N = 20 fully connected agents.The independent variable p is the imitation probability.Each symbol represents an average over 10 5 searches and the lines are guides to the eye.The error bars are smaller than the size of the symbols.