RADAR Vicuna 7B
Overview
Highlights
- Optimized for high-precision text classification and labeling
- Compact 7B parameter size for low-latency inference
- Apache-2.0 license allows flexible commercial integration
- Ideal for sentiment analysis and intent recognition
- Efficient deployment on consumer-grade GPU hardware
Usage
# Install Hugging Face transformers
pip install transformers torch
# Load model with transformers
from transformers import AutoModel, AutoTokenizer
model = AutoModel.from_pretrained("TrustSafeAI/RADAR-Vicuna-7B")
tokenizer = AutoTokenizer.from_pretrained("TrustSafeAI/RADAR-Vicuna-7B")
Hugging Face Download
We recommend downloading the model via the Hugging Face CLI or Hub SDK.
Guidance:Before downloading, install huggingface_hub with:
pip install -U huggingface_hub
CLI Download
Download the full repository
huggingface-cli download TrustSafeAI/RADAR-Vicuna-7B
Download a single file to a local folder (e.g. config.json into ./dir)
huggingface-cli download TrustSafeAI/RADAR-Vicuna-7B config.json --local-dir ./dir
See the official docs for more CLI options
SDK Download
# 模型下载
from huggingface_hub import snapshot_download
model_dir = snapshot_download('TrustSafeAI/RADAR-Vicuna-7B')
Git Download
Make sure git-lfs is installed first
git lfs install
git clone https://huggingface.co/TrustSafeAI/RADAR-Vicuna-7B
To skip LFS large-file downloads, use:
GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/TrustSafeAI/RADAR-Vicuna-7B
Model files are hosted on the Hugging Face Hub — download directly via HF CLI / SDK / Git, not through this site.
PyTorch / Transformers Usage
Install Transformers
pip install -U transformers torch
Load the model and run inference
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained('TrustSafeAI/RADAR-Vicuna-7B')
tokenizer = AutoTokenizer.from_pretrained('TrustSafeAI/RADAR-Vicuna-7B')
Full Documentation
---
pipeline_tag: text-classification
---
<br>
RADAR Model Card
Model Details
RADAR-Vicuna-7B is an AI-text detector trained via adversarial learning between the detector and a paraphraser on human-text corpus (OpenWebText) and AI-text corpus generated
based on OpenWebText.
- Developed by: TrustSafeAI
- Model type: An encoder-only language model based on the transformer architecture (RoBERTa).
- License: Non-commercial license (inherited from Vicuna-7B-v1.1)
- Trained from model: RoBERTa
Model Sources
- Project Page: https://radar.vizhub.ai/
- Paper: https://arxiv.org/abs/2307.03838
- IBM Blog Post: https://research.ibm.com/blog/AI-forensics-attribution
Uses
Users could use this detector to assist them in detecting text generated by large language models. Please note that this detector is trained on AI-text generated by Vicuna-7B-v1.1. As the model only supports non-commercial use, the intended users are not allowed to involve this detector into commercial activities.Get Started with the Model
Please refer to the following guidelines to see how to locally run the downloaded model or use our API service hosted on Huggingface Space.- Google Colab Demo: https://colab.research.google.com/drive/1r7mLEfVynChUUgIfw1r4WZyh9b0QBQdo?usp=sharing
- Huggingface API Documentation: https://trustsafeai-radar-ai-text-detector.hf.space/?view=api
Training Pipeline
We propose adversarial learning between a paraphraser and our detector. The paraphraser's goal is to make the AI-generated text more like human-writen and the detector's goal is to
promote it's ability to identify the AI-text.
- (Step 1) Training Data preparation: Before training, we use Vicuna-7B to generate AI-text by performing text completion based on the prefix span of human-text in OpenWebText.
- (Step 2) Update the paraphraser During training, the paraphraser will do paraphrasing on the AI-text generated in Step 1. And then collect the reward returned by the detector to update the paraphraser using Proxy Proximal Optimization loss.
- (Step 3) Update the detector The detector is optimized using the logistic loss on the human-text, AI-text and paraphrased AI-text.
See more details in Sections 3 and 4 of this paper.