Downloads · 30 days
0
simonlesaumon/evasion-detection-artifacts
evasion-detection-artifacts is a machine learning model from simonlesaumon. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as mit.
Audit de sécurité des détecteurs de texte IA. Système de réécriture qui rend le texte généré par IA indétectable, basé sur les papiers MASH, HIP, et CoPA.
Downloads · 30 days
0
Access
Public
Updated Jul 3, 2026
Repo size
—
Likes
0
Public
Click a slice to open those files.
.jsonl9.4 MB · 98%
From the Hugging Face model README
Audit de sécurité des détecteurs de texte IA.
Système de réécriture qui rend le texte généré par IA indétectable, basé sur les papiers MASH, HIP, et CoPA.
Comprendre et exploiter les faiblesses mathématiques des détecteurs de texte IA (Fast-DetectGPT, Binoculars, GPTZero, Pangram) pour construire un système de réécriture capable de les contourner.
Intuition clé : Les détecteurs exploitent la faible dispersion des tokens du texte IA. Le texte humain a plus de variance dans le choix des mots, la longueur des phrases, et la distribution de fréquence. Si on augmente cette dispersion, on devient invisible.
┌──────────────────────────────────────────────────────────────┐
│ PIPELINE D'ÉVASION │
├──────────────────────────────────────────────────────────────┤
│ │
│ ENTRAÎNEMENT (Modal A100 80GB, ~40€) │
│ ┌──────────────────────────────────────────────────────┐ │
│ │ Phase 1: Style-SFT (~20€) │ │
│ │ BART-large (406M) + Style Embeddings │ │
│ │ Dataset: HC3 — 5K paires AI→Human (finance, medicine, │ │
│ │ open_qa, wiki_csai) │ │
│ └──────────────────────────────────────────────────────┘ │
│ ↓ │
│ ┌──────────────────────────────────────────────────────┐ │
│ │ Phase 2: DPO Adversarial (~21€) │ │
│ │ Reward = -score_détecteur │ │
│ │ β=0.1, hard negative mining │ │
│ └──────────────────────────────────────────────────────┘ │
│ │
│ INFÉRENCE (Modal T4, ~0.60€/h) │
│ ┌──────────────────────────────────────────────────────┐ │
│ │ Stage 1: BART-SFT-DPO → Rewrite AI→Human │ │
│ │ Stage 2: CoPA λ=1.5 → Token dispersion boost │ │
│ │ P_final = (1+λ)·log P_human - λ·log P_machine │ │
│ │ + top-p=0.92 + rep_penalty=1.15 + diversity bonus │ │
│ └──────────────────────────────────────────────────────┘ │
│ │
│ ÉVALUATION │
│ ┌──────────────────────────────────────────────────────┐ │
│ │ Fast-DetectGPT | Binoculars | GPTZero | Pangram │ │
│ │ Métriques: ASR, BERTScore, PPL, Token Dispersion │ │
│ └──────────────────────────────────────────────────────┘ │
└──────────────────────────────────────────────────────────────┘
evasion-detection-artifacts/
├── README.md ← Ce fichier
├── datasets/
│ ├── style_transfer_pairs_train.jsonl ← 4500 paires AI→Human (HC3)
│ ├── style_transfer_pairs_val.jsonl ← 500 paires validation
│ └── bitcoin_text.txt ← Texte test Bitcoin
├── results/
│ ├── copa_qwen2.5_1.5b_gpu_*.json ← Résultats CoPA GPU (Qwen2.5)
│ └── copa_real_distilgpt2.json ← Résultats CoPA CPU (baseline)
├── reports/
│ ├── eval_statistical_qwen25_1.5b_*.json ← Évaluation statistique
│ └── EVASION_DETECTION_REPORT.md ← Rapport complet
└── src/
├── inference_copa.py ← CoPA contrastive decoding
├── inference_combined.py ← BART + CoPA two-stage
├── modal_app_copa.py ← Modal GPU wrapper CoPA
├── modal_app_sft.py ← Modal GPU Style-SFT training
├── modal_app_dpo.py ← Modal GPU DPO training
├── evaluate_detectors.py ← Multi-detector evaluation
├── eval_statistical.py ← Statistical dispersion analysis
├── train_sft_modal.py ← Style-SFT (local/Modal)
├── hf_upload.py ← HF artifact upload adapter
└── cost_guard.py ← Modal budget guard
| Métrique | Original (IA) | Réécrit (CoPA) | Δ |
|---|---|---|---|
| Word freq dispersion | 0.36 | 1.68 | +366% |
| Sentence length CV | 0.154 | 0.327 | +113% |
| Readability (Flesch) | 25 | 32 | +28% |
| Human-likeness | 0.500 | 0.548 | +0.048 |
Original (AI-style):
Bitcoin, often called BTC, is the first and most well-known cryptocurrency in the world. It was created in 2009 by an unknown person or group using the name Satoshi Nakamoto...
Réécrit (CoPA Human-style):
Hey there! Bitcoin, or BTC, is the big bang of all the cool cyber currencies. It was born in 2009. An unknown dude or gals go by the name Satoshi Nakamoto. Unlike the money that grown-ups have, Bitcoin isn't controlled by anyone, or a central bank. Coincidence? Not a bit!...
# Single text
modal run -q src/modal_app_copa.py --text "Your AI-generated text here" --gpu T4
# From file
modal run -q src/modal_app_copa.py --text-file data/bitcoin_text.txt --gpu T4
# Batch (10 samples, synthetic templates)
modal run -q src/modal_app_copa.py --num-samples 10 --gpu T4
# Dry-run first (validates pipeline, ~0€)
modal run src/modal_app_sft.py --dry-run
# Real training (6-8h, ~20€)
modal run src/modal_app_sft.py --data datasets/style_transfer_pairs_train.jsonl
modal run src/modal_app_dpo.py --sft-model simonlesaumon/evasion-detection-models/bart-sft-style-humanization
# Analyze any CoPA output
python src/eval_statistical.py output/copa_modal_results.json output/eval_report.json
pytest tests/test_inference.py -v
| Papier | Conférence | Contribution clé |
|---|---|---|
| MASH (2025) | arXiv:2601.08564 | BART-base 139M + Style-SFT + DPO = 92% ASR |
| HIP (2026) | CMU | Modèles base = 96.7% "humains" (GPTZero) |
| CoPA (2025) | EMNLP | Contrastive decoding training-free |
| Fast-DetectGPT (2024) | ICLR | Courbure de probabilité, 340x plus rapide |
| Binoculars (2024) | ICML | Cross-perplexité, >90% TPR @ 0.01% FPR |
| Pangram (2025) | COLING | Mistral NeMo 12B + active learning |
| Famille | Principe | Exemple |
|---|---|---|
| Statistique | Perplexité + burstiness | GPTZero |
| Courbure | Score = LogP - E[LogP] | Fast-DetectGPT |
| Cross-PPL | Ratio perplexité 2 modèles | Binoculars |
| Watermark | Signature dans les tokens | SynthID-Text |
Ce qu'ils ont en commun : Le texte IA a des tokens groupés en zones de haute probabilité → faible dispersion. Notre approche maximise cette dispersion.
Ce projet est une recherche en sécurité défensive.
| Phase | GPU | Coût |
|---|---|---|
| CoPA prototype | T4 | ~0.30€ |
| Dataset HC3 | CPU | 0€ |
| Style-SFT | A100 80GB | ~20€ |
| DPO adversarial | A100 80GB | ~21€ |
| Inférence combinée | T4 | ~1.20€ |
| Évaluation | A100 80GB | ~7.50€ |
| Ablations | A100 80GB | ~50€ |
| Total | ~100€ |
simonlesaumon/evasion-detection (GitHub)simonlesaumon/evasion-detection-artifactssimonlesaumon/evasion-detection-modelsBuilt with Modal, PyTorch, HuggingFace Transformers. Budget: 200€ Modal credits.