Views
No views yet
| File | Description |
|---|---|
adapter_model.safetensors | LoRA adapter weights |
adapter_config.json | PEFT adapter configuration |
pip install transformers peft safetensors1from transformers import AutoTokenizer, AutoModelForCausalLM
2from peft import PeftModel
3import torch
4
5base_model = "Qwen/Qwen3-4B-Instruct-2507"
6adapter_repo = "suraj-ranganath/StealthRL-Qwen3-4B-LORA" # Update with actual repo path if different
7
8tokenizer = AutoTokenizer.from_pretrained(base_model, trust_remote_code=True)
9model = AutoModelForCausalLM.from_pretrained(
10 base_model,
11 device_map="auto",
12 trust_remote_code=True,
13)
14model = PeftModel.from_pretrained(model, adapter_repo)
15model.eval()1text = (
2 "AI-text detectors are widely used, but they can be fragile when the text is paraphrased "
3 "without changing the meaning."
4)
5
6prompt = f"""You are a paraphrasing assistant.
7Rewrite the text to preserve meaning while changing wording and structure.
8Avoid adding new facts.
9
10TEXT:
11{text}
12
13PARAPHRASE:
14"""
15
16inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
17
18with torch.no_grad():
19 out = model.generate(
20 **inputs,
21 max_new_tokens=200,
22 do_sample=True,
23 temperature=0.8,
24 top_p=0.95,
25 )
26
27print(tokenizer.decode(out[0], skip_special_tokens=True))1@misc{ranganath2026stealthrlreinforcementlearningparaphrase,
2 title={StealthRL: Reinforcement Learning Paraphrase Attacks for Multi-Detector Evasion of AI-Text Detectors},
3 author={Suraj Ranganath and Atharv Ramesh},
4 year={2026},
5 eprint={2602.08934},
6 archivePrefix={arXiv},
7 primaryClass={cs.LG},
8 url={https://arxiv.org/abs/2602.08934},
9}