# Modeling algorithmic bias: simplicial complexes and evolving network topologies – Applied Network Science

Aug 16, 2022

### Algorithmic Bias: from Mean-field to Complex Topologies.

Online social networks have become the primary source of information and an excellent platform for discussions and opinion exchanges. However, each user’s flow of content is organized by algorithms built to maximize platform usage. From this comes the hypothesis that there is an algorithmic bias (also called algorithmic segregation) since these contents are selected based on users’ precedent actions on the platform or the web, reinforcing the human tendency to interact with content confirming their beliefs (confirmation bias).

To introduce in the study of opinion dynamics the idea of a recommender system generating an algorithmic bias, we started from a recent extension of the well-known Deffuant–Weisbuch model (DW-model henceforth), proposed in Sîrbu et al. (2019) (Algorithmic Bias model or AB model, henceforth).

### Definition 1

(Deffuant–Weisbuch model (DW-model)) Let us assume a population of N agents, where each agents i has a continuous opinions (x_{i} in [0,1]). At every discrete time step, a pair (ij) of agents is randomly selected, and, if their opinion distance is lower than a threshold (epsilon), (|x_{i} – x_{j}| le epsilon), then both of them change their opinion according to the following rule:

begin{aligned} begin{aligned} x_{i}(t+1)&= x_{i} + mu (x_{j}-x_{i}) \ x_{j}(t+1)&= x_{j} + mu (x_{i}-x_{j}). end{aligned} end{aligned}

(1)

In the DW-model, the parameter (epsilon in [0,1]) models the population’s confidence bound, assumed constant among all the agents. A low (epsilon) creates a close-minded population, where the individuals can only be influenced by those whose opinions are similar to theirs; a high (epsilon), instead, creates an open-minded population since two agents can influence each other even if their initial opinions are very distant. The parameter (mu in (0, 0.5]) is a convergence parameter, modeling the strength of the influence the two individuals have on each other or, in other words, how much they change their opinion after the interaction. Even if there is no reason to assume that (epsilon) should be constant across the population or at least symmetrical in the binary encounters, this parameter is often considered equal for every agent (apart from a few exceptions as in Lorenz (2010)). The numerical simulations of this model show that the qualitative dynamic is mainly dependent on (epsilon): as (epsilon) grows, the number of final opinion clusters decreases. As for (mu) and N, these parameters influence only the time to convergence and the final opinion distribution width.

The AB model introduces another parameter to model the algorithmic bias: (gamma ge 0). This parameter represents the filtering power of a generic recommendation algorithm: if it is close to 0, the agent has the same probability of interacting with all its peers. As (gamma) grows, so does the probability of interacting with agents holding similar opinions while interacting with those who hold distant opinions decreases. Therefore, this extended model modifies the rule to choose the interacting pair (ij) to simulate a filtering algorithm’s presence. An agent i is randomly picked from the population, while j is chosen from i’s peers according to the following rule:

begin{aligned} p_{i}(j)=frac{d_{ij}^{-gamma }}{sum _{k ne i}d_{ik}^{-gamma }} end{aligned}

(2)

where (d_{ij} = |x_{i}-x_{j}|) is the opinion distance between agents i and j, so that for (gamma = 0.0) the model goes back to the DW-model, i.e. the interacting peer j is chosen at random from (i’s) neighbors or—in other words—every neighbor is assigned the same probability to be chosen. When two agents interact, their opinions change if and only if the distance between their opinions is less than the parameter (epsilon), i.e., (|x_{i}-x_{j}| le epsilon), according to Eq. 1.

In Sîrbu et al. (2019) the discussed AB model results focus only on the mean-field scenario, i.e., the authors assume a complete graph as the underlying social structure. While considering real-world social interactions, however, we can assume that individuals will likely interact only with whom they are acquainted. Therefore, building from the analysis proposed in Pansanella et al. (2022), we evaluate the effects of two different topological models on the unfolding of the identified opinion formation process: Erdős–Rényi (ER) (Erdás and Rényi 1959) and scale-free Barabási–Albert (Barabási and Albert 1999) networks.

### Algorithmic bias: from fixed topologies to adaptive networks

In Sîrbu et al. (2019) and Pansanella et al. (2022), it emerged that the dynamics and final state are mainly determined by (epsilon) and (gamma), with the confidence threshold enhancing consensus and the bias enhancing fragmentation. Comparing simulations performed on complete, ER, and scale-free networks, it emerged that the role of the underlying topology is negligible concerning the effects of the model parameters (thus, confirming what was previously observed in Weisbuch (2004); Fortunato (2004); Stauffer and Meyer-Ortmanns (2004) for the scale-free scenario). However, a higher sparsity implies that fragmentation emerges for lower values of the algorithmic bias. Despite this being a crucial step towards reality, assuming that social networks are static during the whole period is unrealistic. Interactions and relationships evolve, and this evolution influences and is influenced by the dynamical process of opinion exchanges and the presence of recommender systems and filtering algorithms for the construction of the social network, reinforcing the tendency toward homophilic choices.

In the present work, we extended the baseline model (Sîrbu et al. 2019) introducing the possibility of arc rewiring, creating the Adaptive Algorithmic Bias model (AABM henceforth), where peer-to-peer interactions are affected by algorithmic biases, and the networks evolve influenced by such interactions, bringing people to connect to peers with opinions within their confidence bound. To incorporate such behavior, we added a new parameter to the Algorithmic Bias model, namely (p_{r} in [0, 1]), indicating the probability that the agent in a situation of cognitive dissonance decides to rewire their link instead of just ignoring their peer opinion. To maintain the model as simple as possible, this parameter is assumed to be constant across the population and does not depend on the opinion distance. Thus, in the model, every time an agent i interacts with a neighbor j and their opinion distance is beyond the confidence threshold, i.e., (|x_i – x_j| ge epsilon):

• with probability (p_r) the agent rewires the arc looking for a like-minded individual

• with probability (1-p_r) the DW-model is applied, i.e. both opinions and network structure remain unchanged.

To rewire the arc, a node z is randomly selected from the set of non-neighboring nodes, and if (|x_i-x_z| < epsilon), the agent z links to the agent i, otherwise the structure of the graph remains unchanged (see Fig. 1 for an example of this process and algorithm 1 for the process pseudocode).

Without considering the algorithmic bias in the choice of the interacting peer, our work is similar to Kozma and Barrat (2008); Kan et al. (2021). In Kozma and Barrat (2008) the process of rewiring works in the same fashion as in the present work, however, every time the rewiring option is chosen over the standard DW-model update rule, the old link (ij) is broken and a new link (iz) is formed towards a random non-neighboring agent, even if this agent’s opinion is beyond (i’s) confidence threshold. Even in Kan et al. (2021) the rewiring process has a different formulation diverging from the proposed one due to the following specificities: (a) at iteration, a set M of discordant edges is rewired and then a set K of edges undergoes the process of opinion update (i.e., if (M < K) opinion change faster than node rewire, like in the present work); (b) during the rewiring stage the node selection does not happen entirely at random, rather it is “biased” towards similar individuals (still allowing the connection with peers with opinions beyond the confidence threshold); finally (c) the confidence bound and the tolerance threshold for the rewiring are modeled as two independent parameters.

Conversely, from such contributions, our implementation assumes a “zero-knowledge” scenario where agents are not aware of the statuses of their peers beforehand: once rejected the algorithmically biased interaction suggestion, if an agent decides to break the tie and search for a new peer to connect with it will not rely (for that task) on other algorithm suggestions. We adopt such modeling since in social contexts (e.g., in online social networks), the status of unknown peers is hardly known by a user—at least before a first attempt at interacting with them. Moreover, not delegating the identification of potential peers to connect with to the “algorithm,” we allow users to react to a first non-successful system recommendation independently (i.e., during the same iteration, the user prefers not to trust the algorithm. Instead, he/she makes a blind connection choice). Therefore, rewiring a link toward a like-minded individual is not always feasible given the limits of users’ local views.

### Beyond pairwise interactions: modeling peer pressure

Classical networks, with vertex and arcs, only capture dyadic relationships, and every collective dynamic is analyzed as a decomposition of pairwise dynamics. However, there are many systems where it is crucial to capture group dynamics and where considering only binary interactions can limit the explanatory power of models. As introduced in “Introduction” section, different structures can be employed to model higher-order interactions. However, in the specific context of this paper, we chose to employ simplicial complexes since the idea is that a triangle of connected agents may experience peer pressure because it constitutes a group of friends, a strong friendship relationships, where in addition to the binary friendships there is a higher-order relationship among these agents. Simplexes are in fact the simplest mathematical object allowing to consider higher-order relationships. A k-simplex (sigma) is the convex hull of a set of (k+1) nodes (sigma = [p_{0}, p_{1}, …, p_{k}]). The 0-simplex is a single node; the 1-simplex is an arc, the 2-simplex is a triangle, etc. A simplicial complex requires that each face of a simplex is again in the simplicial complex and that the nonempty intersection of two simplices is a face for each. Since a triadic friendship, denoted by a triangle on the social network, does include the binary friendships between each of the three individuals, we propose and analyze an extension of the Algorithmic Bias model to include second-order interactions: the Algorithmic Bias model on Simplicial Complexes (inspired by Horstmeyer and Kuehn (2020) and adapted to the context of bounded confidence models with continuous opinions). This allows us to incorporate peer pressure in an environment where confirmation and algorithmic biases are still present.

In order to implement peer pressure, i.e., a mechanism for which the majority opinion pressures the individual “minority” one to conform, we first need to define what a majority is in the context of a continuous opinion dynamics model. We choose to consider two nodes “agreeing” if their opinion distance is below the confidence threshold, i.e. (|x_i – x_j | < epsilon), similarly to Kozma and Barrat (2008).

The model selects a pair (ij) according to Eq. 2 at every discrete time step and computes the set of triangles T including (ij). If the set is nonempty, the model selects a third node z from T according to Eq. 2. Otherwise, the baseline rule is applied, i.e., there is a pairwise interaction between i and j according to the AAB-model rules.

Once the interacting triplet is chosen, if two agents form a majority, two scenarios may arise:

• the third agent already “agrees” with the majority, i.e., its opinion distance from the average opinion of the majority is below the confidence threshold

• the third agent is in a situation of cognitive dissonance with the majority, i.e., its opinion distance from the average opinion of the majority is beyond the confidence threshold

In the former scenario, the attractive behavior of the pairwise model is adapted to the triadic case: the agents take the average opinion of the triplet; in the latter, we implemented peer pressure by making the three agents adopt the average opinion of the majority. These rules are detailed in the algorithm 2.

Our goal here is to understand the effects of higher-order interactions in a biased environment on the degree of fragmentation reached by the population in the final state. To such an extent, we tested this extended model on the same two graph models: ER (Erdás and Rényi 1959) and a scale-free (Barabási and Albert 1999) network.

We also added the possibility of arc rewiring in this model: to do so, a rewiring takes place with probability (p_r) between the disagreeing pair (ij) with (|x_i – x_j| ge epsilon) when T is an empty set or a “majority” cannot be found in T.

### Experimental settings

Like in Sîrbu et al. (2019), to avoid undefined operations in Eq. 2, when (d_{ik} = 0) we use a lower bound (d_{epsilon } = 10^{-4}). The simulations are designed to stop when the population reaches an equilibrium, i.e., the cluster configuration will not change anymore, even if the agents keep exchanging opinions. We also set an overall maximum number of iterations at (10^5) as in Pansanella et al. (2022). We compute the average results over 30 independent executions for each configuration to account for the model’s stochastic nature. The initial opinion distribution is always drawn from a random uniform probability distribution in [0;1]. To better understand the differences in the final state concerning the different topologies considered, we study the model on all networks for different combinations of the parameters. We are interested in understanding the effects of a co-evolving topology affected by homophily on the dynamics of public opinion in a population and the consequences of peer pressure when moving from pairwise to higher-order interactions.

Moreover, we are also interested in whether, parameters being equal, different initial network topologies influence the final cluster configuration in such extended models. We tested our model, seeding the co-evolution with two different network topologies: an Erdős–Rényi (random) and a Barabási–Albert (scale-free). We set the number of nodes (N=250) in both networks. For the ER network, we fix the p parameter (probability to form a link) to 0.1 (thus imposing a supercritical regime, as expected from a real-world network); we obtain a network composed of a single giant component with an average degree of 24.94. In the BA network, we set the (m=5) (i.e., the parameter regulating the number of edges to attach from a new node to existing nodes), thus obtaining a network instance with an average degree equal to 9.8.Footnote 1

In our simulations, we evaluated the different models on the different possible combinations of the parameters over the following values:

• (epsilon) takes a value from 0.2 to 0.4 with a step of 0.1. We chose these values because these are the values for which, in the AB model, we can observe a shift from polarization to fragmentation and from consensus to polarization. Higher values of (epsilon) lead to consensus regardless of the strength of the algorithmic bias until the bias is high enough and fragmentation explodes.

• (gamma) takes value from 0 to 1.6 with a step of 0.4; for (gamma = 0) the model becomes the DW-model. We would see only fragmented final states for higher values of (gamma).

• (mu = 0.5), so whenever two agents interact, they update their opinions to the pair’s average opinion if their opinions are close enough

• (p_r) (for the Adaptive version of the models) takes a value from 0.0 to 0.5 with a step of 0.1; for (p_r = 0.0) the model becomes the AB model in the case of the Adaptive Algorithmic Bias model.

The models implementation used to carry out our experiments is the one provided by the NDlib (Rossetti et al. 2018) Python library.Footnote 2

To analyze the simulation results, we start by considering the number of final opinion clusters in the population to understand the degree of fragmentation produced by the different combinations of the parameters. This value indicates how many peaks there are in the final distribution of opinions and provides a first approximation of whether a consensus can be obtained or not. To compute the effective number of clusters, accounting for the presence of major and minor ones, we use the cluster participation ratio, as in Sîrbu et al. (2019):

begin{aligned} C = frac{(sum _{i}{c_{i}})^{2}}{sum _{i}{c_{i}^{2}}} end{aligned}

(3)

where (c_{i}) is the dimension of the ith cluster, i.e., the fraction of the population we can find in that cluster. In general, for m clusters, the maximum value of the participation ratio is m and is achieved when all clusters have the same size, while the minimum can be close to 1, if one cluster contains most of the population and a small fraction is distributed among the other (m – 1). To study the degree of polarization/fragmentation, we computed the average pairwise distance between the agents’ opinions. Given an agent i with opinion (x_{i}) and an agent j with opinion (x_{j}) at the end of the diffusion process, the pairwise distance between the two agents is (d_{ij} = | x_{i} – x_{j} |). The average pairwise distance in the final state can be computed as ({frac{sum _{i=0}^{N}{frac{(sum _{j=0}^{N}{d_{ij}})}{N}}}{N}}). While the asymptotic number of opinion clusters and the degree of polarization are essential metrics to describe the results of the dynamics qualitatively, the time to obtain such a final state is equally so. In a realistic setting, available time is finite, so if consensus forms only after a very long time, it may never actually emerge in the population. Thus, we measure the time needed for convergence (to either one or more opinion clusters) in our extended model, recalling that every iteration is made of N interactions, whether pairwise or higher-order (triadic) (Fig. 2).