StealthHumanizer โ GRPO-Trained AI Text Humanizer
Trained with GRPO to evade AI detectors while preserving meaning. 30 minutes on a free Colab T4.
Run Training
# Google Colab (free T4) or Kaggle (free P100):
!pip install -q trl peft transformers datasets torch sentence-transformers accelerate bitsandbytes
!huggingface-cli login --token YOUR_TOKEN
!python train.py
What it does in 30 min
- 1000 AI-generated samples from MAGE benchmark
- GRPO with G=2 against ModernBERT detector (509K training samples, 11 LLMs)
- Semantic preservation via MiniLM cosine similarity
- 4-bit QLoRA on Qwen 2.5-1.5B (fits T4 16GB)
- Auto-pushes trained adapter to this repo
Config
| Parameter | Value | Why |
|---|---|---|
| Samples | 1000 | Fits in 30min |
| Epochs | 1 | Single pass sufficient per AuthorMist findings |
| Group size G | 2 | Minimum for relative comparison, saves VRAM |
| Max tokens | 128 | Short outputs = fast generation |
| Batch | 4ร2 = 8 effective | Balances speed and gradient stability |
| LR | 3e-4 | Aggressive for fast convergence |
| LoRA r | 16 | Good quality/speed tradeoff |
| KL beta | 0.04 | Allow divergence in limited training |
After training
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
base = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-1.5B-Instruct")
model = PeftModel.from_pretrained(base, "Rofati/stealth-humanizer-grpo")
tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen2.5-1.5B-Instruct")