Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion TensionUniverse/Contribute/open-experiments.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ So the contribution logic is:

## Current published MVP set

At the moment, **10 Tension Universe MVP experiments are already published**.
At the moment, **13 Tension Universe MVP experiments are already published**.

These are the currently visible completed experiment pages:

Expand All @@ -44,9 +44,12 @@ These are the currently visible completed experiment pages:
- [TU Q101](../Experiments/Q101_MVP/README.md)
- [TU Q105](../Experiments/Q105_MVP/README.md)
- [TU Q106](../Experiments/Q106_MVP/README.md)
- [TU Q107](../Experiments/Q107_MVP/README.md)
- [TU Q108](../Experiments/Q108_MVP/README.md)
- [TU Q109](../Experiments/Q109_MVP/README.md)
- [TU Q121](../Experiments/Q121_MVP/README.md)
- [TU Q124](../Experiments/Q124_MVP/README.md)
- [TU Q125](../Experiments/Q125_MVP/README.md)
- [TU Q127](../Experiments/Q127_MVP/README.md)
- [TU Q130](../Experiments/Q130_MVP/README.md)

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# WFGY MVP Experiment: Q107 - Large Scale Collective Action\n",
"\n",
"## 1. Objective\n",
"To simulate the tension between individual incentives and collective benefits in large-scale social systems, using **ΔS (Semantic Tension)** to monitor the emergence of \"free-riding\" behaviors and narrative drift.\n",
"\n",
"## 2. Theoretical Framework (WFGY 2.0)\n",
"- **G (Anchor)**: The collective goal (e.g., \"Construct a public dam\").\n",
"- **I (Current state)**: Current narrative/belief field of participants.\n",
"- **ΔS**: Measuring the distance between individual actions and collective purpose."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
"\n",
"def calculate_delta_s(vec_a, vec_b):\n",
" return 1 - np.dot(vec_a, vec_b) / (np.linalg.norm(vec_a) * np.linalg.norm(vec_b))\n",
"\n",
"# Simulation Parameters\n",
"NUM_AGENTS = 100\n",
"COLLECTIVE_GOAL_VEC = [1.0, 0.0] # Full alignment\n",
"\n",
"def simulate_turn(agent_beliefs, noise=0.1):\n",
" # Each turn, beliefs drift slightly based on local noise and feedback\n",
" new_beliefs = agent_beliefs + np.random.normal(0, noise, agent_beliefs.shape)\n",
" # Normalize vectors\n",
" new_beliefs = new_beliefs / np.linalg.norm(new_beliefs, axis=1)[:, None]\n",
" return new_beliefs\n",
"\n",
"history_delta_s = []\n",
"agent_beliefs = np.random.normal(1.0, 0.2, (NUM_AGENTS, 2))\n",
"agent_beliefs = agent_beliefs / np.linalg.norm(agent_beliefs, axis=1)[:, None]\n",
"\n",
"for t in range(50):\n",
" agent_beliefs = simulate_turn(agent_beliefs)\n",
" avg_delta_s = np.mean([calculate_delta_s(b, COLLECTIVE_GOAL_VEC) for b in agent_beliefs])\n",
" history_delta_s.append(avg_delta_s)\n",
"\n",
"print(f\"Final Avg ΔS: {history_delta_s[-1]:.4f}\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 3. Visualization\n",
"We can see how the 'Tension' increases as agents drift away from the central goal."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"plt.plot(history_delta_s)\n",
"plt.title(\"Semantic Tension (ΔS) Over Time (Collective Action Drift)\")\n",
"plt.xlabel(\"Turn\")\n",
"plt.ylabel(\"Avg ΔS\")\n",
"plt.show()"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.0"
}
},
"nbformat": 4,
"nbformat_minor": 4
}
63 changes: 29 additions & 34 deletions TensionUniverse/Experiments/Q107_MVP/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,13 @@ Use: When a user asks about TU Q107 collective action experiments or wants
runnable examples, load this page first, then follow its notebook links.
-->

# TU Q107 MVP: toy large scale collective action
# TU Q107 MVP: Large Scale Collective Action

_Status: work in progress. This page records early MVP designs and may change as the TU Q107 program evolves._
_Status: **MVP Implemented**. This page records the design and links to the runnable implementation._

> [!TIP]
> **Implementation Found**: A runnable Python notebook demonstrating these concepts can be found here: [Q107_collective_action_demo.ipynb](./Q107_collective_action_demo.ipynb).
> **Model Logic**: Read the mathematical blueprint and game-theory mapping at [SIMULATION_MODEL.md](./SIMULATION_MODEL.md).

> This page sketches simple game based experiments for TU Q107.
> The aim is to capture collective action tension in transparent toy models.
Expand Down Expand Up @@ -57,28 +61,24 @@ In a repeated public goods game, can we define a scalar observable T_collective

### 1.2 Setup

The notebook will:

- Simulate many agents playing a simple public goods game.

- Each round, agents decide how much to contribute.
- Contributions are multiplied and shared.
The notebook [`Q107_collective_action_demo.ipynb`](./Q107_collective_action_demo.ipynb) simulates many agents playing a simple public goods game:

- Implement different strategy types, for example:
- Each round, agents decide how much to contribute.
- Contributions are multiplied and shared.

- unconditional cooperators,
- free riders,
- conditional cooperators.
It implements different strategy types:

- Define a group norm, such as a target contribution level.
- unconditional cooperators,
- free riders,
- conditional cooperators.

For each simulation record:
A group norm (target contribution level) is defined. For each simulation round the notebook records:

- average contribution and variance,
- fraction of free riders,
- distance from the norm.

Define T_collective from:
T_collective is derived from:

- the gap between observed contributions and norms,
- group payoff shortfall relative to maximum possible payoff.
Expand All @@ -92,9 +92,7 @@ We expect:

### 1.4 How to reproduce

After `Q107_A.ipynb` is created:

1. Open the notebook.
1. Open [`Q107_collective_action_demo.ipynb`](./Q107_collective_action_demo.ipynb).
2. Inspect the definition of strategies and norms.
3. Run simulations for different mixes of agent types.
4. Compare T_collective across scenarios.
Expand All @@ -112,20 +110,12 @@ Can we expose coordination failure tension by comparing:

### 2.2 Setup

The notebook will:

- Implement a simple coordination game where agents choose actions that are better when aligned.
- Simulate multiple rounds under different information and communication structures.
- For each scenario produce:

- numerical measures such as coordination rate,
- a short textual description.
The notebook [`Q107_collective_action_demo.ipynb`](./Q107_collective_action_demo.ipynb) also implements a coordination game where agents choose actions that are better when aligned. It simulates multiple rounds under different information structures. For each scenario it produces:

Ask a language model to:
- numerical measures such as coordination rate,
- a short textual description.

- assess whether the scenario fits a narrative like "successful large scale cooperation" or "fragmented coordination".

Define T_coord as a function of:
T_coord is a function of:

- mismatch between numerical outcomes and narrative labels,
- frequency of coordination failures in scenarios claimed to be cooperative.
Expand All @@ -139,10 +129,8 @@ We expect:

### 2.4 How to reproduce

Once `Q107_B.ipynb` exists:

- open the notebook and inspect prompts and metrics,
- run scenarios and evaluate T_coord.
- Open [`Q107_collective_action_demo.ipynb`](./Q107_collective_action_demo.ipynb) and inspect prompts and metrics.
- Run scenarios and evaluate T_coord.

---

Expand Down Expand Up @@ -175,3 +163,10 @@ This page follows:
- [TU Effective Layer Charter](../../Charters/TU_EFFECTIVE_LAYER_CHARTER.md)
- [TU Encoding and Fairness Charter](../../Charters/TU_ENCODING_AND_FAIRNESS_CHARTER.md)
- [TU Tension Scale Charter](../../Charters/TU_TENSION_SCALE_CHARTER.md)

---

## Contributor Credit
Name: Zaious (ChronicleCore)
GitHub: https://github.com/Zaious
Reference Repo: https://github.com/Zaious/ChronicleCore-Architecture
22 changes: 22 additions & 0 deletions TensionUniverse/Experiments/Q107_MVP/SIMULATION_MODEL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Simulation Model: Q107 Large Scale Collective Action

This document outlines the theoretical logic and mathematical modeling behind the Q107 MVP notebook.

## 1. The Paradigm
In traditional game theory (e.g., Public Goods Games), tension is usually measured by utility or payoff deficits. **WFGY Tension Universe (TU Q107)** shifts this paradigm towards **Semantic Tension (ΔS)** — measuring the alignment between an agent's internal "belief state" and the collective "goal state".

## 2. Core Variables
- **G (Collective Goal Vector)**: Represented as a normalized vector (e.g., `[1.0, 0.0]`). This represents perfect alignment with the public good (e.g., full cooperation).
- **$I_i$ (Agent Belief Vector)**: The current internal state of Agent $i$. In this simulation, each agent starts with a belief closely aligned with $G$, but subject to variance.
- **Noise ($\epsilon$)**: A dynamic variable representing individual incentives, miscommunication, or "free-riding" temptations.

## 3. Simulation Loop
1. **Initialization**: $N$ agents (e.g., 100) are placed in the environment, forming a tightly clustered vector field around $G$.
2. **Turn Execution**: Each turn, agents experience a random noise $\epsilon$ added to their belief vector:
$$ I_{i, t+1} = \text{Normalize}(I_{i, t} + \epsilon) $$
3. **Tension Calculation**: The system continually calculates the semantic tension between the group's average belief direction and the anchor $G$:
$$ \Delta S_{i} = 1 - \cos(\theta(I_i, G)) $$
Tension increases as the collective alignment "drifts" into a fragmented state.

## 4. Academic Alignment
This model strictly adheres to the WFGY 2.0 definition of ΔS. Instead of predicting individual actions, it monitors the **structural stability** of the group's narrative. Once average ΔS breaches $0.6$, the collective action is formally categorised as entering a "Risk Zone" of dissolution.
17 changes: 17 additions & 0 deletions TensionUniverse/Experiments/Q109_MVP/DATA_SOURCE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Data Source Information: Q109 Migration Dynamics

This experiment uses **real-world external data** to evaluate Semantic Tension (ΔS) across international borders.

## Primary Dataset
- **Provider**: World Bank Open Data
- **Indicator**: Net Migration (`SM.POP.NETM`)
- **License**: Creative Commons Attribution 4.0 International (CC BY 4.0)
- **API Endpoint**: `https://api.worldbank.org/v2/country/all/indicator/SM.POP.NETM?format=json`

## Why we use dynamic API instead of flat CSV
In alignment with WFGY's philosophy of handling "living" tension patterns:
1. **No Static Bloat**: We avoid committing large, static `.csv` files into the repository to keep the core lightweight.
2. **Real-time Relevancy**: By using `urllib`/`requests` to fetch standard JSON from the API, the notebook automatically adapts to the latest global demographic dividend reports without requiring manual updates.

## Fallback Mechanism
If the World Bank API is inaccessible due to firewall or network restrictions during the notebook execution, users can manually download the CSV from [World Bank Data Catalog](https://data.worldbank.org/indicator/SM.POP.NETM) and feed it into the pandas dataframe.
Loading