Feature Extraction
Transformers
Safetensors
English
vfm
verification
guardrails
llm-as-a-judge
agent-governance
custom_code
Instructions to use spitis/VFM-4B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use spitis/VFM-4B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="spitis/VFM-4B", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("spitis/VFM-4B", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
File size: 3,929 Bytes
aec9b92 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 | ---
license: apache-2.0
base_model: Qwen/Qwen3-4B
datasets:
- spitis/CriteriaBank
language:
- en
library_name: transformers
tags:
- verification
- guardrails
- llm-as-a-judge
- agent-governance
---
# VFM-4B
VFM-4B verifies natural-language criteria against a context and target text. It uses a Qwen3-4B backbone and a three-class head, pretrained on [CriteriaBank](https://huggingface.co/datasets/spitis/CriteriaBank) for *Runtime Verification of Multiple Natural Language Criteria for Agent Governance* (NeurIPS 2026).
Each criterion receives **YES** (satisfied), **NO** (not satisfied), or **N/A** (inapplicable or insufficient evidence). Criteria are scored independently over a shared prefix, without text generation. [Code and training recipes](https://github.com/spitis/vfm).
**Use**
```bash
pip install git+https://github.com/spitis/vfm
```
```python
from vfm import VFM
vfm = VFM.from_pretrained("spitis/VFM-4B")
verdicts = vfm.verify(
context="Describe today's weather.",
target="It is sunny today.",
criteria=["Does the response mention sunshine?", "Does the response mention rain?"],
)
for v in verdicts:
print(v["criterion"], v["verdict"], v["p_yes"], v["p_no"], v["p_na"])
```
`context` accepts a string or chat messages; `target` is appended as the next turn. Outputs also include `logits` and `p_yes_binary = p_yes / (p_yes + p_no)`. Use `verify_batch` for separate traces.
Keep criteria short and atomic. Prefixes are left-truncated at 4,096 tokens by default (`max_length`); criterion blocks at 64 tokens, including chat-template tokens. `verify` reuses the prefix cache across chunks of 64 criteria (`chunk_size`).
**Training and results**
Full-parameter pretraining uses 393,531 model-labelled CriteriaBank rows, cross-entropy plus KL to the frozen base model (λ = 1), AdamW, and batch size 128. The released checkpoint is the one saved at **step 2,000 of the 3,075 pretraining steps**.
Paper results below use the released weights for zero-shot evaluation; ternary benchmarks use their YES/NO subset.
| Benchmark | Zero-shot ROC-AUC |
|---|---:|
| InFoBench | 0.942 |
| Synthetic governance | 0.927 |
| ContractNLI | 0.899 |
| INSURE-Dial | 0.671 |
| BeaverTails | 0.779 |
| IFEval | 0.704 |
| PRM800K | 0.782 |
| LLM-AggreFact | 0.857 |
After benchmark finetuning (mean ± standard deviation over three seeds):
| Benchmark | Metric | Score |
|---|---|---:|
| Synthetic governance | Accuracy (%) | 88.8 ± 1.1 |
| Governance transfer | Accuracy (%) | 77.7 ± 0.8 |
| INSURE-Dial | Accuracy (%) | 86.5 ± 1.6 |
| BeaverTails | F1 (%) | 82.6 ± 0.4 |
| IFEval | Balanced accuracy (%) | 95.1 ± 0.6 |
| PRM800K | Balanced accuracy (%) | 82.1 ± 0.6 |
| LLM-AggreFact | Balanced accuracy (%) | 76.3 ± 0.8 |
| ContractNLI | Macro-F1 (%) | 84.2 ± 0.6 |
| DynaBench | Trace-level FAIL F1 | 0.885 ± 0.011 |
Passing VFM's top three rules to a Gemma-4-26B-A4B-it judge raises DynaBench FAIL F1 to **0.946 ± 0.005**.
Finetuned results require separate benchmark training. Governance uses dev selection; INSURE-Dial uses five-fold checkpoint selection over real calls.
**Limitations**
Finetune and tune decision thresholds for your domain. Zero-shot calibration and N/A prediction are weak. Labels are model-generated; evaluations are English-only and text-only. Even the best finetuned verifier approves about 20% of gold violations on INSURE-Dial. Use for monitoring and escalation, not standalone enforcement.
**License:** Apache-2.0, including the Qwen3-4B base model. Tokenizer files are unchanged from Qwen3.
**Citation**
```bibtex
@inproceedings{pitis2026vfm,
title = {Runtime Verification of Multiple Natural Language Criteria for Agent Governance},
author = {Pitis, Silviu and Alamdari, Parand A. and Tang, Jessica and Klassen, Toryn Q. and McIlraith, Sheila A.},
booktitle = {Advances in Neural Information Processing Systems},
year = {2026}
}
```
|