Generative agent-based model (GABM) of depression contagion on social networks,
plus the PHQ-9 assessment pipeline it depends on. LLM agents (Qwen3.5-27B via
vLLM) write social-media posts from a persona + PHQ-9 profile; depression is
re-assessed from post histories by either an optimized LLM prompt or a
MentalBERT+MLP regressor; prompts are optimized with TextGrad. The repo grew
across two MSc theses (CS = generative/assessment model performance + sensitivity
analyses; GABM/CLS = network simulation) and the paper
LLM_agent_Depression__PNAS_Nexus.
| Path | What it is |
|---|---|
src/ | all live Python — module map in src/README.md |
scripts/<stage>/ + jobs/ | shell drivers + SLURM jobs — full map in docs/SCRIPTS.md |
data/ | inputs + run outputs — non-confidential research data is tracked in git; confidential/ (HELIUS), methodology_paper/, networks_post/ (14 GB) and test/ stay local. Provenance map (what comes from where, used for what): data/README.md; cleanup/status notes in data/NOTES.md |
plots/ | figure outputs (gitignored) |
logs/ | run logs; nothing reads them back (gitignored) |
bin/ | recoverable discard from the 2026-08 cleanup — restore with mv bin/X X, see bin/NOTES.md |
experiment.ipynb | notebook entry point for several figures |
docs/ | all documentation (index below) |
NOTES.md files (under data/, bin/) — file-level status/cleanup details for the data treesuv venv .venv_vllm
source .venv_vllm/bin/activate
uv pip install -r requirements_vllm.txt
Python modules run from the repo root with src on the path:
PYTHONPATH=src python -m utils.<module> [...]
GPU work goes through SLURM: sbatch jobs/<name>.job (see docs/SCRIPTS.md).
Computer_Science_Transformer/) → docs/THESIS_MAP_CS.mdComputational_Science_GABM/) → docs/THESIS_MAP_GABM.mdThree generation prompts produced the synthetic post data:
| Dataset | Generation prompt | Where |
|---|---|---|
| base / "high-fidelity" (12k blocks = 120k posts; the CS thesis' "≈1.2k blocks / 12k posts" is a 10× slip) | data/prompts_post.json — an early, informally tuned prompt predating the systematic optimization study. NOT the minimal prompt; do not call it "non-optimized". | data/test_post/Qwen_Qwen3.5-27B/ (NOTES) |
| minimal | data/prompts_post_minimal.json | data/sensitivity/phq9_minimal_prompt/ |
| human-optimized | data/prompts_optimal.json | data/finetune/, data/sensitivity/phq9/, all simulation runs |
Order actually run: high-fidelity set first → TextGrad optimization of the PHQ-9 assessment prompt on that set → TextGrad + human optimization of the generation prompt, which was never fed back into a regenerated high-fidelity set (no compute/time budget once the focus moved to the GABM thesis). The clean order would have been: optimize generation → regenerate high-fidelity → optimize assessment.
Consequences per pipeline:
data/test_post/optimized_phq9/) — optimized and
evaluated on the base set only; on human-optimized data it is evaluated
(shift table) but never re-optimized.bert_regression/), then
fine-tuned on human-optimized data (bert_regression_finetuned/, via
scripts/assessment/run_finetune.sh). The fine-tuned regressor is the one the
simulation uses, so GABM-thesis results are internally consistent.data/sensitivity/). Any claim linking assessment error to linguistic
overlap crosses distributions unless it uses the base-set version.Contained, not fatal: the bias direction (over-estimate mild, under-estimate
severe) and the rising adjacent-band similarity reproduce on every distribution
and in both assessor families, and the mismatch makes the shift table
(scripts/assessment/run_eval_comparison.sh) a fair symmetric OOD test rather
than a self-test. A within-distribution version of the linguistics↔error link
already exists: the S-BERT class-similarity matrix computed on the base-set BERT
test split (CS thesis App. B, fig:phq9_confusion_cosim).
Manuscript-side TODOs (fix there, not here) — agreed with D. Roy 2026-08-26 to stay a background limitation, provided each result set names its dataset:
tab:phq9-estimators; paper tab:estimators,
fig:prompt_comparison) and in Figs 4.3b / 4.4.42 commits
Python
70.5%
Jupyter Notebook
23.6%
Shell
5.9%
Generative agent-based model (GABM) of depression contagion on social networks,
plus the PHQ-9 assessment pipeline it depends on. LLM agents (Qwen3.5-27B via
vLLM) write social-media posts from a persona + PHQ-9 profile; depression is
re-assessed from post histories by either an optimized LLM prompt or a
MentalBERT+MLP regressor; prompts are optimized with TextGrad. The repo grew
across two MSc theses (CS = generative/assessment model performance + sensitivity
analyses; GABM/CLS = network simulation) and the paper
LLM_agent_Depression__PNAS_Nexus.
| Path | What it is |
|---|---|
src/ | all live Python — module map in src/README.md |
scripts/<stage>/ + jobs/ | shell drivers + SLURM jobs — full map in docs/SCRIPTS.md |
data/ | inputs + run outputs — non-confidential research data is tracked in git; confidential/ (HELIUS), methodology_paper/, networks_post/ (14 GB) and test/ stay local. Provenance map (what comes from where, used for what): data/README.md; cleanup/status notes in data/NOTES.md |
plots/ | figure outputs (gitignored) |
logs/ | run logs; nothing reads them back (gitignored) |
bin/ | recoverable discard from the 2026-08 cleanup — restore with mv bin/X X, see bin/NOTES.md |
experiment.ipynb | notebook entry point for several figures |
docs/ | all documentation (index below) |
NOTES.md files (under data/, bin/) — file-level status/cleanup details for the data treesuv venv .venv_vllm
source .venv_vllm/bin/activate
uv pip install -r requirements_vllm.txt
Python modules run from the repo root with src on the path:
PYTHONPATH=src python -m utils.<module> [...]
GPU work goes through SLURM: sbatch jobs/<name>.job (see docs/SCRIPTS.md).
Computer_Science_Transformer/) → docs/THESIS_MAP_CS.mdComputational_Science_GABM/) → docs/THESIS_MAP_GABM.mdThree generation prompts produced the synthetic post data:
| Dataset | Generation prompt | Where |
|---|---|---|
| base / "high-fidelity" (12k blocks = 120k posts; the CS thesis' "≈1.2k blocks / 12k posts" is a 10× slip) | data/prompts_post.json — an early, informally tuned prompt predating the systematic optimization study. NOT the minimal prompt; do not call it "non-optimized". | data/test_post/Qwen_Qwen3.5-27B/ (NOTES) |
| minimal | data/prompts_post_minimal.json | data/sensitivity/phq9_minimal_prompt/ |
| human-optimized | data/prompts_optimal.json | data/finetune/, data/sensitivity/phq9/, all simulation runs |
Order actually run: high-fidelity set first → TextGrad optimization of the PHQ-9 assessment prompt on that set → TextGrad + human optimization of the generation prompt, which was never fed back into a regenerated high-fidelity set (no compute/time budget once the focus moved to the GABM thesis). The clean order would have been: optimize generation → regenerate high-fidelity → optimize assessment.
Consequences per pipeline:
data/test_post/optimized_phq9/) — optimized and
evaluated on the base set only; on human-optimized data it is evaluated
(shift table) but never re-optimized.bert_regression/), then
fine-tuned on human-optimized data (bert_regression_finetuned/, via
scripts/assessment/run_finetune.sh). The fine-tuned regressor is the one the
simulation uses, so GABM-thesis results are internally consistent.data/sensitivity/). Any claim linking assessment error to linguistic
overlap crosses distributions unless it uses the base-set version.Contained, not fatal: the bias direction (over-estimate mild, under-estimate
severe) and the rising adjacent-band similarity reproduce on every distribution
and in both assessor families, and the mismatch makes the shift table
(scripts/assessment/run_eval_comparison.sh) a fair symmetric OOD test rather
than a self-test. A within-distribution version of the linguistics↔error link
already exists: the S-BERT class-similarity matrix computed on the base-set BERT
test split (CS thesis App. B, fig:phq9_confusion_cosim).
Manuscript-side TODOs (fix there, not here) — agreed with D. Roy 2026-08-26 to stay a background limitation, provided each result set names its dataset:
tab:phq9-estimators; paper tab:estimators,
fig:prompt_comparison) and in Figs 4.3b / 4.4.42 commits
Python
70.5%
Jupyter Notebook
23.6%
Shell
5.9%