Adv Syst Sci Appl 2021; 04:87–99 Published online at https://ijassa.ipu.ru. Implementation of the Deffuant Model Within the FLAME GPU Framework Armen L. Beklaryan1*, Levon A. Beklaryan2, Andranik S. Akopov1,2 1National Research University Higher School of Economics, Moscow, Russia 2Central Economics and Mathematics Institute, Russian Academy of Sciences, Moscow, Russia Abstract: The Deffuant model is a model of opinion dynamics based on the factor of the degree of doubt of agents, called uncertainty. Despite its simplicity, the Deffuant model turned out to be technically extremely difficult to analyze, and its basic convergence properties, which are easy to observe numerically, are only empirical results. In the presented work, the agent-based Deffuant model is implemented within the FLAME GPU framework, designed to parallelize simulations of agent-based models based on GPUs. The identity of the results with the original single-thread model is demonstrated. This approach allows us to study various characteristics of the model, its development, modification of the configuration of the ensemble of agents, to conduct various analyses, in particular, cluster analysis. Keywords: Deffuant model, opinion dynamics, extremism, FLAME GPU 1. INTRODUCTION Following the detailed introduction in the article [1], we recall that the field of opinion dynamics studies various processes related to the formation, dissemination and evolution of public opinion about certain events and objects of public interest in social systems. The systematic study of the dynamics of opinions began with the two-stage communication flow model in [2], as well as with the averaging model of social power in [3]. Subsequently, French’s model of social power was refined by Harari [4] and completely rethought by Degroot [5]. Other notable works include the Friedkin and Johnsen model [6], which takes into account the initial distribution of agents’ opinions, a general influence network theory [7], social impact theory [8] and dynamic social impact theory [9]. A comprehensive review of these and other opinion dynamics models is given in the two papers [10, 11] and in the textbook [12]. In recent years, considerable attention has been paid to the so-called models of opinion dynamics with bounded confidence. In such models, one individual is ready to influence another only if the difference of opinion between them is below a certain threshold value. Deffuant, Neau, Amblard, and Weisbuch [13, 14] proposed their own model with bounded confidence, now called the Deffuant–Weisbuch model (DW) or simply the Deffuant model. In this model, a pair of individuals is randomly selected at each discrete time step, and each individual updates his opinion if the opinion of another individual is within his confidence bound. A second well-known model with bounded confidence is the Hegselmann–Krause (HK) [15] model, in which all agents update their opinions synchronously, averaging the opinions of individuals within their confidence bounds. ∗Corresponding author: abeklaryan@hse.ru 88 A.L. BEKLARYAN, L.A. BEKLARYAN, A.S. AKOPOV As shown in the papers of Lorenz [16, 17], the simulation results for the DW model are reduced to three dominant phenomena, such as consensus, polarization, and segmentation. However, the DW model itself does not lend to rigorous analysis due to intramodel strong nonlinear dependencies. The available theoretical (not empirical) results of the model analysis, as a rule, focus on the homogeneous case in which all the agents have the same confidence bound. The convergence of the homogeneous DW model was proved by Lorenz in [18], and its convergence rate was established in [19]. Some studies consider various modifications of the DW model. For example, in [20], the scaling limits of the DW model are considered when the number of agents increases to infinity; in [21], the model is generalized, assuming that each agent can choose several neighbors to exchange opinion at each time step. A separate area of study is the consideration of the DW model in various topologies [22–24]. Nevertheless, the question of convergence of the heterogeneous DW model remains open. It is worth noting that the analysis of the HK model is also limited to the homogeneous case. The convergence of the heterogeneous HK model is partially studied in [1, 25, 26], but only for special cases. This article discusses the implementation of the quasi-homogeneous DW and HK models within the FLAME GPU framework. The observed convergences for different values of the control parameters are studied, which makes it possible to develop further directions for the study of the model. 2. MODEL DESCRIPTION 2.1. Base model Following [14], we give a description of the opinion dynamics model. A model with a population of N agents is considered. Each agent i has two characteristics: opinion xi ∈ [−1, 1] and uncertainty ui ∈ [0, 2]. The interval [max(xi − ui,−1),min(xi + ui, 1)] is called the opinion segment of i-th agent. Agents interact randomly, for the DW model there is one random pair at each step of the model, for the HK model, at each step, each agent interacts with all others. When agents interact, one of them can influence the other if their opinion segments overlap. If the opinion segments do not overlap, it is assumed that the agents are so different from each other in their opinions that they have no chance to influence each other. If the opinion segments of agents i and j overlap, then agent j depends on the opinion of agent i by an amount proportional to the difference between their opinions multiplied by the amount of intersection and divided by the uncertainty of agent i minus 1. The meaning of this formula is that undecided agents influence other agents less than agents who are confident in their opinion. Note that the influence of agents on each other is not symmetrical if the agents have different uncertainties (see Fig. 2.1). After updating the opinions and uncertainties of agents i and j, a new pair is randomly selected and the same process is repeated until the attractors of the dynamical system with invariant opinions and uncertainties of all agents are reached. More formally, let us consider the opinion segments si = [max(xi − ui,−1),min(xi + ui, 1)] and sj = [max(xj − uj,−1),min(xj + uj, 1)]. The overlap hij of opinions is defined as follows: hij = min(xi + ui, xj + uj, 1)−max(xi − ui, xj − uj,−1). The non-overlap, respectively, is equal to 2ui − hij . The agreement of opinions is equal to hij − (2ui − hij) = 2(hij − ui). Thus, the relative agreement of opinions (not symmetric by agents) is equal to 2(hij − ui) 2ui = hij ui − 1. Copyright © 2021 ASSA. Adv Syst Sci Appl (2021) IMPLEMENTATION OF THE DEFFUANT MODEL WITHIN THE FLAME GPU FRAMEWORK 89 xj xi hij 2ui - hij x'j xi Fig. 2.1. The influence of agent i on agent j. Now let us consider the modification of the opinion of agent j and its uncertainty after interacting with agent i. If hij ≤ ui, that is, the agreement of opinions is negative, then agent j is not influenced by agent i. If hij > ui, then the modification of the opinion and uncertainty of agent j is proportional to the relative agreement of opinions, namely: x ′ j = xj + µ ( hij ui − 1 ) (xi − xj), u ′ j = uj + µ ( hij ui − 1 ) (ui − uj), where µ is the parameter of elasticity of opinion and uncertainty (intensity of interaction). The main features of the described model are the following properties: • in the process of interaction, agents influence not only each other’s opinions, but also uncertainties; • the influence is not symmetrical: when agents have different uncertainties (see Fig. 2.2) “confident” agents (low uncertainty) are more influential. This corresponds to life experience, in which confident people, as a rule, are easier to convince uncertain people than vice versa; • continuous dependence of influence (increment of opinion) on the parameters xi, ui, xj , and uj . The abrupt change in increments in other opinion dynamics models is difficult to explain from a psychological point of view. As part of the further analysis of the model, we will consider two scenarios of agent interaction at the step: 1. At each step, one random pair of agents is selected (step of the first type). This corresponds to the original DW model. 2. At each step, each agent interacts with each others, and the interaction effect is averaged by the number of pairs at the model step (step of the second type). This corresponds to the modification within the HK model. 2.2. Extremists in the model The next step in building the model is to introduce extremists into the model: we assume that agents at the extreme points of the distribution of opinions are more confident (their uncertainty is lower). This hypothesis can be justified by the fact that often people who hold extreme opinions tend to be more convinced of their views. On the contrary, people who have moderate initial opinions often express uncertainty. Copyright © 2021 ASSA. Adv Syst Sci Appl (2021) 90 A.L. BEKLARYAN, L.A. BEKLARYAN, A.S. AKOPOV Fig. 2.2. Relative agreement is plotted on the left graph as a function of xi for different values of ui. The right graph shows the increment of xj when modifying the opinion as a function of xi for different values of ui. To implement such a mechanism, we define two values of initial uncertainty: ue is the uncertainty of extremist agents (small one) and u is the uncertainty of moderate agents, presumably greater than ue. We also define pe as the global proportion (presumably small) of extremist agents in the general population (we believe that all extremists have the same uncertainty), and p+ and p− are the proportion of extremists with positive and negative extreme opinions, respectively. For ease of initialization of the model, we introduce a parameter of relative bias between the proportion of positive and negative extremist agents according to the following formula: δ = |p+ − p−| p+ + p− = |p+ − p−| pe . As part of the practical implementation, we first randomly assign an initial opinion to all agents of the population from a uniform distribution in the segment [−1, 1]. Then we initialize Np+ agents with the most positive initial opinions and Np− with the most negative opinions with uncertainty ue, and the rest with uncertainty u. 2.3. Parameters of the model To identify the effect of the initialization of the model on the type of convergence, the following parameters are introduced: • pe is the global proportion of extremist agents; • u is the initial uncertainty of moderate agents; • ue is the initial uncertainty of extremist agents; • δ is the relative bias between the proportions of positive and negative extremist agents; • µ is the intensity of interaction (the degree of trust in someone else’s opinion). Due to the stochasticity of the model, each experiment was repeated 100 times after which the results were averaged. The total number of agents in the population for all experiments is 1000. To obtain a slightly more detailed picture of convergence, in comparison with the original model, instead of a purely homogeneous model (all moderate agents have the same initial uncertainty), we considered quasi-homogeneous model, in which the uncertainties of moderate agents are subject to a normal distribution with a single mean and extremely small variance. Unless otherwise specified, ue = 0.1. Copyright © 2021 ASSA. Adv Syst Sci Appl (2021) IMPLEMENTATION OF THE DEFFUANT MODEL WITHIN THE FLAME GPU FRAMEWORK 91 Fig. 4.3. Simulation results for low uncertainty and first type step. 3. FLAME GPU REALIZATION The software implementation of the model is performed using the FLAME GPU simulation platform [27], providing efficient parallelization of large-scale agent-oriented models. At the same time, calculations were performed on the FORSITE DSWS PRO supercomputer based on QUADRO RTX 6000 with a capacity of 16.3 Tflops. A feature of the FLAME GPU platform is the use of XML language to describe the structure of the simulation model, global environment variables, functions implemented at the CPU level, in particular, providing dynamic change of opinion and uncertainty of agents, clustering, processing simulation results and interaction with the system database, etc., as well as functions implemented at the individual level of each agent and performed independently on GPUs. 4. ANALYSIS OF SIMULATION RESULTS 4.1. Without extremists The authors of the original article [14] note that the number of clusters of opinions in the model without extremists empirically is equal to w/(2u), where w is the width of the initial distribution of opinions (equal to 2, since opinions lie in the segment [−1, 1]), and u is the initial uncertainty of moderate agents. The results obtained by us are completely consistent with this conclusion. 4.1.1. Many clusters with low uncertainty. With a low uncertainty of 0.2, we get 1/0.2 = 5 clusters almost equidistant from each other (u = 0.2). The results are shown in Figures 4.3- 4.4. 4.1.2. Two clusters with average uncertainty. With an average uncertainty of 0.5, we get 1/0.5 = 2 clusters (u = 0.5). The results are shown in Figures 4.5-4.6. 4.1.3. One cluster with high uncertainty. With a high uncertainty of 1, we get 1 cluster (u = 1). The results are shown in Figures 4.7-4.8. 4.2. Within extremists 4.2.1. Central convergence. Weak radicalization: if the moderate majority is confident in their opinion, and there are not too many extremists, then most of the moderate majority does Copyright © 2021 ASSA. Adv Syst Sci Appl (2021) 92 A.L. BEKLARYAN, L.A. BEKLARYAN, A.S. AKOPOV Fig. 4.4. Simulation results for low uncertainty and second type step. Fig. 4.5. Simulation results for average uncertainty and first type step. Fig. 4.6. Simulation results for average uncertainty and second type step. not become extremists, although some are radicalized (u = 0.3, µ = 0.5, pe = 0.2, δ = 0). The results are shown in Figures 4.9-4.11. Copyright © 2021 ASSA. Adv Syst Sci Appl (2021) IMPLEMENTATION OF THE DEFFUANT MODEL WITHIN THE FLAME GPU FRAMEWORK 93 Fig. 4.7. Simulation results for high uncertainty and first type step. Fig. 4.8. Simulation results for high uncertainty and second type step. Fig. 4.9. Simulation results for central convergence and first type step. 4.2.2. Bipolarization. If the moderate majority is not sure of their opinion, then most of them become extremists. At the same time, the larger the proportion of extremists, the Copyright © 2021 ASSA. Adv Syst Sci Appl (2021) 94 A.L. BEKLARYAN, L.A. BEKLARYAN, A.S. AKOPOV Fig. 4.10. Joint distribution of opinion and uncertainty for central convergence. Fig. 4.11. Simulation results for central convergence and second type step. Fig. 4.12. Simulation results for bipolarization and first type step. more moderate agents become extremists (u = 1.2, µ = 0.5, pe = 0.2, δ = 0). The results are shown in Figures 4.12-4.14. 4.2.3. Single polarisation. If there are more extremists of one pole, then they can win over most of the moderate majority. At the same time, even if the proportion of extremists is not Copyright © 2021 ASSA. Adv Syst Sci Appl (2021) IMPLEMENTATION OF THE DEFFUANT MODEL WITHIN THE FLAME GPU FRAMEWORK 95 Fig. 4.13. Joint distribution of opinion and uncertainty for bipolarization. Fig. 4.14. Simulation results for bipolarization and second type step. Fig. 4.15. Simulation results for single polarisation and first type step. very large, and the moderate majority is very uncertain, then the majority is able to completely radicalize (u = 1.2, µ = 0.5, pe = 0.2, δ = 0.7). The results are shown in Figures 4.15-4.17. 4.2.4. Slow weak radicalization. If trust in society is very low (µ parameter), then even extremely convincing radicals will not be able to persuade the entire moderate majority to Copyright © 2021 ASSA. Adv Syst Sci Appl (2021) 96 A.L. BEKLARYAN, L.A. BEKLARYAN, A.S. AKOPOV Fig. 4.16. Joint distribution of opinion and uncertainty for single polarisation. Fig. 4.17. Simulation results for single polarisation and second type step. Fig. 4.18. Simulation results for slow weak radicalization and first type step. themselves. At the same time, due to the low level of confidence, convergence will be slow (u = 0.5, µ = 0.1, pe = 0.2, δ = 0, ue = 0.05). The results are shown in Figures 4.18-4.20. Copyright © 2021 ASSA. Adv Syst Sci Appl (2021) IMPLEMENTATION OF THE DEFFUANT MODEL WITHIN THE FLAME GPU FRAMEWORK 97 Fig. 4.19. Joint distribution of opinion and uncertainty for slow weak radicalization. Fig. 4.20. Simulation results for slow weak radicalization and second type step. 5. CONCLUSION The identity of the parallelized multiparametric implementation of the Deffuant model, as an extension of the original version of the model, with the original result up to the ergodic components of the configuration space is established. Such an extension makes it possible to study the dependence of the state of the configuration space on the control parameters, ergodic components of the configuration space, cluster partitions in the dynamics of the evolution of the system, to localize the points (regions) of the bifurcation of the system, as well as to investigate the dependence of the characteristics of the system on the topology of the ensemble of agents. A separate area of further research is the development of the model within the framework of the general concept of Control, Activity, Personality [28]. ACKNOWLEDGEMENTS This work was funded by the Russian Foundation for Basic Research (RFBR), Project Number 20-01-00002. REFERENCES Copyright © 2021 ASSA. Adv Syst Sci Appl (2021) 98 A.L. BEKLARYAN, L.A. BEKLARYAN, A.S. AKOPOV 1. Chen, G., Su, W., Mei, W., & Bullo, F. (2020) Convergence properties of the heterogeneous Deffuant–Weisbuch model. Automatica, 114, 108825, https://dx.doi.org/10.1016/j.automatica.2020.108825. 2. Katz, E. & Lazarsfeld, P. (1955) Personal Influence: The Part Played by People in the Flow of Mass Communications. Free Press. 3. French, J. R. P. J. (1956) A formal theory of social power. Psychological Review, 63, 181–194, https://dx.doi.org/10.1037/h0046123. 4. Harary, F. (1959) Studies in social power, Ch. A criterion for unanimity in French’s theory of social power, 168–182. University of Michigan. 5. Degroot, M. H. (1974) Reaching a consensus. Journal of the American Statistical Association, 69, 118–121, https://dx.doi.org/10.1080/01621459.1974.10480137. 6. Friedkin, N. E. & Johnsen, E. C. (1990) Social influence and opinions. The Journal of Mathematical Sociology, 15, 193–206, https://dx.doi.org/10.1080/0022250X.1990.9990069. 7. Friedkin, N. E. (1998) A Structural Theory of Social Influence. Structural Analysis in the Social Sciences, Cambridge University Press, https://dx.doi.org/10.1017/CBO9780511527524. 8. Latané, B. (1981) The psychology of social impact. American Psychologist, 36, 343– 356, https://dx.doi.org/10.1037/0003-066X.36.4.343. 9. Latané, B. (1996) Dynamic social impact: the creation of cul- ture by communication. Journal of Communication, 46, 13–25, https://dx.doi.org/10.1111/j.1460-2466.1996.tb01501.x. 10. Proskurnikov, A. V. & Tempo, R. (2017) A tutorial on modeling and analysis of dynamic social networks. Part I. Annual Reviews in Control, 43, 65–79, https://dx.doi.org/10.1016/j.arcontrol.2017.03.002. 11. Proskurnikov, A. V. & Tempo, R. (2018) A tutorial on modeling and analysis of dynamic social networks. Part II. Annual Reviews in Control, 45, 166–190, https://dx.doi.org/10.1016/j.arcontrol.2018.03.005. 12. Bullo, F. (2021) Lectures on Network Systems. Kindle Direct Publishing. 13. Deffuant, G., Neau, D., Amblard, F., & Weisbuch, G. (2000) Mixing beliefs among interacting agents. Advances in Complex Systems, 3, 87–98, https://dx.doi.org/10.1142/S0219525900000078. 14. Deffuant, G., Amblard, F., Weisbuch, G., & Faure, T. (2002) How can extremism prevail? A study based on the relative agreement interaction model. Journal of Artificial Societies and Social Simulation, 5. 15. Hegselmann, R. & Krause, U. (2002) Opinion dynamics and bounded confidence: models, analysis and simulation. Journal of Artificial Societies and Social Simulation, 5. 16. Lorenz, J. (2007) Continuous opinion dynamics under bounded confidence: A survey. International Journal of Modern Physics C, 18, 1819–1838, https://dx.doi.org/10.1142/S0129183107011789. 17. Lorenz, J. (2010) Heterogeneous bounds of confidence: Meet, discuss and find consensus! Complexity, 15, 43–52, https://dx.doi.org/10.1002/cplx.20295. 18. Lorenz, J. (2005) A stabilization theorem for dynamics of continuous opin- ions. Physica A: Statistical Mechanics and its Applications, 355, 217–223, https://dx.doi.org/10.1016/j.physa.2005.02.086. 19. Zhang, J. & Chen, G. (2015) Convergence rate of the asymmetric Deffuant- Weisbuch dynamics. Journal of Systems Science and Complexity, 28, 773–787, https://dx.doi.org/10.1007/s11424-015-3240-z. 20. Como, G. & Fagnani, F. (2011) Scaling limits for continuous opinion dynamics systems. The Annals of Applied Probability, 21, 1537–1567, https://dx.doi.org/10.1214/10-AAP739. Copyright © 2021 ASSA. Adv Syst Sci Appl (2021) https://dx.doi.org/10.1016/j.automatica.2020.108825 https://dx.doi.org/10.1037/h0046123 https://dx.doi.org/10.1080/01621459.1974.10480137 https://dx.doi.org/10.1080/0022250X.1990.9990069 https://dx.doi.org/10.1017/CBO9780511527524 https://dx.doi.org/10.1037/0003-066X.36.4.343 https://dx.doi.org/10.1111/j.1460-2466.1996.tb01501.x https://dx.doi.org/10.1016/j.arcontrol.2017.03.002 https://dx.doi.org/10.1016/j.arcontrol.2018.03.005 https://dx.doi.org/10.1142/S0219525900000078 https://dx.doi.org/10.1142/S0129183107011789 https://dx.doi.org/10.1002/cplx.20295 https://dx.doi.org/10.1016/j.physa.2005.02.086 https://dx.doi.org/10.1007/s11424-015-3240-z https://dx.doi.org/10.1214/10-AAP739 IMPLEMENTATION OF THE DEFFUANT MODEL WITHIN THE FLAME GPU FRAMEWORK 99 21. Zhang, J. & Hong, Y. (2013) Opinion evolution analysis for short-range and long-range Deffuant–Weisbuch models. Physica A: Statistical Mechanics and its Applications, 392, 5289–5297, https://dx.doi.org/10.1016/j.physa.2013.07.014. 22. Bashari, M. & Akbarzadeh-T, M.-R. (2020) Controlling opinions in Deffuant model by reconfiguring the network topology. Physica A: Statistical Mechanics and its Applications, 544, 123462, https://dx.doi.org/10.1016/j.physa.2019.123462. 23. Gandica, Y., del Castillo-Mussot, M., Vázquez, G. J., & Rojas, S. (2010) Continuous opinion model in small-world directed networks. Physica A: Statistical Mechanics and its Applications, 389, 5864–5870, https://dx.doi.org/10.1016/j.physa.2010.08.025. 24. Amblard, F. & Deffuant, G. (2004) The role of network topology on extremism propa- gation with the relative agreement opinion dynamics. Physica A: Statistical Mechanics and its Applications, 343, 725–738, https://dx.doi.org/10.1016/j.physa.2004.06.102. 25. Mirtabatabaei, A. & Bullo, F. (2012) Opinion dynamics in heterogeneous networks: Convergence conjectures and theorems. SIAM Journal on Control and Optimization, 50, 2763–2785, https://dx.doi.org/10.1137/11082751X. 26. Chazelle, B. & Wang, C. (2017) Inertial Hegselmann-Krause sys- tems. IEEE Transactions on Automatic Control, 62, 3905–3913, https://dx.doi.org/10.1109/TAC.2016.2644266. 27. Richmond, P., Chisholm, R., Heywood, P., Leach, M., & Chimeh, M. K. (2021) FLAME GPU, https://dx.doi.org/10.5281/zenodo.5428985. 28. Novikov, D. (2020) Control, Activity, Personality. Advances in Systems Science and Applications, 20, 113–135, https://dx.doi.org/10.25728/assa.2020.20.3.931. Copyright © 2021 ASSA. Adv Syst Sci Appl (2021) https://dx.doi.org/10.1016/j.physa.2013.07.014 https://dx.doi.org/10.1016/j.physa.2019.123462 https://dx.doi.org/10.1016/j.physa.2010.08.025 https://dx.doi.org/10.1016/j.physa.2004.06.102 https://dx.doi.org/10.1137/11082751X https://dx.doi.org/10.1109/TAC.2016.2644266 https://dx.doi.org/10.5281/zenodo.5428985 https://dx.doi.org/10.25728/assa.2020.20.3.931 Introduction Model description Base model Extremists in the model Parameters of the model Flame GPU realization Analysis of simulation results Without extremists Many clusters with low uncertainty. Two clusters with average uncertainty. One cluster with high uncertainty. Within extremists Central convergence. Bipolarization. Single polarisation. Slow weak radicalization. Conclusion