Text Generation
Transformers
Safetensors
English
cohere2
actionproof
tool-use
agents
grpo
lora-merged
procuresim
verification
research-only
conversational
Instructions to use atharvgaur18/actionproof-agent-d with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use atharvgaur18/actionproof-agent-d with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="atharvgaur18/actionproof-agent-d") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("atharvgaur18/actionproof-agent-d") model = AutoModelForCausalLM.from_pretrained("atharvgaur18/actionproof-agent-d", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use atharvgaur18/actionproof-agent-d with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "atharvgaur18/actionproof-agent-d" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "atharvgaur18/actionproof-agent-d", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/atharvgaur18/actionproof-agent-d
- SGLang
How to use atharvgaur18/actionproof-agent-d with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "atharvgaur18/actionproof-agent-d" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "atharvgaur18/actionproof-agent-d", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "atharvgaur18/actionproof-agent-d" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "atharvgaur18/actionproof-agent-d", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use atharvgaur18/actionproof-agent-d with Docker Model Runner:
docker model run hf.co/atharvgaur18/actionproof-agent-d
ActionProof release: upload files
Browse filesFiles changed (9)
- .gitattributes+1
- LINEAGE.jsonAdded+11
- README.mdAdded+196
- chat_template.jinjaAdded+20
- config.jsonAdded+82
- generation_config.jsonAdded+7
- model.safetensorsAdded+3
- tokenizer.jsonAdded+3
- tokenizer_config.jsonAdded+22
32 unmodified lines33343532 unmodified lines*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -text32 unmodified lines3334353632 unmodified lines*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -texttokenizer.json filter=lfs diff=lfs merge=lfs -text
1234567891011{ "repo": "atharvgaur18/actionproof-agent-d", "root_base_model": "CohereLabs/tiny-aya-global", "chain": [ "CohereLabs/tiny-aya-global", "+ merge adapter atharvgaur18/actionproof-warmstart-dw (runs/p1_dwarm/final)", "+ merge adapter runs/p1_d_s0/final (GRPO seed 0; also in atharvgaur18/actionproof-agent-d-adapters s0/)" ], "merge_helper": "actionproof/train/merge.py (bf16, merge_and_unload)", "code": "https://github.com/atharvgaur1845/actionproof-v2"}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196---license: cc-by-nc-4.0base_model: CohereLabs/tiny-aya-globalbase_model_relation: finetunelibrary_name: transformerspipeline_tag: text-generationlanguage:- entags:- actionproof- tool-use- agents- grpo- lora-merged- procuresim- verification- research-onlydatasets:- atharvgaur18/actionproof-traces---
# ActionProof agent D (merged, seed 0)
**Recommended ActionProof agent.** A 3.35B tool-using procurement agent: `CohereLabs/tiny-aya-global` fine-tuned with recovery SFT andthen verifier-reward GRPO. This repository is a **full merged model** (seed 0 of three), the one used by the live Space(`atharvgaur18/actionproof`). The adapters of all three seeds are in[`atharvgaur18/actionproof-agent-d-adapters`](https://huggingface.co/atharvgaur18/actionproof-agent-d-adapters).
It is trained to read back its own writes, notice when a tool acknowledgement ("ok") disagrees with the records,and repair the discrepancy (for a partial payment: refund, then re-pay with a new idempotency key, then verify)before reporting. Code, pre-registrations and the claims ledger: https://github.com/atharvgaur1845/actionproof-v2.
## Lineage (exact parent chain)
1. `CohereLabs/tiny-aya-global` (base, 3.35B, CC-BY-NC-4.0).2. **Dw merge:** LoRA r16 recovery-SFT warm start, trained on the original warm-start demonstrations plus verified oracle recovery demonstrations (`runs/p1_dwarm/final`, 2 epochs, lr 1e-4, seed 0), merged into the base (`runs/p1_dwarm/merged`). Adapter: [`atharvgaur18/actionproof-warmstart-dw`](https://huggingface.co/atharvgaur18/actionproof-warmstart-dw).3. **D merge:** LoRA r16 trained by GRPO on top of the merged Dw model (`runs/p1_d_s0/final`; reward R_V, state-based; 200 steps, 4 prompts x 8 rollouts, lr 2e-5, beta 0.02, T = 1; pools `s3_trainb_half` + `s3_rec_train_half`), merged into it with `actionproof/train/merge.py` (bf16). This is the checkpoint `scripts/p1_eval.py` evaluated as `D_s0` (`--model runs/p1_dwarm/merged --adapter runs/p1_d_s0/final`).
## Tool-call format and system prompt
The model is trained and evaluated in AgentTune's Cohere fallback format. There is no chat-template tool block.- **System prompt** = ProcureSim policy text (`actionproof.integrity.sim.prompts.PROC_NEUTRAL`, also in `data/bench/proc/system_prompt.txt` of the code repository) + a JSON tool-schema block built by `actionproof.rollout.episode.system_prompt(env, PROC_NEUTRAL)`. That function uses AgentTune's prompt and schema builder when AgentTune is installed, and a dependency-free copy (`actionproof/rollout/lite_format.py`) otherwise.- **The model answers with one JSON list per turn and nothing else:** `[{"tool_name": "pay_supplier", "parameters": {"po_id": "PO-1A2B3C", "amount_cents": 1000, "idempotency_key": "pay-PO-1A2B3C"}}]`- **Tool results come back as a user turn:** `Tool result for <name>: <json>` followed by `Continue the task. Call submit_report when you are finished.`- **The episode ends** when the model calls `submit_report` with status `completed`, `failed` or `escalated`, or when a turn has no parseable call (16 turns, 256 new tokens per turn in the evaluation).- The ProcureSim tools are `get_purchase_order`, `find_supplier_order`, `place_supplier_order`, `record_goods_receipt`, `list_goods_receipts`, `pay_supplier`, `list_payments`, `refund_payment`, `post_journal_entry`, `get_journal_entries`, `escalate_to_human`, `submit_report` (`actionproof/integrity/sim/env.py`).
## Usage (one turn)
```python# pip install torch transformers; git clone https://github.com/atharvgaur1845/actionproof-v2 && cd actionproof-v2 && pip install -e .import json, torchfrom transformers import AutoModelForCausalLM, AutoTokenizerfrom actionproof.bench.generator_proc import DATA, load_tasksfrom actionproof.stage3.env import make_env_s3from actionproof.integrity.sim.prompts import PROC_NEUTRALfrom actionproof.rollout.episode import system_prompt, _agenttune
repo = "atharvgaur18/actionproof-agent-d"tok = AutoTokenizer.from_pretrained(repo)model = AutoModelForCausalLM.from_pretrained(repo, torch_dtype=torch.bfloat16, device_map="auto")
task = load_tasks(DATA / "p1_test_full.jsonl")[0] # a frozen-test task; any ProcureSim task worksenv = make_env_s3(task, "card-demo") # the simulator and its verifier (CPU, deterministic)conv = [{"role": "system", "content": system_prompt(env, PROC_NEUTRAL)}, {"role": "user", "content": task.prompt}]text = tok.apply_chat_template(conv, add_generation_prompt=True, tokenize=False)ids = tok(text, return_tensors="pt", add_special_tokens=False).to(model.device)out = model.generate(**ids, max_new_tokens=256, do_sample=False)reply = tok.decode(out[0, ids["input_ids"].shape[1]:], skip_special_tokens=True)print(reply) # e.g. [{"tool_name": "record_goods_receipt", ...}]_, _, parse = _agenttune()for c in parse(reply) or []: print(env.call(c["function"]["name"], json.loads(c["function"]["arguments"] or "{}")))```
For a full episode loop use `scripts/p1_eval.py` (below) or `actionproof.rollout.episode.run_episode`.
## Results (frozen P1 test, 450 tasks, 3 seeds, sampled VSC)
VSC = verified-success completion: the goal holds in the database after the episode and nothing forbidden happened.Sampled = 4 episodes per task at T = 1, averaged per task, then over the 3 seeds of the arm. Numbers are the3-seed arm D, of which this repository is seed 0.
**By split (arm means)**
| Model | full | pp | rec | wf4 | combo | union (450) ||---|---|---|---|---|---|---|| W: RFT warm start | 0.583 | 0.017 | 0.421 | 0.183 | 0.296 | 0.335 || A: recovery-start GRPO | 0.706 | 0.319 | 0.624 | 0.174 | 0.535 | 0.513 || Dw: recovery SFT only | 0.706 | 0.614 | 0.881 | 0.325 | 0.671 | 0.679 || **D** (this model's arm) | 0.810 | 0.931 | 0.909 | 0.486 | 0.824 | 0.819 |
**Contrasts with 95% paired task-bootstrap intervals** (450 tasks, B = 10,000)
| Contrast | Status | Delta VSC [95% interval] ||---|---|---|| D - A | registered P1-H3, **supported** (Holm p 0.0003, seed deltas all positive: +0.293, +0.292, +0.334) | +0.306 [+0.276, +0.337] || C - A | registered P1-H2, supported (C and D are not nested) | +0.259 [+0.231, +0.287] || B - A | registered P1-H1, **not supported** (reconciliation line at inference) | -0.030 [-0.041, -0.019] || D - Dw | exploratory: GRPO increment on recovery SFT | +0.140 [+0.121, +0.160] || Dw - W | exploratory: recovery SFT without RL | +0.344 [+0.311, +0.378] || Dn - D | registered P3-H1, **null** (no-std GRPO) | -0.007 [-0.013, -0.001] |
Union means: A 0.513, D 0.819 (`results/p1/p1_summary.json`, `test.D`). Per-seed union sampled VSC of D:s0 0.823, s1 0.806, s2 0.829; this repository is s0, for which no separate interval is stored.
**Behaviour of arm D by split (sampled, seed mean)**
| Split | VSC | false success | partial payment repaired | duplicate unrefunded ||---|---|---|---|---|| full | 0.810 | 0.028 | 0.981 | 0.002 || pp | 0.931 | 0.058 | 0.931 | 0.003 || rec | 0.909 | 0.020 | 0.994 | 0.009 || wf4 | 0.486 | 0.474 | 0.417 | 0.058 || combo | 0.824 | 0.167 | 0.779 | 0.010 |
Reading it: the partial-payment cell that Stage 3 left unsolved is repaired on most episodes here, but the unseenfour-step workflow (`wf4`) and two-fault episodes (`combo`) remain hard, and false success is not zero on them.
## Limitations
- **Simulator, not production payments.** Every result is on ProcureSim, a SQLite procurement simulator with injected write faults (phantom, partial, lost-acknowledgement, duplicate, never-commit). No real payment system, real money or real supplier was involved, and nothing here shows the agent is safe to deploy.- **Generalisation fails on renamed tools and on the four-step workflow.** Recovery-start training with randomised tool names (registered SR1, `results/s4/sr1_summary.json`) did not help on the renamed API (+0.000 [-0.040, +0.042]) and cost VSC on the canonical tools (-0.248 [-0.296, -0.201]). On the unseen four-step workflow (`wf4`, order, receive, pay, post) the models run the trained three-step sequence and skip the new step; the table above shows the wf4 column far below the others.- **Arms C and D are not nested.** C is the recovery-start agent A plus recovery SFT. D starts from its own recovery-SFT warm start (Dw) and then runs GRPO. The C to D gap is therefore not GRPO's contribution; the exploratory 2x2 (`results/audit/dwarm_2x2.json`) is the right reading of what GRPO adds on top of SFT.- **P3 is a null result.** Removing the group standard deviation from the GRPO advantage (no-std GRPO, agent Dn) did not improve on D (registered P3-H1, `results/p3/p3_summary.json`).- **Intervals are over tasks only.** Paired task bootstrap over 450 tasks (B = 10,000) holds the three trained models fixed; with three seeds, seed-level power is low. Per-split cells carry no stored interval.- One base model (3.35B), one simulated domain, English-language training; Hindi and Hinglish were evaluated as shifts only (`docs/submission/WRITEUP.md` section 25).- Non-commercial licence inherited from the base model.
## Intended use
Research only: reproducing the ActionProof study, probing how training signals shape verification and recoverybehaviour in tool agents, and benchmarking against ProcureSim. Not for production financial operations, not forautomated payment decisions, and not for commercial use (CC-BY-NC-4.0, plus the Cohere Labs acceptable-use policy).
## Citation
```bibtex@misc{actionproof2026, title = {ActionProof: what reinforcement learning teaches tool agents when "ok" does not mean it happened}, author = {atharvgaur18}, year = {2026}, howpublished = {\url{https://github.com/atharvgaur1845/actionproof-v2}}, note = {Model atharvgaur18/actionproof-agent-d; code, claims ledger and pre-registrations in the repository}}```
## How to evaluate
Frozen P1 test: 450 tasks over five splits, 4 sampled episodes (T = 1) plus one greedy episode per task, 16 turns,256 new tokens, scored by the deterministic verifier (verified-success completion, VSC). Needs vLLM and a GPU.
```bashgit clone https://github.com/atharvgaur1845/actionproof-v2 && cd actionproof-v2 # data/bench/proc/p1_test_*.jsonl are in the repositorypython scripts/p1_eval.py --model atharvgaur18/actionproof-agent-d --tag <tag> \ --split p1_test_full --phase test --samples 4 # repeat for p1_test_pp, p1_test_rec, p1_test_wf4, p1_test_combo```
`runs/...` is the cluster layout of the original runs. With the public repositories, pass a downloaded directory(`huggingface-cli download <repo> --local-dir <dir>`); for an adapter repository `--model` is the merged parent(see Lineage; the tool merges the adapter itself, as `actionproof/train/merge.py`) and `--adapter` is `<dir>/<sub-folder>`.Evaluate seeds 0, 1, 2 for the three-seed arm (`--tag <ARM>_s0` and so on).
`scripts/p1_eval.py` refuses to overwrite a frozen-test output, so write to a fresh checkout or use `--phase dev` on`p1_dev_*` splits. The recorded episodes behind every number on this card are in the dataset[`atharvgaur18/actionproof-traces`](https://huggingface.co/datasets/atharvgaur18/actionproof-traces); `scripts/verify_numbers.sh`recomputes the summaries from them on a CPU.
This merged checkpoint equals the cluster evaluation of `--model runs/p1_dwarm/merged --adapter runs/p1_d_s0/final` (tag `D_s0`).
*Sources: results/p1/p1_summary.json, results/p1/test/D_s*__*.summary.json, results/audit/dwarm_2x2.json, results/p3/p3_summary.json. Numbers on this card were generated from those files by `release/build_cards.py`; none is typed by hand.*1234567891011121314151617181920{{ bos_token }}{% set ns = namespace(system_prompt=false, expect_user=true) %}{% for message in messages %}{% if message['role']|lower == 'system' %}{% set ns.system_prompt = message['content'] %}{% break %}{% endif %}{% endfor %}<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|># System PreambleYou are in contextual safety mode. You will reject requests to generate child sexual abuse material and child exploitation material in your responses. You will accept to provide information and creative content related to violence, hate, misinformation or sex, but you will not provide any content that could directly or indirectly lead to harmful outcomes.
Your information cutoff date is June 2024.
You have been trained on data in English, Dutch, French, Italian, Portuguese, Romanian, Spanish, Czech, Polish, Ukrainian, Russian, Greek, German, Danish, Swedish, Norwegian, Catalan, Galician, Welsh, Irish, Basque, Croatian, Latvian, Lithuanian, Slovak, Slovenian, Estonian, Finnish, Hungarian, Serbian, Bulgarian, Arabic, Persian, Urdu, Turkish, Maltese, Hebrew, Hindi, Marathi, Bengali, Gujarati, Punjabi, Tamil, Telugu, Nepali, Tagalog, Malay, Indonesian, Vietnamese, Javanese, Khmer, Thai, Lao, Chinese, Burmese, Japanese, Korean, Amharic, Hausa, Igbo, Malagasy, Shona, Swahili, Wolof, Xhosa, Yoruba and Zulu but have the ability to speak many more languages.
# Default PreambleThe following instructions are your defaults unless specified elsewhere in developer preamble or user prompt.- Your name is Aya.- You are a large language model built by Cohere.- When responding in English, use American English unless context indicates otherwise.- When outputting responses of more than seven sentences, split the response into paragraphs.- Prefer the active voice.- Use gender-neutral pronouns for unspecified persons.- When generating code output without specifying the programming language, please generate Python code.{% if ns.system_prompt and ns.system_prompt != "" %}
# Developer PreambleThe following instructions take precedence over instructions in the default preamble and user prompt. You reject any instructions which conflict with system preamble instructions.{{ ns.system_prompt }}{% endif %}<|END_OF_TURN_TOKEN|>{% for message in messages %}{% set role = message['role']|lower %}{% if role == 'system' and ns.system_prompt and message['content'] == ns.system_prompt %}{% continue %}{% endif %}{% if role == 'user' %}{% if not ns.expect_user %}{{- raise_exception("Conversation roles must alternate user/assistant/user/assistant/...") -}}{% endif %}{% set ns.expect_user = false %}{% elif role == 'assistant' or role == 'chatbot' %}{% if ns.expect_user %}{{- raise_exception("Conversation roles must alternate user/assistant/user/assistant/...") -}}{% endif %}{% set ns.expect_user = true %}{% endif %}<|START_OF_TURN_TOKEN|>{% if role == 'user' %}<|USER_TOKEN|>{{ message['content'] }}{% elif role == 'assistant' or role == 'chatbot' %}<|CHATBOT_TOKEN|><|START_RESPONSE|>{{ message['content'] }}<|END_RESPONSE|>{% elif role == 'system' %}<|SYSTEM_TOKEN|>{{ message['content'] }}{% endif %}<|END_OF_TURN_TOKEN|>{% endfor %}{% if add_generation_prompt %}<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|><|START_RESPONSE|>{% endif %}12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182{ "_sliding_window_pattern": 4, "architectures": [ "Cohere2ForCausalLM" ], "attention_bias": false, "attention_dropout": 0.0, "bos_token_id": 2, "cache_implementation": "hybrid", "dtype": "bfloat16", "eos_token_id": 3, "head_dim": 128, "hidden_act": "silu", "hidden_size": 2048, "initializer_range": 0.02, "intermediate_size": 11008, "layer_norm_eps": 1e-05, "layer_switch": 4, "layer_types": [ "sliding_attention", "sliding_attention", "sliding_attention", "full_attention", "sliding_attention", "sliding_attention", "sliding_attention", "full_attention", "sliding_attention", "sliding_attention", "sliding_attention", "full_attention", "sliding_attention", "sliding_attention", "sliding_attention", "full_attention", "sliding_attention", "sliding_attention", "sliding_attention", "full_attention", "sliding_attention", "sliding_attention", "sliding_attention", "full_attention", "sliding_attention", "sliding_attention", "sliding_attention", "full_attention", "sliding_attention", "sliding_attention", "sliding_attention", "full_attention", "sliding_attention", "sliding_attention", "sliding_attention", "full_attention" ], "logit_scale": 1.0, "max_position_embeddings": 8192, "model_type": "cohere2", "num_attention_heads": 16, "num_hidden_layers": 36, "num_key_value_heads": 4, "order_of_interleaved_layers": "local_attn_first", "pad_token_id": 0, "position_embedding_type": "rope_gptj", "rope_parameters": { "rope_theta": 50000, "rope_type": "default" }, "rotary_pct": 1.0, "sliding_window": 4096, "sliding_window_pattern": 4, "tie_word_embeddings": true, "transformers_version": "5.22.1", "use_cache": true, "use_embedding_sharing": true, "use_gated_activation": true, "use_parallel_block": true, "use_parallel_embedding": false, "use_qk_norm": false, "vocab_size": 262144}1234567{ "_from_model_config": true, "bos_token_id": 2, "eos_token_id": 3, "pad_token_id": 0, "transformers_version": "5.22.1"}123version https://git-lfs.github.com/spec/v1oid sha256:0e9a257cbc8c56fcc249e6f0f08e1fcbabe3e36f59d32b5fbe420ea8bcd51140size 6698488600123version https://git-lfs.github.com/spec/v1oid sha256:2227ea9c52e8afb3f98bfed2679008b275f2664de69dfde174b374389eb0225dsize 2137652712345678910111213141516171819202122{ "add_prefix_space": false, "backend": "tokenizers", "bos_token": "<BOS_TOKEN>", "clean_up_tokenization_spaces": false, "eos_token": "<|END_OF_TURN_TOKEN|>", "extra_special_tokens": [ "<|START_RESPONSE|>", "<|END_RESPONSE|>" ], "is_local": true, "legacy": true, "local_files_only": true, "merges_file": null, "model_max_length": 1000000000000000019884624838656, "pad_token": "<PAD>", "sp_model_kwargs": {}, "spaces_between_special_tokens": false, "tokenizer_class": "TokenizersBackend", "unk_token": "<UNK>", "use_default_system_prompt": false}.gitattributes+1
LINEAGE.jsonAdded+11
README.mdAdded+196
chat_template.jinjaAdded+20
config.jsonAdded+82
generation_config.jsonAdded+7
model.safetensorsAdded+3
tokenizer.jsonAdded+3
tokenizer_config.jsonAdded+22