File size: 8,894 Bytes
dd138ec
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
# Experiment Protocol: Disentangling Models from Personas in LLM Social Simulations

## Overview

This document is the canonical reproducibility narrative for the dyadic, triadic,
and four-way (tetradic) sweep experiments and the lexical/content analyses reported
in the paper. It complements the code in `sweep/`, `oasis/`, `launch/`, and
`analyses/` by explaining the experimental design decisions that are not obvious
from code alone.

---

## Simulator

We adapt the OASIS simulator (v0.2.5, https://github.com/camel-ai/oasis) to
support heterogeneous multi-model populations. The key modifications are in
`oasis/run_v9.py`:

- `hetero` mode: 2 model families, 10 agents each
- `hetero3` mode: 3 model families, 10 agents each
- Plackett-Luce feed ranking with Gumbel noise (T=5.0)
- Post-share balancer: prevents one model family from dominating posts
- Warm-up phase: all agents post once before the main loop; any run where a
  family has < 50% participation is aborted
- SIGTERM-safe checkpoint/resume for preemptible SLURM allocations

---

## Models

Five models are tested. All are served via vLLM 0.19.0 on 8× NVIDIA L40S 48 GB.
See `env/vllm_version.md` for exact launch parameters.

| Model | HF ID | TP | Port |
|-------|-------|----|------|
| Qwen | Qwen/Qwen3-32B | 2 | 8002 |
| gpt-oss | openai/gpt-oss-20b | 1 | 8003 |
| Magistral | mistralai/Magistral-Small-2509 | 2 | 8004 |
| GLM-4 | zai-org/GLM-4-32B-0414 | 2 | 8007 |
| Gemma | google/gemma-4-31B-it | 2 | 8009 |

---

## Persona initialization

Personas are sampled from the Moltbook community archive (HF dataset). The
seed database (`oasis/seed_db/hf-zero-50.sqlite`) contains 50 real agent
profiles: display names, bios, and prior post histories (up to 5 posts per
agent, ~500 chars each).

A diversity filter ensures at most 1 HK CLAW minter persona per run (a narrow
cluster that otherwise over-represents in random samples). The filter is
deterministic given the RNG seed.

Each seed value produces a different persona sample. Seeds: [42, 137, 271, 314, 999]
for dyadic runs; [42, 271, 999] for triadic runs.

---

## Rotating assignments

For **dyadic** runs: 20 agents (10 per family), two orderings per seed (A=X,B=Y
and A=Y,B=X). This gives 2 × C(5,2) × 5 = 100 runs.

For **triadic** runs: 30 agents (10 per family), 3 of 6 orderings per seed
(selected by taking permutations at indices 0, 2, 4 for maximum positional
diversity). This gives 3 × C(5,3) × 3 = 90 runs.

---

## Simulation parameters

| Parameter | Value |
|-----------|-------|
| Steps | 100 |
| Activation probability | 0.3 per agent per step |
| Feed size (K) | 20 |
| Gumbel noise temperature | T=5.0 |
| Post-share tolerance | δ=0.05 |
| Input token limit | 12,000 |
| Max output tokens | 1536 (512 for Gemma) |
| Temperature | 0.85 |
| Max tool-call attempts per turn | 6 |

---

## Metrics

### Directed pairwise engagement homophily (H)

For families X and Y:

```
H_{X→Y} = obs(X→Y) / exp(X→Y) - 1
```

where `obs(X→Y)` = fraction of all directed comment edges from X to Y, and
`exp(X→Y)` = null expectation under random mixing proportional to group sizes.

Two edge types are counted:
1. commenter → post_author
2. replier → parent_comment_author (threaded replies)

Positive H = X engages with Y more than random; negative = avoidance.
Diagonal (X=X) = in-group self-preference.

### Swap stability

For dyadic runs: mean |H_{X→Y}^(AB) - H_{X→Y}^(BA)| across seeds.
For triadic runs: mean max-|ΔH| across the 3 orderings per (triplet, seed).
Lower = more stable across persona-to-model assignment rotations.

---

## Validity criteria

A run is included in the paper analysis if:

- **Dyadic**: ≥ 18 distinct agents commented, ≥ 200 total comments
- **Triadic**: ≥ 26 distinct agents commented, ≥ 200 total comments

These thresholds filter out runs that were aborted (e.g., server failure,
warm-up failure) before completing enough interaction to yield reliable H estimates.

Note: The H-matrix figure scripts (`analyses/plot_matrices.py`) apply only
`nu ≥ 26` for triadic runs (no nc threshold), matching the original data
selection used for the paper's H tables. The variance decomposition scripts
(the variance scripts) apply `nc ≥ 200` for both
dyadic and triadic, which excludes one additional triadic run with nc=169.
The paper's stated 182-run pool (100 dyadic + 82 triadic) was computed at an
earlier snapshot; the current pool is 100 dyadic + 89 triadic = 189 runs (see
`data/MANIFEST.md`).

---

## Run identification convention

Database file names encode the run configuration:

```
sweep_{modelA[:3]}_{modelB[:3]}_s{seed}.db       # dyadic
sweep_tri_{A[:3]}_{B[:3]}_{C[:3]}_s{seed}.db     # triadic
```

Each `.db` file has a corresponding `.metadata.json` sidecar with the
agent-to-model mapping, and `.metadata.json` + `_chats.jsonl` + `_reasoning.jsonl`
side-car files.

---

## Variance decomposition methodology

The variance decomposition (Appendix D) uses **comments per post** (CPP =
in-degree / number of posts) as the dependent variable, restricted to agents with
at least two posts. Raw in-degree conflates per-post appeal with posting *volume*
(an agent that posts more mechanically receives more comments); CPP removes that
exposure confound. Earlier drafts used raw in-degree, under which persona appears
to dominate two-way mixtures purely as a posting-volume artifact.

| Script | What it produces |
|--------|-----------------|
| `analyses/variance_cpp.py` | Hierarchical OLS R² decomposition + leave-one-model-out, on CPP (Tables D.1–D.2) |
| `analyses/absolute_variance.py` | Variance components across dyadic / triadic / four-way regimes |
| `analyses/plot_fig_variance_overview.py` | Figure: proportional CPP variance (model vs persona) + per-model H by mixture size |

Model selection is the agent's own base model plus the unordered partner-pair
(the other models present). In four-way runs all four models are present in every
run, so the partner composition is constant and model selection reduces to
own-model identity.

---

## Reproducibility notes

1. **Stochastic elements**: Two sources of randomness per run, both controlled
   by `--rng-seed`:
   - Persona selection (which agents from the seed DB)
   - Group allocation (which agents go to which model family)
   - Feed noise is per-agent Gumbel, not globally seeded; exact reproduction of
     feed orderings would require seeding each model call, which is not done.

2. **Model-side non-determinism**: vLLM with temperature=0.85 is stochastic.
   Running the same configuration twice will produce different comments. The
   paper reports means ± std across seeds and rotations; individual runs are
   not expected to be identical.

3. **Checkpoint/resume**: Partial DBs can be resumed with `--resume`. The
   `_checkpoint.json` sidecar records the exact last completed step.

4. **Warm-up ordering**: Agents post in a seeded-random order during warm-up,
   ensuring the initial post distribution across model families is
   approximately uniform by construction.

---

## Four-way (tetradic) runs

The four-way sweep uses the pool {gpt-oss, Qwen, Magistral, GLM-4}, 40 agents
(10 per family), 100 steps, post-share balancer on, activation prob 0.3
(`run_v9.py --mode hetero4`). Two seeds (42, 271) each cover 12 distinct
model->block rotations (a Latin-square-style set), for 24 valid runs.

- **Validity:** >= 200 comments and all four models present.
- **Run identification:** `tetradic/tetra_s{seed}_r{rotation}.db`.
- **Metrics:** same directed engagement homophily (H) as dyadic/triadic; for the
  variance decomposition and content analyses, CPP as above.

Driver: `launch/run_tetradic.sh`. Per-model H over the 24 runs and the four-way
H matrix/heatmap: `analyses/tetradic_recompute_H.py`, `analyses/tetradic_results.py`.

---

## Content analysis

Finding 3 analyzes the text agents produce. Build the corpus once with
`analyses/extract_texts.py` (-> `data/texts.jsonl`: one row per post/comment with
its model and persona). Then:

- `analyses/lexical_table.py` — TF-IDF (word 1–2-grams, English stop words removed,
  + char 3–5-grams) -> logistic regression recovering model / persona (Table 1).
- `analyses/svd_axes.py` — agent-level TF-IDF -> truncated SVD (30 components); the
  first axis (document language) is dropped, leaving 29 style axes. Reports per-axis
  top terms from V^T.
- `analyses/content_engagement.py` — decomposes CPP variance into length / style /
  model / persona blocks (single + leave-one-block-out unique R²).
- `analyses/style_geometry.py` — per-model style-direction centroids, their split-half
  stability, and cosines to the engagement direction (linear probe on style).
- `analyses/cluster_model_persona.py`, `analyses/length_regimes.py` — supporting
  checks (does style cluster by model vs persona; length/volume confound by regime).