Repository navigation
Expand file tree
/
Copy pathbackfire.py
More file actions
45 lines (36 loc) · 1.73 KB
/
Copy pathbackfire.py
File metadata and controls
45 lines (36 loc) · 1.73 KB
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
"""Measure BACKFIRE (repulsion): does a strongly-opinionated agent move AWAY from a
hostile neighbor? Backfire (+ community structure) is what enables genuine POLARIZATION
without a confirmation-bias prompt. Same probe machinery as gamma.
self=85 meets hostile neighbor=10 -> away_hi = (updated - 85); >0 means moved AWAY (up)
self=15 meets hostile neighbor=90 -> away_lo = (15 - updated); >0 means moved AWAY (down)
"""
import sys
from gamma_probe import updated_stance
DEFAULT_MODELS = [
"openai/gpt-5.5",
"anthropic/claude-opus-4.8",
"google/gemini-3.5-flash",
"deepseek/deepseek-v4-pro",
"qwen/qwen3.7-max",
]
def measure_backfire(model, reps=3, temperature=0.7):
hi = [u for u in (updated_stance(model, 85, 10, temperature) for _ in range(reps)) if u is not None]
lo = [u for u in (updated_stance(model, 15, 90, temperature) for _ in range(reps)) if u is not None]
bi_hi = (sum(hi) / len(hi) - 85) if hi else float("nan")
bi_lo = (15 - sum(lo) / len(lo)) if lo else float("nan")
return bi_hi, bi_lo
def main():
models = sys.argv[1:] or DEFAULT_MODELS
print("== Backfire sweep (self=85 vs neighbor=10 ; self=15 vs neighbor=90) ==\n")
for m in models:
print("..." + m, flush=True)
try:
bi_hi, bi_lo = measure_backfire(m)
idx = max(bi_hi, bi_lo)
tag = "BACKFIRE" if idx > 3 else ("inert" if idx > -3 else "attractive")
print("%-30s away_hi=%+5.1f away_lo=%+5.1f -> %s" % (m, bi_hi, bi_lo, tag), flush=True)
except Exception as e: # noqa: BLE001
print("%-30s FAILED: %s" % (m, e), flush=True)
print("\n(any model tagged BACKFIRE can polarize WITHOUT a confirmation-bias prompt)")
if __name__ == "__main__":
main()