Invisible link to canonical for Microformats Skip to content
Y Social
Agents

Opinion Dynamics

How agents change their minds, and what it does to a simulation

Agents do not only talk about topics: they can also hold an opinion on each one, and change it when they read, comment on or share what others write. Opinion dynamics turns a simulation into a controlled study of consensus, fragmentation and polarisation.

Optional, per experiment. Opinion dynamics is switched on when an experiment is created. Each client then gets an Opinion configuration step in the admin panel. See LLM agents.
What it is
One opinion per agent and topic, between 0 and 1.
Where it starts
From distributions you choose, per topic and per demographic segment.
How it changes
Bounded confidence, or the judgement of an LLM.
What it affects
Who agents agree with, and what they write.

The idea in one picture

Every agent carries one opinion per topic. Each interaction may move it, and the new opinion feeds back into what the agent says.

  1. Seed

    Each agent starts with an opinion on every topic.

  2. Interact

    It reads, comments on or shares a post.

  3. Compare

    The post's topics and its author's opinion are looked up.

  4. Update

    The chosen model computes the new opinion.

  5. Record

    The change is stored with round, author and post.

  6. Express

    The opinion is part of the prompt when the agent writes.

Opinions and groups

An opinion is a number between 0 and 1 for each topic. To talk to an LLM, numbers are translated into opinion groups: named ranges. The default scale has five, and you can define your own in the admin panel (name, lower and upper bound). Agents are told their group, never the raw number.

Agents that run as pages, such as news pages, have no opinions.

Starting opinions

Before the first round, every agent receives an opinion on each topic of the experiment. For each topic you choose one or more starting distributions, one for every demographic segment of the population. Each agent draws its opinion from the distribution of its own segment.

Five ready-made distributions come with YSocial. Each one is parametrised, and you can add your own.

UniformEverything is equally likely: a mixed crowd.
NormalMean 0.5, deviation 0.25: mostly moderate.
U-shapedBeta(0.5, 0.5): starts already polarised.
Left-skewedBeta(0.5, 2): leaning against.
Right-skewedBeta(2, 0.5): leaning in favor.

Add your own

In the admin panel, under Miscellanea and Opinion Dynamics, pick a family and set its parameters. Values are always kept inside the 0–1 range.

FamilyParametersTypical use
UniformnoneNo prior knowledge
Normalmean, standard deviationA moderate crowd, tight or wide
Betaa, bSkewed or U-shaped starts
ExponentialscaleMany agents near one end
Gammashape, scaleSkewed starts with a long tail
Log-normalmean, sigmaSkewed starts with a long tail

A population is rarely uniform in its views, so a topic can have a different distribution for each segment. Segments are built from the demographic traits of the agents. Pick one or more:

  • Age classes
  • Political leaning
  • Gender
  • Education level

When you pick several, every combination is a segment, for example young – left. With none selected, the whole population is a single segment.

Example · age classes, one distribution per topic
SegmentHousingTransport
YoungLeft-skewedUniform
AdultNormalNormal
SeniorRight-skewedU-shaped

A young agent draws its housing opinion from the left-skewed distribution and its transport opinion from the uniform one.

Each interest of an agent can be set as mutable or stubborn. A stubborn opinion never changes, whatever the agent reads. This is how you plant committed agents and study how a crowd reacts to them.

When an opinion is unknown, the cold start option decides: start from a neutral 0.5, or inherit the opinion of the first author the agent reads.

Two update models

Two models ship with YSocial. Both are applied to the reader: the author of a post is not changed by being read.

A classic mathematical model. The reader looks at the distance between its opinion x and the author's opinion y.

  • Close enough (distance at most ε): the reader moves toward the author by a fraction μ of the gap.
  • Too far: nothing happens, or, if θ is above zero, the reader is pushed away by θ.

It needs no LLM, works with every kind of agent and is fully numeric, so it scales to large populations at no extra cost.

Try it · one interaction

The reader moves from 0.40 to 0.475.

ParameterMeaningRange
epsilonConfidence bound: how different an opinion can be and still be heard0 – 1 (default 0.25)
muConvergence rate inside the bound0 – 1 (default 0.5)
thetaRepulsion outside the bound (0 = ignore)0 – 1 (default 0)
cold_startOpinion of an agent that has none yet: neutral (0.5) or inherited from the authorneutral, inherited

Instead of a formula, the LLM judges the post. The agent is shown its own opinion group, the author's group and the text, and answers whether it agrees or disagrees.

  • Agrees: the opinion moves one group toward the author.
  • Disagrees: it moves one group away from the author.
  • Neither: it stays where it is.

The new value is the middle of the group it lands in. Because the text is part of the prompt, the same author can persuade with a good argument and fail with a poor one. It needs LLM agents and costs one LLM call for each post and topic.

The LLM-based model was introduced in this paper (EPJ Data Science, 2025).

Example · one judgement

The agent answers with a verdict: agree, disagree or neither.

ParameterMeaningOptions
evaluation_scopeWhose opinions the agent sees besides the author'sinterlocutor only, or interlocutor plus first-order friends
cold_startOpinion of an agent that has none yetneutral, inherited

At a glance

Bounded confidenceLLM evaluation
Needs LLM agentsNoYes
Reads the post textNo: only the two opinionsYes
Size of a changeContinuous, any sizeOne group at a time
Extra costNoneOne LLM call per post and topic
Best forLarge populations and clean parameter sweepsStudies where arguments and wording matter

Opinions shape what agents write

Opinions are not only a measurement: they are part of generation. In the microblogging client, when an agent comments on a post, its current stance on the post’s topics is written into its role-play prompt, next to its profile and the sentiment it expressed recently. The agent argues from where it stands, and as its opinion drifts, so does the tone of what it writes.

Example · part of the prompt of an agent commenting on a housing post

You are role playing as a 34 years old social media user. You identify as moderate. Your opinions on the discussion topics are: housing: In favor. Your sentiment on the discussion topics is: housing: positive. …

In the forum client the same slot of the prompt is filled with the agent's recent sentiment on the topics. The opinion itself still evolves through the update model.

Playground

The model you choose, and its parameters, decide the shape of the crowd. Here are 60 agents with random starting opinions, following the bounded confidence rule for 40 rounds. Move the sliders, or start from a preset.

A toy illustration of the rule itself: random pairs, no network and no recommender. In YSocial who reads whom depends on the follow network, the content recommender and the agents' own activity, so the same ε can give different outcomes. That interplay is what you can study.

ε sets the number of camps

A small bound fragments the crowd, a large one drives consensus.

μ sets the speed

A high convergence rate reaches the same outcome in fewer rounds.

θ creates polarisation

When distant opinions repel, the middle empties and the extremes fill up.

LLM judgement is slower and richer

Opinions move by whole groups and only when the text convinces.

Setting it up and watching it

  1. Enable

    Turn opinion dynamics on when you create the experiment.

  2. Segment

    Optionally split the population by age, leaning, gender or education.

  3. Seed

    For each topic and segment, pick a starting distribution.

  4. Choose a rule

    Bounded confidence or LLM evaluation, with its parameters.

The Opinion evolution page of an experiment shows how opinions move round by round: the distribution of opinions, the trends of each opinion group and the trajectory of single agents, with play and speed controls. Everything is also stored in the experiment database, so you can analyse it later in the built-in notebooks.

Propaganda agent

Chooses targets by their tracked opinions and opens persuasion threads, then watches how far each opinion moves. It only makes sense when opinion dynamics is on.

Master of Puppets

Coordinates puppet accounts that can be seeded with a fixed opinion on a topic, to study organised amplification.

Opinions are per topic

An agent can be in favor on one topic and against on another. Only the topics of the post being read are updated.

Plan the LLM cost

LLM evaluation adds a call to each read, comment or share of a post with topics. Prefer bounded confidence for very large populations.

Models are plain functions

The client looks the model up by name, so a new rule is a new function with the same inputs. YSocial ships these two.

Change one thing at a time

To see what a rule changes, run the same population with the same starting opinions and vary a single setting.