Skip to content

S2-group/conflict-humans-ai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

90 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

conflict-humans-ai

This repository contains the replication package and dataset of the study titled "Neither human nor rational: how artificial intelligence reshapes conflict". The work is currently under submission.

Project layout

  • scripts/llm-prompter/ — main experiment drivers, provider config, and Prompter templates.
  • scripts/decision-classification/ — classification helper and label schema.
  • data/ — prompt plans, datasets and intermediate outputs.
  • scripts/data_analysis/ — R scripts and analysis artifacts.

Getting started

Prerequisites

  • Python 3.12+ recommended
  • Git

Quick setup (recommended)

  1. Clone the repository and enter the folder.
  2. Create and activate a Python virtual environment:
python3 -m venv .venv
source .venv/bin/activate
  1. Install dependencies for the subproject you plan to run. Example for llm-prompter:
pip install -r scripts/llm-prompter/requirements.txt

For the decision-classification helper:

pip install -r scripts/decision-classification/requirements.txt
  1. Create a .env file with your provider API keys (see scripts/llm-prompter/README.md for details).

Running experiments

Sequential (small runs)

Change to the scripts/llm-prompter folder and run main.py:

cd scripts/llm-prompter
python3 main.py -i ../../data/prompts_plan_FULL_30_REP.json \
	-o ./replication-outputs/replication.json \
	-p ./llm_provider_config.json \
	--llm Mistral-Large-2407 --temp 0.0 --delay 5

Parallel (large-scale)

Use parallel_main.py for parallelized runs. The script creates checkpoints under prompter_checkpoints/ and logs under logs/.

python3 parallel_main.py -i ../../data/prompts_plan_FULL_30_REP.json \
	-o ./replication-outputs/replication.json -p ./llm_provider_config.json --delay 5

Recovering checkpoints

If a run is interrupted, use recover_checkpoints.py (see scripts/llm-prompter/README.md) to merge checkpoint data into a new input file and resume.

Classification helper

scripts/decision-classification/classify.py labels CSV rows using an LLM. Example (via .vscode launch config):

python3 scripts/decision-classification/classify.py -i data/manually_classified_data.csv -c answer --limit 20 --output output/result-test.csv --model azure/gpt-5-chat --categories scripts/decision-classification/categories.json

Notes

  • By default the script will overwrite the input file if --output is not provided; see the script's warnings.
  • Use --restore to skip rows that are already classified and resume a previous run.

Configuration

  • Provider mapping and model flags: scripts/llm-prompter/llm_provider_config.json.
  • Per-subfolder requirements.txt files list Python dependencies.
  • Environment variables and API keys should be stored in a .env file (not committed).

Where to get help

License

This project includes a LICENSE file. Refer to it for license terms.

About

Replication package of the study titled "Neither human nor rational: how artificial intelligence reshapes conflict"

Resources

License

Stars

Watchers

Forks

Contributors