sriram1983007 commited on
Commit
76b6f15
·
verified ·
1 Parent(s): f695220

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +12 -70
README.md CHANGED
@@ -7,7 +7,6 @@ language:
7
  - en
8
  pipeline_tag: text-generation
9
  library_name: transformers
10
-
11
  tags:
12
  - stablecoin
13
  - payments
@@ -21,7 +20,6 @@ tags:
21
  - web3
22
  - usdc
23
  - eip-3009
24
- - compliance
25
  - fraud-detection
26
  - financial-risk
27
  - qwen
@@ -29,80 +27,24 @@ tags:
29
  - text-generation
30
  ---
31
 
32
- Base Model: huggingface.co/sriram1983007/SRA-RiskGate-4B
33
-
34
- GGUF Repo: huggingface.co/sriram1983007/SRA-RiskGate-4B-Q4_K_M-GGUF
35
-
36
- ### 🦙 Run Instantly with Ollama
37
-
38
- ```bash
39
- ollama run sriram1983007/sra-riskgate
40
-
41
- # SRA-RiskGate-4B
42
-
43
- A small model for both ends of a stablecoin payment's life:
44
-
45
- - **Risk gate:** give it a payment (an x402 request, an EIP-3009 authorization, or an ERC-20 transfer), your
46
- policy, and your verification tool results; it returns `approve` / `hold` / `reject` with reasons.
47
- - **Dispute adjudication:** give it a dispute with signed evidence and escrow/ledger state; it decides
48
- what can actually happen across the settlement-finality line (void before release, arbiter refund from
49
- escrow or from a merchant bond, voluntary refund, deny, escalate, or no enforceable remedy), with exact
50
- amount, destination and an idempotency key for any refund. It never proposes reversing a final payment. Fine-tuned from `Qwen/Qwen3-4B-Instruct-2507` on [sriram1983007/sra-stablecoin-risk-bench](https://huggingface.co/datasets/sriram1983007/sra-stablecoin-risk-bench).
51
-
52
- # 🛡 SRA-RiskGate-4B
53
 
54
  [![Interactive Demo](https://img.shields.io/badge/Demo-Interactive%20Space-blue?style=for-the-badge&logo=huggingface)](https://sriram1983007-sra-riskgate-demo.static.hf.space/index.html)
55
  [![Dataset](https://img.shields.io/badge/Dataset-Risk%20Bench-green?style=for-the-badge&logo=huggingface)](https://huggingface.co/datasets/sriram1983007/sra-stablecoin-risk-bench)
 
 
56
 
57
- **SRA-RiskGate-4B** is an autonomous risk scoring, compliance verification, and dispute resolution model fine-tuned on top of `Qwen/Qwen3-4B-Instruct-2507`.
58
-
59
- * **Overall SRA Score:** `0.9159`
60
- * **Risk Decision Accuracy:** `99.49%`
61
- * **Unsafe Approval Rate:** `0.47%` (Threshold: $\le 2.0\%$)
62
- * **Dispute Impossible Remedy Rate:** `0.19%` (Threshold: $\le 1.0\%$)
63
- * **JSON Schema Validity:** `100.0%`
64
-
65
- ## Results on the SRA benchmark (test split, 2,000 payments)
66
-
67
- | model | sra_score | risk gate score | unsafe approvals | dispute score | impossible remedies | wrongful refunds | refund detail acc. |
68
- |---|---|---|---|---|---|---|---|
69
- | Qwen/Qwen3-4B-Instruct-2507 (untrained) | 0.421 | 0.443 | 0.345 | 0.400 | 0.000 | 0.000 | 0.000 |
70
- | **SRA-RiskGate-4B** | 0.916 | 0.995 | 0.005 | 0.837 | 0.002 | 0.022 | 0.660 |
71
-
72
- `unsafe approvals`: payments that should have been held or rejected but were approved.
73
- `impossible remedies`: on final payments, reversals, escrow mechanisms, or forced refunds with no usable bond.
74
- `wrongful refunds`: refunds granted where the correct outcome was not a refund.
75
- Injection prompts in the test split use phrasings never seen in training.
76
-
77
- ## How to use
78
 
79
- ```python
80
- import json
81
- from transformers import pipeline
82
- gate = pipeline("text-generation", model="sriram1983007/SRA-RiskGate-4B", device_map="auto")
83
 
84
- # see sra/prompt.py in the source repo
85
- messages = build_messages(now, policy, payload, tool_results) # risk gate
86
- # messages = build_dispute_messages(now, policy, case, tool_results) # dispute
87
- out = gate(messages, max_new_tokens=512, do_sample=False)[0]["generated_text"][-1]["content"]
88
- verdict = json.loads(out)
89
- ```
90
-
91
- The model expects **tool results** (signature verification, attestation checks, sanctions screening) in the
92
- prompt. It does not do cryptography and does not know any sanctions list. Always run live screening
93
- through a tool.
94
-
95
- ## Intended use and limits
96
 
97
- - A **triage and explanation layer** in front of human or rule-based controls for agent payments,
98
- stablecoin operations and dispute desks. It is not a compliance program, not an arbiter, and not legal
99
- advice. Dispute recommendations should be reviewed by a person before funds move.
100
- - Trained on synthetic data with templated explanations; expect distribution shift on real payloads,
101
- and validate on your own traffic before relying on it.
102
- - Keep a deterministic backstop: sanctions hits and invalid signatures should be rejected by code,
103
- whatever the model says.
104
 
105
- ## Training
106
 
107
- LoRA (r=32, alpha=64, all projections, 4-bit NF4 base during training), 1 epoch, lr 1e-4 cosine, effective batch 16,
108
- max length 3072, loss on the verdict only. Trained with TRL `SFTTrainer`.
 
7
  - en
8
  pipeline_tag: text-generation
9
  library_name: transformers
 
10
  tags:
11
  - stablecoin
12
  - payments
 
20
  - web3
21
  - usdc
22
  - eip-3009
 
23
  - fraud-detection
24
  - financial-risk
25
  - qwen
 
27
  - text-generation
28
  ---
29
 
30
+ # 🛡️️ SRA-RiskGate-4B
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31
 
32
  [![Interactive Demo](https://img.shields.io/badge/Demo-Interactive%20Space-blue?style=for-the-badge&logo=huggingface)](https://sriram1983007-sra-riskgate-demo.static.hf.space/index.html)
33
  [![Dataset](https://img.shields.io/badge/Dataset-Risk%20Bench-green?style=for-the-badge&logo=huggingface)](https://huggingface.co/datasets/sriram1983007/sra-stablecoin-risk-bench)
34
+ [![GGUF Quantized](https://img.shields.io/badge/GGUF-Q4__K__M-yellow?style=for-the-badge&logo=huggingface)](https://huggingface.co/sriram1983007/SRA-RiskGate-4B-Q4_K_M-GGUF)
35
+ [![Ollama Registry](https://img.shields.io/badge/Ollama-Registry-black?style=for-the-badge&logo=ollama)](https://ollama.com/sriram1983007/sra-riskgate)
36
 
37
+ An autonomous risk scoring, compliance verification, and dispute adjudication model fine-tuned from `Qwen/Qwen3-4B-Instruct-2507` on [sra-stablecoin-risk-bench](https://huggingface.co/datasets/sriram1983007/sra-stablecoin-risk-bench).
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38
 
39
+ A specialized 4B model designed for both ends of a stablecoin payment lifecycle:
40
+ - **Risk Gate:** Evaluates incoming payment operations (x402 requests, EIP-3009 authorizations, or raw ERC-20 transfers) against policy constraints and verification tool results to return deterministic `approve`, `hold`, or `reject` verdicts with structured reasoning.
41
+ - **Dispute Adjudication:** Ingests dispute evidence and escrow/ledger state to determine legally and technically viable remedies across settlement-finality boundaries (void before release, arbiter escrow refund, merchant bond claim, voluntary refund, deny, or escalate) complete with exact amount, destination address, and idempotency keys. It strictly avoids proposing impossible reversals on final ledger state.
 
42
 
43
+ ---
 
 
 
 
 
 
 
 
 
 
 
44
 
45
+ ### 🦙 Quickstart with Ollama
 
 
 
 
 
 
46
 
47
+ Run locally via the official Ollama registry:
48
 
49
+ ```bash
50
+ ollama run sriram1983007/sra-riskgate