InferenceGuard Privacy Rewriter (Qwen2.5-1.5B-Instruct QLoRA)

PEFT QLoRA adapter for Qwen/Qwen2.5-1.5B-Instruct trained to rewrite user prompts so that implicit demographic cues (age, location, occupation, education, income) cannot be inferred while preserving task-relevant questions, constraints, and non-author entities.

Training Summary

  • Base Model: Qwen/Qwen2.5-1.5B-Instruct (4-bit NF4 QLoRA, r=32, alpha=64, dropout=0.10)
  • Dataset: data/sft/teacher_v2/train.jsonl (4,034 single-turn rows: Qwen2.5-7B-Instruct SynthPAI rewrites filtered by DeBERTa-v3 NLI & numerical retention + 2,000 position-controlled augmented examples + 605 identity no-ops)
  • Loss Masking: assistant_only_loss=True (completion-only supervision)

Evaluation Results

  • Span-Annotated Benchmark 50 (53 cases): 46/53 (86.8%) pass rate, 1.0000 mean PII span removal rate, 0 copy-through failures.
  • Held-Out Adversary (microsoft/Phi-4-mini-instruct, PromptPAI n=50):
    • Raw text attacker accuracy: 0.3650
    • Presidio PII-redacted: 0.3600
    • Prompt-only Qwen2.5-1.5B: 0.1850
    • Fine-tuned QLoRA (qlora_sft): 0.1500 (58.9% relative reduction vs. Raw/Presidio)

Usage

from src.rewriter.inference import QwenRewriterInference

rewriter = QwenRewriterInference(
    model_name_or_path="Qwen/Qwen2.5-1.5B-Instruct",
    adapter_path="AT707/inferenceguard-rewriter-v1",
    load_in_4bit=True,
)
print(rewriter.rewrite("I am a 26yo engineer in Seattle. How do I optimize FastAPI?"))
Downloads last month
890
Safetensors
Model size
2B params
Tensor type
BF16
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for AT707/inferenceguard-rewriter-v1

Adapter
(1,784)
this model