File size: 2,868 Bytes
a0ebc13
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
---
license: mit
tags:
- multi-agent-reinforcement-learning
- ppo
- recurrent-neural-network
- neuroscience
- inter-brain-dynamics
---

# mouse-run-run β€” RNN agents (mouse-run-run-1)

Trained chaser/explorer agents for a modern PyTorch reproduction and
architecture extension of the MARL experiment in Zhang et al. (2025),
*Inter-brain neural dynamics in biological and artificial intelligence
systems*, Nature 645, 991–1001.

**Architecture:** vanilla ReLU RNN (the paper's architecture). Analysis (hidden) dimension 256; two independently
parameterized actor-critic agents (chaser and explorer, no weight sharing).

This repo holds one full experiment: **20 trained agent pairs** (tasks
`social` and `non_social` Γ— seeds 0–9), each trained with PPO for 20,000
updates Γ— 40 episodes Γ— 100 steps. 20/20 units completed on the first attempt.

## Contents

- `{social,non_social}/seed_XXXX/attempt_01/checkpoints/latest.safetensors` β€”
  trained chaser+explorer weights (safetensors; config/metrics in metadata).
- `paper_rollouts/*.safetensors` β€” 25Γ—500-step analysis rollouts per pair:
  per-timestep hidden states, positions, actions, and social-event flags
  (schema v3, time-aligned; degenerate episodes flagged).
- `paper_random_eval.jsonl` β€” standardized random-opponent evaluation.
- `derived/{tables,reports}/` β€” canonical tables and the per-experiment report.
- `cross_architecture_study/` β€” the four-architecture comparison report,
  figures, and cross-architecture PLSC/CKA data.
- `manifest.json`, `raw_records.jsonl`, `launch_gate.json`,
  `triton_equivalence.json` β€” provenance.

## Key results (this architecture)

Behavior (vs standardized random opponent, social task):
- chaser collisions / episode: **8.98**
  (non-social control: 3.45)
- chaser partner-in-vision: 0.61

Neural (social agents):
- collision decoding (balanced acc): **0.98**
- partner escape / approach decoding: 0.89 / 0.89
- PLSC shared-dimension top correlation: 0.74

See `cross_architecture_study/report.md` for the four-architecture comparison.
**Headline:** the architectures do not learn the same internal representations β€”
only the RNN develops genuine internal shared dynamics at low mutual vision.

## Load a checkpoint

```python
from huggingface_hub import hf_hub_download
from mouse_run_run.serialization import load_checkpoint
from mouse_run_run.policy import build_policy

path = hf_hub_download("JacobLinCool/mouse-run-run-1",
    "social/seed_0000/attempt_01/checkpoints/latest.safetensors")
config, metrics, chaser_state, explorer_state = load_checkpoint(path)
chaser = build_policy(config["architecture"], config["env"]["observation_size"],
                      hidden_size=config["hidden_size"])
chaser.load_state_dict(chaser_state)
```

Code: https://github.com/JacobLinCool/mouse-run-run (paper reproduction +
cross-architecture study).