5D Library › Collective Dynamics, Coupled-Oscillator Synchrony and Distributed Consensus · 中文

Chapter 6 Bounded Confidence: from Consensus to Clusters, and the Evidence on “Echo Chambers”

Listening only to nearby opinions

In the DeGroot model everyone is pulled by the opinions of everyone they trust, however far apart they are. In reality people often take seriously only opinions not too far from their own. Bounded-confidence models write this into the rule: people whose opinions differ by more than a confidence bound ε\varepsilon do not influence each other. There are two basic versions, described systematically in the review by Castellano, Fortunato and Loreto in 2009 and the survey by Lorenz in 2007 (Castellano et al. 2009; Lorenz 2007).

Calculation

Two models. Opinions are xi∈[0,1]x_i \in [0, 1].

Hegselmann–Krause model (synchronous updating) (Hegselmann and Krause 2002): at each step everyone simultaneously replaces their opinion by the mean of all opinions (their own included) within ε\varepsilon of it: xi(t+1)=1|Ii(t)|∑j∈Ii(t)xj(t),Ii(t)={j:|xj(t)−xi(t)|≤ε}.x_i(t+1) = \frac{1}{|I_i(t)|}\sum_{j\in I_i(t)} x_j(t), \qquad I_i(t) = \{j : |x_j(t) – x_i(t)| \le \varepsilon\}.

Deffuant model (random pairs) (Deffuant et al. 2000): at each step two people ii and jj are drawn at random; if |xi−xj|<ε|x_i – x_j| < \varepsilon, both move towards each other by μ\mu times the gap (μ=0.5\mu = 0.5 means they meet in the middle): xi←xi+μ(xj−xi),xj←xj+μ(xi−xj).x_i \leftarrow x_i + \mu(x_j – x_i), \qquad x_j \leftarrow x_j + \mu(x_i – x_j).

Both are nonlinear versions of the DeGroot model: the trust matrix is no longer fixed but depends on the current opinions. The Hegselmann–Krause model converges in finitely many steps to a fixed point in which any two opinions are either equal or more than ε\varepsilon apart (Lorenz 2007).

The Hegselmann–Krause model: threshold and population size

For 500 initial opinions drawn uniformly on [0,1][0,1], the program runs 40 simulations for each ε\varepsilon and records the share reaching consensus (a single cluster), the number of clusters (“major” if holding at least 5 % of agents) and the number of steps to convergence. After sorting the opinions, each person’s ε\varepsilon-window can be found with two pointers and averaged with prefix sums, so each step costs only O(N)O(N) operations. Finally it compares the share reaching consensus for 50, 500 and 5,000 people.

Calculation

# Hegselmann-Krause (2002) bounded confidence: every agent moves at once to the mean of
# all opinions within eps of its own (itself included). N = 500 opinions drawn uniformly
# from [0, 1]; 40 runs per eps. On sorted opinions the eps-windows are found by two
# pointers and summed with prefix sums, so one step costs O(N). Stop when no opinion
# moves by more than 1e-10.
# Clusters: groups of final opinions closer than 1e-6; "major" = at least 5 % of agents.
import random, statistics

def hk(x, eps, max_steps=5000):
    x = sorted(x); n = len(x)
    for t in range(1, max_steps + 1):
        pre = [0.0]
        for v in x: pre.append(pre[-1] + v)
        lo = hi = 0; new = []
        for v in x:
            while x[lo] < v - eps: lo += 1
            while hi < n and x[hi] <= v + eps: hi += 1
            new.append((pre[hi] - pre[lo]) / (hi - lo))
        if max(abs(a - b) for a, b in zip(new, x)) < 1e-10:
            return new, t
        x = new                        # the update preserves the order of opinions
    return x, max_steps

def clusters(x, tol=1e-6):
    sizes = [1]
    for a, b in zip(x, x[1:]):
        if b - a > tol: sizes.append(1)
        else: sizes[-1] += 1
    return sizes

if __name__ == "__main__":
    rng = random.Random(2002); N = 500
    print("  eps  P(consensus)  mean clusters  mean major  1/(2 eps)  median steps"
          "  max steps")
    for eps in (0.05, 0.08, 0.10, 0.12, 0.15, 0.17, 0.19, 0.20, 0.21, 0.22, 0.23, 0.25,
                0.27, 0.30):
        res = [hk([rng.random() for _ in range(N)], eps) for _ in range(40)]
        cl = [clusters(x) for x, _ in res]; steps = [t for _, t in res]
        cons = sum(len(c) == 1 for c in cl) / 40
        major = statistics.mean(sum(s >= 0.05 * N for s in c) for c in cl)
        mc, md = statistics.mean(map(len, cl)), statistics.median(steps)
        print(f"  {eps:.2f}    {cons:4.2f}        {mc:5.2f}        {major:5.2f}      "
              f"{1 / (2 * eps):5.2f}        {md:5.0f}        {max(steps):5d}")
    print("P(consensus) by population size N (30 runs each; N = 5000: 10 runs)")
    print("    N    " + "".join(f" eps={e:.2f}" for e in (0.17, 0.19, 0.21, 0.23, 0.25)))
    for n in (50, 500, 5000):
        runs = 10 if n == 5000 else 30
        row = [sum(len(clusters(hk([rng.random() for _ in range(n)], e)[0])) == 1
                   for _ in range(runs)) / runs for e in (0.17, 0.19, 0.21, 0.23, 0.25)]
        print(f"  {n:5d} " + "".join(f"    {v:4.2f}  " for v in row))
#   eps  P(consensus)  mean clusters  mean major  1/(2 eps)  median steps  max steps
#   0.05    0.00         7.97         7.35      10.00            9           31
#   0.08    0.00         5.03         4.75       6.25            9           49
#   0.10    0.00         4.05         3.85       5.00            9           59
#   0.12    0.00         3.25         3.10       4.17            9           73
#   0.15    0.00         2.50         2.45       3.33            8           74
#   0.17    0.00         2.17         2.10       2.94            8           84
#   0.19    0.03         2.00         1.98       2.63            8           15
#   0.20    0.17         1.90         1.82       2.50            7          128
#   0.21    0.33         1.68         1.68       2.38            7           63
#   0.22    0.55         1.45         1.45       2.27           12          145
#   0.23    0.65         1.35         1.35       2.17           10          145
#   0.25    0.97         1.02         1.02       2.00           10           41
#   0.27    1.00         1.00         1.00       1.85            6           14
#   0.30    1.00         1.00         1.00       1.67            5            7
# P(consensus) by population size N (30 runs each; N = 5000: 10 runs)
#     N     eps=0.17 eps=0.19 eps=0.21 eps=0.23 eps=0.25
#      50     0.00      0.07      0.03      0.13      0.57  
#     500     0.00      0.00      0.30      0.83      0.97  
#    5000     0.00      0.10      1.00      1.00      1.00  

With 500 people, ε≤0.17\varepsilon \le 0.17 never gives consensus, ε=0.25\varepsilon = 0.25 gives consensus 97 % of the time, and ε≥0.27\varepsilon \ge 0.27 always; the share crosses one half at about 0.22. Across population sizes the threshold sharpens as the population grows: at ε=0.21\varepsilon = 0.21, only 3 % of runs with 50 people reach consensus, 30 % with 500, and all 10 runs with 5,000; at ε=0.19\varepsilon = 0.19, 10 % with 5,000. This agrees with the literature: Fortunato in 2005 found a consensus threshold of about 0.2 for large populations (Fortunato 2005), and Lorenz found 0.19 in a density-based model (Lorenz 2007). The framework’s “consensus at ε≈0.2\varepsilon \approx 0.2” holds only for large populations; in a small group of a few dozen, even ε=0.25\varepsilon = 0.25 gives only about an even chance of consensus (57 % with 50 people). The two tables’ estimates for 500 people at ε=0.23\varepsilon = 0.23 differ (0.65 and 0.83) because of sampling error (only 30 to 40 runs per cell).

Two further phenomena appear near the threshold. First, convergence is slow: most runs converge in 5 to 15 steps, but at ε=0.20\varepsilon = 0.20 to 0.23 the longest runs take 128 to 145 steps — two clusters about to merge take a long time to “see” each other. Second, the share reaching consensus need not increase monotonically with ε\varepsilon: Lorenz pointed out in 2006 that at smaller ε\varepsilon consensus can “strike back” after a phase of polarisation, in a way that depends on the population size (Lorenz 2006). So “consensus → polarisation → fragmentation” is a broad trend as ε\varepsilon shrinks, not three sharply bounded phases.

The Deffuant model: major clusters and outliers

For 200 uniformly distributed initial opinions, μ=0.5\mu = 0.5 and 1,500 meetings per person on average, the program runs 12 simulations for each ε\varepsilon. Final opinions closer than 0.01 count as one cluster; clusters with at least 5 % of agents are major, the rest minor; the program compares the count with the rule of thumb ⌊1/(2ε)⌋\lfloor 1/(2\varepsilon) \rfloor and gives the distance between the two outermost major clusters.

Calculation

# Deffuant, Neau, Amblard & Weisbuch (2000): random pairs meet; if |x_i - x_j| < eps both
# move by mu = 0.5 of the gap (they meet in the middle). N = 200 opinions uniform on
# [0, 1], 1,500 meetings per agent; 12 runs per eps. Clusters = groups of final opinions
# closer than 0.01; "major" = at least 5 % of agents, the rest "minor". Rule of thumb:
# about 1/(2 eps) major clusters.
import random, statistics, math

def deffuant(n, eps, rng, mu=0.5, meetings_per_agent=1500):
    x = [rng.random() for _ in range(n)]
    for _ in range(meetings_per_agent * n // 2):
        i = rng.randrange(n); j = rng.randrange(n - 1); j += j >= i
        d = x[j] - x[i]
        if -eps < d < eps:
            x[i] += mu * d; x[j] -= mu * d
    return sorted(x)

def clusters(x, gap=0.01):
    sizes = [1]
    for a, b in zip(x, x[1:]):
        if b - a > gap: sizes.append(1)
        else: sizes[-1] += 1
    return sizes

if __name__ == "__main__":
    rng = random.Random(2000); n, R = 200, 12
    print("  eps   P(all in    major      minor    floor(1/(2 eps))  spread of"
          "   P(single")
    print("        one)        clusters   clusters                   majors      major)")
    for eps in (0.05, 0.10, 0.15, 0.20, 0.25, 0.30, 0.40, 0.50):
        maj, mino, one, spread = [], [], 0, []
        for _ in range(R):
            x = deffuant(n, eps, rng); cl = clusters(x)
            big = sum(s >= 0.05 * n for s in cl); maj.append(big)
            mino.append(len(cl) - big); one += big == 1 and len(cl) == 1
            pos, k = [], 0                          # positions of the major clusters
            for s in cl:
                if s >= 0.05 * n: pos.append(statistics.mean(x[k:k + s]))
                k += s
            spread.append(max(pos) - min(pos) if len(pos) > 1 else 0.0)
        mj, mn, sp = statistics.mean(maj), statistics.mean(mino), statistics.mean(spread)
        print(f"  {eps:.2f}     {one / R:4.2f}        {mj:5.2f}      {mn:5.2f}"
              f"           {math.floor(1 / (2 * eps)):2d}            {sp:.2f}"
              f"      {sum(m == 1 for m in maj) / R:.2f}")
#   eps   P(all in    major      minor    floor(1/(2 eps))  spread of   P(single
#         one)        clusters   clusters                   majors      major)
#   0.05     0.00         8.67       2.00           10            0.88      0.00
#   0.10     0.00         4.33       0.83            5            0.76      0.00
#   0.15     0.00         2.75       0.83            3            0.60      0.00
#   0.20     0.00         2.08       0.92            2            0.50      0.00
#   0.25     0.00         1.83       0.67            2            0.37      0.17
#   0.30     0.17         1.25       0.92            1            0.11      0.75
#   0.40     0.42         1.00       0.83            1            0.00      1.00
#   0.50     1.00         1.00       0.00            1            0.00      1.00

The number of major clusters roughly matches the rule ⌊1/(2ε)⌋\lfloor 1/(2\varepsilon)\rfloor: on average 2.75 at ε=0.15\varepsilon = 0.15 (rule: 3), 4.33 at 0.10 (rule: 5) and 8.67 at 0.05 (rule: 10), slightly below the rule when ε\varepsilon is small. Deffuant and colleagues in 2000 and Weisbuch and colleagues in 2002 both reported this regularity (Deffuant et al. 2000; Weisbuch et al. 2002), and Ben-Naim, Krapivsky and Redner found in 2003 that the bifurcation pattern of clusters repeats almost periodically in 1/ε1/\varepsilon (Ben-Naim et al. 2003). Two points deserve notice.

First, “polarisation” in the model is just two clusters, not necessarily at the extremes. At ε=0.20\varepsilon = 0.20 there are on average 2.08 major clusters, with the outermost two 0.50 apart, roughly at 0.25 and 0.75 rather than at 0 and 1. Second, when most people agree, a few “outliers” are often left at the ends: at ε=0.40\varepsilon = 0.40 all 12 runs have a single major cluster, but only 42 % have everyone in one cluster, the rest leaving minor clusters; only at ε=0.50\varepsilon = 0.50 do all runs end in a single cluster, in line with the result that ε≥0.5\varepsilon \ge 0.5 always gives consensus (Lorenz 2007). The Hegselmann–Krause model leaves no such minor clusters in its consensus region (with 500 people and ε≥0.27\varepsilon \ge 0.27 both the number of clusters and the number of major clusters are 1.00), and the two models differ in this respect; at smaller ε\varepsilon, however, the Hegselmann–Krause model also leaves a few minor clusters (in the table above, at ε=0.05\varepsilon = 0.05 there are on average 7.97 clusters, of which 7.35 are major).

Left: final positions of 500 opinions in the Hegselmann–Krause model against \varepsilon (one run per \varepsilon; the size of each dot shows the size of the cluster); as \varepsilon falls, one cluster splits into two, three and more. Right: the number of major clusters in the Deffuant model (each point the mean of 4 runs) compared with \lfloor 1/(2\varepsilon) \rfloor.

“Echo chambers”: analogy and evidence

Bounded-confidence models are often used to illustrate “echo chambers”: if people listen only to similar opinions, the group splits into pieces that no longer talk to each other. As an analogy this is suggestive, but one must separate what the model says from what it does not. The model says that under a rule of interacting only with nearby opinions, the smaller the confidence bound, the more clusters remain. It does not say that people actually update this way, nor that more contact with opposing opinions would reduce the splitting — in these models “contact” and “being influenced” are the same thing, whereas in reality they can come apart.

Evidence

Exposure to opposing views does not necessarily reduce polarisation. Bail and colleagues in 2018 recruited American Democrats and Republicans who used Twitter regularly and randomly assigned some of them to be paid to follow, for a month, a bot that retweeted messages from the other side. Republicans who followed a liberal bot became substantially more conservative afterwards; Democrats who followed a conservative bot became slightly more liberal, not significantly (Bail et al. 2018). The Facebook experiment of Nyhan, Settle, Thorson and colleagues reported in Nature in 2023 found that content from like-minded sources makes up a large share of what users see, but that experimentally reducing such content did not measurably reduce polarisation and related attitudes (Nyhan et al. 2023).

Both studies contradict the simple inference that “more exposure to opposing views breaks the echo chamber”. Bounded-confidence models themselves hint at why: opinions beyond ε\varepsilon exert no pull; add a repulsive mechanism such as “opinions too far away provoke aversion”, and contact can even widen the gap. The book makes no judgement on any real social issue.

Hypothesis · not established · The confidence bound depends on the rules of discussion

In bounded-confidence models ε\varepsilon is a fixed personal parameter. The author conjectures that it depends at least partly on the rules of discussion: if everyone must restate the other side’s reasons before disagreeing, the range over which people are willing to move towards distant opinions widens. This can be tested in numerical estimation tasks: assign two discussion rules at random, measure each person’s revision against “the difference between the other’s opinion and one’s own initial opinion”, and estimate the effective ε\varepsilon. If the estimated ε\varepsilon does not differ between the two rules, the conjecture is wrong. This is only a conjecture about rules of discussion in the laboratory and makes no political claim.

Summary

In bounded-confidence models opinions are influenced only by nearby opinions. The Hegselmann–Krause model passes from clusters to consensus at about ε≈0.2\varepsilon \approx 0.2 in large populations; in small populations the threshold is blurred, convergence near the threshold is slow, and the share reaching consensus need not be monotone. The Deffuant model gives about ⌊1/(2ε)⌋\lfloor 1/(2\varepsilon)\rfloor major clusters, often leaves outliers at the ends, and always reaches consensus for ε≥0.5\varepsilon \ge 0.5. “Polarisation” in the models is just two clusters, not necessarily at the extremes; “echo chamber” is an analogy, and field experiments do not support the simple inference that more exposure to opposing views reduces polarisation. The next chapter reads this research beside ancient discussions of “harmony” and “sameness”.

References

Bail, Christopher A., Lisa P. Argyle, Taylor W. Brown, et al. 2018. “Exposure to Opposing Views on Social Media Can Increase Political Polarization.” Proceedings of the National Academy of Sciences 115 (37): 9216–21. https://doi.org/10.1073/pnas.1804840115.
Ben-Naim, Eli, Paul L. Krapivsky, and Sidney Redner. 2003. “Bifurcations and Patterns in Compromise Processes.” Physica D 183 (3–4): 190–204. https://doi.org/10.1016/S0167-2789(03)00171-4.
Castellano, Claudio, Santo Fortunato, and Vittorio Loreto. 2009. “Statistical Physics of Social Dynamics.” Reviews of Modern Physics 81 (2): 591–646. https://doi.org/10.1103/RevModPhys.81.591.
Deffuant, Guillaume, David Neau, Frédéric Amblard, and Gérard Weisbuch. 2000. “Mixing Beliefs Among Interacting Agents.” Advances in Complex Systems 3: 87–98.
Fortunato, Santo. 2005. “On the Consensus Threshold for the Opinion Dynamics of Krause–Hegselmann.” International Journal of Modern Physics C 16 (2): 259–70.
Hegselmann, Rainer, and Ulrich Krause. 2002. “Opinion Dynamics and Bounded Confidence: Models, Analysis and Simulation.” Journal of Artificial Societies and Social Simulation 5 (3): 2.
Lorenz, Jan. 2006. “Consensus Strikes Back in the Hegselmann–Krause Model of Continuous Opinion Dynamics Under Bounded Confidence.” Journal of Artificial Societies and Social Simulation 9 (1): 8.
Lorenz, Jan. 2007. “Continuous Opinion Dynamics Under Bounded Confidence: A Survey.” International Journal of Modern Physics C 18 (12): 1819–38.
Nyhan, Brendan, Jaime Settle, Emily Thorson, et al. 2023. “Like-Minded Sources on Facebook Are Prevalent but Not Polarizing.” Nature 620 (7972): 137–44. https://doi.org/10.1038/s41586-023-06297-w.
Weisbuch, Gérard, Guillaume Deffuant, Frédéric Amblard, and Jean-Pierre Nadal. 2002. “Meet, Discuss, and Segregate!” Complexity 7 (3): 55–63.

Fan, Y. (2026). Collective Dynamics, Coupled-Oscillator Synchrony and Distributed Consensus: From the Kuramoto Phase Transition and Vicsek Flocking to DeGroot Spectral Convergence, Read Beside Classical Chinese Thought on Harmony and Conformity [集群动力学、耦合振子同步与分布式共识的数学模型] (Version 1.0.0). 5D Library. https://doi.org/10.5281/zenodo.23828063 · Licensed under Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0).