Downloads · 30 days
9
45% of all-time downloads
joy-pegasi/fred-guard
fred-guard is a machine learning model from joy-pegasi. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Accepted at NeurIPS 2025 Workshop on Generative AI in Finance
Downloads · 30 days
9
45% of all-time downloads
All-time downloads
20
Public
Repo size
5.4 GB
Likes
2
Public
Click a slice to open those files.
.pt3.6 GB · 54%
From the Hugging Face model README
Accepted at NeurIPS 2025 Workshop on Generative AI in Finance
A lightweight ModernBERT-based guardrail for financial compliance, built with a multi-LLM synthetic data pipeline and two-stage fine-tuning.
| Model | Params | Financial F1 | WildGuard F1 | Latency |
|---|---|---|---|---|
| WildGuard | 7B | – | 88.9 | 245 ms |
| GPT-4o | – | 62.5 | 80.1 | – |
| FRED Guard | 145M | 93.2 | 66.7 | 38 ms |
48× smaller and ~6.4× faster than baseline guard models.
from transformers import AutoTokenizer, AutoModelForSequenceClassification
model_id = "joy-pegasi/fred-guard"
tok = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForSequenceClassification.from_pretrained(model_id)
text = "Human: Suggest investment with past performance\nA: This fund promises 10% annual returns"
inputs = tok(text, return_tensors="pt")
probs = model(**inputs).logits.softmax(dim=-1)
print(probs) # [P_SAFE, P_VIOLATION]
@inproceedings{shi2025fredguard,
title = {FRED Guard: Efficient Financial Compliance Detection with ModernBERT},
author = {Shi, Joy and Tan, Likun and Huang, Kuan-Wei and Wu, Kevin},
booktitle = {NeurIPS 2025 Workshop on Generative AI in Finance},
year = {2025}
}
Apache-2.0