OpenAdapt-Veto-4B-r6

Website ยท Docs ยท GitHub ยท Hugging Face Org

Local visual safety verifier for desktop and web GUI agents. OpenAdapt-Veto-4B-r6 inspects a post-action screenshot and intended state summary at commit boundaries and returns one calibrated verdict token (PASS, VETO, or ABSTAIN) in 357 ms p50 at $0 API cost. When uncertain (ABSTAIN), the runtime stops and escalates to a human reviewer rather than accepting the action.

Model Summary

Property Value
Base model Qwen/Qwen3.5-4B
Adapter type PEFT LoRA (r=16, lora_alpha=32, 7 linear projections)
Adapter size 81 MB (safetensors)
Inference memory 3.15 GB VRAM (4-bit NF4, bfloat16 compute)
Decode method Constrained 3-token single-step decode (PASS / VETO / ABSTAIN)
Median latency 357 ms p50
License Apache-2.0

Out-of-Distribution Evaluation (Zero-Leak App Split)

Evaluated on a strict zero-leak cross-application split with zero overlapping applications between training and test sets:

  • Train split: 6 Ubuntu desktop applications (N = 440)
  • Held-out OOD test split: 4 unseen desktop applications โ€” GIMP, LibreOffice Calc, Thunderbird, and VLC (N = 160)
Metric (Held-Out 4 Unseen Apps, N = 160) Previous (OpenAdapt-Veto-4B-r5) OpenAdapt-Veto-4B-r6
OOD AUROC 0.6272 0.7905 (DeLong p = 0.0051)
OOD False-Positive Rate (Session-Start z-score) 37.9% 6.9%
Benign Utility (Clean Actions Accepted) 62.1% 93.1%
Median Latency (Constrained 3-Token Decode) โ€” 357 ms
GPU Memory (4-bit NF4) 3.13 GB 3.15 GB

Quickstart

1. With openadapt wrap

Wrap any desktop or web GUI agent with deterministic commit-boundary checks plus local OpenAdapt-Veto-4B-r6 visual verification:

pip install openadapt
openadapt wrap --veto-model OpenAdapt/openadapt-veto-4b-r6 -- <your-agent-command>

2. Standalone Python (transformers + peft)

import json, math, torch
from PIL import Image
from peft import PeftModel
from transformers import AutoModelForImageTextToText, AutoProcessor, BitsAndBytesConfig

BASE_MODEL = "Qwen/Qwen3.5-4B"
ADAPTER_ID = "OpenAdapt/openadapt-veto-4b-r6"
LABELS = ("PASS", "VETO", "ABSTAIN")

SYSTEM_PROMPT = (
    "You are OpenAdapt-Veto, a strict visual verification guard. "
    "Inspect the post-action screenshot and intended state summary. "
    "Reply with exactly one token: PASS, VETO, or ABSTAIN. "
    "If any validation error, wrong field value, unexpected state, or session reset is visible, reply VETO. "
    "If the target region is occluded or ambiguous, reply ABSTAIN. "
    "Never guess PASS when uncertain."
)

bnb = BitsAndBytesConfig(
    load_in_4bit=True,
    bnb_4bit_quant_type="nf4",
    bnb_4bit_compute_dtype=torch.bfloat16,
    bnb_4bit_use_double_quant=True,
)
processor = AutoProcessor.from_pretrained(ADAPTER_ID)
base = AutoModelForImageTextToText.from_pretrained(
    BASE_MODEL, quantization_config=bnb, device_map="auto", torch_dtype=torch.bfloat16
)
model = PeftModel.from_pretrained(base, ADAPTER_ID).eval()

image = Image.open("post_action.png").convert("RGB")
dom_summary = {"intended_fields": {"record_id": "REC-0104", "amount": "$420.00"}, "aria_errors": []}
user_text = (
    "Verify whether the post-action screenshot matches the intended state with zero visual faults.\n"
    f"Intended DOM summary: {json.dumps(dom_summary, sort_keys=True)}\n"
    "Answer (PASS, VETO, or ABSTAIN):"
)
messages = [
    {"role": "system", "content": [{"type": "text", "text": SYSTEM_PROMPT}]},
    {"role": "user", "content": [{"type": "image", "image": image}, {"type": "text", "text": user_text}]},
]
prompt = processor.apply_chat_template(
    messages, tokenize=False, add_generation_prompt=True, enable_thinking=False
)
inputs = processor(text=[prompt], images=[image], return_tensors="pt").to(model.device)

label_ids = [processor.tokenizer.encode(lbl, add_special_tokens=False)[0] for lbl in LABELS]
with torch.no_grad():
    logits = model(**inputs).logits[0, -1, :].float()
    vals = [float(logits[tid].item()) for tid in label_ids]
    m = max(vals)
    exps = [math.exp(x - m) for x in vals]
    probs = [e / sum(exps) for e in exps]

verdict = LABELS[max(range(3), key=lambda i: probs[i])]
print({"verdict": verdict, "probs": dict(zip(LABELS, [round(p, 4) for p in probs]))})

Intended Use and Limitations

  • Use alongside deterministic checks: OpenAdapt-Veto-4B-r6 is designed as the visual layer paired with deterministic entity, policy, and system-of-record read-back checks.
  • Unseen themes: Calibration on new visual themes works best with session-start z-score normalization computed over the first benign screens of a session.
  • Non-visual backend errors: A screenshot verifier cannot detect backend failures that render an identical confirmation screen; pair with API or database read-back checks before marking irreversible writes complete.

Links

Downloads last month
1
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for OpenAdapt/openadapt-veto-4b-r6

Finetuned
Qwen/Qwen3.5-4B
Adapter
(1,252)
this model

Collection including OpenAdapt/openadapt-veto-4b-r6