Modelling Non-Linear Consensus Dynamics on Hypergraphs

The basic interaction unit of many dynamical systems involves more than two nodes. In such situations where networks are not an appropriate modelling framework, it has recently become increasingly popular to turn to higher-order models, including hypergraphs. In this paper, we explore the non-linear dynamics of consensus on hypergraphs, allowing for interactions within hyperedges of any cardinality. After discussing the different ways in which non-linearities can be incorporated in the dynamical model, building on different sociological theories, we explore its mathematical properties and perform simulations to investigate them numerically. After focussing on synthetic hypergraphs, namely on block hypergraphs, we investigate the dynamics on real-world structures, and explore in detail the role of involvement and stubbornness on polarisation.


I. INTRODUCTION
Networks provide a powerful language to model systems made of interacting elements, as observed in many scientific domains. Within the social sciences, for instance, their significance has increased in recent years with the emergence of online social networks. In particular, social network analysis has become a common tool to help model and extract information from the myriad of social interactions in a system. In addition to algorithms extracting central nodes or clusters of similar nodes, much research has focussed on the impact of the network structure on the dynamics of opinion formation [1], looking at a variety of models, from linear ones, like the Voter model or the DeGroot model [2], to non-linear ones, like the bounded-confidence models [3] and threshold models [4].
Nevertheless, it is important to remember that networks are an abstract representation of real-world systems, and several studies have shown, in recent years, that they may be inadequate to capture critical aspects of interacting systems [5,6]. In particular, the basic interacting units of a network are pairs of nodes, an assumption that is not verified in situations when multi-body or group interactions take place, such as in neural activity [7][8][9], robotics [10] or scientific collaborations [11]. The importance of irreducible group interactions, that is interactions that can not be built from a combination of pairwise interactions, is especially relevant for opinion dynamics. Experiments in social psychology such as the conformity experiment [12] indicate that multiple exposures might be necessary for an agent to adopt a certain opinion state. This dependence on multiple contacts can be seen as a first step towards group effect. Threshold models, in which the state of agents switches if a certain fraction of their neighbours agree, have been developed to describe this phenomenon and are already inherently different from simple models of epidemic spread. However, these models are based on independent, pairwise interactions that are linearly accumulated and therefore do not account for truly higher-order effects [13].
Popular choices for modelling genuine group interactions include hypergraphs [14][15][16] and simplicial complexes. The latter has opened the doors to the use of algebraic topology in the analysis and study of complex systems [17][18][19][20][21][22][23]. With regard to dynamical processes on higher-order models, several works have attempted to apply social dynamics to either of these structures [22,24,25]. Moreover, linear dynamics such as random walks and general spectral analysis have been extended to hypergraphs [26][27][28][29]. Nevertheless, Neuhäuser et al. have shown with the introduction and analysis of the so-called three-body consensus model (3CM) [30] that multi-body dynamical effects that go beyond rescaled pairwise interactions can only appear if the interaction function is non-linear, regardless of the underlying multi-body structure. If the interaction function is linear, the system can always be written as a linear, pairwise interaction system on a rescaled network. Therefore, non-linearity is the essential ingredient to make genuine group dynamics appear.
In this work, we generalise 3CM by proposing a Multi-body Consensus Model (MCM) for opinion consensus on hypergraphs of arbitrary group size, and explore different versions of interaction functions emphasising different sociological mechanisms, such as peer pressure and homophily, i.e. the tendency for similar nodes to interact more often. We then present the combined effects of these phenomena in numerical simulations on empirical hypergraphs. The rest of this paper is structured as follows. In Section II, we introduce the process of modelling multi-body interactions, and derive some useful analytical quantities. In Section III, we present and discuss MCM. Section IV contains simulations on real-world hypergraphs and Section V is devoted to discussing further possibilities and avenues of research.

A. Structure of a hypergraph
The hypergraph H is a set V (H ) = {1, 2, . . . , N } of N nodes, and a set E(H ) = {E 1 , E 2 , . . . , E M } of M hyperedges. Each hyperedge E α is a set of nodes, i.e. E α ⊆ V (H ) ∀ α = 1, 2, . . . , M . We denote by E c (H ) the set of all hyperedges of cardinality c (henceforth referred to as c-edges).
We describe the structure of H using the adjacency tensors A c ∈ R N c , c = 2, 3 . . . , N , where A c represents the connections made by c-edges.
Thus A c is symmetric in all dimensions, and A ij... = 1 ⇒ i = j = . . .. Each node i ∈ V (H ) has a dynamical variable x i ∈ R associated with it. x i is termed the 'state' of i, and represents the notion of an opinion of an individual i in a hypergraph of social interactions.

B. General diffusion-like processes on hypergraphs
We denote byẋ i Eα the effect of E α on the derivativeẋ i of the state on node i. We have thatẋ i Eα = 0 when i ∈ E α , and for i ∈ E α , we write: This models the influence of j ∈ E α , j = i on i via the linear term (x j − x i ), modulated by the function s ijEα . In this most general case, each triplet of affected node (i), acting node (j), and hyperedge (E α ) is modulated by the unique function s ijEα . Note that while the choice of modulating function is determined by this triplet, its argument is the states of all the nodes in E α . The complete 'diffusion-like' process is then obtained by linearly combining the effect of each hyperedge [30,31], and one thus obtains the system of equationṡ The special case where the choice of modulating function for a node i is the same for all E α , and symmetric in all k ∈ E α , k = i allows us to derive some interesting analytical results. Under this assumption, we denote the modulating function as s i and we can write the effect of all c-edges on i as: Thus,ẋ i is given by:

C. Deriving the Laplacian
We now derive the Laplacian for this process. Along the lines of [30], we define weight matrices W c and the degree matrix D c as: Here, D c ij = 0 ∀ i = j. This allows us to writeẋ where L c ij = (c − 1)D c ij − W ij . Eq.(5) can now be written as: where L ij = N c=2 L c ij . We see that when the modulation function s i is a constant, i.e. when the interactions are linear, the dynamics reduce to those of a static weighted network. However, when the interactions are non-linear, the corresponding network is time-dependent. Thus, we conclude as in [30] that irreducible multi-body effects are created only by non-linear interactions.
The effect of E α on i ∈ E α is modulated by two functions -s I i and s II i . They define the two 'facets' of MCM, which can be studied separately in two simplified models that we call MCM I, witḣ and MCM II, withẋ The difference in their sociological motivation and mathematical properties is captured by the arguments of their modulating functions.
• s I i is a function of the distance of x i to the mean state of the hyperedge, and determines the rate at which that hyperedge influences its state.
• s II i is a function of the distance of a participating node j from the mean state of the hyperedge excluding i.
Thus, while MCM I modulates the competing effect of different hyperedges on the state an incident node, MCM II determines which nodes inside a single hyperedge are the most influential. It is important to emphasise that s II i reduces to the modulating function of the original 3CM for hyperedges of cardinality 3, whereas s I i adds a new aspect that is not present in 3CM. In the next two sections, we discuss the mathematical and sociological differences of these functions further.

MCM I: Analysis in the mean field
We note that both s I i and s II i are invariant under translations (x i → x i + a for a ∈ R) and reflection about the origin (x i → −x i ). Thus, the dynamics are independent of the frame of reference in R. Since the argument of s II i is dependent on both i and j, it cannot be analysed by the methods in Section II C. In the case of s I i , in contrast, as it is symmetric in all k ∈ E α , k = i, its Laplacian can be derived as in Section II C. Further, we can analytically derive some properties in the mean field.
We assume that all nodes have the same modulating function, and denote it as s I . Consider a hypergraph H with m k hyperedges of cardinality k for k = 2, 3, . . . , N . We assume the homogeneous mixing hypothesis, where the probability of a node participating in a hyperedge is independent of the node in question. Under this hypothesis, we can say that each node participates in km k N hyperedges of cardinality k and that the mean of every hyperedge is the global meanx. In order to examine the time evolution ofx in the mean field, we proceed as follows. For i ∈ E α , we haveẋ Using this, we can writeẋ Thus, the mean opinion evolves asẋ and we observe that in a homogeneously mixed system, the mean does not shift if the distribution of x i about the mean is symmetric. We can also investigate the effect of asymmetry in the initial distribution of the states. Consider a situation where the initial states are binary (either 1 or 0). Suppose at t = 0, f 0 fraction of the nodes have state 0, and the rest (f 1 = 1 − f 0 ) have state 1. From Eq.14, we can writė x shifts towards the majority.
Similarly,x shifts towards the minority for monotonically decreasing s I .

Numerical Simulations
To demonstrate the fundamental differences between MCM I and II, we run numerical simulations of each model on identical topologies, and with the same choice of modulating function. As a natural choice for modulation that is monotonic, continuous, and always positive, we consider for this illustration exponential functions.
We define a hypergraph with N nodes as fully connected if all 2 N − N − 1 hyperedges with cardinality ≥ 2 exist. We simulate the models on a fully connected hypergraph with N = 10 nodes by initialising node states as binary numbers (0 or 1), with n 0 nodes of state 0. Since the modulating functions are always positive, a global consensus is reached without oscillations as expected. In the simulations, we define the global consensus as the average state when the standard deviation σ 2 ({x i }) ≤ 0.0005. Numerical results in Fig. 1 show that the two facets evolve in completely contrasting ways. Further, the results for MCM I validate the analytical results in Section III B 1. For a monotonically increasing modulating function (λ > 0), we see that the mean state shifts towards the initial majority. Similarly, it shifts towards the initial minority for a monotonically decreasing modulating function (λ < 0). While MCM II is a direct generalisation of 3CM, MCM I shows an opposite behaviour, despite the same choice function for the modulating function. These drastic differences underline the distinct nature of the two modulating functions, -and of their associated models MCM I and MCM II -, as well as the huge effect of the argument in the modulation function on the modelling outcome. After this first analysis of the mathematical differences between the two variations of MCM, let us now turn to their sociological motivation, in order to chose appropriate modulating functions.
C. Sociological Differences

MCM I
Homophily is a central concept in sociology describing the tendency of like-minded individuals to interact [32]. The topology of social interactions is often influenced heavily by homophily. In sociological terms, the argument to s I quantifies the difference between the opinion of individual i and the average opinion of group E α that i belongs to. The influence of a group on a node is thus determined by the proximity of its average state to the state of the node. For instance, consider the step function: Individual i is influenced by a group only if their opinions differ by a value less than the threshold φ i . This mechanism is reminiscent of threshold models [33] [34] and bounded confidence models like the Deffuant model [3], with the important difference that it is group-specific, i.e. each hyperedge corresponds to one group, while network-based models usually consider the whole neighbourhood of a node as its single group. As an illustration, in Fig. 2, we present the evolution of MCM I on a fully connected hypergraph (N = 10) initialised as two tight groups around 0.05 and 0.95 with φ i = 0.1 for all nodes. We see that no global consensus is reached despite the existence of groups where individuals of vastly different opinions may interact. Another choice for s I i is a monotonic function, where a decreasing function represents an individual i who is less influenced by groups with opinions very different from its own than by groups with similar opinions. This can be thought of as individual i resisting change, or some form of 'stubbornness'. On the other hand, an increasing function can be thought of as representing 'gullibility'. Consider the exponential function: For λ i < 0 (> 0), the function is monotonically decreasing (increasing). Stubborn (gullible) nodes are therefore characterised by λ i < 0 (> 0). In Fig. 3, we present the evolution of MCM I with an exponential modulation on An important effect of MCM I is that it makes it possible for an individual to heavily influence other members of a group while being resistant to their influence. This allows certain individuals to be 'trendsetters' and to pull entire groups towards their opinion. Stubborn individuals in a group of people with whom they disagree can be trendsetters.

MCM II
The pressure to conform is an important sociological and psychological phenomenon [35], at the root of most models of opinion dynamics. 'Conformity' is used to describe the tendency of an individual to align its beliefs to those of its peers, and is usually affected by the reinforcing nature of shared opinions (peer pressure). The sociological interpretation of the argument of s II i is the difference between the opinion of individual j to the average opinion of the group except individual i. Thus, in MCM II, the influence exerted by j inside a hyperedge depends on the proximity of its opinion to those of the rest of the group. For instance, consider the exponential function: When δ i < 0, individual i tends to be more influenced by individuals who agree with the rest of the group. In contrast, for δ i > 0 an individual is attracted to the outliers of a group. 'Anti-conformists' or 'contrarians' are individuals whose decisions oppose the majority, and can thus be associated with δ i > 0. In Fig. 1 (b), we see that in a population of conformers (contrarians), the mean shifts towards the initial majority (minority), as expected.

D. Defining s I i and s II i for MCM
The previous sections considered MCM I and MCM II separetedly. Let us now consider a general model integrating both types of mechanisms. To do so, we build on Social Judgement Theory [36] where the responses of people to different opinions are categorised as: • The latitude of acceptance -where the other opinion is sufficiently close to their own belief and is accepted.
Their beliefs shift towards the new opinion (assimilation).
• The latitude of rejection -where the other opinion is too far from theirs and is therefore unacceptable. This leads to their opinion shifting away from the other (contrast).
• The latitude of non-commitment -where the other opinion is neither sufficiently close to be accepted nor different enough to be repulsive. According to Social Judgement Theory, the more the individual is personally involved in an issue, the smaller their latitudes of acceptance and non-commitment. Inspired by this categorisation, and drawing from the Jager-Amblard model [37], we define for each node i, two thresholds -that of acceptance (φ A i ) and that of rejection (φ R i ), and we propose For MCM II, we keep an exponential modulating function.

E. Evolution of MCM on a block hypergraph
In the previous sections, simulations were run on fully connected hypergraphs. Let us now turn our attention to more nuanced hypergraph models in order to uncover the impact of structure on dynamics. As a first step, we consider a block hypergraph model, inspired by the stochastic block network model, and defined for a hypergraph with 2 blocks of N nodes each. The probability of a hyperedge with n 1 and n 2 nodes from the two blocks respectively being created is given by p n1n2 out , where p out is a parameter for the model. Note that intra-block hyperedges have either n 1 = 0 or n 2 = 0, and are thus created with probability 1. This means that both blocks are fully connected, and the number of inter-block hyperedges can varied by tuning p out . In Fig. 4, we plot the cardinality distribution of a block model of a hypergraph averaged over 1000 instances with N = 5.
The system has several parameters, some associated with its structure, and other to the dynamical model. As a first descriptive study, we study the effect of φ A i and φ R i , we fix δ i = −5, λ i = −1 for all nodes. We consider a block hypergraph with N = 5 and p out = 0.4, with the initial opinions of the nodes in the two blocks as values from a uniform distribution over [0, 0.5] and [0.5, 1] respectively. Further we set φ A i = φ A and φ R i = φ R as the same for all nodes. For each choice of the parameters φ A i and φ R i , we simulate 500 realisations of the evolution of MCM. Unlike the numerical simulations performed previously, MCM is not guaranteed to reach a global consensus. Here, we stop the simulation when the difference in standard deviation over 500 timesteps is less than 0.0005.
In Fig. 5, we plot the evolution of 10 (out of the 500) realisations for each set of values for the parameters. This preliminary analysis reveals that low values of φ R , which represents intolerance in the social context, create polarisation. In contrast, a large value of φ A encourages consensus. In all the simulations, the range of possible opinions is restricted to [0,1]. This allows us to define the notion of extreme nodes as those with state > 0.9 or < 0.1, and thus to quantify the extent of polarisation. This interpretation is confirmed by the results in Table I, where we see that for low (high) values of φ A and φ R , there is polarisation (consensus). For intermediate values, the two blocks reach an internal consensus first, before converging to the global consensus. Due to the small size of the blocks, as well as the presence of several inter-block hyperedges, we do not see a co-existence of extreme and non-extreme nodes. However, for large group sizes and more sparsely connected blocks, this coexistence is indeed possible. In the next sections, we will explore the dynamics of MCM for these specific choices of interaction function, with a specific focus on the emergence of polarisation and the importance of stubbornness.

A. Datasets
We study the dynamics of MCM on empirical hypergraphs of social interaction. To create hypergraphs describing real-world interactions, we use the publicly available SocioPatterns dataset [38]. To represent a diverse variety of social situations, we use the following datasets: • Primary Schools dataset [39][40] -schoolchildren and teachers at a primary school in France  • High School dataset [42] -students at a high school in Marseilles, France (2012) The SocioPatterns datasets record face-to-face interactions with a temporal resolution of 20 seconds. This allows us to check whether individuals are truly interacting as a group [43]. For every 20 second window, we create a network of interactions and catalogue all the maximal cliques. If a clique interacts often, we assume that it represents a social group where the interactions are multi-body, and are distinguishable from the pairwise interactions of its members. In practice, we set an arbitrary threshold and include a maximal clique as a hyperedge if it is observed ≥ 5 times. Specifics about the structure of the hypergraphs are provided in Table II. Fig. 6 shows their degree distributions and weighted adjacency matrices. Here, degree refers to the number of hyperedges containing a node and A ij is given by the number of hyperedges containing both i and j. The resulting hypergraphs show very different types of structures, including different degree distributions. This diversity is an asset in order to test the qualitative features of the dynamics of MCM.

B. Role of involvement
We initialise the nodes with states drawn from a uniform distribution in [0, 1]. Fixing λ i = −1, δ i = −5, we consider three scenarios for (19): .80 in order to investigate the role of involvement on the dynamics. Note that the goal of this investigation is to show that there are values of the parameters for which the model evolves in similar ways for all the empirical hypergraphs. A complete exploration of the parameter space is beyond the intent and the scope of this work. Figs. 7 (a) -(d) show the typical evolution of one realisation of MCM on the empirical hypergraphs for each scenario. To quantify the extent of polarisation, we plot the fraction of extreme nodes in the course of time (Fig. 7 (e)). Fig. 7 shows that, at least for our choice of parameters, the evolution of MCM is similar in the different topologies, indicating the robustness of temporal profiles on the details of the underlying hypergraph. We observe that a group of individuals who are all highly invested in a discussion tends to split into two extreme factions with opposing views. Groups with less invested individuals tend to settle on a common consensus, while groups of moderately invested people evolve to an intermediate situation, with a partial consensus and the emergence of a small group of extremists.

C. Role of stubbornness
As a second step, we investigate the impact of stubbornness. To facilitate the understanding of the results, we restrict the scope to situations where all nodes are subject solely to acceptance, and not rejection, by imposing that φ A , φ R > 1. We also fix the same value of δ i for all the nodes, with δ i = −5 in the following simulations, but qualitatively similar results can be found for other values. The value of λ i defines the stubbornness for each node i, such that λ i < 0 characterises a stubborn node and stubbornness increases with the magnitude of λ i . Numerical simulations reveal that the effect of changing λ i is sensitive to the topology, initialisation as well as the values of the   other parameters. To fix the topology, we consider the Primary School hypergraph. Fig. 6 shows that the Primary School hypergraph is reminiscent of a block model. Students interact much more with their classmates than with others. In order to ensure that the effect of stubborness is present in every block, we fix the stubborn nodes -choosing all 10 teachers and picking 3 students randomly from each class (50 in total). We initialise all the nodes with binary states -1 for the stubborn nodes (λ i = λ * ), and 0 for the others (λ i = −1). This gives usx(t = 0) = 0.2066. The results in Fig. 8 show that the mean opinion of the group shifts towards 1, which indicates that the presence of a few stubborn individuals has a significant effect on the consensus of the group. Further, the dependence of the consensus state on the value of λ * shows that the effect of stubborn individuals increases with their stubbornness.

V. DISCUSSION
Networks are a powerful language to model interacting systems. Yet one of its core assumptions, that connectivity emerges from the combination of pairwise interactions, is not necessarily verified in empirical systems. In this paper, we have explored the problem of consensus in situations such that basic interaction units are composed of more than two nodes. Representing the underlying structure as a hypergraph, we propose a general non-linear model for consensus dynamics, called MCM, where different model ingredients are associated with different sociological mechanisms. We have studied certain aspects of the models mathematically and have explored its behaviour on artificial as well as on real-life hypergraphs, revealing a rich phenomenology and the strong interplay between the structure and the dynamics. Yet, this paper only scratches the surface of this dynamical system, and many research venues remain open. First, we have explored only a limited part of the parameter space, and additional theoretical and numerical results would be required to improve our understanding of the different regimes supported by the model and the nature of the transitions between them. Second, though we define multi-body interactions in a general way, we analyse only a special class of them. Finding different functional forms of group interactions relevant to other complex processes is a possible direction of research. Another interesting line of inquiry lies in extending and generalising multi-body interactions to adaptive hypergraphs. Most dynamical processes (including MCM) are sensitive to the topology, and thus making models to capture the dynamics of the underlying hypergraph promises to be an important area. Other possible extensions could be studying opinion dynamics on weighted or directed hypergraphs, or exploring the effects of stochasticity on the consensus.