margin-arena 0.2.0b1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. margin_arena-0.2.0b1/.gitattributes +4 -0
  2. margin_arena-0.2.0b1/.github/workflows/ci.yml +31 -0
  3. margin_arena-0.2.0b1/.github/workflows/publish.yml +33 -0
  4. margin_arena-0.2.0b1/.gitignore +8 -0
  5. margin_arena-0.2.0b1/LICENSE +21 -0
  6. margin_arena-0.2.0b1/MANIFEST.in +8 -0
  7. margin_arena-0.2.0b1/PKG-INFO +174 -0
  8. margin_arena-0.2.0b1/README.md +139 -0
  9. margin_arena-0.2.0b1/docs/beta_report.md +137 -0
  10. margin_arena-0.2.0b1/docs/legacy_v0_1.md +130 -0
  11. margin_arena-0.2.0b1/margin_arena/__init__.py +9 -0
  12. margin_arena-0.2.0b1/margin_arena/__main__.py +3 -0
  13. margin_arena-0.2.0b1/margin_arena/arena.py +284 -0
  14. margin_arena-0.2.0b1/margin_arena/backend.py +155 -0
  15. margin_arena-0.2.0b1/margin_arena/beta_cli.py +70 -0
  16. margin_arena-0.2.0b1/margin_arena/budget.py +58 -0
  17. margin_arena-0.2.0b1/margin_arena/cli.py +211 -0
  18. margin_arena-0.2.0b1/margin_arena/configs/vllm.example.json +10 -0
  19. margin_arena-0.2.0b1/margin_arena/datasets.py +52 -0
  20. margin_arena-0.2.0b1/margin_arena/environment.py +130 -0
  21. margin_arena-0.2.0b1/margin_arena/evidence.py +83 -0
  22. margin_arena-0.2.0b1/margin_arena/huggingface.py +157 -0
  23. margin_arena-0.2.0b1/margin_arena/interpret.py +83 -0
  24. margin_arena-0.2.0b1/margin_arena/limits.py +78 -0
  25. margin_arena-0.2.0b1/margin_arena/model_worker.py +87 -0
  26. margin_arena-0.2.0b1/margin_arena/monitor.py +62 -0
  27. margin_arena-0.2.0b1/margin_arena/oracle.py +17 -0
  28. margin_arena-0.2.0b1/margin_arena/preflight.py +79 -0
  29. margin_arena-0.2.0b1/margin_arena/rehearsal.py +33 -0
  30. margin_arena-0.2.0b1/margin_arena/review.py +38 -0
  31. margin_arena-0.2.0b1/margin_arena/runner.py +208 -0
  32. margin_arena-0.2.0b1/margin_arena/tasks.py +36 -0
  33. margin_arena-0.2.0b1/margin_arena/validation.py +66 -0
  34. margin_arena-0.2.0b1/margin_arena/world/Dockerfile +9 -0
  35. margin_arena-0.2.0b1/margin_arena/world/private/artifacts.json +1 -0
  36. margin_arena-0.2.0b1/margin_arena/world/seed/README.md +5 -0
  37. margin_arena-0.2.0b1/margin_arena/world/seed/depot/__init__.py +1 -0
  38. margin_arena-0.2.0b1/margin_arena/world/seed/depot/access.py +8 -0
  39. margin_arena-0.2.0b1/margin_arena/world/seed/depot/api.py +17 -0
  40. margin_arena-0.2.0b1/margin_arena/world/seed/depot/registry.py +14 -0
  41. margin_arena-0.2.0b1/margin_arena/world/seed/docs/compatibility.md +7 -0
  42. margin_arena-0.2.0b1/margin_arena/world/seed/tests/test_public.py +15 -0
  43. margin_arena-0.2.0b1/margin_arena/world/worker.py +55 -0
  44. margin_arena-0.2.0b1/margin_arena.egg-info/PKG-INFO +174 -0
  45. margin_arena-0.2.0b1/margin_arena.egg-info/SOURCES.txt +61 -0
  46. margin_arena-0.2.0b1/margin_arena.egg-info/dependency_links.txt +1 -0
  47. margin_arena-0.2.0b1/margin_arena.egg-info/entry_points.txt +3 -0
  48. margin_arena-0.2.0b1/margin_arena.egg-info/requires.txt +32 -0
  49. margin_arena-0.2.0b1/margin_arena.egg-info/top_level.txt +1 -0
  50. margin_arena-0.2.0b1/pyproject.toml +37 -0
  51. margin_arena-0.2.0b1/release.json +60 -0
  52. margin_arena-0.2.0b1/requirements/analysis.txt +256 -0
  53. margin_arena-0.2.0b1/requirements/runtime.txt +193 -0
  54. margin_arena-0.2.0b1/scripts/check_external_apps.py +58 -0
  55. margin_arena-0.2.0b1/scripts/freeze_dependencies.py +18 -0
  56. margin_arena-0.2.0b1/scripts/validate_release.py +72 -0
  57. margin_arena-0.2.0b1/setup.cfg +4 -0
  58. margin_arena-0.2.0b1/tests/test_backend_and_batch.py +114 -0
  59. margin_arena-0.2.0b1/tests/test_beta.py +174 -0
  60. margin_arena-0.2.0b1/tests/test_core.py +221 -0
  61. margin_arena-0.2.0b1/tests/test_docker.py +57 -0
  62. margin_arena-0.2.0b1/tests/test_interpret.py +151 -0
  63. margin_arena-0.2.0b1/tests/test_worker.py +40 -0
@@ -0,0 +1,4 @@
1
+ * text=auto eol=lf
2
+ *.whl binary
3
+ *.gz binary
4
+ *.safetensors binary
@@ -0,0 +1,31 @@
1
+ name: CPU validation
2
+ on: [push, pull_request]
3
+ permissions:
4
+ contents: read
5
+ jobs:
6
+ runtime:
7
+ runs-on: ubuntu-24.04
8
+ steps:
9
+ - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803
10
+ - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1
11
+ with:
12
+ python-version: '3.12'
13
+ - run: python -m pip install torch==2.14.0+cpu --index-url https://download.pytorch.org/whl/cpu
14
+ - run: python -m pip install -r requirements/runtime.txt
15
+ - run: python -m pip check
16
+ - run: python -m margin_arena verify-release
17
+ - run: python -m margin_arena build
18
+ - run: MARGIN_DOCKER_TESTS=1 python -m unittest discover -s tests -v
19
+ - run: python -m build
20
+ - run: python -m twine check dist/*
21
+ analysis:
22
+ runs-on: ubuntu-24.04
23
+ steps:
24
+ - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803
25
+ - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1
26
+ with:
27
+ python-version: '3.12'
28
+ - run: python -m pip install torch==2.14.0+cpu --index-url https://download.pytorch.org/whl/cpu
29
+ - run: python -m pip install -r requirements/analysis.txt
30
+ - run: python -m pip check
31
+ - run: python -m unittest discover -s tests -p test_interpret.py -v
@@ -0,0 +1,33 @@
1
+ name: Publish package
2
+ on:
3
+ workflow_dispatch:
4
+ permissions:
5
+ contents: read
6
+ jobs:
7
+ build:
8
+ runs-on: ubuntu-24.04
9
+ steps:
10
+ - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803
11
+ - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1
12
+ with:
13
+ python-version: '3.12'
14
+ - run: python -m pip install build twine
15
+ - run: python -m margin_arena verify-release
16
+ - run: python -m build
17
+ - run: python -m twine check dist/*
18
+ - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
19
+ with:
20
+ name: distributions
21
+ path: dist/*
22
+ publish:
23
+ needs: build
24
+ runs-on: ubuntu-24.04
25
+ environment: pypi
26
+ permissions:
27
+ id-token: write
28
+ steps:
29
+ - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093
30
+ with:
31
+ name: distributions
32
+ path: dist/
33
+ - uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33
@@ -0,0 +1,8 @@
1
+ .venv/
2
+ __pycache__/
3
+ *.pyc
4
+ *.egg-info/
5
+ build/
6
+ dist/
7
+ runs/
8
+ .env
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 MARGIN Arena contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,8 @@
1
+ include release.json
2
+ recursive-include docs *.md
3
+ recursive-include requirements *.txt
4
+ recursive-include scripts *.py
5
+ recursive-include tests *.py
6
+ recursive-include .github *.yml
7
+ include .gitattributes
8
+ include .gitignore
@@ -0,0 +1,174 @@
1
+ Metadata-Version: 2.4
2
+ Name: margin-arena
3
+ Version: 0.2.0b1
4
+ Summary: Counted resource limits and observation records for external agent tasks
5
+ License-Expression: MIT
6
+ Project-URL: Repository, https://github.com/CarterYoo/margin-arena
7
+ Project-URL: Issues, https://github.com/CarterYoo/margin-arena/issues
8
+ Requires-Python: >=3.11
9
+ Description-Content-Type: text/markdown
10
+ License-File: LICENSE
11
+ Requires-Dist: inspect-ai<0.4,>=0.3.263
12
+ Provides-Extra: inspect
13
+ Requires-Dist: inspect-ai<0.4,>=0.3.263; extra == "inspect"
14
+ Provides-Extra: hf
15
+ Requires-Dist: torch<3,>=2.6; extra == "hf"
16
+ Requires-Dist: transformers<6,>=4.57; extra == "hf"
17
+ Requires-Dist: safetensors<1,>=0.6; extra == "hf"
18
+ Provides-Extra: data
19
+ Requires-Dist: datasets<6,>=4; extra == "data"
20
+ Requires-Dist: inspect-ai<0.4,>=0.3.263; extra == "data"
21
+ Provides-Extra: control
22
+ Requires-Dist: control-arena<20,>=19; extra == "control"
23
+ Provides-Extra: nnsight
24
+ Requires-Dist: nnsight<0.8,>=0.7; extra == "nnsight"
25
+ Provides-Extra: lens
26
+ Requires-Dist: transformer-lens<4,>=3.9; extra == "lens"
27
+ Provides-Extra: sae
28
+ Requires-Dist: sae-lens<7,>=6.51; extra == "sae"
29
+ Provides-Extra: captum
30
+ Requires-Dist: captum<1,>=0.8; extra == "captum"
31
+ Provides-Extra: analysis
32
+ Requires-Dist: pandas<4,>=2; extra == "analysis"
33
+ Requires-Dist: safetensors<1,>=0.6; extra == "analysis"
34
+ Dynamic: license-file
35
+
36
+ # MARGIN Arena
37
+
38
+ MARGIN provides counted resource limits and inspectable records for agents working on external tasks. Its scope is **detect, analyze, and understand**. It does not supply a new research dataset, train agents, implement interventions, or claim that a particular limit induces reward hacking.
39
+
40
+ Version **0.2.0b1** is a beta. Choose a local Hugging Face causal language model, attach an external Inspect task or ControlArena setting, and specify each trial's resources. The source setting keeps its dataset, tools, sandbox, and scorer.
41
+
42
+ ## Install
43
+
44
+ Python 3.11 or later is required; the tested environments use Python 3.12. Use Linux or WSL for Docker settings.
45
+
46
+ ```bash
47
+ pip install "margin-arena[hf,control]==0.2.0b1"
48
+ ```
49
+
50
+ Until the version appears on PyPI, install the public repository:
51
+
52
+ ```bash
53
+ pip install "margin-arena[hf,control] @ git+https://github.com/CarterYoo/margin-arena.git"
54
+ ```
55
+
56
+ For immutable experiments, replace the branch with a recorded commit. Tested CPU dependency snapshots are in `requirements/runtime.txt` and `requirements/analysis.txt`. Install CPU Torch from the official PyTorch index before applying those files. GPU users must select the appropriate official PyTorch build and record their hardware and driver versions.
57
+
58
+ ## Five explicit limits
59
+
60
+ | Parameter | Counted quantity | Behavior at the boundary |
61
+ | :--- | :--- | :--- |
62
+ | `tokens` | All generated token IDs, including reasoning, JSON, code, arguments, and final text | Each generation has a reserved cap. A report reserve is included in the total. |
63
+ | `seconds` | Monotonic time from the first actor turn, including observation and tools | Local model worker is terminated; no further actions are admitted. External tool cancellation has a separate caveat below. |
64
+ | `verification_runs` | Admitted calls to explicitly named verification tools | Further verification calls are denied before execution; other tools remain available. |
65
+ | `tool_calls` | Admitted individual calls, including submission and restart requests | Further work tools are unavailable; the existing report reserve remains available. |
66
+ | `sessions` | Initial session plus admitted `restart_session` requests | Further restarts are denied; all other resource counters persist across restarts. |
67
+
68
+ `None` disables time, tool, or verification limits. Sessions default to one. Each generation sees its remaining counters. Require `0 < report_tokens < tokens`; `per_call_tokens` caps one complete generation. Input tokens are recorded separately. Truncated output is terminal and never executes a partial request. An early final answer or stop is terminal even when resources remain.
69
+
70
+ Model loading and initial sandbox preparation precede the trial clock. Source scoring and cleanup follow actor execution and are not charged to it. If generation is killed before returning, actual usage is unknown and its outstanding reservation stays in the ledger. Polling and process termination add a small measured delay; an exact millisecond stop is not promised.
71
+
72
+ ## Use a ControlArena setting
73
+
74
+ ```python
75
+ from margin_arena import Arena, HFModel, Limits
76
+ from control_arena.settings.apps.apps_setting import AppsSetting
77
+
78
+ def main():
79
+ arena = Arena(
80
+ HFModel(name="YOUR_MODEL_REPOSITORY", revision="YOUR_MODEL_COMMIT",
81
+ device="cuda", dtype="bfloat16", context_window=8192),
82
+ Limits(tokens=16000, seconds=600, tool_calls=40, sessions=1,
83
+ per_call_tokens=1024),
84
+ seed=0,
85
+ )
86
+ task = arena.from_control_arena(AppsSetting())
87
+ arena.evaluate(task, out="runs/development_001", limit=1)
88
+
89
+ if __name__ == "__main__":
90
+ main()
91
+ ```
92
+
93
+ The main guard is required for the separate model process. Weights must fit the selected device. This beta adds no quantization, multi GPU distribution, or automatic backend switching.
94
+
95
+ APPS has a submission tool and official scorer, but no interactive verification tool. The example therefore does not invent a verification allowance. For that axis, choose a source with an actual verification service and pass `verification_tools=("its_tool_name",)`. Multiple sessions in a mutable environment require an asynchronous `reset(state)` callback restoring that source's initial state. Missing bindings fail before generation.
96
+
97
+ ControlArena is used in honest task mode. The actor receives the setting description and main task; hidden solutions and side task metadata stay outside its prompt. This adapter uses the setting lifecycle and official scorer, not ControlArena attack policies or control protocols. Validate each setting, especially tools that call other models or return nontext observations.
98
+
99
+ ```bash
100
+ margin-eval --setting control_arena.settings.apps.apps_setting:AppsSetting \
101
+ --model YOUR_MODEL_REPOSITORY --revision YOUR_MODEL_COMMIT \
102
+ --device cuda --dtype bfloat16 --context-window 8192 \
103
+ --tokens 16000 --seconds 600 --tool-calls 40 --sessions 1 --per-call-tokens 1024 \
104
+ --limit 1 --out runs/development_001
105
+ ```
106
+
107
+ ## Other external data and environments
108
+
109
+ `Arena.task(dataset, tools=..., scorer=..., sandbox=..., setup=..., post_submission=..., reset=...)` accepts Inspect samples and the source's lifecycle components. `--binding module:function` loads a trusted installed factory receiving the arena and returning this task.
110
+
111
+ `margin_arena.datasets.from_jsonl` and `from_huggingface` map explicitly selected input, target, and ID columns. Only the input becomes visible. Hub revisions resolve to a commit; row hashes retain provenance. These loaders do **not** create a repository environment or official benchmark scorer from a text row. Loading SWE bench issue text, for example, is not a SWE bench evaluation without its official checkout, execution, and test bindings. Text CLI modes offer only explicit `match` or `includes` scoring.
112
+
113
+ Each evaluation saves the complete sample snapshot and hash, setting configuration, package versions, limits, seed, and model identity. Preserve external image digests and assets not contained in the samples. Reuse saved samples or pin upstream dataset revisions; moving source references alone are insufficient for reproduction.
114
+
115
+ ## Model interface and evidence
116
+
117
+ The local backend retains ordinary Hugging Face model and tokenizer objects. It applies the model's chat template and requests one strict JSON action or final report. Exact rendered text, input IDs, mask, output IDs, original response, sampling parameters, and tool schema are recorded. It does not silently trim context, repair JSON, remove reasoning, or retry failed responses. Models without a chat template and encoder decoder models are unsupported. Model selection does not establish competence: check the exact output contract on development cases before a larger run.
118
+
119
+ Every sample has a hash chained `events.jsonl`, `result.json`, and optional activation artifacts. Inspect logs retain source scores. Their top level model name is the explicitly unused `mockllm/margin_transport_unused` transport; real inference runs through the MARGIN backend recorded in `configuration.json` and each trial. Do not attribute research results to the placeholder.
120
+
121
+ ```bash
122
+ margin verify-trial runs/development_001/sample_SAMPLE_ID
123
+ ```
124
+
125
+ Verification replays resource admissions and settlements, checks raw token counts, and compares the summary with its journal. It does not rerun external scorers, prove human review, or authenticate against a host that can rewrite all files and hashes. Infrastructure errors stop later sample execution. Malformed output, truncation, task failure, and refusal remain separate outcomes.
126
+
127
+ ## Read only interpretation
128
+
129
+ Set `HFModel(capture_modules=("MODEL_SPECIFIC_MODULE",))` or repeat `--capture-module`. Native PyTorch hooks capture the **first prefill forward of the original generation**, with exact positions, module names, shapes, dtype, model identity, unique request ID, and safetensors hash. This beta does not save decode step activations or provide activation patching.
130
+
131
+ | Library | Connection | CPU check |
132
+ | :--- | :--- | :--- |
133
+ | PyTorch and safetensors | Original prefill capture and verified tensor loading | Later one token cached forwards execute; output IDs and logits match the unobserved tiny model. |
134
+ | NNsight 0.7 | Existing HF model and recorded input IDs | Layer output saved through an actual trace. |
135
+ | TransformerLens 3.9 | TransformerBridge over existing HF weights | Activation cache obtained; logits match the raw tiny model without legacy weight folding. |
136
+ | SAE Lens 6.51 | Encoding after declared revision, module, and feature width checks | A tiny untrained SAE encodes matching input and rejects a revision mismatch. |
137
+ | Captum 0.9 | PyTorch LayerActivation | Actual layer observation checked. |
138
+ | pandas and HF Datasets | Output token rows joined to prompt position and request ID | Exports agree with raw records. |
139
+
140
+ These are software checks with an **untrained tiny CPU model**, not trained model findings or universal architecture support. SAE training preprocessing and intended layer must also match; no general pretrained SAE is supplied. Offline replay can differ due to dtype, kernels, cache, or library versions. Preserve that distinction.
141
+
142
+ ControlArena 19 requires Hugging Face Hub below 1, whereas TransformerLens 3.9 requires Transformers 5 and Hub 1 or later. Use separate environments. There is intentionally no combined `all` extra.
143
+
144
+ ```bash
145
+ python -m venv analysis_env
146
+ analysis_env/bin/pip install "margin-arena[hf,analysis,nnsight,lens,sae,captum]==0.2.0b1"
147
+ ```
148
+
149
+ ```python
150
+ from margin_arena.interpret import load_activations, to_pandas
151
+ tensors, metadata = load_activations("runs/development_001/sample_ID/activations/REQUEST_ID.safetensors")
152
+ table = to_pandas("runs/development_001/sample_ID/events.jsonl")
153
+ ```
154
+
155
+ ## Enforcement and interpretation limits
156
+
157
+ Verification limits count named calls, not commands inside an unrestricted shell. True service execution quotas require an exclusive source service binding. MARGIN rejects unbound quotas but cannot discover every alternative path in third party environments.
158
+
159
+ Local deadlines terminate the model worker. External tool deadlines cancel the awaiting coroutine and record remote effects as **unconfirmed**. Remote job cleanup depends on the source sandbox. Tools that secretly invoke other models are unsupported because those tokens are outside this ledger. Validate source properties before claiming exact end to end enforcement.
160
+
161
+ Resource exhaustion does not prove a model felt pressure. A source score does not automatically label deception or reward hacking. Compare controlled conditions on the same external tasks and inspect actual actions, effects, and independent source scores. This release reports no new model experiment or causal finding.
162
+
163
+ ## Development checks
164
+
165
+ ```bash
166
+ python -m unittest discover -s tests -v
167
+ python -m margin_arena build
168
+ MARGIN_DOCKER_TESTS=1 python -m unittest discover -s tests -p test_docker.py -v
169
+ python scripts/check_external_apps.py --out runs/apps_binding_check
170
+ ```
171
+
172
+ The final command fetches one public APPS row and submits a fixed diagnostic program through the original Docker setting and scorer, without model calls. The three old Artifact Depot tasks remain legacy regression fixtures, described in [the archived guide](docs/legacy_v0_1.md); they are not the beta's research dataset. First party code is MIT licensed; external artifacts retain their own licenses.
173
+
174
+ See [the beta report](docs/beta_report.md) for actual validation and release status. References: [ControlArena](https://control-arena.aisi.org.uk/), [Inspect limits](https://inspect.aisi.org.uk/setting-limits.html), [NNsight](https://nnsight.net/documentation/modeling/language/), [TransformerLens](https://transformerlensorg.github.io/TransformerLens/generated/code/transformer_lens.model_bridge.bridge.html), [Captum](https://captum.ai/api/layer.html), [SAE Lens](https://jbloomaus.github.io/SAELens/).
@@ -0,0 +1,139 @@
1
+ # MARGIN Arena
2
+
3
+ MARGIN provides counted resource limits and inspectable records for agents working on external tasks. Its scope is **detect, analyze, and understand**. It does not supply a new research dataset, train agents, implement interventions, or claim that a particular limit induces reward hacking.
4
+
5
+ Version **0.2.0b1** is a beta. Choose a local Hugging Face causal language model, attach an external Inspect task or ControlArena setting, and specify each trial's resources. The source setting keeps its dataset, tools, sandbox, and scorer.
6
+
7
+ ## Install
8
+
9
+ Python 3.11 or later is required; the tested environments use Python 3.12. Use Linux or WSL for Docker settings.
10
+
11
+ ```bash
12
+ pip install "margin-arena[hf,control]==0.2.0b1"
13
+ ```
14
+
15
+ Until the version appears on PyPI, install the public repository:
16
+
17
+ ```bash
18
+ pip install "margin-arena[hf,control] @ git+https://github.com/CarterYoo/margin-arena.git"
19
+ ```
20
+
21
+ For immutable experiments, replace the branch with a recorded commit. Tested CPU dependency snapshots are in `requirements/runtime.txt` and `requirements/analysis.txt`. Install CPU Torch from the official PyTorch index before applying those files. GPU users must select the appropriate official PyTorch build and record their hardware and driver versions.
22
+
23
+ ## Five explicit limits
24
+
25
+ | Parameter | Counted quantity | Behavior at the boundary |
26
+ | :--- | :--- | :--- |
27
+ | `tokens` | All generated token IDs, including reasoning, JSON, code, arguments, and final text | Each generation has a reserved cap. A report reserve is included in the total. |
28
+ | `seconds` | Monotonic time from the first actor turn, including observation and tools | Local model worker is terminated; no further actions are admitted. External tool cancellation has a separate caveat below. |
29
+ | `verification_runs` | Admitted calls to explicitly named verification tools | Further verification calls are denied before execution; other tools remain available. |
30
+ | `tool_calls` | Admitted individual calls, including submission and restart requests | Further work tools are unavailable; the existing report reserve remains available. |
31
+ | `sessions` | Initial session plus admitted `restart_session` requests | Further restarts are denied; all other resource counters persist across restarts. |
32
+
33
+ `None` disables time, tool, or verification limits. Sessions default to one. Each generation sees its remaining counters. Require `0 < report_tokens < tokens`; `per_call_tokens` caps one complete generation. Input tokens are recorded separately. Truncated output is terminal and never executes a partial request. An early final answer or stop is terminal even when resources remain.
34
+
35
+ Model loading and initial sandbox preparation precede the trial clock. Source scoring and cleanup follow actor execution and are not charged to it. If generation is killed before returning, actual usage is unknown and its outstanding reservation stays in the ledger. Polling and process termination add a small measured delay; an exact millisecond stop is not promised.
36
+
37
+ ## Use a ControlArena setting
38
+
39
+ ```python
40
+ from margin_arena import Arena, HFModel, Limits
41
+ from control_arena.settings.apps.apps_setting import AppsSetting
42
+
43
+ def main():
44
+ arena = Arena(
45
+ HFModel(name="YOUR_MODEL_REPOSITORY", revision="YOUR_MODEL_COMMIT",
46
+ device="cuda", dtype="bfloat16", context_window=8192),
47
+ Limits(tokens=16000, seconds=600, tool_calls=40, sessions=1,
48
+ per_call_tokens=1024),
49
+ seed=0,
50
+ )
51
+ task = arena.from_control_arena(AppsSetting())
52
+ arena.evaluate(task, out="runs/development_001", limit=1)
53
+
54
+ if __name__ == "__main__":
55
+ main()
56
+ ```
57
+
58
+ The main guard is required for the separate model process. Weights must fit the selected device. This beta adds no quantization, multi GPU distribution, or automatic backend switching.
59
+
60
+ APPS has a submission tool and official scorer, but no interactive verification tool. The example therefore does not invent a verification allowance. For that axis, choose a source with an actual verification service and pass `verification_tools=("its_tool_name",)`. Multiple sessions in a mutable environment require an asynchronous `reset(state)` callback restoring that source's initial state. Missing bindings fail before generation.
61
+
62
+ ControlArena is used in honest task mode. The actor receives the setting description and main task; hidden solutions and side task metadata stay outside its prompt. This adapter uses the setting lifecycle and official scorer, not ControlArena attack policies or control protocols. Validate each setting, especially tools that call other models or return nontext observations.
63
+
64
+ ```bash
65
+ margin-eval --setting control_arena.settings.apps.apps_setting:AppsSetting \
66
+ --model YOUR_MODEL_REPOSITORY --revision YOUR_MODEL_COMMIT \
67
+ --device cuda --dtype bfloat16 --context-window 8192 \
68
+ --tokens 16000 --seconds 600 --tool-calls 40 --sessions 1 --per-call-tokens 1024 \
69
+ --limit 1 --out runs/development_001
70
+ ```
71
+
72
+ ## Other external data and environments
73
+
74
+ `Arena.task(dataset, tools=..., scorer=..., sandbox=..., setup=..., post_submission=..., reset=...)` accepts Inspect samples and the source's lifecycle components. `--binding module:function` loads a trusted installed factory receiving the arena and returning this task.
75
+
76
+ `margin_arena.datasets.from_jsonl` and `from_huggingface` map explicitly selected input, target, and ID columns. Only the input becomes visible. Hub revisions resolve to a commit; row hashes retain provenance. These loaders do **not** create a repository environment or official benchmark scorer from a text row. Loading SWE bench issue text, for example, is not a SWE bench evaluation without its official checkout, execution, and test bindings. Text CLI modes offer only explicit `match` or `includes` scoring.
77
+
78
+ Each evaluation saves the complete sample snapshot and hash, setting configuration, package versions, limits, seed, and model identity. Preserve external image digests and assets not contained in the samples. Reuse saved samples or pin upstream dataset revisions; moving source references alone are insufficient for reproduction.
79
+
80
+ ## Model interface and evidence
81
+
82
+ The local backend retains ordinary Hugging Face model and tokenizer objects. It applies the model's chat template and requests one strict JSON action or final report. Exact rendered text, input IDs, mask, output IDs, original response, sampling parameters, and tool schema are recorded. It does not silently trim context, repair JSON, remove reasoning, or retry failed responses. Models without a chat template and encoder decoder models are unsupported. Model selection does not establish competence: check the exact output contract on development cases before a larger run.
83
+
84
+ Every sample has a hash chained `events.jsonl`, `result.json`, and optional activation artifacts. Inspect logs retain source scores. Their top level model name is the explicitly unused `mockllm/margin_transport_unused` transport; real inference runs through the MARGIN backend recorded in `configuration.json` and each trial. Do not attribute research results to the placeholder.
85
+
86
+ ```bash
87
+ margin verify-trial runs/development_001/sample_SAMPLE_ID
88
+ ```
89
+
90
+ Verification replays resource admissions and settlements, checks raw token counts, and compares the summary with its journal. It does not rerun external scorers, prove human review, or authenticate against a host that can rewrite all files and hashes. Infrastructure errors stop later sample execution. Malformed output, truncation, task failure, and refusal remain separate outcomes.
91
+
92
+ ## Read only interpretation
93
+
94
+ Set `HFModel(capture_modules=("MODEL_SPECIFIC_MODULE",))` or repeat `--capture-module`. Native PyTorch hooks capture the **first prefill forward of the original generation**, with exact positions, module names, shapes, dtype, model identity, unique request ID, and safetensors hash. This beta does not save decode step activations or provide activation patching.
95
+
96
+ | Library | Connection | CPU check |
97
+ | :--- | :--- | :--- |
98
+ | PyTorch and safetensors | Original prefill capture and verified tensor loading | Later one token cached forwards execute; output IDs and logits match the unobserved tiny model. |
99
+ | NNsight 0.7 | Existing HF model and recorded input IDs | Layer output saved through an actual trace. |
100
+ | TransformerLens 3.9 | TransformerBridge over existing HF weights | Activation cache obtained; logits match the raw tiny model without legacy weight folding. |
101
+ | SAE Lens 6.51 | Encoding after declared revision, module, and feature width checks | A tiny untrained SAE encodes matching input and rejects a revision mismatch. |
102
+ | Captum 0.9 | PyTorch LayerActivation | Actual layer observation checked. |
103
+ | pandas and HF Datasets | Output token rows joined to prompt position and request ID | Exports agree with raw records. |
104
+
105
+ These are software checks with an **untrained tiny CPU model**, not trained model findings or universal architecture support. SAE training preprocessing and intended layer must also match; no general pretrained SAE is supplied. Offline replay can differ due to dtype, kernels, cache, or library versions. Preserve that distinction.
106
+
107
+ ControlArena 19 requires Hugging Face Hub below 1, whereas TransformerLens 3.9 requires Transformers 5 and Hub 1 or later. Use separate environments. There is intentionally no combined `all` extra.
108
+
109
+ ```bash
110
+ python -m venv analysis_env
111
+ analysis_env/bin/pip install "margin-arena[hf,analysis,nnsight,lens,sae,captum]==0.2.0b1"
112
+ ```
113
+
114
+ ```python
115
+ from margin_arena.interpret import load_activations, to_pandas
116
+ tensors, metadata = load_activations("runs/development_001/sample_ID/activations/REQUEST_ID.safetensors")
117
+ table = to_pandas("runs/development_001/sample_ID/events.jsonl")
118
+ ```
119
+
120
+ ## Enforcement and interpretation limits
121
+
122
+ Verification limits count named calls, not commands inside an unrestricted shell. True service execution quotas require an exclusive source service binding. MARGIN rejects unbound quotas but cannot discover every alternative path in third party environments.
123
+
124
+ Local deadlines terminate the model worker. External tool deadlines cancel the awaiting coroutine and record remote effects as **unconfirmed**. Remote job cleanup depends on the source sandbox. Tools that secretly invoke other models are unsupported because those tokens are outside this ledger. Validate source properties before claiming exact end to end enforcement.
125
+
126
+ Resource exhaustion does not prove a model felt pressure. A source score does not automatically label deception or reward hacking. Compare controlled conditions on the same external tasks and inspect actual actions, effects, and independent source scores. This release reports no new model experiment or causal finding.
127
+
128
+ ## Development checks
129
+
130
+ ```bash
131
+ python -m unittest discover -s tests -v
132
+ python -m margin_arena build
133
+ MARGIN_DOCKER_TESTS=1 python -m unittest discover -s tests -p test_docker.py -v
134
+ python scripts/check_external_apps.py --out runs/apps_binding_check
135
+ ```
136
+
137
+ The final command fetches one public APPS row and submits a fixed diagnostic program through the original Docker setting and scorer, without model calls. The three old Artifact Depot tasks remain legacy regression fixtures, described in [the archived guide](docs/legacy_v0_1.md); they are not the beta's research dataset. First party code is MIT licensed; external artifacts retain their own licenses.
138
+
139
+ See [the beta report](docs/beta_report.md) for actual validation and release status. References: [ControlArena](https://control-arena.aisi.org.uk/), [Inspect limits](https://inspect.aisi.org.uk/setting-limits.html), [NNsight](https://nnsight.net/documentation/modeling/language/), [TransformerLens](https://transformerlensorg.github.io/TransformerLens/generated/code/transformer_lens.model_bridge.bridge.html), [Captum](https://captum.ai/api/layer.html), [SAE Lens](https://jbloomaus.github.io/SAELens/).
@@ -0,0 +1,137 @@
1
+ # MARGIN Arena beta implementation report
2
+
3
+ Date: September 14, 2026. Package version: 0.2.0b1.
4
+
5
+ ## Purpose
6
+
7
+ The user requested an installable environment where researchers select an open weight model, connect existing datasets, and vary five countable resources. Its scope is detection, analysis, and understanding of agent behavior. Interventions are excluded and belong to later work. MARGIN is an experimental environment, not a new benchmark dataset, model ranking, or established finding about reward hacking.
8
+
9
+ This beta connects external Inspect samples and ControlArena settings instead of expanding the three original Artifact Depot tasks. Those remain legacy regression fixtures. Prior HTR study records were not edited or relabeled. No GPU was allocated and no trained model research experiment was run during this release's validation.
10
+
11
+ ## Implementation inventory
12
+
13
+ | File | Responsibility |
14
+ | :--- | :--- |
15
+ | `limits.py` | Immutable resource settings and trial counters shared across sessions. |
16
+ | `arena.py` | Admission rules, source lifecycle, model execution, tool receipts, terminal stopping, and failure handling. |
17
+ | `datasets.py` | External JSONL and Hugging Face rows with explicit input, target, and ID mapping. |
18
+ | `beta_cli.py` | Installed `margin-eval` interface for model, source, resource, and capture settings. |
19
+ | `huggingface.py` | Ordinary HF model and tokenizer, exact prompt and token records, read only prefill hooks. |
20
+ | `model_worker.py` | Separate local model process, with confirmed process termination at a deadline. |
21
+ | `interpret.py` | Verified tensor loading, token tables, NNsight, TransformerLens, SAE Lens, and Captum connections. |
22
+ | `validation.py` | Independent replay of discrete resource accounting and raw record integrity. |
23
+ | `tests/` | Counter boundaries, external task integration, worker cancellation, actual CPU generation, interpretation, and legacy regression checks. |
24
+ | `requirements/` | Separate tested CPU runtime and analysis dependency snapshots. |
25
+ | `.github/workflows/` | CPU CI and a separately triggered PyPI publishing workflow. |
26
+
27
+ The existing native vLLM adapter, passive monitor, recorded action replay, and Artifact Depot environment remain legacy components. They are not claimed to be fully integrated alternatives to every new HF feature. A remote vLLM endpoint does not automatically expose internal activations. This release adds no monitor calibration result or intervention runner.
28
+
29
+ ## Resource rules
30
+
31
+ | Resource | Count and boundary |
32
+ | :--- | :--- |
33
+ | Generated tokens | Every output ID, including reasoning, JSON, code, arguments, and report text. Before each call, reserve the smaller of its cap and remaining allowance. Settle returned usage; keep an outstanding reservation if usage is unknown. Report capacity is inside the total. |
34
+ | Time | Monotonic elapsed time from before the first actor generation, including records and tool execution. Terminate the local worker and admit no later actions at expiry. |
35
+ | Verification executions | Admitted calls to explicitly bound verification tools. An exhausted verification call never invokes the tool or consumes a normal tool slot. |
36
+ | Tool calls | Each admitted action, including submission and explicit restart. Once exhausted, only the existing report allowance is available. |
37
+ | Sessions | Initial attempt plus explicitly admitted restarts. Reset mutable source state with the source callback, while preserving every resource counter and prior record. |
38
+
39
+ Model loading and initial sandbox preparation precede the actor clock; source scoring and cleanup follow it. These phases still have operational cost. Polling and process termination add a measured delay, so the implementation does not promise an exact millisecond stop. Input tokens are recorded separately and do not consume output allowance.
40
+
41
+ Final submission or refusal is terminal even when resources remain. No additional response is requested after a final answer. Per call truncation is terminal and cannot execute a partial action. No context trimming, automatic JSON repair, hidden retry, or backend switching is performed. Model errors stop later actor execution. Incorrect task answers, malformed outputs, truncation, and infrastructure failures remain distinct.
42
+
43
+ Missing source bindings fail before generation. An active verification limit requires actual named tools; mutable multi session tasks require an explicit asynchronous reset callback. Named tool invocation counting is a true service execution limit only when the source makes that service exclusive. Alternative access through an unrestricted shell is not automatically prevented. Tools that secretly invoke other models are unsupported because their tokens are outside this ledger.
44
+
45
+ External tool deadlines cancel the awaiting coroutine and mark remote effects unconfirmed. Reset timeout effects are similarly unconfirmed. The source sandbox must terminate remote processes. Only the local model worker's termination is confirmed by MARGIN. These distinctions must remain visible in any experimental claim.
46
+
47
+ ## External datasets and scoring
48
+
49
+ `Arena.task` accepts Inspect samples, source tools, scorer, sandbox, setup, post submission hook, and optional reset. `Arena.from_control_arena` uses the setting's public lifecycle in honest task mode. The actor receives the setting description and main task; hidden solutions and side task metadata stay outside the prompt. This is setting integration, not execution of ControlArena attack or control protocols.
50
+
51
+ The JSONL and Hub loaders expose only the selected input field. The target remains available to the scorer. Hub revisions resolve to a commit and row hashes preserve provenance. Each evaluation saves a full source sample snapshot, sample hash, setting configuration, package versions, limits, seed, and package source hash. External images and source assets must also be preserved if they are not in those samples. Merely loading a SWE bench issue is not a SWE bench evaluation without its repository environment and official tests.
52
+
53
+ One actual upstream APPS row was exercised through the original setting, Docker sandbox, submit tool, and scorer:
54
+
55
+ | Item | Observed value |
56
+ | :--- | :--- |
57
+ | Dataset | `RoganInglis/apps-control-arena` |
58
+ | Revision | `29db28f76042952d56add8671f798280b200744d` |
59
+ | Sample | `0` |
60
+ | Setting | ControlArena 19.0.0 `AppsSetting` |
61
+ | Submission | Fixed diagnostic program `print(0)` |
62
+ | Model inference | Zero calls |
63
+ | Execution | One original submit invocation, then terminal stop |
64
+ | Scorer | Original `apps_scorer`, one source test case |
65
+ | Task result | `main_task_success = I`; expected `4`, observed `0` |
66
+ | Infrastructure | Diagnostic execution succeeded and the sandbox was cleaned up |
67
+ | Journal | Nine events; `a0fa7681c69928ecbdac59198eb7d8fb16986aa3e758781511e783df31bf607d` |
68
+
69
+ The deliberately wrong program verifies that task failure does not become infrastructure failure. This is a software diagnostic, not a measurement of model APPS ability. APPS has no interactive verification tool, so the usage example does not invent one. Its Python 3.4 image is an upstream compatibility requirement.
70
+
71
+ ## Exact model and activation records
72
+
73
+ The HF backend retains ordinary model and tokenizer objects, applies the model's chat template, and requests one strict JSON action or final report. It saves rendered text, input IDs, attention mask, generated IDs, original response, tool schema, sampling settings, and model identity. Models must have a chat template and fit the chosen device; encoder decoder models, quantization, and automatic multi GPU placement are outside this beta. Open weight model selection is not a guarantee of structured output competence. Validate each intended model contract on development cases.
74
+
75
+ Read only PyTorch hooks save selected module outputs from the first prefill forward of the original generation. Every artifact has a unique request ID, input and output IDs, token positions, module names, shapes, dtypes, phase, model identity, forward call count, and safetensors hash. The loader verifies bytes and tensor metadata. Decode step activations are not stored. Offline replay is explicitly different from observation during original generation and may differ numerically across kernels, dtype, cache, and package versions.
76
+
77
+ Inspect logs retain the external scores. Their top level model name is the explicitly unused `mockllm/margin_transport_unused` transport. Actual inference occurs through MARGIN's backend, identified in the configuration and each trial. Do not attribute a model result to the placeholder.
78
+
79
+ The `margin verify-trial PATH` command replays resource admissions and settlement, checks raw token counts, verifies the journal chain, and compares the final summary with the journal. It does not rerun the external scorer, prove human review, or authenticate a host capable of rewriting all files and hashes.
80
+
81
+ ## Interpretation compatibility actually checked
82
+
83
+ | Library | Tested connection | Scope |
84
+ | :--- | :--- | :--- |
85
+ | PyTorch and safetensors 0.8.0 | Original prefill capture, tensor round trip, hash and shape verification | Three generated tokens included two later one token cached forwards. Hooked and unhooked runs matched output IDs and followup logits on a small untrained CPU GPT2. |
86
+ | NNsight 0.7.0 | Existing HF model wrapped in `LanguageModel`; actual trace saves MLP output | CPU observation integration, not all architectures or remote services. |
87
+ | TransformerLens 3.9.0 | Existing HF weights through `TransformerBridge`; cache and logits compared | No legacy weight folding. Other architectures require separate equivalence checks. |
88
+ | SAE Lens 6.51.0 | `StandardSAE.encode` after declared revision, module, and width checks | Untrained test SAE only; pretrained SAE choice and training preprocessing must match separately. |
89
+ | Captum 0.9.0 | Actual `LayerActivation` output | Observation compatibility; no attribution or intervention conclusion. |
90
+ | pandas and HF Datasets | One row per generated token joined to request and prompt position | Exports checked against raw records. |
91
+
92
+ An additional tiny local saved model was loaded by the actual worker and run through an external Inspect task. Its three output tokens, terminal truncation, activation artifact, ledger verification, and process cleanup were checked. These are CPU software diagnostics with untrained models, not new research experiments or evidence that the environment elicits reward hacking.
93
+
94
+ Runtime and analysis must currently be separate environments. ControlArena 19 requires Hugging Face Hub below 1; TransformerLens 3.9 requires Transformers 5 and Hub 1 or later. Runtime used Transformers 4.57.6; analysis used 5.17.0. Both used Python 3.12 and Torch 2.14.0+cpu. Both passed `pip check`. Saved tensors and exact input records connect the environments; no incompatible combined `all` extra is advertised.
95
+
96
+ ## Intermediate review and fixes
97
+
98
+ Checks were inspected during development rather than only at the end. The following issues were corrected:
99
+
100
+ 1. Inspect dataset names are read only after construction; the adapter now sets the name in its initializer.
101
+ 2. The tool executor requires a message list and returns messages plus optional nested generation. The adapter now uses that contract and rejects unmetered nested generation.
102
+ 3. A source submission can have a custom name. Termination now uses the actual configured name.
103
+ 4. Inspect could schedule another sample despite its fail on error setting. A failure latch now prevents later actor execution; a test checks that the simulated first kernel failure creates only one trial.
104
+ 5. TransformerBridge was not exported at the installed package's top level. The documented module import now passes a real cache and logits test.
105
+ 6. ControlArena metadata contains enum values. Pydantic JSON conversion now preserves them in the journal. The failed first APPS diagnostic remains separate from its corrected run.
106
+ 7. Legacy source identification could scan an entire site packages directory after installation. Installed wheels now check their own RECORD hashes; source checkouts retain manifest verification.
107
+ 8. Reset timeout and nontext tool observations now preserve explicit failure or unconfirmed effect records instead of silently claiming compatibility.
108
+
109
+ The regression suite checks counter boundaries, denial before service execution, persistent resources across resets, terminal submission, no context trimming, truncated action rejection, batch stopping, summary tamper rejection, actual cached generation, process termination, and analysis connections. Legacy Docker tests cover reference repairs, unauthorized exposure followed by restoration, protected paths, and editable tests that cannot forge the independent score.
110
+
111
+ Upstream NNsight and SAE Lens emit deprecation warnings. Repeated Inspect evaluations emit an AnyIO unclosed stream warning; the analysis stack also emits an unclosed `/dev/null` warning. These are retained in logs. MARGIN tests check model process and task container termination, but the upstream warnings are not claimed to be fixed.
112
+
113
+ ## Distribution and reproduction
114
+
115
+ Local validation completed with 50 tests discovered in the runtime environment: 46 passed and four optional interpretation tests were skipped there. The separate analysis environment ran all seven interpretation tests successfully, including those four. Thus all 50 distinct tests were exercised successfully across the two environments. The final runtime suite took 155.847 seconds; the seven analysis tests took 32.371 seconds. All four actual Docker tests passed. Both dependency environments passed `pip check`.
116
+
117
+ An earlier full suite run encountered a source manifest mismatch while distribution assembly was running concurrently in the same tree. The builder temporarily creates a source archive staging directory. The failure was preserved; the final suite ran with the source unchanged and passed. Build and source verification now run sequentially. Source archive verification also recognizes the two exact setuptools metadata files added during packaging, while still checking every frozen source file.
118
+
119
+ The wheel was installed into a fresh environment outside the checkout. The installed commands, packaged Docker assets, wheel RECORD checks, an external Inspect task, its original match scorer, and journal replay all passed without using the source directory. Wheel and source archive metadata passed `twine check`. Final public installation and publication details are recorded in the delivery report.
120
+
121
+ The public repository is [CarterYoo/margin-arena](https://github.com/CarterYoo/margin-arena). Wheel and source archive builds expose `margin` and `margin-eval`. Source, tests, documentation, package assets, and dependency snapshots are covered by `release.json`. Runs, build output, caches, and credentials are excluded. Old 0.1 records and archives remain historical.
122
+
123
+ CI defines separate runtime and analysis CPU jobs. PyPI publishing is a separately triggered workflow using Trusted Publishing. Ordinary pushes do not automatically publish. GitHub creation is complete. PyPI creation needs the user's authenticated account and a pending publisher bound to owner `CarterYoo`, repository `margin-arena`, workflow `publish.yml`, environment `pypi`. A configured pending publisher alone neither reserves a name nor establishes that upload succeeded. The final delivery report records actual publication and installation results.
124
+
125
+ Use the README's commands with fixed source and model revisions. Begin with a few development examples checking exact context, tokenization, output format, actual effects, scores, and stop behavior. Review records before scaling. An invalid interface or excessive refusal is a measurement issue to diagnose, not a scientific null result. Preserve failed and negative outcomes and version any protocol revision.
126
+
127
+ ## Current claim
128
+
129
+ MARGIN is a beta environment with explicit resource admission rules, external task integration, original generation records, and tested analysis interfaces. These particular CPU paths have been exercised. This does not show that resource scarcity causes reward hacking, that a model feels pressure, that every source has exclusive verification access, or that observational activations identify a causal neural mechanism. Those remain questions for calibrated model studies.
130
+
131
+ ## Primary references
132
+
133
+ Architecture and data: [ControlArena](https://control-arena.aisi.org.uk/), [its Setting interface](https://github.com/UKGovernmentBEIS/control-arena/blob/main/control_arena/settings/_setting.py), [Inspect limits](https://inspect.aisi.org.uk/setting-limits.html), [upstream APPS data](https://huggingface.co/datasets/RoganInglis/apps-control-arena).
134
+
135
+ Analysis interfaces: [NNsight](https://nnsight.net/documentation/modeling/language/), [TransformerLens TransformerBridge](https://transformerlensorg.github.io/TransformerLens/generated/code/transformer_lens.model_bridge.bridge.html), [SAE Lens](https://jbloomaus.github.io/SAELens/), [Captum](https://captum.ai/api/layer.html). Interfaces were also exercised in the exact installed versions described above.
136
+
137
+ Distribution: [PyPI project creation through Trusted Publishing](https://docs.pypi.org/trusted-publishers/creating-a-project-through-oidc/), [the publishing workflow](https://docs.pypi.org/trusted-publishers/using-a-publisher/).