Opinion dynamics with memory: how a society is shaped by its own past
Gioia Boschi Chiara Cammarota Reimer Kühn






mymainaddress]Gioia Boschi
gioia.boschi@kcl.ac.uk

mymainaddress]Chiara Cammarota
chiara.cammarota@kcl.ac.uk

mymainaddress]Reimer Kühn
reimer.kuehn@kcl.ac.uk

[mymainaddress]Mathematics Department, King's College London, Strand, London WC2R 2LS, UK


In order to understand the development of common orientation of opinions in
the modern world we propose a model of a society described as a large collection of agents that exchange their expressed opinions under the influence of their mutual interactions and external events. In particular we introduce an interaction bias which results in the emergence of a collective memory such that the society is able to store and recall information coming from several external signals. Our model shows how the inner structure of the society and its future reactions are shaped by its own history. 
We provide an analytical explanation of such mechanism and we study the features of external influences with higher impact on the society.
We show the emergent similarity between the reaction of a society modelled in this way and the Hopfield-like mechanism of information retrieval in Neural Networks.



   
[2010] 00-0199-00







§ INTRODUCTION

Contemporary human society lies under the effect of an almost fully accomplished globalisation.
International barriers have become more permeable thanks to the spread of English as universal language. Connections of individuals develop across huge distances throughout the world thanks to the daily use of social media and the immediate coverage nowadays attained by information media. 
These observations naturally support the picture of a global society described as a large collective system involving strongly interacting degrees of freedom, represented by the individuals' actions or opinions.
With this picture in mind, scientists started to study the human society by means of a statistical mechanics approach. 
Early results of this effort resulted in the first opinion dynamics model proposed by a physicist <cit.> and the introduction of the Ising model to study consensus in societies <cit.> .
An important amount of work followed these first seminal articles, building a literature in which the pressure of the society is modelled by assimilative interactions that mimic the tendency of people to imitation.
The most widely studied models of a society of this kind come from physics, i.e. the Voter model <cit.> the Ising model with its variants <cit.>  already mentioned and the Majority rule model <cit.>. 
Yet, despite many other interesting features, it soon appeared evident that models only based on assimilative interactions describe a society in which full consensus is typically inevitable. To overcome this problem the concept of homophily <cit.>, that is the tendency of people to interact more often or with grater intensity with similar others, has been introduced
<cit.>.
However, the fragmentation of the society into groups with different opinions obtained in models that include both assimilation and homophily was found to be unstable under the introduction of noise <cit.>. In fact an infinitesimal amount of noise it is seen to irremediably redirect the society to a state of full agreement.
The idea that antagonistic interactions <cit.> and xenophobia (the phenomenon for which the larger the dissimilarity between two interacting individuals, the more they evaluate each other negatively) <cit.> should be taken into account to resolve this issue has been developed only fairly recently.
In the present work we build up on these observations and put them in conjunction with the traditional approach that assumes imitation tendencies between individuals.
We propose a model for opinion formation based on the rule that individuals in agreement with each other tend to reinforce their mutual positive influence, while individuals in disagreement will develop an antagonistic relation based on the mistrust towards one another's view. These tendencies will be encoded in an interaction term that for each pair of individuals reflects the history of their agreement or disagreement at previous times. Past relevant interactions are only those that lie within the finite range of agent's memory.


We note that the dynamics of the model we propose is strongly reminiscent of the dynamics of graded response neural networks <cit.> which have been used to describe associative memory. Indeed, the model discussed here will, under suitable conditions, develop interactions of the Hopfield type <cit.>. 
Models of society including Hopfield-like interactions have been already used in social sciences in a few occasions <cit.> to study consensus formation and opinion polarization.
In these works Hopfield interactions are introduced and studied in conjunction with a number of other elements like individual flexibility, broad-mindedness, and open-mindedness <cit.> or in more complicated network structures <cit.>.
Moreover in all these cases the focus of the study was on the stationary state reached by a society with fixed interpersonal interactions and how it is approached from a random initial condition. 
Our contribution will instead focus on a model society whose internal interactions develop starting from historical interpersonal relationships. Yet, it will, under suitable conditions, spontaneously turn out to closely resemble a model society exhibiting Hopfield-like couplings.
We will develop a detailed analysis of the way the Hopfield-like interactions develop and analyze the resulting collective behaviour of the system.
To this aim we will focus on a society that is constantly under the influence of new external events and we will pay particular attention to the reaction of the society to world-wide news, modelled as external fields applied to it <cit.>.
We will study whether the society does develop self-maintained collective memories of certain news, and will therefore be irremediably shaped by them. In literature the concept of collective memory was first introduced in <cit.> and only recently scholars have focused on how collective memory is influenced by media  <cit.>. In our model the possibility for external events to impress the society will depend on a number of parameters including the extent of the news influence on single individuals and how frequently they are impacting the society. In particular our model shows that strongly impacting news, or even just very frequent news, can change the internal structure of the society in a drastic way and will determine its non linear collective response to future external influences.
The structure of the paper is as follows.
In Section <ref> we will introduce the model and its main features, before entering into the description of different scenarios corresponding to different kinds of external information. The results are presented in Section <ref> and organized in the following sections starting from the simplest scenario to more complicated ones. 
Given the growing complexity of the problems studied, not all
the cases considered can be fully solved analytically. 
For each choice of the external stimuli we first derive all the analytic predictions we have access to, then we complete the picture by showing simulation results.


§ THE MODEL


 The society that we consider is composed of a set of N agents, each potentially connected to all the other agents. With agent i we associate a continuous preference field u_i.
 Expressed opinions are given by nonlinear functions g(u_i) of the preference field u_i of agent i. We will take g(u_i) to be of sigmoid form, implying that expressed opinions remain bounded. 
We will take the stochastic dynamics of the system to be of the form: 

    u̇_̇i̇=-u_i+I_i+∑_j≠ i^N J_ijg_j+η_i ,

where we use the abbreviation g_j= g(u_j) and we dropped time dependencies, which in general pertain to all variables in the equation. Here J_ij >0 represents a mutually supportive interaction between the individuals i and j while J_ij<0 indicates an antagonistic interaction between the same agents. The quantity I_i represents the mass media information as perceived by individuals, while -u_i is a mean reversion term which entails that in absence of external influences the preference field of each agent will fluctuate around zero.
The last term η_i is a white noise with Gaussian distribution with zero mean and finite variance ⟨η_i(t)η_j(t')⟩ = σ^2 δ_ijδ(t-t').
The combined effect of individually perceived external sources of information, I_i, and the interaction with others agents' expressed opinions, g_j, may act to drive the preference field of an agent away from zero, and thus may favour the development of specific orientations. 
The heterogeneous external information I_i is defined as I_i=I_0 ξ_i separating the strength I_0 of the signal from the variables ξ_i encoding the local variability. Note that such variability might be genuine or arise as a result of individually variable perception of an underling uniform message (which may be caused by idiosyncratic interpretations).
We simply assume that ξ_i can only be either +1 or -1. 

 Finally and most importantly the tendency of each person to agree or disagree with others is based in our model on the memory of past history of agreement and disagreement with them. People which have a history of agreement in the past, will be more likely to agree also in the future, and an analogous result holds for disagreement. 
 This feature represents the key ingredient of our model.
 More specifically we consider the recent history of agreement or disagreement to have a larger weight than the distant past to take into account how vivid the experience of past interactions is. We will assume an exponentially weighted memory and take interactions between agents at time t to be given by  

    J_ij(t)= J_0·γ/N∫_0^ts  g_i(s)g_j(s) e^-γ(t-s)
  
for some J_0>0, assuming for simplicity the time scale τ_γ=1/γ of the memory to be uniform across agents.
 The normalization factor 1/N is introduced so that the interaction with other agents is not overwhelmingly dominant, but remains comparable to the influence of external sources of information in the large N limit.

 In this way we have a society that uses the past history to interpret any instantaneous inputs that it receives. In particular agreement (disagreement) will be perceived if the value of g_i(s)g_j(s) will be continuously positive (negative) on the time scale τ_γ and will bias agents i and j toward future agreement (disagreement). 
 When the history of past interaction is instead characterized by an alternation of agreement and disagreement periods the agents will tend to be neutral with each other, J_ij∼0.
 This memory effect is particularly important when studying the influence of the external information on the agents' opinions.
Note that the memory that appears in our model, being a memory of past relations, must not be confused with the memory of past actions or opinions of single agents that has been more often considered in the literature of social behaviour <cit.>. 



 §.§ Agents' interactions vs Hopfield couplings


The main ingredient of our model is the memory of past interactions, which is associated with the time scale τ_γ. The model also contemplates a second time scale which is the relaxation time of the individual preference u_i. The latter has been set equal to 1, without loss of generality as in general all the other parameters and time can be expressed in terms of its unit. 
A third time scale Δ_0 should be also considered. It is the one associated with the duration of the exposure of the society to external stimuli.
We will typically focus on the regime τ_γ≫Δ_0≫ 1 corresponding to a fast adaptation of 𝐮 to eventual external stimuli and a slow memory decay which will be responsible of the storing of previous opinion configurations in the memory of interpersonal relations. This process will describe how the whole society can be shaped by its past by learning from patterns of opinions produced by sustained signals or series of repeated external stimuli. 
Among the different scenarios studied, we will describe the case of the arrival of different external stimuli represented by a local field changing in time I(t)=I_0ξ^μ(t). In this expression p different random choices of ξ^μ(t)=(ξ_i^μ(t)) ∈{± 1}^N are considered, one for each integer value in {1...p} that μ(t) assumes, each of them for a time Δ_0. Each of these random vectors represents the perceived piece of news that influence the society during the time Δ_0 and is later substituted by a different piece of news. Under the effect of such external influences we expect that the society will likely develop interactions comparable to the classic Hopfield couplings <cit.> defined from a collection of p random patterns ξ^μ, albeit rescaled by a factor 1/p, so in the long time limit we expect

    J_ij≃ J_ij^/p=1/Np∑_μ=1^pξ_i^μξ_j^μ .

In fact, if each strong signal clamps the expressed opinions towards the positions that it suggests (𝐠(t)=ξ^μ(t)) for a time Δ_0≪τ_γ, and the sequence μ(t) of the signals' appearances is repeated many times in τ_γ, 
the average over the past history in Eq.(<ref>) can be approximated by an average over the product of ξ_i^μ and ξ_j^μ as by definition of Hopfield couplings. 
 In section <ref> we will discuss the similarity between the generated interpersonal couplings in our modeled society and Hopfield couplings in more detail.
For the moment it is interesting to note that, despite the similarity that emerges at first sight, the couplings in the Hopfield model <cit.> were taken to be fixed from the start, whereas in the present case they evolve dynamically under the influence of external signals and internal dynamics.  It is only in the case of the special scenario described above that we will see the emergence of Hopfield type couplings. 



 §.§ Numerical details

While a few of the simplest scenarios investigated in the present paper can be studied analytically, we are in many cases forced to use numerical simulations. To perform these, we note that the couplings of Eq. (<ref>) satisfy a dynamical evolution equations:

    J̇_ij(t)= γ[J_0/Ng_i(t)g_j(t) - J_ij(t)] .

We use Euler integration to integrate Eq. (<ref>) and Eq. (<ref>); we found a step size
t=0.1 (with η_i(t)=σ√(dt)) sufficiently small for our purposes.
There are many parameters involved in the simulations, some are fixed in all the cases, some vary. The fixed parameters are listed here: we choose N=100 for the number of agents and p=3 for the number of different external signals. Although these numbers are small, they produce results that are representative of the N→∞ limit with p≪ N (as we have checked by using other (p,N) combinations). Throughout this paper we used a low noise level, σ^2=0.01, to ensure that non-trivial collective states can emerge. All simulations start with random initial conditions u_i ∼𝒩(0, σ^2/2) which would be the equilibrium distribution in a non-interacting system without external signal. 
The other important parameters that change from case to case are the time length of each external signal Δ_0, the amplitude I_0 of the polarizing signal (apart from a few exceptions taken to be I_0=50), the strength of the interactions J_0 and the time scale τ_γ of the memory of past interactions.





§ RESULTS OVERVIEW


Our model is constructed on the simple assumption that the mutual interactions between agents depend  on their past history of agreement or disagreement. Our main result is that this creates a mechanism that allows a society to develop a collective memory of its past experiences. 
To study this mechanism in more detail, we analyze different protocols of external influences that first trigger the different individuals' opinions. The different scenarios presented range from simple situations to more complex and realistic ones and are listed below together with a list of the results obtained in each case. 
 

    
  * The external information I is heterogeneous but constant in time. We are able to treat the system analytically and predict its long time behaviour. Already in this simple setting the presence of the signal changes the way people interact and determines their future behaviour. 
    
  * The signal consists of a sequence of different (random) patterns, repeatedly presented in a cyclic fashion. In the long run this creates a stable matrix of interactions between the agents which can be predicted analytically. 
    By means of this interaction matrix  the society develops a memory of the opinion patterns presented previously     and it is found to be able to recall each of them. 

    
  * A sequence of external stimuli is repeatedly presented in a cyclic fashion as before. However there are gaps between the presentation of successive signals where the society is not exposed to an external stimulus and follows its own internal dynamics. In this scenario a critical ratio of patterns duration and length of the gaps without pattern presentation must be exceeded for the system to develop persistent memory of the signal. We provide an analytic treatment to predict this critical ratio. 
    Interestingly we also found that in the case of high-impact news that influence the society very frequently, the presentation time needed for the news to be memorized by the society is unexpectedly small.

The study of even more realistic situations such as sequences of external influences with different impact on the society and random appearance in time will be considered in a follow up paper.


§ LEARNING FROM A PERSISTENT EXTERNAL SIGNAL


In this section we start illustrating the behaviour of the society described by our model in a simple setting. Here we study its reaction to an external information persistent in time and described by a signal I_i=I_0 ξ_i where I_0 is its strength and ξ_i is a random variable taking values in {± 1}, which represents the way in which the agent i perceives it. Note that the uniform perception I_i=I_0   ∀ i is a particular case of what discussed here. Our aim is to understand how the society reacts to this signal and how the memory of the opinions induced by it develops in this simple case before moving to more complicated settings. In order to do this, we will study the evolution in time of the agents' preference field u_i and of interaction couplings J_ij between agents. 
Even in the simple case of a constant signal, solving the equation for u_i is not a trivial task, mainly because of the dependence of the couplings on the expressed opinions.
We will see that the presence of the signal will induce the agents to change their opinion, consequently modifying the relationship of agreement and disagreement between them. As a results of this change, the couplings J_ij, which are null at the beginning of the dynamics, will start to evolve and establish the new interactions between the agents. This process allows the society to learn the opinion pattern ξ and to collectively retrieve it in the future. 

We can write down a formal solution of Eq. (<ref>) with couplings defined in Eq. (<ref>): 

    u_i(t)   =    u_i(0)e^-t+ J_0 ∫_0^t s [ U_i(s)+η_i(s) ] e^-(t-s)+I_0ξ_i (1- e^-t)  ,

in which 

    U_i(s)=γ∫_0^s s' ^-γ(s-s')g_i(s')q(s,s') ,

with 

    q(s,s')=1/N∑_jg_j(s)g_j(s') .

We note that, by appeal to the law of large numbers, the correlator q(s,s') will be non-random in the large N limit. Noting further that, for γ≪ 1, the function U_i(s) are very slowly varying funcions of s, we see that:

    ∫_0^t  s U_i(s)^-(t-s)≃ U_i(t) ∫_0^t  s ^-(t-s) = U_i(t)(1-^-t) .

To proceed we adopt one further approximation to replace U_i(t) in Eq. (<ref>) by its noise average (indicated by ⟨·⟩), which is tantamount to replacing the g_i(s') in Eq. (<ref>) by their noise average. While this replacement leads to an underestimation of the noise contribution in the evolution of the u_i(t), we found that the effect remains small in the parameter ranges considered. With this approximations the solution for u_i becomes

    u_i= u_i(0)^-t+ J_0 ⟨ U_i(t)⟩ (1-^-t) + ∫_0^∞η_i(τ)e^-ττ+ I_0ξ_i(1-^-t)  .

This means that u_i will be a Gaussian process with mean

    ⟨ u_i ⟩ = u_i(0)^-t+ J_0 ⟨ U_i(t)⟩ (1-^-t) + I_0ξ_i(1-^-t) ,

covariance

    C(t,t')   =   ⟨(u_i(t)-⟨ u_i⟩ (t))(u_i(t')-⟨ u_i⟩ (t'))⟩
       =   ∫_0^t∫_0^t' s  s' ⟨η_i(s)η_i(s')⟩ e^-(t-s)e^-(t'-s')
       =   σ^2/2(^-|t-t'|-^-(t+t')) ,

and variance 

    σ_u^2(t)=C(t,t)=σ^2/2(1-^-2t) .

We are interested in studying the system in the long time limit t, t' →∞, where the u_i-process become stationary, with the covariance of the u_i only depending on the time difference τ=|t-t'|=O(1), i.e. C(t,t')=C(τ), so we will have

    lim_t →∞⟨ U_i(t)⟩ = γ⟨ g_i ⟩q̃(γ)

where q̃(γ) is the Laplace transform of q(t-s'). 
The mean of u_i, its covariance and variance will thus become

    ⟨ u_i ⟩   =   γ⟨ g_i ⟩q̃(γ) J_0  + I_0ξ_i 
    
    C(τ)    =   σ^2/2^-τ
    σ^2_u    =   C(0)=σ^2/2 .

Now we realize that ⟨ u_i ⟩=ξ_i⟨ u ⟩ and ⟨ g_i ⟩ = ⟨ g(⟨ u_i ⟩ + σ_u ζ_i)⟩_ζ = ξ_i ⟨ g ⟩, with ⟨·⟩_ζ being the average taken over ζ∼𝒩(0,1), are a consistent solution of Eq. (<ref>). This allows us to take out the dependencies on i from the equations.

If we now choose the expressed opinions to be the error functions of the preference fields, with g_i=(u_i), we can exploit the properties of the error function to obtain a self consistency equation for ⟨ u ⟩. We will have

    ⟨ g⟩=(⟨ u⟩/√(1+2σ_u^2))

and 

    q(τ)=⟨(⟨ u⟩_∞+σ_ux)(⟨ u⟩ _∞+ρ(τ)σ_ux/√(1+2(1-ρ^2(τ))σ_u^2))⟩_x ,

where ⟨·⟩_x stands for an average over a Normal random variable x and the correlation coefficient ρ(τ) is 

    ρ(τ)=C(τ)/σ_u^2=e^-|τ| .

(See <cit.> for further details on these last passages from a similar computation in a different context.) 

Gathering these results together we obtain a closed system of equations that describe the preference field of the agents in our society under the effect of a constant external signal in the stationary regime:

    ⟨ u⟩   =    I_0 + J_0 γ(⟨ u⟩/√(1+2σ_u^2))q̃(γ) ,
    σ_u^2   =   σ^2/2 ,
    q̃(γ)   =   ∫_0^∞τ q(τ)e^-γτ ,
    
    q(τ)   =   ⟨(⟨ u⟩+σ_ux)(⟨ u⟩+ρ(τ)σ_ux/√(1+2(1-ρ^2(τ))σ_u^2))⟩_x .

In  order  to  understand  to  what  extent  the  external  field  has  influenced  the
society we will focus on the overlap of the asymptotic system state with the pattern ξ:

    m(t) = 1/N∑_i ξ_i g_i(t)  .

This quantity measures whether the expressed opinions in the society are similar to those induced by the signal ξ, i.e. m∼ O(1), or not. The overlap is self-averaging in the N →∞ limit and its value at late times, t →∞, is given by

    m = 1/N∑_i ξ_i ⟨ g_i⟩ = ⟨ g ⟩ ,

which therefore satisfy the following equation

    m = (⟨ u ⟩/√(1+2σ_u^2))=( I_0 + J_0 γq̃(γ)m/√(1+2σ_u^2)) .

We chose to write the last equation in a self consistent form to show that under certain conditions we can expect a non zero value of m even when the signal is finally removed, I_0=0. 
Indeed, for sufficiently large values of the product J_0q̃(γ) in comparison with the noise contribution quantified by σ, the equation admits a non zero solution. For example, if the society is exposed to a signal I_0=1 for long times, given a J_0=6 and γ=10^-3 its overlap will be close to 1 and will remain close to 1 when the signal is removed (we will see that in the same conditions this value will match the results obtained with a simulated dynamics).
In other words the society is potentially able to remember the opinions induced by the signal even when it is removed, after having been exposed to such signal for sufficiently long time. 
To shed more light on this mechanism we now focus on the evolution of the couplings and the value they reach in the stationary regime for a society described by a choice of the parameters that admits a non zero solution to Eq.(<ref>).

 The upper panel of Fig. <ref> shows how couplings evolve in a numerical simulation starting from a society without interactions between agents. The continuous curve shows the norm of the J_ij matrix defined as

    |J|=√(∑_ijJ_ij^2) .

For sufficiently large I_0, a simple analytic argument allows us to give an accurate prediction of this growth. In the presence of a signal I_i=I_0ξ_i, preference fields rapidly orient towards the signal with large absolute values of u_i and g_i will therefore soon be approximately equal to ξ_i. By using this information we can integrate Eq. (<ref>) to obtain:
 
    J_ij(t)≈J_0·γ/N∫_0^ts  ξ_iξ_j e^-γ(t-s)= J_0/Nξ_iξ_j (1-e^-γ t)  ,
 
where the memory time scale appears explicitly. 
The average absolute value of this analytic prediction is represented also in units of J_0 by the dashed line in the upper panel of Fig.<ref> and nicely superimpose with the numerical results. As the system will quickly approach a stationary state, aligned with the external signal, interactions further stabilizing that the very same stationary state will be established after a time set by the memory time scale, chosen to be τ_γ= 10 in that simulation. 

Note that the sign of the predicted couplings is also peculiar. 
For long times the J_ij approach the Mattis couplings <cit.>:

    lim_t→∞J_ij(t)= J_0/Nξ_iξ_j ≡ J^M_ij
 
equivalent to the Hopfield couplings in Eq.(<ref>) for p=1. 
It is well known that in a system with pairwise interactions given by Mattis couplings (Eq.(<ref>))  with sufficiently large amplitude, the variables spontaneously align in the directions defined by ξ.
In our modelled society this would correspond to the fact that the opinion pattern can be spontaneously retrieved because the corresponding Mattis couplings have been formed as a consequence of the memory of the sustained past opinion patterns induced by the exposure to the signal I_i=I_0ξ_i. 
To verify that this is the case we define the correlation

    Q=∑_ijJ_ijJ_ij'/√(∑_ij J_ij^2∑_ijJ'_ij^2)

that reveals the degree of alignment between two sets of couplings J=(J_ij) and J'=(J'_ij), with Q=1 implying perfect alignment and Q=0 the absence of any correlations.
In the lower panel of Fig.<ref> we exhibit the correlation between couplings observed in a simulation with both the analytic prediction (Eq. (<ref>)) and the asymptotic Mattis couplings (Eq. (<ref>)). It shows that interactions are very quickly perfectly correlated with both the analytically predicted couplings and the Mattis couplings, although their norm is initially smaller than |J^M| (see comparison with the absolute value of J^M/J_0 in the upper panel of Fig.<ref>).
In conclusion, the memory of interpersonal relations developed in response of an external stimulus ξ produces in the society interactions of increasing strength, which are very quickly aligned with Mattis couplings corresponding to the ξ itself. 

For large enough strength of the couplings we can expect that the society will spontaneously polarize along ξ autonomously sustaining its memory even after the external signal is gone. 
To give evidence of this interesting phenomenon we studied different dynamics in which the external signal ξ is switched on at t=0 and removed at a time t_r.
We then focus on the asymptotic average overlap for

    
  * dynamics in which couplings keep evolving after t_r (evolving J_ij)
    
  * dynamics in which couplings are fixed to the value they had at t_r (frozen J_ij).
 

The average overlap for both versions of the dynamics has been calculated as the average of the simulated overlap at stationarity over the last 1000 units of time and plotted in Fig. <ref> as a function of t_r. 

The dynamics with frozen J_ij shows at which t_r the couplings have grown large enough for a spontaneous m to arise. 
We note here that this overlap m corresponds to the solution of the self-consistent Eq. (<ref>) derived for the stationary solution once the amplitude of the asymptotic couplings J_0 q̃(γ) is replaced by the amplitude of the frozen couplings |J(t_r)| (also reported in Fig. <ref>) and I_0=0.
According to this equation the critical value of the strength of Mattis type couplings needed for the model to exhibit spontaneous order with m>0 is |J_c|=0.148 J_0 and it corresponds to the |J|=(0.148 ± 0.003)J_0 reached at the minimum t_r where m>0 in simulations with frozen J_ij.
We will come back to this minimum time t_r 
in a different context in Section <ref>. 

Interestingly the dynamics with evolving J_ij is instead characterized by an asymptotic spontaneous overlap arising in a discontinuous way even before that minimum t_r. 
Indeed, at variance with the frozen case, the evolving couplings will continue to grow after t_r even in absence of the external signal as a result of the interactions embedded in the system. If this residual reinforcement of the couplings is large enough a positive feedback loop will occur between the evolving couplings and the degree of order supported by the interactions currently established in the society. The degree of order will be strengthened by strong interactions, which will in turn grow further due to a higher degree of persistence of the expressed opinion pattern.
As soon as this self-sustained mechanism takes place it leads to a strongly polarized society represented by the large value of m in Fig. <ref>.

In the following sections we will study more complicated cases in which the external signal is composed of a sequence of different stimuli both with and without interposed periods of complete absence of stimuli. 
The understanding of the system's reaction to a single external stimulus gained in the present section as well as the quantities introduced here will be used in the next sections to understand if and how the society is able to learn and subsequently retrieve the different opinion patterns to which it has been exposed in the past.



§ PERIODIC EXTERNAL SIGNAL


 As a second step in the exploration of our society's behaviour we will change the external information structure, passing from a constant signal I_0ξ to a signal that changes in time. The aim is mimicking a sequence of different news or events, labeled by the index μ∈{1, …, p}, to which the society is exposed and reacts.
 As before, the variables ξ^μ represent the way in which the population reacts to a single piece of information, and are modelled as random variables with entries ξ_i^μ  ∈{± 1}.
 The different contributions I^μ=I_0ξ^μ will appear in an ordered sequence, each  switched on for a time span Δ_0 before being substituted by the following piece of news in the sequence. 
 This process is repeated in a cyclic fashion. The resulting expression of the signal is thus
 
    I_i(t)= I_0 ξ_i^μ(t) ,

 with
 
    μ(t)= 1+⌊t/Δ_0⌋p ,

where ⌊·⌋ is the notation for the integer part. This series of repetitive signals represents a simple but effective way to model series of events that are repeatedly appearing in television or newspapers.

As introduced in section <ref>, we expect that in the long run the exposure of the society to a sequence of signals defined in Eq. (<ref>) and (<ref>) will result  in the development of couplings that are similar to the Hopfield couplings (Eq. (<ref>)).
Indeed as before, given a signal with large amplitude I_0, we can assume that the opinions g_i become rapidly equal to the opinion pattern proposed every time we have a signal spike, so we have that g(t)=ξ^μ(t). For this assumption to provide an accurate approximation of the full dynamics, we also assume that Δ_0≫ 1 allowing us indeed to neglect transient behaviour after the switches of the external signal.
Using this approximation we can calculate (see Appendix A for details) the couplings J_ij developed in the society at times t, which are multiples of the presentation time pΔ_0: 

    J_ij = J_0/N  (e^γΔ_0-1) (e^-γ t-1)/(1-e^γΔ_0 p)∑_μ=1^pξ_i^μξ_j^μ e^(μ-1)Δ_0γ

In the long time limit t →∞ (thus N_p→∞) this tends to

    lim_N_p→∞ J_ij(t=N_pΔ_0 p) = J_ij,∞(p)= J_0/N(e^γΔ_0-1)/(e^γΔ_0 p-1)∑_μ=1^pξ_i^μξ_j^μ e^(μ-1)Δ_0γ .

Eq. (<ref>) shows explicitly that the learning protocol allows the couplings to approach in the long run a weighted version of the Hopfield couplings where each pattern's weight is a function of its presentation order (μ). This means that we expect an uneven storing of the patterns: the pattern last seen is remembered best, while the memory of the previous ones decays exponentially on a time scale τ_γ, in a similar way as in some generalized Hopfield models of forgetful memories <cit.>.
Finally 
expanding equation (<ref>) for small γΔ_0 (many repetitions of news presented within a memory time) we obtain

    J_ij,∞= J_0/pN∑_μ=1^pξ_i^μξ_j^μ + J_0/pN∑_μ=1^pξ_i^μξ_j^μ (μ-1)Δ_0γ + o((Δ_0γ)^2) .

Note that the first term is proportional to the Hopfield couplings (see Eq. (<ref>)), 
which can be thus thought as a zeroth order approximation to our couplings.
 
Similarly to what happens in Hopfield Neural Networks, our society will be able in the long run to store and easily retrieve the opinion patterns ξ^μ. 
The level of retrieval of the society for each of the patterns μ can be evaluated using a set of overlaps m^μ: 

    m^μ(t)=1/N∑_iξ_i^μ g_i(t) .

These overlaps will tell us if the system is aligned with one of the opinion configurations previously presented (m^μ = O(1)) or not (m^μ = O(1/√(N))). 
The value of m^μ in the long time limit can be obtained assuming the Gaussianity of u_i (as done in the scenario of the previous section)
and evaluating the average u_i in the following way: we use the couplings evaluated in Eq. (<ref>) to evaluate the long term limit of Eq. (<ref>). In the absence of a signal (I_i=0 ∀ i) we thus obtain u_i ∼𝒩(⟨ u_i⟩,σ_u^2), with

    ⟨ u_i⟩   =   ∑_jJ_i,j,∞⟨ g_j⟩
    σ_u^2    =   σ^2/2 ,

and 

    ⟨ g_i⟩   =   (⟨ u_i⟩/√(1+2σ_u^2))
       =   ((e^γΔ_0-1)/(e^γΔ_0 p-1)J_0 ∑_μ=1^pξ_i^μ  m^μ  e^(μ-1)Δ_0γ/√(1+σ^2)).

If different patterns have negligible mutual overlaps, such as for uncorrelated patterns with 1/N∑_iξ_i^μξ_i^ν∼1/√(N) for μ≠ν, the equation above can have a non trivial solution for which the society aligns with exactly one of the patterns, ν.
In this case m≃{0,..0, m^ν ,0...,0} and

    m^ν≃( m^ν J_0 (e^γΔ_0-1)/(e^γΔ_0 p-1)e^(ν-1)Δ_0γ/√(1+σ^2)) .

Note that under certain conditions the solution of Eq. (<ref>) is non trivial and will be larger for more recently presented patterns and smaller for older ones, meaning that, if remembered at all, recent pieces of news will be better recalled by the society.  

As a confirmation of this behaviour we simulated the dynamics of our society until a time t_r at which we froze the couplings. 
To check whether the society has developed a memory of the p external signals to which it has been exposed, after t_r we apply each signal contribution again for a short time after which we remove it to observe the response of the society in terms of the overlaps m^μ in absence of it.


As shown in Fig. <ref>, the society quickly reacts to each of the spikes after t_r=6090 as the corresponding m^μ (highlighted in Fig. <ref> with different colours for different signal patterns) jumps to 1 during the spike and relaxes to a non trivial value in absence of external signal. It remains stationary until the subsequent spike of a different pattern is applied.
The expected stationary non trivial overlap m^μ obtained from Eq. (<ref>) matches quite well with the simulation results. To further confirm our findings we defined the quantities m^μ as the average of m^μ over 100 simulations and we compared them for different strength I_0 of the signal applied during the dynamics, with their analytical predictions in Table <ref>. In this case to obtain m^μ in each simulation we froze the couplings at t_r and we averaged the values of m^μ on the last 2000 steps after the corresponding subsequent signal spike. 
We note that predictions always slightly overestimate the simulation results. The two main reasons for this discrepancy are that in Eq. (<ref>) we neglected the contributions of the fluctuations of g_i(t) and that the transients of the u_i dynamics after every change of external signal were neglected in the analytical evaluation of the couplings.
Moreover the theory works better for higher I_0 as the assumption we made that the opinions align immediately to the signal becomes more accurate for large signals.
Finally we can observe that predictions get worse for earlier external signals. Indeed they are associated with smaller effective couplings in Eq. (<ref>) and consequently overlap solutions more susceptible to the neglected fluctuations.


The possibility to store and retrieve all the presented external signals as shown in Fig. <ref> is expected, given the similarity between the spontaneously formed interaction couplings and classical Hopfield couplings (see Eq. (<ref>)).
For the simulation reported in Fig. <ref> we indeed find that interactions very soon align almost perfectly with corresponding Hopfield couplings as shown in the upper panel of Fig. <ref>. 
The figure also shows that analytic predictions of J from Eq. (<ref>) are very accurate as the corresponding Q≃1 at all times for J analytical.
As discussed in the previous section, the possibility for the society to retrieve the pattern induced by an external signal requires sufficiently large couplings to allow a non-zero solution of Eq. (<ref>).
In the bottom panel of Fig. <ref> we compare the norm of J  (defined in Eq. (<ref>)) obtained with simulations to its analytical prediction and the norm of the Hopfield couplings over p J^H/p. The evolution of the analytical curve predicts closely the evolution of the simulated |J|/J_0 while |J^H|/p overestimates the true value of |J| at the beginning of the dynamics.
However at t_r=6090 the value of the simulated |J| has reached a stationary value very close to |J^H|/p.  
The society has been irremediably shaped by the opinion patterns ξ^μ. 



§ INTERMITTENT EXTERNAL SIGNAL


In this section we study a still stylized but slightly more complicated scenario. We analyse the response of the society to intermittent external information. We keep the cyclic presentation mode described in the previous section. However, the different opinion patterns are no longer influencing the society for the entire presentation period Δ_0, but only for a fraction θΔ_0 of each period, with θ<1. 
The signal is absent for the remainder Δ_1=(1-θ)Δ_0 of the presentation period:

    I_i(t)= 
     
    I_0 ξ_i^μ(t)   nΔ_0 < t ≤ nΔ_0 + θΔ_0
    
    0

with n ∈ℕ and 

    μ(t)= 1+⌊t/Δ_0⌋p .

In this way we represent a society hit by a periodic sequence of different strong stimuli, such as repetitive political propaganda or a series of shocking events (e.g. terrorist attacks) alternated with periods of absence of external information. Questions that arise in such a scenario are: Will the society be shaped by these shocks? What is the smallest fraction θ of the time for which the system is exposed to external stimuli that still allows the society to spontaneously retain the information presented? 

To evaluate the couplings in this case, we assume that during the time θΔ_0 in which the signal I_0ξ^μ is on, the preference fields immediately align and g = ξ^μ, which requires the signal strength I_0 to be sufficiently large. As long as the society remains unable to retain the presented patterns, we find that, as soon as the signal is removed, the preference fields very quickly decay to 0 and remain small during the time Δ_1 in which the signal is off. Once the society has been exposed to sufficiently many presentation cycles, couplings of sufficient strength may have developed allowing the society to retain information about the latest pattern presented, even when the signal is removed. When evaluating the couplings for this situation, we assume for simplicity that the system remains nearly fully aligned with the previously presented pattern, g≃ξ^μ, even after the the signal is turned off.
Figure <ref> shows a simulation exhibiting a transition from an early time regime, where information is not retained after signal removal, to a late time regime, where the system remains aligned with a signal even at times where the signal is switched off. In Fig. <ref>, we present a zoom into both the early time and the late time regimes. Shaded rectangles in the figure represent the intervals θΔ_0 in which an external signal is present. At early time when the signal is switched off, the opinions take some time to disalign to it. This extra time, that we will indicate as θ' Δ_0, is not easy to calculate, however we can give a rough estimation of it assuming that the preference field u_i(t) freely decays to zero when the signal is removed (see <ref>).


We define the time t^*, in multiples of pΔ_0, as the time of the last cycle of external stimuli that is still insufficient to create couplings of a strength needed for the society to retain the previously presented information.
Using the signal structure defined in Eq. (<ref>), we can derive an expression for the couplings for t<t^* and for t>t^* under the simplifying assumptions made above (details of the calculations in <ref>):

    J_ij(t<t^*)=J_0/N(^γΔ_0(θ+θ')-1)^-γ t(1-e^γ t)/(1-e^γΔ_0 p)∑_μ=1^p ξ_i^μξ_j^μ^Δ_0γ(μ-1)


    J_ij ( t>t^*)    =   J_0/N e^-γ t((e^γΔ_0(θ+θ')-e^γΔ_0)(1-e^γ t^*)/(1-e^γΔ_0 p). 
            +  . (e^γΔ_0-1)(1-e^γ  t)/(1-e^γΔ_0 p)) ∑_μ=1^pξ_i^μξ_j^μ e^(μ-1)Δ_0γ

The couplings in Eq.s (<ref>) and (<ref>) are for simplicity evaluated only for integer multiples of Δ_0.
As shown in Fig.  <ref>, the couplings thus predicted compare remarkably well with those evaluated in a numerical simulation of the dynamics as presented in Fig. <ref>. However, given the approximations used in the estimation of θ' we cannot expect to have a perfect agreement between the analytical prediction and the simulations (the limitations of our approach are discussed in <ref>).

In Fig. <ref>,  the choice of parameters is such that the interactions rapidly align with the Hopfield couplings, and their norm grows along the dynamics eventually granting retrieval of the signal patterns after a finite time t^*. 

To determine t^*, we use these equations to obtain an expression for the couplings J at time t^*+(θ+θ') Δ_0 (see <ref> for details of the calculation) and use these in the self-consistency equation for m^1 (also derived in the same appendix)

    m^1 =( m^1 J_0(1-^-γΔ_0(θ+θ'))/√((1+σ^2))(1-e^-γ (t^*+Δ_0 p))/(1- e^-γΔ_0 p)) .

The value of t^* is then obtained by requiring that Eq. (<ref>) has a non trivial solution, which gives

    t^*=  -Δ_0p [1 + 1/γΔ_0 p log(1 - √((1+σ^2))/J_0(1-^-γΔ_0(θ+θ'))√(π)/2(1-e^-γΔ_0 p)   ) ]  .

Note that t^* increases with decreasing θ, and it will eventually diverge (and a finite t^* will cease to exist)
as θ is decreased below θ_

    θ_   =   -1/γΔ_0log(1-√(π(1+σ^2))/2J_0(1-^-γΔ_0 p))-θ'
       =    -1/γΔ_0log(1-√(π(1+σ^2))/2J_0(1-^-γΔ_0 p))- 1/Δ_0log(I_0(1-e^-Δ_0θ)/0.74)

for which the argument of the logarithm in Eq. (<ref>) vanishes and where θ' is evaluated in <ref>.
 The solution of this equation can be found numerically and the resulting behaviour in function of 1/Δ_0 is shown in Fig. <ref>. The condition θ > θ_ thus guarantees the existence of a finite time t^* at which persistent memory starts to form, and at least one of the patterns stored can be recovered[For θ > θ_ at least one pattern will be recovered, but this does not guarantee that the first pattern of the cyclically repeated sequence is among those recovered.]. 
The existence of a minimum value of θ required for the society to be able to spontaneously retrieve the information contained in the signals presented earlier is of immediate practical relevance. For advertisement campaigns, for instance, it defines the minimum fraction of time needed for a repeatedly presented signal to permanently impress the audience as a collective body. In the domain of news, it would, for instance allow to assess, whether or not repeated news items might leave a subtle persistent trace in the society and produce collective responses otherwise unpredictable.

To verify our predictions of θ_ we simulated dynamics with external signal of different amplitude I_0 until stationary interaction couplings are reached. We then froze the couplings and counted how many times the society recovers at least one of the patterns[This includes also mixture states with 𝐦=(m^1, m^2, m^3), where m^1 0, m^2 0 and m^3 0, which are also encountered in some instances.] after a signal spike. 
Recovery is reached when the corresponding overlap in absence of external signal satisfies the threshold condition m^μ>0.4.
Such recovery threshold has been chosen significantly higher than the overlap (∼ 1/√(N) = 0.1) expected if the system state is uncorrelated with the pattern, but not too high in order not to exclude recovery with a low O(1) overlap given the system parameters. We finally estimate θ_ from simulations as the smallest θ for which at least half of 50 trial runs of the dynamics show such retrieval behaviour.

In Fig. <ref> we plot θ_ for different values of I_0 as a function of the inverse total presentation time 1/Δ_0 alongside the analytic prediction θ_ obtained above.  

As clearly visible in the figure, for large Δ_0 the analytic curve gives a good prediction of the simulation results for all the signal strengths, confirming that there is not significant dependence on I_0 in this regime. It is interesting to notice that in this regime the value of (θ_+θ')Δ_0 corresponds to the minimum time needed by the society to embed a single pattern presented with a persistent signal (the minimum t_r mentioned in section <ref>):

    θ_+θ'≃ -1/γΔ_0log(1-√(π(1+σ^2))/2J_0)

assuming J_0>√(π(1+σ^2))/2. This means that at the beginning of the dynamics the society is able to maintain its orientation towards the very first pattern seen, that will be the one most easily remembered. 

Interestingly at small Δ_0 a much stronger dependence on I_0 develops. The analytical curves qualitatively capture the trend of the numerical ones but overestimate their true value. This discrepancy can be related to the approximations used in the estimate of θ'. 
When solving the dynamics in the fraction of time θ'Δ_0 we neglect the interactions between agents.
In doing this we underestimate the partial memory that has started to form in the society, and consequently overestimate the θ_ needed for recovery. 

Lastly but very importantly we note that both numerical results and analytic estimations show a decrease in θ_ at small Δ_0 which is more pronounced when I_0 is larger.
This phenomenon is a direct consequence of the fact that θ' increases with I_0, therefore for larger I_0 the term Δ_0θ' allows recovery with smaller θ_. 
In applications the fact that 
θ_ reaches very small values for small Δ_0 and large I_0 would suggest to invest in short but frequent and high-impact advertisements. Similarly we can conclude that shocking events such as terror attacks, if repeated on short periods, might leave deep traces in the society despite being very localised in time.

 

§ CONCLUSIONS

 News of disruptive events in history such as terror attacks often appear to change the behaviour of a society and will influence how people will react to news of future events of a similar kind. In this work we introduce a simple model of opinion dynamics which includes otherwise well-studied phenomena such as homophily <cit.> (the tendency of people to interact more often with others who share similar opinions) and xenophobia <cit.> (the tendency to adopt  opinions different different from those of people with whom there has been disagreement in the past). The model includes dynamically evolving couplings, which effectively record an exponentially weighted history of co-expressed opinions between any pair of agents in the system. We show how this mechanism allows a society do develop a collective memory of external information it had previously been exposed to, allowing it to spontaneously retrieve such information in the future when briefly triggered by exposure to that information.
 
  We study the emergence of this type of collective memory both analytically and by way of simulations for three stylized scenarios representing different histories of exposure to external information: (i) information consisting of a persistent signal, (ii) information consisting of repeated presentations of a set of different signal patterns, and (iii) information consisting of repeated presentations of a set of different signal patterns separated by periods of absence of any signal. In the first scenario, the external information does not change in time; the society aligns to the signal and — after a sufficiently long time of exposure to the signal — will remember it in the future even when the signal is removed. In the second scenario, the society is exposed to a series of signals, corresponding to different news. If these news are repeated for a sufficient number of times, the society is able to remember all of them, and recall them in the future when triggered by a brief spike of the same information. This can be true also in the third scenario, in which the different news are are interspersed with phases of absence of any signal. The determining factor here is the relative length of the periods of signal presentation and signal removal. We were able to compute the critical minimal ratio of presentation time and signal removal time that allows the society to develop a persistent memory of the sequence of news and thereby to remain aligned to external information even when the signal is removed. Moreover we demonstrated that even very short signals, if sufficiently strong and repeated sufficiently often, can guarantee the spontaneous retrieval of their information.

 In the three scenarios analysed, polarizing signals presented to the society were able to deeply change the collective behaviour of the society described by our model, in the sense that persistent memory of past events emerged which causes it to react differently in the future. The condition for this to occur is always that the bare coupling constant J_0 in the model is sufficiently large compared to the noise level of the dynamics. Thus our model is able to capture, how the collective behaviour of a society can be strongly influenced by its past events.

 A follow up work will concern the study of the model under more realistic assumptions about signal structures, including presentation of news items in random order and presentation of news with different signal intensities. An interesting further generalization that could be considered to make the model more realistic is to define interactions depending on  multidimensional (rather than binary scalar) opinions so as to represent the effect that individuals interact in ways which depend on judgments about a collection of topics. In this setting the evolving interactions based on past interpersonal agreement or disagreement on the entire set of topics would correlate the agents' response to the different topic in a non trivial way.
 


§ ACKNOWLEDGEMENTS

The authors acknowledge funding by the Engineering and Physical Sciences Research Council  (EPSRC)  through  the  Centre  for  Doctoral  Training  in  Cross  Disciplinary Approaches to Non-Equilibrium Systems (CANES, Grant Nr.  EP/L015854/1). The authors would like to thank Nishanth Sastry for his contribution at the initial stage of this project and Jean-Philippe Bouchaud, Ton Coolen, Imre Kondor and Francesca Tria for interesting discussions. 




§ ANALYTICAL PREDICTION OF J_IJ FOR A REPETITIVE SIGNAL

We want to give an analytical estimation of J_ij for a signal defined in Eqs. (<ref>) and (<ref>). For simplicity, we will evaluate the couplings only at the end of each pattern presentation period (i.e., for times t which are integer multiples of Δ_0). We thus define J_ij(ν,t) as the coupling at time t=N_p pΔ_0+νΔ_0, in which N_p is the number of complete cycles of p patterns and ν < p the number of additional patterns seen in the final (possibly incomplete) cycle presented up to time t. If we assume that as soon as the signal is switched on, the expressed opinions g will for each μ presented align with the pattern ξ^μ,  then J_ij(ν, t) will take the form

    J_ij(ν, t)    =   J_0/Nγ∫_0^t s e^-γ(t-s)g_i(s)g_j(s)
       =   J_0/Nγ[( ξ_i^1ξ_j^1 ∫_0^Δ_0 s e^-γ(t-s)+.....
           .+ ξ_i^pξ_j^p ∫_(p-1)Δ_0^pΔ_0 s e^-γ(t-s)) 
           +  ( ξ_i^1ξ_j^1 ∫_pΔ_0^(p+1)Δ_0 s e^-γ(t-s) +....
            +. ξ_i^pξ_j^p ∫_(2p-1)Δ_0^2pΔ_0 s e^-γ(t-s)) + . . .
            + . ( ξ_i^1 ξ_j^1 ∫_N_p pΔ_0^(N_p p+1)Δ_0 s e^-γ(t-s) +.....
           + . . ξ_i^νξ_j^ν∫_(N_pp+ν-1)Δ_0^t=(N_pp+ν)Δ_0 s e^-γ(t-s)) ] .

Using

    ∫_a^a+Δ_0 e^γ s s=∫_0^Δ_0e^γ x+γ adx=(e^γΔ_0-1)e^γ a/γ ,

we obtain

    J_ij   =   J_0/N e^-γ t (e^γΔ_0-1)
    [( ξ_i^1ξ_j^1 +. . .+ξ_i^pξ_j^p  e^γ (p-1)Δ_0).
    
       +   . ( ξ_i^1ξ_j^1 e^γ pΔ_0+. . .+ξ_i^pξ_j^p  e^γ (2p-1)Δ_0)+ . . ..
       +   . ( ξ_i^1ξ_j^1 e^γ N_p pΔ_0+. . .+ξ_i^νξ_j^ν  e^γ (N_pp+ν -1)Δ_0)] .

Now we can group the terms and using t=N_ppΔ_0 + νΔ_0 we have

    J_ij(ν,t)    =   J_0/N (e^γΔ_0-1)(e^-γ t∑_μ=1^pξ_i^μξ_j^μ e^(μ-1)Δ_0γ∑_k=0^(t-νΔ_0)/(pΔ_0)-1 e^γΔ_0 pk. 
            + . ∑_μ=1^νξ_i^μξ_j^μ e^-(ν-μ+1)Δ_0γ) 
       =   J_0/N  (e^γΔ_0-1)( (e^-γ t-e^ -γνΔ_0))/(1-e^γΔ_0 p)∑_μ=1^pξ_i^μξ_j^μ e^(μ-1)Δ_0γ.
           + . ∑_μ=1^νξ_i^μξ_j^μ e^-(ν-μ+1)Δ_0γ) .




§ Θ' ESTIMATION FOR INTERMITTENT SIGNAL
 
We would like to have an estimate of the the time needed by the expressed opinions to disalign with the signal when this is removed. Given that we are not able to evaluate the integral in Eq. (<ref>) during the decaying transient of g_i(t), we can estimate it considering |g_i(s)g_j(s)|=1 for a time (θ+θ')Δ_0 and 0 for the remaining time Δ_0(1-θ-θ'). The time θ' Δ_0 can be estimated as the time in which |g_i(s)g_j(s)| falls to half of its value at the removal of the signal (that is approximately 1). In this way the overestimation implied by assuming |g_i(s)g_j(s)|=1 for s ≤θ'Δ_0 is compensated by the underestimation made by assuming |g_i(s)g_j(s)|=0 at subsequent times. We can give a rough estimate of g_i during the decay assuming that the signal is switched on at time 0 and as soon as it is removed the preference fields follow:

    u(t) = ⟨ u(Δ_0θ)⟩^-t .

where we recall that  u = ξ_i u_i and u_i(θΔ_0) is the solution of Eq. (<ref>) just before the signal is removed. Here we also assume that the interactions between the agents and the noise are neglected, such that the preference field freely decay to 0.  Using this, we can calculate the time t=θ'Δ_0 for which |g_i(t)g_j(t)|=0.5 that is:

    θ' ≃1/Δ_0log ( ⟨ u(Δ_0θ)⟩ /0.74) .

In order to find u_i(θΔ_0) we use Eq. (<ref>) and we assume that the opinions are 0 before the signal is presented and they align to it as soon as it is switched on with g_i ∼ξ_i^μ . As a consequence in Eq. (<ref>) we will have u_i(0)=0 and

    ⟨ U _i(Δ_0θ)⟩   =   γ/N∫_0^Δ_0θ s  ^-γ(Δ_0θ-s)g_i(s) ∑_j g_j(s)g_j(Δ_0θ) 
       =   ξ_i^1  m(t)(1-e^-γΔ_0θ) ,

which in the limit Δ_0 ≪τ_γ which we consider in this paper gives:

    |⟨ U _i(Δ_0θ)⟩| = |m(t)γΔ_0θ| ≪ 1

and so it is negligible respect to the other terms in the equation.
 The final estimation of ⟨ u(Δ_0θ)⟩ will thus be:
 
    ⟨ u(Δ_0θ)⟩ = I_0(1-e^-Δ_0θ) ,

 that inserted in Eq. (<ref>) gives:

    θ'   =   1/Δ_0log(I_0(1-e^-Δ_0θ)/ 0.74) .

We want also to remark that neglecting the terms in Eq. (<ref>) from the calculations does not influence significantly the final result. In fact if we substitute m ≃ 1 in Eq. (<ref>) and we use this to estimate θ' the results that we obtain once the other parameters inserted the results do not differ substantially when compared to those obtained by neglecting this subdominant contribution. 



§ J_IJ FOR INTERMITTENT SIGNAL
 
Given a signal of the form in Eq. (<ref>) and (<ref>) we want to calculate the couplings J_ij in our model.  In order to do this we will assume that at the beginning of the dynamics, as soon as soon as each signal contribution μ is switched on, the preference field aligns to it with g_i = ξ_i^μ. The opinions will remain aligned to the signal for a time Δ_0(θ + θ') where θΔ_0 is the time the signal is actually on and θ' Δ_0 is the additional time the opinions remain aligned to the signal during the decay of the preference field g_i.

Let us define t=N_pΔ_0 p, with N_p as the total number of complete cycles of p pattern presentations seen at time t. 
Following the same reasoning of <ref> we will calculate J at time t as: 

    J_ij   =    J_0 γ/N∫_0^t^-γ(t-s)g_i(s)g_j(s) 
       =     J_0 γ/N( ξ_i^1 ξ_j^1 ∫_0^Δ_0 (θ+θ')^-γ(t-s) ds + ... . 
            + . ξ_i^p ξ_j^p ∫_Δ_0(p-1)^Δ_0 (p-1+θ+θ')^-γ(t-s)ds) + ...
            + ( ξ_i^1 ξ_j^1 ∫_(N_p-1) pΔ_0^Δ_0((N_p-1) p+θ+θ')^-γ(t-s)ds + . ... 
           . + ξ_i^p ξ_j^p ∫_Δ_0N_p(p-1)^Δ_0(N_p(p-1)+θ+θ')^-γ(t-s)ds )

Now using  

    ∫_a^a+Δ_0(θ+θ')^γ sds= (^γΔ_0 (θ+θ')-1)e^γ a/γ ,

we get

    J_ij   =   J_0/N (^γΔ_0(θ+θ')-1) e^-γ t∑_μ=1^p ξ_i^μξ_j^μ^Δ_0γ(μ-1)∑_k=0^N_p-1^Δ_0γ p k

and finally exploiting

    ∑_k=0^N_p-1^Δ_0γ p k=(1-e^γΔ_0p N_p)/(1-e^γΔ_0 p)=(1-e^γ t)/(1-e^γΔ_0 p)

we obtain

    J_ij   =   J_0/N (^γΔ_0(θ+θ')-1)(e^-γ t-1)/(1-e^γΔ_0 p)∑_μ=1^p ξ_i^μξ_j^μ^Δ_0γ(μ-1) .


If the amplitude J_0 of the couplings is too small for the given noise level of the dynamics, the society may never be able to retrieve any of the information it was previously exposed to, in which case the above expression holds for all t. Otherwise, if J_0 is large enough, for some θ the society is able to retrieve the pattern 1 at time t=t^*+Δ_0(θ+θ') after its presentation, with t^*=N_p^*Δ_0 p. For this to happen we thus need a non-trivial solution of:

    m^1=( m^1 J_0(1-^-γΔ_0(θ+θ'))/√((1+σ^2))(e^-γ (t^*+Δ_0 p)-1)/(e^-γΔ_0 p-1))  ,

obtained using J at t=t^*+(θ+θ')Δ_0:

    J_ij   =   J_0/N (1-^-γΔ_0(θ+θ')) [(e^-γ t^*-1)/(1-e^γΔ_0 p)∑_μ=1^p ξ_i^μξ_j^μ^Δ_0γ(μ-1) + 
             + ξ_i^1ξ_j^1  ]
     .

We thus need

    J_0(1-^-γΔ_0(θ+θ'))/√((1+σ^2))(1-e^-γ (t^*+Δ_0p))/(1-e^-γΔ_0 p)2/√(π)≥ 1

which is possible after a time 

    t^* = -Δ_0 p[1  + 1/γΔ_0 p log(1 - √((1+σ^2))/J_0(1-^-γΔ_0(θ+θ'))√(π)/2(1-e^-γΔ_0 p)   )] .

In order for this time to be finite θ should be larger than a certain threshold that is calculated in the main text. For time larger than t^* we thus have that the opinions remain aligned with the signal even when this is removed, so the couplings J can be calculated considering g_i = ξ_i^μ for the whole time interval Δ_0. This means that to calculate J at a time t=N_pΔ_0 p > t^* we need to add terms to the sum of integrals in Eq. (<ref>), which are integrals of the kind of Eq. (<ref>) albeit with the upper limit replaced by a + Δ_0. This results in the following couplings:

    J_ij   =   J_0/N e^-γ t[ (e^γΔ_0(θ+θ')-1) ∑_μ=1^pξ_i^μξ_j^μ e^(μ-1)Δ_0γ∑_k=0^N_p^*-1e^γΔ_0 p k. 
            + . (e^γΔ_0-1) ∑_μ=1^pξ_i^μξ_j^μ e^(μ-1)Δ_0γ∑_k=N_p^*^N_p-1 e^γΔ_0 p k] 
       =   J_0/N e^-γ t∑_μ=1^pξ_i^μξ_j^μ e^(μ-1)Δ_0γ[ (e^γΔ_0(θ+θ')-1)  (1-e^γΔ_0p N_p^*)/(1-e^γΔ_0 p). 
            + . (e^γΔ_0-1) (e^γΔ_0p N_p^*-e^γΔ_0p N_p)/(1-e^γΔ_0 p)]

For simplicity in this appendix we calculated J_ij only for discrete times multiple of pΔ_0. However we can remark that it is possible to calculate them for any time, following the same reasoning used here.


§ THE ROLE OF SIGNAL STRENGTH FOR INTERMITTENT SIGNALS


	
	The analytically predicted couplings J do not always give the true norm |J| of the couplings in our model, given that the approximations made in the calculations are of limited validity. In Fig. <ref> we exhibit the dynamical evolution of |J|/J_0 for intermittent signals for a variety of signal strengths and observe that while the analytic theory does predict the true evolution reasonably well for small values I_0 of the signal strength, the analytical prediction fails qualitatively for very large values of I_0. The different curves in the figure correspond to dynamics with parameters other than the signal strength I_0 identical for all curves. The analytical prediction appears to work better for simulations with smaller I_0. This is due to approximations used in the estimation of the time θ'Δ_0 needed by the preference fields to decay to 0 when the signal is removed after a pattern presentation. Our estimation does in fact neglect the effect of the couplings during the decay.
 For I_0=1 the time θ'Δ_0 is not large enough to allow the couplings to grow much and neglecting their contribution in our calculation does not effect significantly the prediction of |J|. For I_0=50, the time Δ_0θ' is large enough to allow the coupling to grow to sufficiently large values to permit eventual spontaneous recall, so neglecting them results in a substantial error in the prediction of |J|. In fact, in the case of I_0=50, after a time t^* (approximately equal to the time of the steep increase of |J|/J_0 in the figure) the couplings have become sufficiently strong to sustain the opinion patterns when the signal is removed, kickstarting the positive feedback-loop which eventually results in the society being capable of nearly perfect spontaneous pattern retrieval — a behaviour very different from the one predicted analytically for the given parameters (for which a finite t^* does not exist). 



