{'fraction_non_alphanumeric': 0.02737513937483179, 'fraction_numerical': 0.009727402053135454, 'mean_word_length': 4.377196609468679, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 3, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Opinion dynamics with emergent collective memory: the impact of a long and heterogeneous news history

In modern society people are being exposed to numerous information, with some of them being frequently repeated or more disruptive than others. In this paper we use a model of opinion dynamics to study how this news impact the society. In particular, our study aims to explain how the exposure of the society to certain events deeply change people's perception of the present and future. The evolution of opinions which we consider is influenced both by external information and the pressure of the society. The latter includes imitation, differentiation, homophily and its opposite, xenophobia. The combination of these ingredients gives rise to a collective memory effect, which is triggered by external information. In this paper we focus our attention on how this memory arises when the order of appearance of external news is random. We will show which characteristics a piece of news needs to have in order to be embedded in the society's memory. We will also provide an analytical way to measure how many information a society can remember when an extensive number of news items is presented. Finally we will show that, when a certain piece of news is present in the society's history, even a distorted version of it is sufficient to trigger the memory of the originally stored information.


Introduction
Nowadays, thanks to the world-wide diffusion of digital technologies, people are bombarded by a myriad of different news. With the increasing popularity of social media, news items incessantly appear on all screens, triggering people's attention and influencing the way in which they think and act. Understanding how opinions and choices are affected by external events has thus become Email addresses: gioia.boschi@kcl.ac.uk (Gioia Boschi), chiara.cammarota@uniroma1.it (Chiara Cammarota), reimer.kuehn@kcl.ac.uk (Reimer Kühn) of particular interest for different research fields, such as sociology, politics and marketing. In the last years, physicists have proposed many mathematical models [1, 2, 3] to understand how humans behave and form their opinions, giving birth to a new research field called sociophysics. Some of the most famous works in this field concern the use of models borrowed from statistical mechanics, such as the Ising model to study consensus [4,5,6]. Others introduced a variety of different models such as the Voter model [7,8] or the Majority rule model [9,10]. A part of these works is dedicated to the study of how the society reacts to external information [11,12] coming from a single source [13] or multiple ones [14].
In our recent paper [15] we presented a model of a society where opinions are formed through the combined effect of mutual influence among agents and driving through multiple external events. The key ingredient of the model is the way in which agents interact: when two agents have often been in agreement, they tend to be in agreement also in the future and the same happens with disagreement. This behaviour is the result of the combination of different human tendencies largely studied and applied in different social models. Together with imitation, which is the main ingredient of all of the previously mentioned models, we consider differentiation [16,17,18,19,20,12], homophily (an attractive influence or the tendency to become more similar to people in agreement with us) [21,22] and its opposite, xenophobia (a repulsive influence or the tendency to become different from people in disagreement with us) [23,24,25,26,27]. Our study shows that these combined attitudes, encoded in the interaction matrix of our model, prompt the emergence of a Hopfield-like [28,23] collective memory by which the society embeds the information coming from external news and recalls them in the future. Note that the memory effect which appears in our model is a memory of past relations and 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 interactions [29,30,31]. Studies about collective memory appear instead in [32], while a model which consider memory of past relationships is presented in [33].
While the focus of our previous paper was on finite number of news cyclically presented, in this new work we study the behaviour of the same model but focusing our attention on items of information which are presented in random order and with non-uniform intensity. The exploration of this new scenario goes in the direction of making the model more realistic. In fact, in the real world, the news that a person may receive are plenty, with some of them appearing more often than others. We begin by exploring a simple scenario in which only a finite number of news items is presented, before moving on to more complicated ones in which information consists of extensively many items of news. In this second scenario we will use techniques common in statistical mechanics (i.e. replica calculations) to calculate the maximum number of pieces of information a society can retain in its collective memory.
In that context we also investigate the question, how well a society is able to collectively recall a piece of information embedded in its collective memory at some point in the past, if exposed to a news item which is a more or less distorted version of that ancient memory, thus bearing only imperfect similarity with it.
We will present our results organizing the paper in the following way. In Sec. 2 we present the model analysed in the paper. In Sec. 3 we present the behaviour of the society under the effect of a finite number of news items presented in a random order. In Sec. 3.1 we show how the frequency and the strength of this news are determinant for their storage in the society's memory. In Sec. 3.2 we perform a similar analysis testing a large spectrum of parameters. In Sec. 4 we focus on a different setting in which many different news invest the society and we calculate how many among them will be effectively remembered, i.e. the storage capacity of our society, comparing analytical results with simulations. Finally in Sec. 4.2 we show how a society which has received a certain signal, is able to remember it when the noisy version of the same signal is shown.

The model
In this paper we will analyse a model, firstly introduced in [15], of a society of N individuals interacting through feedback received from within the society itself and the effect of an external disruptive signal. In particular, with each agent we associate a continuous variable u i which represents her/his preference on a topic which evolves followinġ (1) In this model we assume that v j = g(u j ), representing the expressed opinions of the agent j, is a sigmoid (bounded) function of the preference field u j . The dynamics of u i is driven by the agent's perception of external information I i and the pressure of the society, defined as the weighted sum of the expressed opinions of all the agents. The sign of the weights J ij , which change in time as described later, characterize the type of relation between the pair (i, j) of agents: a positive sign entails an assimilation of opinions while a negative sign entails differentiation. The time derivativeu i contains a mean reversion term −u i which entails that, when external influences are absent, the preference field of each agent fluctuates around zero. The last term η i is a white noise with Gaussian distribution with zero mean and finite variance η which accounts for stochastic effects in opinion dynamics.
The novelty of our model is the way in which the couplings, and so the interpersonal relations of the agents', evolve in time. The tendency of two agents to agree or disagree is based on their history of agreement and disagreement. People which have a history of agreement (disagreement) will be more likely to agree (disagree) in future. This feature is encoded in couplings J ij which evolve in time following Here the product of the agents' expressed opinions is weighted with an exponentially decaying function, with a memory time scale τ γ = 1/γ. It entails that more recent history has a larger weight than the distant past in determining the mutual influence of the agents. In this way our society uses the past history to interpret the instantaneous inputs that receives from outside. The prefactor J 0 sets an overall scale for the strength of the interactions, while the N −1 scaling of couplings with system size N is to ensure that a large system limit of the dynamics exists. A detailed study of the behaviour of this model under the influence of constant or periodic external information can be found in [15]. In the case of constant external information, we observed that at stationarity the u i are approximately Gaussian distributed u i ∼ N ( u i , σ u ), with: and where σ 2 is the noise variance.
In this paper we will use the same Gaussian approximation to analyse the society under the effect of different kinds of random external signals. Firstly we will study the behaviour of the society under the influence of a finite number of different news items presented at random. Then we will study a society influenced by an infinite sequence of different news items and we will focus on how many of these can be actually remembered.

Random presentation of a finite number of patterns
In our previous paper [15] on the model described by Eq.s (1-2), we examined the society under the effect of sequential periodic external news. In that case the order of presentation determined which information was most clearly remembered. More realistically, however, we expect to see news appearing in a less regular fashion, with some signals more frequent or stronger than others. In this section we show how the society responds when news items may have a variable strength or are received in a random order, each returning with a given probability. This kind of external information will be represented in our model by a signal which is constructed from a collection of many news items from which the item presented at any time is chosen at random and is switched on for a time ∆ 0 . Each piece of news is modelled by a random vector ξ µ with ξ µ i ∈ {−1, 1} and an index µ ∈ {1, . . . , p}. The value of ξ µ i determines the direction of the opinion that the agent i takes in response to the information µ. We can thus write the external signal as: where the µ k ∈ {1, . . . , p} are random, with π µ = Prob(µ k = µ) defined as the probability that the information labelled µ is presented. When the I µ 0 are sufficiently large, the agents' opinions will quickly align with the information received, so that v i ≃ ξ µ i almost immediately after the signal ξ µ is switched on. This corresponds to a situation in which the external information is disruptive and captures the attention of the whole society. In this case we are able to calculate the couplings J ij , proceeding as in [15] for periodically presented patterns, splitting the integral over intervals of length ∆ 0 , during which v i (t) ∼ ξ µ i . We adopt a convention different from that used in [15], counting "backward" in time, and using k = 1 to label the final presentation period, k = 2 the previous one, and so forth. This gives with N p denoting the total number of news presentation periods up to time t, i.e. t = N p ∆ 0 , and The k-sum in Eq. (7) is a large weighted sum of Bernoulli random variables δ µ,µ k . It can be evaluated as a sum of averages by appeal to the Law of Large Numbers, giving We will be mostly dealing with the limit γ∆ 0 ≪ 1 ≪ γ∆ 0 N p for which Np k=1 w k = 1 − e −γ∆0Np ≃ 1, and for which it can be shown that corrections to Eq. (9) are negligible, being smaller than the dominant contribution by a factor O( √ γ 0 ∆ 0 ). If π µ = 1/p for µ = 1, . . . , p, couplings are (apart from a factor 1/p) equal to Hebb-Hopfield couplings [34,28] used in the well known Hopfield model of associative neural network. This similarity, already discussed in [15], suggests that our network of agents can behave in a manner analogous to a network of neurons, in which firing patterns are stored in the couplings. Instead of neural patterns we will have opinion patterns ξ µ that under suitable conditions can be stored and recalled by the society by means of a reshaping of individuals' interactions. A measure of the similarity between the stored opinion patterns and a given piece of news µ is the overlap between the pattern µ and the system state The overlap m µ will be close to one during the presentation of the signal contribution µ and close to zero when other signal contributions are presented. Most importantly, when the signal is totally removed, the value of m µ tells us whether the society's opinions remain aligned with one of the previously presented news.
To investigate this question, we evaluate the m µ in a stationary regime with fixed external signal I i , after couplings are frozen at their values given by Eq. (9).
Exploiting the fact that the u i (t) in the stationary regime are Gaussian, with means and variances defined in terms of Eq.s (3), (4) and (5), we obtain i.e., a set of self-consistency equations for the overlaps {m µ }, µ = 1, . . . , p. Here we have used the approximation 1 − e −γ∆0Np ≃ 1 valid in the large N p limit as discussed above. For large N , the fixed point equations can be expressed in terms of averages over the statistics of the ξ µ i and the I i by appeal to the LLN, giving in which the double angled brackets denote an average over the distribution of the {ξ µ } and the external stationary signals I. In much of what follows we will be interested in so-called retrieval solutions in the absence of external signals, for which it is assumed that the system state is aligned with only a single opinion pattern, so that the vector m of overlaps has only a single nonvanishing component, m = (0, ..., m µ , ...0), for some µ ∈ {1, . . . , p}, for which the system of self-consistency equations (10) simplifies to The solution of Eq. (13) can be compared to the value of m µ estimated by simulating the model dynamics described in Eqs (1), (2), (6), using presentation probabilities π µ for the different patterns. Equations of motion are integrated using a simple Euler algorithm. During the dynamics the couplings evolve and reach a plateau corresponding to their stationary value. When this happens we stop the dynamics and we freeze the couplings at their current value. We then switch on each signal pattern in turn for a brief period, sufficient to have the society aligned with the patterns, after which the signal is removed. We then wait until the value of m µ converges to a "stationary" level around which, due to the noise, it oscillates with a small variance. The final average value of m µ is evaluated averaging over 700 values of m µ (t) at stationarity. Results are then averaged over 10 simulations performed with different random pattern realizations. In the simulation we assume that I µ 0 = I 0 and -initially -for π µ = 1/p for all µ. In this way all the patterns have the same probability of appearance and the same strength. Other details of how simulations are performed can be found in Appendix C. In Fig 1 we compare the results for m µ as a function of the presentation period ∆ 0 as obtained from simulations with the analytical predictions. For the simulations we use systems of size N = 100, and p = 3 for the number of patters which, as argued in [15], is representative of a system at low loading. As ∆ 0 becomes large, results for random patterns begin to deviate from the theoretical predictions. This is mainly due to the effect that random patterns have non-zero mutual overlaps in systems of finite size N , which is in contrast to assumptions used in the derivation of the fixed-point equation for retrieval solutions in the thermodynamic limit N → ∞. Indeed, using orthogonal patterns in the simulation, we observe a much better agreement between analytical predictions and results from simulations. To better understand this aspect we must carefully think of the role played by non-orthogonality: given two positively correlated patterns, the memory of the first gets reinforced while the second is presented and vice versa. When two patterns are anti-correlated, the opposite happens and their memory is instead weakened. This phenomenon is amplified when ∆ 0 is large because the same patterns have more time to get mutually reinforced or weakened as the case may be. The creation of this pattern imbalance may lead to some patterns having a smaller overlap than others, or even being forgotten, which explains the deviation from predictions by numerical data for non-orthogonal patterns. When the signal strength I µ 0 and the probability π µ vary between patterns, the behaviour of the society is non trivially affected. The influence of varying these two parameters is investigated in the following by performing two different numerical experiments. In the first experiment, described in Sec. 3.1, we show how the recovery of a piece of news depends on the probability of its appearance and on its strength in the news stream. In the second experiment, described in Sec. 3.2, we investigate the recovery of patterns when their parameters are chosen at random, such to observe how the probability of a piece of news to be embedded in the society depends on the properties of the other news also presented in the same dynamics.

Storing random news with different strengths and frequencies of appearance
In the previous experiment we analysed the behaviour of a society under the effect of news items presented randomly with equal probability. With the aim of modeling a more realistic scenario we consider now an external signal made of random news which have a different probability of being presented to the society as well as different intensities. To start this new analysis we will assign to the first pattern a probability π 1 and a signal strength I 1 0 and equal parameters to the other two with π 2 = π 3 = (1 − π 1 )/2 and I 2 0 = I 3 0 . In this experiment we will follow the same simulation protocols as before, except that we do not average the value of m µ over several realizations. Rather than recording average overlaps, we measure the fraction of instances f µ in which m µ exceeds a critical value m c = 0.4. This value is chosen to be significantly larger than the value of random mutual overlaps between different patterns (see Appendix C for other simulations details.) In Fig 2 we show f 1 and f 2 as a function of π 1 for different values of I 1 0 keeping I 2 0 = 10 fixed. For all signal strengths, the fraction f 1 increases steeply as the pattern probability π 1 increases. We expect that for N → ∞ the curve presents a discontinuous transition between 0 and 1. As anticipated, when the probability π 1 grows beyond 0.33 (the point where the three patterns are equally probable), the pattern µ = 1 is always recovered, while the other two are progressively less frequently remembered. However the most interesting effect is linked to the signal strength. In a real society we expect that the intensities I µ 0 of external information are not equal for all pieces of news but that some are significantly weaker or stronger than others. In Fig 2 we show the effect of this variability in our model. The recovery of the first pattern becomes easier for I 1 0 > I 2 0 = I 3 0 and more difficult for I 1 0 < I 2,3 0 . This result suggests that even a rarer piece of news, if particularly intense and disruptive, can leave a strong mark on the society. In Fig 2 we can also notice that the increased strength of pattern one results in a more difficult recovery of pattern 2 even if its signal strength is not changed. This effect suggests that the possibility for a piece of news to impress the society depends not only on its own immediate impact but also on the impact of other news that is present in the news stream. This means that a piece of news strong enough to be remembered on its own can be forgotten when presented alongside stronger or more frequent information. This can explain, for example, how news about politics that would be remembered when broadcast alone may be forgotten when presented with other shocking news, such as those about terror-attacks or earthquakes.

Storing random news with random intensities and frequencies of appearance
In the previous experiment we have shown that, when we fix the parameters of two pieces of information, the third one presented in the same experiment is more likely to be recovered if presented more often or if it is presented with bigger intensity. This gives us only a partial information on how our society reacts to random news. To complete this picture, we investigated the recovery of opinion patterns using a broad range of parameters. Using the protocol of Sec. 3.1, we now measure the recovery of patterns in a society where the signal strengths and probabilities of appearance are chosen at random, with 0 < π µ < 1, p µ=1 π µ = 1 and 0 < I µ 0 < 10. As before we take p = 3. The total number of samples of triplets taken is 3600. In Figure 3 we plot a map of recovered (black dots) and unrecovered (red crosses) patterns as a function of their probabilities of appearance and their strengths. For weak signals the patterns will not be remembered by the society even when they appear very often. For larger signal strengths, there is a separation between recovered and unrecovered patterns around π = 0.3.
We will call recovery zone the region of the graph where pattern recovery is predominant and will refer to the complementary region as non-recovery zone. However Fig 3 shows that some of the patterns around the boundary between the two zones don't behave as expected, e.g. some news around I 1 0 = 5 and π = 0.2 are recovered, while some others around I 1 0 = 5 and π = 0.4 are not. More generally, the separation between the two zones is not sharp and we observe a large transition area. A smooth transition is to be expected due to finite size effects, as discussed earlier. In fact, we present patterns only for a finite number of times in any realization of the dynamics, giving rise to fluctuations in their effective frequency of appearance. However, other aspects may play a role, broadening even further the transition area visible in Fig 3. For instance as also discussed in the previous subsection the relative strength (and in this case the relative probability of appearances) of concomitant news in the recent history can result in a systematically more frequent recovery of news that would be otherwise unrecovered and vice versa. An attempt to disentangle these two aspects is presented in Appendix A.

Extensively many patterns and society's storage capacity
Real-life news are divulged with different intensity and characterized by different frequency of appearances. Moreover, it is also conceivable that the number of different news the society receives should not be considered to be very small in comparison to system size, as assumed when analyzing the situation of a finite number of external signals that we have considered so far.
We present here the analysis of a society hit by a stream of news items, each different from all others. We will take them as randomly generated at each presentation. In particular, we will investigate the number of news that the society can effectively remember, or the storage capacity of the society, whose interactions have been shaped by such a history of news. In order to store a large number of patterns, proportional to the number N of agents of the system, the society needs to receive a number of news items of order N within the memory time τ γ = 1/γ. For this reason we need to consider a scaling of the memory decay rate of the form γ = γ 0 /N , as it is needed to ensure that an extensive number of patterns remains within "memory range". In the initial formulation of the model (Eq. (2)) we used an explicit scaling factor 1/N in the couplings in order to get a meaningful theory in the thermodynamic limit N → ∞. In the present case, there is no need to introduce such an explicit scaling factor by hand, as the correct scaling follows automatically from the scaling of γ. Adopting such a scaling, the couplings J ij are thus seen to take the form We should note that this scaling is correct in the limit of a large number of agents (thermodynamic limit), only when the society receives a series of different random news. We consider an external signal made of a sequence of news labelled by µ = 1, 2, 3, . . . , p, with p = α max N . Given that we are eventually considering a history of infinitely many patterns. i.e. α max → ∞, it is convenient to count them in reverse order, with µ = 1 indicating the most recent pattern received and α max N indicating the oldest one.
The time dependent external signal will thus be of the form As before, we assume signal intensities to be large. Each signal pattern µ is presented for a time ∆ 0 , during which the society's opinions are well aligned with the signal with v i (s) ≃ ξ µ i . We can use this to evaluate the integral in Eq. (14), splitting it in pieces of length ∆ 0 and calculating them separately as described in [15]. The resulting couplings for small γ 0 ∆ 0 are: where we introducedγ 0 ≡ γ 0 ∆ 0 . We will use α c to denote the storage capacity of the society, i.e., α c N is the maximum number of patterns that the society is able to recall. The concept of storage capacity was introduced in neural networks and first computed for the Hopfield model in [35]. Our couplings in Eq. (16) are in fact reminiscent of a particular type of neural network model, the Hopfield model with forgetful memory [36,37,38,39]. In the present paper, we investigate the storage capacity of a society in the noiseless limit of our model (1). In this case, the dynamics of the u i is known to be governed by a Lyapunov function [40,41], provided the interaction matrix is symmetric and the function v j describing the expressed opinions as functions of the preference fields u j are monotone increasing functions of their argument. Both conditions met in our case. Following [42,43] we can locate the minima of the Lyapunov function, and thus the attractors of the dynamics, by taking the zero-temperature limit of the free-energy of a system with the Lyapunov function as its energy function. The analysis can be found in Appendix B. We will describe the collective properties of the society using three order parameters: 1. the overlap between the society state and a given opinion pattern presented by the signal (taken to be pattern µ) where angled brackets denote a thermal average and over-bars an average over the disorder embodied by the other opinion patterns ν( = µ) embedded in the society. For a finite number of patterns, this parameters corresponds to the one defined in Eq. (10). 2. the mean of averaged squared opinions, which are the off-diagonal elements of the replica symmetric matrix of Edwards-Anderson order parameters (see Appendix B) 3. a susceptibility-type parameter where q q are the diagonal elements of the replica symmetric matrix of Edwards-Anderson order parameters.
Making use of replica theory (details of the calculations in Appendix B) we obtain the following three fixed point equations, the solutions of which selfconsistently determine these three order parameters and their dependence on the parameters characterising the system: with and where z is a normally distributed random variable of zero-mean and unit variance. The double angled brackets denote an average over the site-random variables, i.e. ξ µ and I, and over the Gaussian random variable z. We note that the equations above have been obtained under the assumption that during every presentation time the society is perfectly aligned with the signal patterns presented i.e. in the large I 0 limit. The I appearing in Eq. (B.23) is not the signal described by Eq. (15) that appeared during the history of pattern presentations to the society, but a node-dependent perceived signal to which agents of the society may be subjected at the end of an extensive number of such pattern presentations. In the following subsections we will study two different retrieval scenarios, one is the spontaneous retrieval of patterns ξ µ obtained setting I to 0, the other is the retrieval of old patterns when one of them is presented again, though in the form of a weak randomly distorted version of the original. In both cases the problem of solving z-dependent fixed-point equations within the set (20) of fixed-point equations is avoided by transforming the Gaussian zdistribution into av-distribution as done in [43] and then taking the averages respect to thev-distribution.

Spontaneous retrieval
We solved Eq.s (20) numerically for I = 0 and different values of α andγ 0 . We expect this system to have two solutions when α ≤ α c , one with m = 0 and one with m > 0, the latter disappearing for α > α c . We thus computed the storage capacity α c as the threshold of α after which the system has a unique solution with m = 0. In Fig 4a the values of α c found for different values of J 0 are plotted as a function ofγ 0 . Whatever the value of J 0 , the storage capacity is zero whenγ 0 is too small; it becomes non-zero at a critical value ofγ 0 and grows until it reaches a peak and then decreases again. A small value ofγ 0 corresponds to a long memory time or very short pattern presentation periods. This results in a society being exposed to too many patterns within its memory time, which interfere with each other and make the retrieval of these memories impossible. Conversely, whenγ 0 is too large, the memory of the patterns fades too quickly for a large number of patterns to be remembered. These phenomena are similar to those observed in [36,37,38,39] in the context of forgetful Hopfield networks. In Fig 4b we show an example of how the solution jumps from m ∼ 1 to m = 0 when α > α c . The numerical solution is compared to the values of m found using the simulated dynamics at low temperature for the model described in Eq. (1). In the simulations we present a sequence of p = N signal patterns to a society of N = 800 and N = 200 individuals. We record the values of m in absence of signal as described at the end of Sec. 3 and we averaged them over 50 simulations with different patterns realizations. Other simulation details can be found in Appendix C. Fig 4b shows the values obtained as a function of α = µ/N , which are in good agreement with the theory. Given that we have a finite N , the transition from one solution to the other at α = α c is not abrupt, but is rounded and becomes steeper with increasing N . For the same reason there is a non-zero overlap of order O(1/ √ N ) between the patterns, which results in a residual m for α > α c .

Noisy signal
In this last subsection we study the ability of a society to retrieve patterns of news after having been exposed to an infinite series of such news items. In particular, we focus on what happens when one of these pieces of news is presented again to the society, albeit at low intensity and distorted by some amount of noise. How will the society respond? Will it develop a reaction in line with the new pattern as presented, or will the interpersonal relations formed in response to the society's history of news exposures allow it to recognize and retrieve the information in its "pure" form as previously stored? The answer depends not only on the strength of the signal presented and on how much it is distorted by the noise, but also on how long ago in the past the society had been exposed to the original un-distorted version of it. In other words, it depends on how well the memory of the original opinion pattern is still embedded in the system. In order to model this situation, we consider a noisy signal of the form: where ξ µ is one of the news presented in the society's history, I 0 the amplitude of the new signal to be presented and σ I z i is a Gaussian noise with mean 0 and variance σ I . First we comment on the average behaviour of the society. Figure 5 shows the overlap m with the original pattern for different values of σ I and I 0 at γ 0 = 10 and α = 0.012. In panel (a) it is visible how the retrieval of the original opinion pattern becomes more difficult as σ I grows, until the pattern is no longer recovered. Naturally, as I 0 gets bigger, the point at which this happens moves towards larger values of σ I . Conversely, when the noise is too disruptive the pattern is mostly not retrieved but the presence of the signal still guarantees a non zero value of m.
We show in panel (b) how the distortion of the signal also changes the maximal 'age' α c of a news item that the society is able to retrieve when exposed to a distorted version of it. While we use the same symbol as for the storage capacity, i.e. the maximum number of opinion patterns a society can spontaneously retrieve, these quantities are obviously not strictly the same. In particular in absence of distortion, the presence of a signal aligned with one news already seen produces a larger α c than the storage capacity of spontaneous retrieval. In other words, the presence of I 0 allows the retrieval of opinion patterns that would have not been recovered spontaneously. When some amount of distortion is also present, how far in the past these opinion patterns can have been presented and still be recalled, clearly depends on the level σ I of distortion of the pure memories. Figure 5b shows how the value of α c at which the solution for m jumps between a high and a low value, depends on σ I when the distortion is added to a signal of strength I 0 = 0.2. When the noise increases, the degree of similarity with an item originally stored decreases implying that older opinion patterns, which are less strongly embedded, cannot be recalled any longer; this is confirmed by the fact that the corresponding α c decreases with increasing level σ I of pattern distortion.
These results on the average behaviour can be complemented by looking at the distribution of expressed opinions, which reveal the emergence of an interesting behaviour . Fig 5c and 5d show how the distributions of expressed opinions in response to a distorted incoming piece of news, change in a very non trivial way with its noise level σ I . The functions I + and I − show the distribution of the external fields corresponding to positive and negative values of ξ µ i , with The function p + (v) is the distribution of expressed opinions of all agents i which originally received the signal I = I 0 ξ µ i with ξ µ i = +1, while p − (v) is the same for ξ µ i = −1. When expressed opinions have the same sign as the original signal we can conclude that the society has successfully retrieved the corresponding news.
Panels (c) and (d) show two scenarios in which the signal is in both cases very distorted and the distributions of I + and I − barely differ, being just slightly shifted versions of each other, yet the response of the society is very different. Panel (c) shows that in presence of a very large distortion p + (v) and p − (v) are approximately symmetrical and almost identical. This means that the society is not able to retrieve the original opinion pattern and individuals' opinions are uncorrelated with the original un-distorted opinion pattern the society had been exposed to in the past.
A small reduction of the noise level or the amount of distortion of an original news item leads to a completely different behaviour in terms of the distributions of expressed opinions. The results corresponding to this scenario are shown in panel (d), with distributions of expressed opinions being strongly asymmetric and biased in the direction of the original un-distorted signal with, p + (v) (p − (v)) peaked at 1 (−1) only. In this case individual's opinions are almost perfectly aligned with the originally presented information, despite the fact that the society is exposed to an external signal which has very little resemblance with it.
The important message delivered by these results is that even a weak and distorted signal can trigger the society to retrieve old stored memories. The society described by our model is able to remember information from the past, even when exposed to very noisy versions of it. The collective memory that emerges in this context connects distorted pieces of information to their clear undistorted versions embedded in the collective memory. The maximum amount of noise tolerated for this to happen depends on the signal strength I 0 and the value of α, i.e. how far in the past an original news item has impacted the society. In a real society shaped by a history of intense events, like terror attacks, earthquakes, or other crises, a new signal which resembles one of the old memories, even if only barely, can trigger in the population the same reactions it had shown in the past. These results open the way to design social experiments to understand how collective memory is formed and activated or re-activated by new information, and to test whether this mechanism can explain strong and pronounced collective responses to news items that don't appear to be particularly disruptive.

Conclusions
In this paper we studied how exposure to strong external information can shape the behaviour of a society within a model of opinion dynamics introduced in our previous paper [15] that produces interactions between individual agents based on their recent history of mutual agreement or disagreement. In this way people tend to agree with others if they have a history of predominant of mutual agreement, whereas they will be more likely to disagree with them in case of a history of predominant recent disagreement. This mechanism gives rise to a collective memory effect by which a society can remember past configurations of opinions. As mentioned initially, the opinion configurations we are interested in are those produced in reaction to external news. In the present paper we studied the effect of random news and how properties, such as their frequency of appearance, their strength or their relative intensity with respect to other news, determine whether the corresponding opinion patterns can be remembered or not. Unsurprisingly, we have seen that opinions in reaction to strong and frequent news are more easily remembered. However, we observe that even rare signals can have a deep impact on the society if they are powerful enough. Moreover, we showed that the memory formation of an opinion pattern depends not only on its own strength and frequency of appearance, but also on the characteristics of the other news presented within the memory span of a society. In fact, a piece of news which has a sufficient strength to be remembered if presented along with news items which have a similar amplitude, can be forgotten if were instead presented along with stronger news. A different aspect of the model behaviour is the proportion of consecutive news that a society can remember when a very long sequence of information is presented. Using techniques borrowed from statistical mechanics, we found this proportion analytically and confirmed it using simulations. The results which we found are compatible with the behaviour of models appearing in the literature of forgetful Hopfield networks [36,37,38,39]. The last result concerns how noisy information is perceived by the society. We showed that if a piece of news was presented in the recent history of a society, and it is confronted with distorted version of it, the society is able to reconnect the distorted version with the clean memory it corresponds to, recalling the originally stored memory of it. This implies that the collective memory of a society is able to produce interesting effects that modulate the collective perception of current news or affairs, and it could be used to understand attitudes of people towards external events that may be only weakly correlated with past ones. This means that a shocking event that hits a society can change its perception of future similar events.
In the future we would like to extend our work by adding other interesting features to our model. We know for example that in the real world not all people receive the same news or perceive them with the same strength, so we aim to take this into account. Another possible improvement consists in personalising the intensity of the pressure of the society for different agents. In this way some people will be more influenced by their peers and others less. Another possibility is to consider multiple opinions related to a set of different issues that may be relevant at the same time, and to have interactions depending on the history of such sets of opinions on a range of different topics. Apart from the addition of further ingredients to the model, the main future direction of our work will be its calibration against real data.
To inspect the effect of mutual interactions between patterns of news concomitantly presented to the society, we studied several societal dynamics where random news are presented in triplets with random probability of appearance and random intensity. In Fig. 3 we report the information on the final recovery or non-recovery of the patterns from the society, as a function of the probability and the intensity with which they were presented. In the graph we can notice a smooth transition region between a recovery zone and a non-recovery zone with some patterns within the recovery zone remaining un-recovered and, conversely, some patterns in the non-recovery zone apparently being recovered. Apart from an expected finite size effect, a factor which can also contribute to this phenomenon is the influence of the relative strengths and the relative probabilities of patterns presented during the same run of the dynamics. In fact, in Sec. 3.1, Fig. 2b we saw that, when there is one pattern in a triplet of patterns with a stronger amplitude, the other two are recovered less frequently than the strong pattern in question. In order to understand if this is a reason for anomalously recovered or un-recovered patterns, we propose to isolate outliers in the recovery and non-recovery zone which we identify as those patterns that have an anomalous behaviour when compared to their neighbours in the parameter space of frequency of occurrence and intensity, i.e. they are points corresponding to recovered patterns which are predominantly surrounded by those corresponding to un-recovered patterns and vice versa. Figure A.6a shows a selection of points µ which have at least 50% of neighbours µ ′ with opposite retrieval outcome (and opposite colour in our representation) within We multiplied the difference in probability to a factor 10 in order to account for the difference in scale between the probability which is randomly drawn between 0 and 1, and the signal strength which is randomly drawn between 0 and 10.
To investigate whether mutual interactions between patterns influences recovery, we evaluate where the anomalous patterns are located relative to the other patterns in within their triplet which have the opposite recovery state. This means for example, that given a pattern that is unexpectedly recovered, we want to know how it is located relative to the un-recovered patterns presented within the same run of the dynamics. We thus calculate the average coordinate difference between the anomalously recovered point and the patterns in their triplets with opposite behaviour. Given a recovered pattern µ = 1, assuming that both the patterns µ = 2 and µ = 3 are un-recovered, we calculate the coordinate difference in the I 0 direction as ∆ I0 = 2 . If only µ = 2 is un-recovered then ∆ I0 = I 1 0 − I 2 0 . Analogous formulae apply to the difference in the π direction. We thus replot the points in Figure A.6a as a function of the coordinate differences 1 .
Interestingly, we notice that recovered (unrecovered) patterns typically fall into their 'natural' or expected top-right (bottom-left) regions when plotted in terms of their new coordinates. In other words, unexpected recovery (or nonrecovery) of patterns, as highlighted in the right panel, can be explained by the fact that they were appearing together with particularly weak (strong) or less (more) frequent patterns, which affected their likelihood of retrieval despite their own features.
Additional evidence about the mutual influence of news retrievals can be obtained by looking directly at the statistics of news, which belong to the triplets of patterns that are anomalously retrieved or unretrieved by the society . Figures A.6c and A.6d show in yellow respectively the anomalously recovered and unrecovered patterns of Fig. A.6a, accompanied only by the patterns presented in the same run of the dynamics. The accompanying patterns are presented in red when they are not recovered and in black when they are recovered. In Fig.A.6c we observe that anomalously recovered patterns are often accompanied by other recovered patterns with medium probability of appearance, which rarely reaches π > 0.5. Conversely, anomalously unrecovered patterns are accompanied by other recovered patterns with probability of appearance often in the range 0.5−0.8, as visible in Fig.A.6d. These observations give additional evidence to the hypothesis that very frequent news can hinder the ability of other news to be retrieved. Moreover, we note that anomalously recovered patterns often appear concomitantly with very weak news with medium probability of appearance, see the dense cluster of unrecovered patterns with π around 0.3−0.6 and I 0 between 0 and 1 in Fig. A.6c. The same region of parameters is totally empty in Fig. A.6d, which contain information about triplets of anomalously unretrieved patterns. This last observation supports the idea that the retrieval of a pattern is enhanced when accompanying patterns, which appear often in the dynamics, are weak enough. Unfortunately, even in the simple case of societal dynamics involving only three patterns discussed here, these phenomena do not establish quantitative causal relations on the possibility to retrieve or not retrieve a pattern, although it becomes clear that fluctuations of retrieval probabilities cannot be simply ascribed to finite-size effects. We have, however, collected indirect evidence that the relative strength and probability of the patterns in the system can influence the likelihood of their recovery. In particular, a pattern which has a probability and/or a strength which is small in magnitude can be recovered if the other patterns in the same dynamics are weaker in probability or signal strength. Similarly, patterns in a triplet of patterns with medium/high probability and/or high signal strength can end up being unexpectedly unrecovered.

Appendix B. Replica calculations for an infinite flow of patterns
In this Appendix we derive the system of equations (20), which defines the order parameters of the model in the noiseless limit of Eq. (1). The society described by this model is subject to an infinite sequence of external signals representing exposure to an infinite history of news items (Eq. (15)), as introduced in Sec. 4. Using replica calculations, we obtain the free-energy of the model and we derive and solve the corresponding fixed-point equations in the zero-temperature limit. The calculation follows standard reasoning. For further details, we refer to [43].

Appendix B.1. Replica Approach
We start assuming that the asymptotic state of our system is macroscopically correlated with at most one of the presented patterns, taken to be pattern µ. We want to obtain the average of the free energy of the system taken over the randomness in all but pattern µ = αN . This is done using replica trick, for which we can write the free energy in the form where β is the reciprocal of the thermodynamic temperature which tends to infinity in the noiseless limit, while n is the number of replica and is the replicated partition function. One can write the Hamiltonian of a replica σ appearing in this expression as follows Here and G(v) is the integrated inverse input-output relation The disorder due to the patterns ν( = µ) appears only through the X ν σ , which for any fixed configuration {v σ } are Gaussian random variables of zero mean and covariance The average over the patterns disorder can therefore be performed as a Gaussian integral, resulting in in which Q is a matrix with elements q σσ ′ . The standard procedure now is to introduce the overlaps m µ σ and Edwards-Anderson order parameters q σσ ′ as integration variables, using conjugate variables for Fourier representations of δ-functions that enforce the definition of these order parameters. This results in in which I is the n × n unit matrix, while 1 1 1 is the n × n with all elements equal to 1. Using the algebra of these matrices one finds (AI − B1 1 1) −1 = 1 A I + B A(A + Bn) 1 1 1 −→ 1 A I + B A 2 1 1 1 , as n → 0 .
We thus get Exploiting the fact that a ′ (x) = −γ 0 a(x), we find (assuming α max → ∞) the first integral to give To evaluate the second integral, use d dx Although it is not obvious at this point, this integral is positive by construction. It is expected that C = β(q d − q) will remain finite in the β → ∞-limit we are interested in.
This gives The coupling between replica through a complete square embodied in the second contribution in (B.14) is then dealt with in the usual way by Gaussian linearisation.
The fixed point equations for m, q and C finally take the form in which r is defined through Eq. (B.18): The inner average in Eq.s B.19 is now a thermal average over effective RS singlesite Hamiltonians of the form (B.21) while outer averages are over the on-site disorder and over the additional zeromean unit-variance Gaussian z appearing in H RS . In the limit for β → ∞, given a generic function F the inner averages can be written as: wherev is the value of v which minimizes H RŜ v(ξ µ , I, z) = g mξ µ J 0γ0 e −γ0α + J 0 √ rz + I − J 0 1 + ln(1 − J 0γ0 C) J 0γ0 C v . (B.23) We are thus left with the problem of solving a z-dependent fixed-point equation, Eq. (B.23), within the system (B.19) of fixed-point equations, which is avoided by transforming the Gaussian z-distribution into av-distribution and then taking the averages respect tov. For a vanishing signal, i.e. I = 0, the resulting p(v) will be given by (B.25) number of agents N = 100 is a good approximation of the thermodynamic limit at finite p. Although these numbers seem small, they produce results that are representative of the N → ∞ limit with p ≪ N . In Sec. 4 we perform the same kind of simulations to describe a society which receives an infinite number of external news. In this case J 0 is fixed to 0.2, a value at which was possible to obtain analytical results to be compared to the simulations. The signal strength was chosen to be I 0 = 10 while the size of the system explored where N = 200 and N = 800. The value ofγ 0 is chosen to be 15, close to the point at which the corresponding critical capacity is maximum. The value ofγ is varied through different simulations, with only the value of ∆ 0 changing and γ 0 always kept at 1. Through all the paper we used a low noise level, with variance σ 2 = 0.01, to ensure that non-trivial collective states can emerge. All simulations start with random initial conditions u i ∼ N (0, σ 2 /2) which would be the equilibrium distribution in a non-interacting system without external signal.
v 0 to 1. In this case the integrals appearing in Eq. (C.2) must be split and taken from −1 to −v 0 and from v 0 to 1. For the parameters used in this paper the condition in Eq. (C.3) is not met, so this split is not necessary.