Active-inference trust-game simulations for studying partner-local affective precision as a relationship-specific confidence signal.
Anonymous review: the public code mirror for double-blind review is https://anonymous.4open.science/r/affect_aif.
affect_aif contains a pymdp-backed trust-game model, paper reproduction
configs, compact result summaries, and the manuscript source. The central
mechanism tracks partner-local prediction error in an external beta state and
maps that state into policy precision during action selection.
tasks/trust/: trust-game environments, POMDP construction, affect update, partner-local agent/runtime state, and payoff helpers. This is the core trust model package, even though it contains the agent machinery.experiments/trust/: TOML spec loading, variant expansion, batch execution, logging, and configured analysis hooks for the focal-agent paper experiments.experiments/multifocal/: tested reciprocal AIF-vs-AIF extension code. This is future work and is not used by the paper reproduction configs.configs/: public runnable TOML specs grouped by intent.scripts/: supported command-line entry points for running experiments and analyzing existing results.analysis/: post-hoc metrics, figures, and compact artifact builders.docs/: model, experiment, result, and manuscript documentation.results/: tracked compact summaries and manifests; raw CSVs are retained outside git (see Paper Result Data below).
python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"python scripts/experiment/run.py \
--config configs/demo/01_predictability_value.toml \
--workers 1Inspect a config without running it:
python scripts/experiment/inspect.py --config configs/demo/01_predictability_value.tomlDry-run the paper suite first:
python scripts/experiment/run.py \
--config configs/paper/01_predictability_value.toml \
--config configs/paper/02_deployment_ablation.toml \
--config configs/paper/03_partner_selection.toml \
--config configs/paper/04_betrayal_adaptation.toml \
--config configs/paper/05a_alpha_sweep.toml \
--config configs/paper/05b_prior_factorial.toml \
--config configs/paper/05c_forgiveness.toml \
--workers 1 \
--dry-runRemove --dry-run to launch the full reproduction. Use --workers 1 unless
you intentionally want parallel local execution.
python scripts/analysis/analyze.py \
--results results/paper/04_betrayal_adaptation/raw/betrayal_adaptation/betrayal_adaptation/results.csv \
--output-dir /tmp/affect_aif_analysisPhenotype compact tables and manuscript figures are regenerated from existing raw trajectories with:
python scripts/analysis/phenotype_artifacts.py --help
python scripts/analysis/make_paper_figures.py --helpFull per-round results.csv files for the paper suite are gitignored. The
review packet with row-level paper results is here:
Compact summaries and manifests remain under results/paper/. Regenerate raw
trajectories from configs/paper/ when needed.
configs/README.md: choose a config.docs/overview/: understand the model and hypotheses.docs/experiments/: run demos, paper configs, and diagnostics.docs/results/: inspect compact result summaries and provenance.docs/manuscript/: build and inspect the manuscript.notebooks/: demo and reproduction notebooks.
Partner-Specific Affective Precision in Social Active Inference models
relationship-specific confidence in social active inference: each partner has a
local precision estimate, updated from that partner's evidence and mapped into
policy selection during the trust game. This repository is the reference
implementation—the task, POMDP, affective-precision update, experiments, and
analysis—built on inferactively-pymdp
for belief updating and policy selection.
The manuscript is under anonymous peer review. Until publication, reference this repository and pin a commit for reproducibility. After publication, cite the paper for the model and findings.
@software{shah2026affect_aif,
title = {affect\_aif: Partner-Specific Affective Precision in Social Active Inference},
author = {Shah, Harshil and Pashea, Andrew},
year = {2026},
url = {https://github.com/har5h1l/affect_aif},
version = {0.1.0},
license = {MIT},
note = {Reference implementation on inferactively-pymdp}
}Released under the MIT License.