Upload folder using huggingface_hub
Browse files- README.md +1 -1
- hf/code_README.md +66 -0
- paper/main.pdf +2 -2
- paper/main.tex +3 -3
- paper/submission_plan.md +10 -1
- results/hf_publication.json +4 -2
README.md
CHANGED
|
@@ -13,7 +13,7 @@ tags:
|
|
| 13 |
This repository is the released code for *Causal Latent-State Agents: Pre-Action
|
| 14 |
Safety from a World Model You Can Audit* (submitted to *Artificial Intelligence*,
|
| 15 |
Elsevier). It is a mirror of the repository accompanying the submission, at
|
| 16 |
-
commit `
|
| 17 |
|
| 18 |
It contains the analysis code, the configuration, the tests, the result files and
|
| 19 |
the figure scripts. The benchmark and the trained artefacts are in two companion
|
|
|
|
| 13 |
This repository is the released code for *Causal Latent-State Agents: Pre-Action
|
| 14 |
Safety from a World Model You Can Audit* (submitted to *Artificial Intelligence*,
|
| 15 |
Elsevier). It is a mirror of the repository accompanying the submission, at
|
| 16 |
+
commit `d4089a9` (2026-11-25).
|
| 17 |
|
| 18 |
It contains the analysis code, the configuration, the tests, the result files and
|
| 19 |
the figure scripts. The benchmark and the trained artefacts are in two companion
|
hf/code_README.md
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
tags:
|
| 4 |
+
- agent-safety
|
| 5 |
+
- world-models
|
| 6 |
+
- causal-inference
|
| 7 |
+
- reproducibility
|
| 8 |
+
- code
|
| 9 |
+
---
|
| 10 |
+
|
| 11 |
+
# CLSA — code for "Causal Latent-State Agents"
|
| 12 |
+
|
| 13 |
+
This repository is the released code for *Causal Latent-State Agents: Pre-Action
|
| 14 |
+
Safety from a World Model You Can Audit* (submitted to *Artificial Intelligence*,
|
| 15 |
+
Elsevier). It is a mirror of the repository accompanying the submission, at
|
| 16 |
+
commit `{{COMMIT}}` ({{DATE}}).
|
| 17 |
+
|
| 18 |
+
It contains the analysis code, the configuration, the tests, the result files and
|
| 19 |
+
the figure scripts. The benchmark and the trained artefacts are in two companion
|
| 20 |
+
repositories:
|
| 21 |
+
|
| 22 |
+
| What | Where |
|
| 23 |
+
|---|---|
|
| 24 |
+
| PreAct-Bench: 4,508 pre-action decision points, images, schema, data card | [fahadhafeezofficial/preact-bench](https://huggingface.co/datasets/fahadhafeezofficial/preact-bench) |
|
| 25 |
+
| Trained artefacts for both backbones (transcoder, world model, risk head, monitors) | [fahadhafeezofficial/clsa-artifacts](https://huggingface.co/fahadhafeezofficial/clsa-artifacts) |
|
| 26 |
+
|
| 27 |
+
## Layout
|
| 28 |
+
|
| 29 |
+
| Path | Contents |
|
| 30 |
+
|---|---|
|
| 31 |
+
| `src/clsa/` | Package: sandbox, transcoder, world model, risk head, controller, monitors |
|
| 32 |
+
| `experiments/` | E1–E9 and `check_numbers.py`, which traces every table value back to `results/` |
|
| 33 |
+
| `tiers/` | Standalone smoke tests for the three adoption tiers |
|
| 34 |
+
| `tests/` | Test suite (31 tests) |
|
| 35 |
+
| `configs/` | Frozen experiment configuration |
|
| 36 |
+
| `results/` | Result JSON/JSONL files behind every number in the paper |
|
| 37 |
+
| `figures/`, `paper/` | Figure scripts and LaTeX source |
|
| 38 |
+
| `hf/` | Scripts that published these three repositories |
|
| 39 |
+
|
| 40 |
+
## Running it
|
| 41 |
+
|
| 42 |
+
```bash
|
| 43 |
+
python -m pip install -r requirements.txt
|
| 44 |
+
export PYTHONPATH=src
|
| 45 |
+
make test # 31 tests
|
| 46 |
+
python experiments/check_numbers.py # 103 table values traced to results/
|
| 47 |
+
```
|
| 48 |
+
|
| 49 |
+
Full reproduction of the benchmark and the artefacts needs the two companion
|
| 50 |
+
repositories:
|
| 51 |
+
|
| 52 |
+
```bash
|
| 53 |
+
hf download fahadhafeezofficial/preact-bench --repo-type dataset --local-dir data/preact_bench
|
| 54 |
+
hf download fahadhafeezofficial/clsa-artifacts --repo-type model --local-dir data/derived
|
| 55 |
+
make reproduce # bench + experiments + figures + number check
|
| 56 |
+
```
|
| 57 |
+
|
| 58 |
+
The derived artefacts must sit in `data/derived/<backbone with "/" as "__">`,
|
| 59 |
+
which is the layout the artefacts repository already uses and the only layout
|
| 60 |
+
`load_model()` resolves; there is no environment variable for that path.
|
| 61 |
+
|
| 62 |
+
Everything runs on a CPU, with no GPU, no paid API and no vendor SDK.
|
| 63 |
+
|
| 64 |
+
## Licence and citation
|
| 65 |
+
|
| 66 |
+
MIT (see `LICENSE`). Citation metadata is in `CITATION.cff`.
|
paper/main.pdf
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:60efc7ae6423d953c983e88d3a6a53ea3f2be23154eb8da7db9bb582b72e3eb1
|
| 3 |
+
size 375548
|
paper/main.tex
CHANGED
|
@@ -456,14 +456,14 @@ Pre-registration is in version control ahead of the results.
|
|
| 456 |
\section{Data and code availability}
|
| 457 |
|
| 458 |
The benchmark is published at
|
| 459 |
-
\href{https://huggingface.co/datasets/fahadhafeezofficial/preact-bench}{\
|
| 460 |
under MIT: 4{,}508 rows, the GUI images, the row schema and the data card. The
|
| 461 |
trained artefacts (transcoder, world model, risk head and monitors for both
|
| 462 |
backbones) are at
|
| 463 |
-
\href{https://huggingface.co/fahadhafeezofficial/clsa-artifacts}{\
|
| 464 |
with the metrics needed to interpret them. The code --- source, configuration,
|
| 465 |
tests, result files and figure scripts --- is at
|
| 466 |
-
\href{https://huggingface.co/datasets/fahadhafeezofficial/clsa-code}{\
|
| 467 |
under MIT, and is the repository accompanying this submission;
|
| 468 |
\texttt{make reproduce} regenerates the benchmark audit, the figures, the
|
| 469 |
tables and the number-traceability check from those files.
|
|
|
|
| 456 |
\section{Data and code availability}
|
| 457 |
|
| 458 |
The benchmark is published at
|
| 459 |
+
\href{https://huggingface.co/datasets/fahadhafeezofficial/preact-bench}{\nolinkurl{huggingface.co/datasets/fahadhafeezofficial/preact-bench}}
|
| 460 |
under MIT: 4{,}508 rows, the GUI images, the row schema and the data card. The
|
| 461 |
trained artefacts (transcoder, world model, risk head and monitors for both
|
| 462 |
backbones) are at
|
| 463 |
+
\href{https://huggingface.co/fahadhafeezofficial/clsa-artifacts}{\nolinkurl{huggingface.co/fahadhafeezofficial/clsa-artifacts}}
|
| 464 |
with the metrics needed to interpret them. The code --- source, configuration,
|
| 465 |
tests, result files and figure scripts --- is at
|
| 466 |
+
\href{https://huggingface.co/datasets/fahadhafeezofficial/clsa-code}{\nolinkurl{huggingface.co/datasets/fahadhafeezofficial/clsa-code}}
|
| 467 |
under MIT, and is the repository accompanying this submission;
|
| 468 |
\texttt{make reproduce} regenerates the benchmark audit, the figures, the
|
| 469 |
tables and the number-traceability check from those files.
|
paper/submission_plan.md
CHANGED
|
@@ -90,7 +90,7 @@ Editorial Manager upload form.
|
|
| 90 |
| CRediT author statement | manuscript, unnumbered section | ready |
|
| 91 |
| Declaration of competing interest | manuscript | ready |
|
| 92 |
| Funding statement (no funding received) | manuscript | ready |
|
| 93 |
-
| Data availability | manuscript +
|
| 94 |
| Declaration of AI use | `ai_statement.tex` (option C) | ready |
|
| 95 |
| Pre-registration and deviations | `preregistration.md`, `../PRE_REGISTRATION.md` | ready (supplement) |
|
| 96 |
| Reproducibility instructions | `../README.md`, `../Makefile` | ready |
|
|
@@ -109,6 +109,15 @@ supported the work, and the Funding section states this.
|
|
| 109 |
|
| 110 |
### Verified before packaging
|
| 111 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 112 |
- `load_model` for both backbones from a clean `git archive` copy, using only the
|
| 113 |
commands in the model card (2 checkpoints, 130,797 parameters each).
|
| 114 |
- `make paper` with option C: 11 pages, 0 LaTeX errors, no undefined citations;
|
|
|
|
| 90 |
| CRediT author statement | manuscript, unnumbered section | ready |
|
| 91 |
| Declaration of competing interest | manuscript | ready |
|
| 92 |
| Funding statement (no funding received) | manuscript | ready |
|
| 93 |
+
| Data availability | manuscript + three Hub repositories (benchmark, artefacts, code) | ready |
|
| 94 |
| Declaration of AI use | `ai_statement.tex` (option C) | ready |
|
| 95 |
| Pre-registration and deviations | `preregistration.md`, `../PRE_REGISTRATION.md` | ready (supplement) |
|
| 96 |
| Reproducibility instructions | `../README.md`, `../Makefile` | ready |
|
|
|
|
| 109 |
|
| 110 |
### Verified before packaging
|
| 111 |
|
| 112 |
+
- Code mirror published at
|
| 113 |
+
<https://huggingface.co/datasets/fahadhafeezofficial/clsa-code> (169 files,
|
| 114 |
+
2.5 MB, no benchmark data or checkpoints copied) and cited by URL in the data
|
| 115 |
+
availability section, so the cover letter's claim that the code is openly
|
| 116 |
+
released under MIT now matches the manuscript.
|
| 117 |
+
- The three availability URLs were switched from `\texttt` to `\nolinkurl`:
|
| 118 |
+
the artefacts URL could not break and was clipped at the page edge, printing
|
| 119 |
+
`huggingface.co/fahadhafeezoffi` with the rest lost. All three now wrap and all
|
| 120 |
+
three appear in full in the extracted text.
|
| 121 |
- `load_model` for both backbones from a clean `git archive` copy, using only the
|
| 122 |
commands in the model card (2 checkpoints, 130,797 parameters each).
|
| 123 |
- `make paper` with option C: 11 pages, 0 LaTeX errors, no undefined citations;
|
results/hf_publication.json
CHANGED
|
@@ -14,5 +14,7 @@
|
|
| 14 |
"model_folders": [
|
| 15 |
"HuggingFaceTB__SmolLM2-360M-Instruct",
|
| 16 |
"Qwen__Qwen2.5-0.5B-Instruct"
|
| 17 |
-
]
|
| 18 |
-
|
|
|
|
|
|
|
|
|
| 14 |
"model_folders": [
|
| 15 |
"HuggingFaceTB__SmolLM2-360M-Instruct",
|
| 16 |
"Qwen__Qwen2.5-0.5B-Instruct"
|
| 17 |
+
],
|
| 18 |
+
"code": "https://huggingface.co/datasets/fahadhafeezofficial/clsa-code",
|
| 19 |
+
"code_commit": "164190e"
|
| 20 |
+
}
|