Collective emotion dynamics in chats with agents, moderators and Bots

Using agent-directed simulations, we investigate ﬂuctuations in the collective emotional states on a chat network where agents interchange messages with a ﬁxed number of moderators and emotional Bot. To design a realistic chat system, the interaction rules and some statistical parameters, as well as the agent’s attributes, are inferred from the empirical chat channel Ubuntu . In the simulations, the Bot’s emotion is ﬁxed; the moderators tune the level of its activity by passing a fraction (cid:178) of messages to the Bot. At (cid:178) (cid:38) 0 , the collective emotional state matching the Bot’s emotion polarity gradually arises; the average growth rate of the dominant emotional charge serves as an order parameter. Due to self-organizing effects, the collective dynamics is more explosive when positive emotions arise by positive Bot than the onset of negative emotions in the presence of negative Bot at the same (cid:178) . Furthermore, when the emotions matching the Bot’s emotion polarity are spread over the system, the underlying fractal processes exhibit higher persistence and stronger clustering of events than the processes spreading of emotion polarity opposite to the Bot’s emotion. On the other hand, the relaxation dynamics is controlled by the external noise; the related nonextensive parameter, estimated from the statistics of returns, is virtually independent of the Bot’s activity level and emotion contents.


Introduction
In recent years, application of statistical physics into interdisciplinary research of social dynamics becomes of key importance, especially for understanding the fundamental problem -how the collective behaviors emerge over time from the activity of individual participants. Owing to the wealth of empirical data from various online communication systems, social dynamics has been researched as an example of a complex system in the physics laboratory [1][2][3][4][5][6][7][8][9]. In these studies, methods of statistical physics and graph theory are often supplemented with the machine-learning techniques for text analysis to infer particular content, i.e., information or emotion [10][11][12] communicated between users. Having high temporal resolution of the data, the role of emotions was investigated on Blogs and Diggs [3,13], in online games [5], forums [9], online social networks [6,14], crowd-sourcing [7], and others. It has been recognized that emotions play a role in shaping the structure of social networks that evolve with user interactions [15,16]; moreover, the emergence of patterns of positive and negative conduct [2], as well as collective emotional behaviors [17] have been studied.
Theoretical modelling of the underlying stochastic processes, however, is much more complex in comparison with the processes in standard physical systems of interacting units (atoms, molecules, nanoparticles). Specifically, interactions among human users essentially depend on their circadian cycles and a number of user-specific characteristics, such as its psychology profile, activity pattern, mutual trust or preferences towards particular communication contents. Recent advances in the computational science [18] with individual-based modelling provide the right platform where these attributes of humans can be effectively considered [19]. In this approach, that we also use here, the empirical data of a concrete online system are analysed to infer the activity patterns and statistical distributions that characterize the users' behavior. Then, these distributions are utilized to design a set of attributes of interacting agents [19][20][21][22] (see section 2).
In this paper, we use agent-directed simulations to investigate the collective dynamics with emotions in online chat systems. To design a realistic chat system, we adopt rules and parameters of the empirical channel Ubuntu [23]; in the system, an automated chat program (chat Bot) is present as well as a number of moderators (users who manage new messages posted on the channel passing them to the Bot). In the model, agents and moderators are interacting by interchange of messages with each other and with an emotional chat Bot whose emotion is fixed during the process. The emotional state of each participant in the process is described by two variables, representing two key elements of emotion: arousal (degree of reactivity) and valence (pleasure or displeasure). Quantitative study of emotions in psychology is based on Russell's model of affect [24], where these two components are sufficient to recognize a commonly known emotion. Conventional values of these quantities are expressed by mapping onto the surface of a unit circle. For consistency, several agent's attributes are taken from the distributions, which are obtained from the same empirical system. A description of the empirical data, the structure of chat-networks and the role of emotional arousal inferred from the analysed text messages, can be found in works [1,16,25]. By analogy with the empirical system, in the simulations, the chat network co-evolves with the dynamics, i.e., by adding nodes and links or increasing weight on previous links [15]. Each node of the network represents an agent, moderator or Bot, and a directed link indicates that at least one message from the source to target node occurred during the evolution time. The emergent "social" contacts facilitate further communications; hence, spreading of emotion among the connected agents occurs in a self-organized manner. In stochastic processes on networks, robust scaling features are often observed where both nature of the process and structure of the network play a role [26,27]. Here, we focus on the collective dynamics of emotion spreading on chat networks.
Recently, we have simulated the presence of Bots with human-like features (personalized emotional messages, delayed actions) in chat systems [20,21]. It was demonstrated that, despite a limited number of contacts, the Bot's activity can affect the mood of the agents in the entire system. In contrast to works of [20,21], here we introduce a variant of the agent-based model in which the Bot's activity level can be tuned by varying a parameter, which helps us investigate how the collective emotional state of agents is raised by Bots. The control parameter is the fraction of messages passed to the Bot by the moderators. Apart from potentials of the model to predict the situations at the real chat channel, the simulated emotion dynamics represents a theoretically interesting case of an open nonlinear system. The system is driven from outside by the arrival of new agents according to the empirical pink noise signal, as well as from inside, by a sequence of the Bot's messages carrying a fixed emotion content. Analysing the simulated data, we show how the collective emotional states of agents arise under the influence of Bots. Moreover, we demonstrate that the fractal structure of time series and clustering of events with a specified emotion content have universal features connected with q-generalized statistics.
In section 2, we introduce the model by defining the agent's profiles, the parameters and interaction rules. Some features of the emergent network and quantities measuring the collective emotional states are studied in section 3.2. Then, we investigate the universal dynamics of emotional chats in section 4. A brief summary is given in section 5.

Agent-based model of emotional chats with moderators and Bots
Agents are situated on an evolving chat network. In a network, the appearance of a directed link i → j at time t indicates that, at that time, a message was sent from an agent i to agent j . The network size N (t ) increases by the arrival of new agents; active agents establish new links or use previous connections. Hence, the connected agents can influence each other along the links that exist up to the current time. Each agent can see all messages appearing on the channel, including the messages that are not directed to anyone of the agents. These messages are exposed within the rolling time window, i.e., all messages created on the channel within the past T 0 steps are visible. We assume that the messages created within T 0 previous time steps and directed to an agent, as well as messages exposed on the channel, can influence the agent's emotional state. Their aggregated impact of the agent's i arousal and valence is built via the corresponding influence fields, h a i (t ) and h v i (t ), respectively: .
Here, a m j is the arousal contained in the message m along the link j → i ; the summation is over the messages from the list lin i of agent's i incoming links. N and similarly, h v mf (t ) contains contributions of these messages in the manner of equation (2.2). According to the line of modelling the agents' interaction in networks [20][21][22], the agent's i emotional arousal a i (t ) and valence v i (t ) fluctuate under the action exerted on that agent over time. Specifically, when the agent i is taking part in the process (according to the rules), the current values of its arousal and valence are corrected by the field's contribution [21]: Then, an elevated arousal may trigger the agent's action, i.e., cretaing a new message which carries the agent's current emotion. The agent's activity status is regulated by the dynamic rules that are described in the following. Otherwise, when the agent is not involved in any activity, its arousal and valence are constantly relaxing towards zero with the rates γ a = γ v . Note that the maps in equations (2.4) and (2.5) systematically preserve the variables in the range a i (t ) In the spirit of individual-based modelling, the agent's i participation in the chat process depends on its personal profile. Appart from the fluctuating emotional state, the agent's profile is fully defined by the following attributes [19]: By the agent's first appearance in the system, it receives a unique id and type (i.e., agent, moderator or Bot). Moreover, to mimic heterogeneity of the real chat system, each agent gets a fixed number of messages N i c ∈ P (N c ) that it can create during the simulation time. Similarly, the agent's inclination towards direct communication g i versus posting messages on the channel, is also fixed from a distribution g i ∈ P (g ) by the agent's appearance. These two distributions are determined from the same empirical data to take into account potential dependencies between these parameters, as shown in the right-hand panel, in figure 1. For every N c , a value of g is chosen as a Gaussian random, where the mean and the standard deviation follow the dependence on N c which is observed in the empirical data, cf. figure 1 (right-hand). Other attributes of agents indicated in (2.6) are dynamically varying. The agent's pattern of in-coming and out-going links, lin i , lout i , evolves by establishing new contacts in the network. However, the agent's status (active or passive) fluctuates according to the chat process; the agent becomes 33801-3 active when its delay time since it's previous performance ∆t i expires. After each completed action, a new delay time is taken as a random number from the distribution ∆t i ∈ P (∆t ). To statistically match the agent's profiles from a given empirical system, the distribution P (∆t ) is determined from the same empirical dataset. In figure 1 (left-hand panel), the distribution is shown for the case of ordinary users P U (∆t ) and moderators P M (∆t ) as well as the distribution P (N c ) derived from the dataset of Ubuntu channel. It should be stressed that, apart form statistically shorter delay times, the moderators are given an unlimited number of messages N M c = ∞ during the simulation time. Similarly, the Bot's capacity is unlimited. In addition, each agent whose id was placed on the Bot's list gets reply from the Bot without any delay. (Other types of Bots are considered in [20,21].) Note that the activity of moderators involves human characteristics, i.e., delay time, one-to-one communication as well as fluctuating emotions under the influence of the received messages. On the other hand, the Bot's emotion is fixed during the entire simulation time; moreover, Bot simultaneously replies to all agents on its list. Here, we consider posBot with a fixed positive emotion "enthusiastic", and negBot with a negative emotion "shame", corresponding to the coordinates (a = 0.6718, v = 0.5154) and (a = −0.2346, v = −0.4747), respectively, in the emotion circumplex map [24]. The number of messages that the Bot handles per time step vary, being regulated by the fraction of all messages of currently active moderators. Also, for a better control of Bot's impact, in this model g Bot = 1, i.e., Bot does not post messages to the channel. Note that in this model, by analogy with the empirical system, the Bot is always present; hence, it can be picked for conversation by an ordinary agent even if = 0. First, the Bot is introduced and added to the empty active agents list; the Bot's list and channel list are also started. Subsequently, at each time step, a fluctuating number p(t ) of agents is added; the profile of each added agent is fixed according to equation (2.6) and its initial arousal and valence are selected as uniform random values. The time series p(t ) which is used in the simulations is shown in the inset to figure 1; it represents the number of new arrivals in the empirical system. The time series p(t ) is a pink noise signal with pronounced daily fluctuations [21]. In this way, we incorporate the necessary daily cycles in the agents' activity. Moreover, temporal resolution of the empirical time series (in this case one minute) sets the time scale for the simulation time step. Numerical values of the parameters T 0 = 2min; k = 0.4; c 2 = d 2 = 0.5; γ a = γ v = 0.01 are used in the simulations; for typical values of the fields, these parameters enable a larger phase space for each trajectory (see also [21] where different parameters are varied).
Interactions among added agents with the agents on the active list are executed according to the model rules. (The program flow is given in the Appendix.) Time step is ended by relaxing emotion variables and decreasing delay times of all present agents and by updating the active agents list. In the simulations, we keep track of each message: its creation time, identity of the sender and the receiver (or channel), as well as its emotional content, which comprises the emotional arousal and valence of the sender at the moment of message creation.

Emergence of a social network
As it was mentioned in section 2, in the process of chats among agents, moderators and Bot a social network comprising all their connections evolves. An example of such chat network appearing after 2000 simulation steps in the presence of negBot is displayed in figure 2. As discussed in [1,15,25], chat networks exhibit a hierarchical structure that is strongly associated with the type and emotional content of messages interchanged between participants. A detailed analysis of the topology of chat networks both from empirical data and agent-based simulations within the present model is given in [16]. It was shown that, when an emotionally neutral Bot is active and = 0.5 in the model, the emergent network has statistically similar features as the network obtained from the Ubuntu channel data. Specifically, both network types are described with the power-law distributions for in-coming and out-going links with a similar exponent τ q ∼ 2 as well as disassortativity measures that are shown in figure 2A, B. Moreover, the chat networks exhibit k-core structure with a power-law k-dependence [16]. The central core consists of moderators and Bot. When the emotional Bots are active, statistically similar network topologies emerge in the case of posBot and negBot. However, their layered structure that can be distinguished according to the emotion valence of messages sent along the links is considerably different and depends on the Bot's emotion [16]. Here, we focus on quantitative analysis of underlying processes by which collective states with positive and negative emotion emerge under the Bot's influence.

Collective response of the network to the Bot's activity
In the absence of emotional Bots, the emotion polarity at the level of the entire network is well balanced. In figure 3, we plot the actual valence in the temporal sequence of messages interchanged among the agents (including moderators) when the Bot is entirely inactive. Slightly positive emotion charge, similarly to the empirical data, can be attributed to higher arousals for most of the positive emotions, compared with negative emotions that are involved in chats. In a limited scaling region, indicated by straight lines in figure 3, we find the scaling exponents H v = 0.633 ± 0.005, φ v = 0.79 ± 0.02 for the fluctuations around the trend, F 2 (n) ∼ n H , and the power spectrum, S(ν) ∼ ν −φ , respectively. However, when an emotional Bot is active, the system tends to polarize by spreading the Bot's emotion among agents [15,20,21].
On the other hand, when moderators are absent, the response of agents to the Bot's activity is depicted in  dt |〉 thus measures the Bot's emotional impact on the entire system, and can serve as an order parameter [26]. With the action of moderators, the Bot's activity level is tuned by the fraction of messages passed to Bot. To determine R( ), the normalized charge signal integrated until time t , iQ n (t ), is plotted against t in figure 5 for different values of . Upper and lower half-planes correspond, respectively, to the situations when posBot and negBot were involved. The order parameter as a function of , determined from the linear fits of these curves, is shown in figure 5 (b). Note that the average growth rates R( ) differ at a given value, suggesting potential differences in the self-organized processes spreading Growth rate R of the normalized charge plotted against .
impacts of the positive and negative Bot. In the following section, we examine the fractal structure of these processes. The physical principle behind temporal fractal structures, in various complex systems [27], lies in a self-similarity of the underlying stochastic process, which is likely manifested in time series and in clustering of events, or avalanches. The occurrence of clustering in the stochastic process, on the other hand, can be often related with nonextensive or q-generalized statistics [29,30]. In the present context, we consider clusters of temporally connected events that carry a specified (positive or negative) emotion content. Using standard approaches [13,31], we determine the distribution of avalanche sizes and durations; these are shown in figure 6 (e), (f), corresponding to the presence of negative and positive Bot, respectively. The histograms are fitted by Tsallis distribution

The dynamics of chats with positive and negative emotions
with κ = 1. The non-extensivity parameter q = 1.40 was found for the positive avalanches in the case of positive Bot and similarly, negative avalanches when negative Bot was active. A bit smaller value q = 1.33 fits the distributions in the case of emotional valence opposite to the Bot's emotion. The analysis of returns, or differences between consecutive values in the considered time series, gives further insight into the nature of relaxation processes in systems with nonextensive statistics and fractal time series. Often q-Gaussian expression (4.1) with κ = 2, is found for the distribution of returns [29,30]

Conclusion
Within agent-based simulations, we have demonstrated how the presence of emotional Bots in online chat systems can induce collective emotional dynamics with a preset (positive or negative) mood. In the appearance of these collective states of agents, both the structure of the co-evolving social network and the self-organized dynamics play their roles. The architecture of chat networks with emotion-related layers has been studied in [15,16]. In this work, our focus was on the collective dynamics of emotional interactions. Considering time series of the number of messages that carry a specified emotion content, we have analysed their fractal structure, clustering and returns. This quantitative analysis of the corresponding time series allowed us to uncover the role of noise (two driving modes) in the system, on the one hand, and to relate the fractal dynamics of emotions with the nonextensive q-deformed statistics, on the other hand. Our main conclusions can be summarized as follows: (i) Owing to a higher emotional arousal that, consequently, induces higher activity and self-organization level in the social network, positive emotions in the presence of positive Bot propagate more efficiently than negative emotions when the negative Bot is active. stronger clustering and persistence in the dynamics than the propagation of the emotion opposite to the Bot's emotion. Hence, these characteristics of the emotion dynamics can be attributed to the role of endogenous (emotionally) coherent noise, exerted by the Bot's activity. (iii) External noise, represented by arrival of new agents with random emotional states, however, almost completely controls the relaxation processes, which is manifested in the universality of the statistics of returns. if i is Bbot then 15: send message to a selected agent from Bot list and the related Moderator; 16: else 17: