CoolFace
Modelpublic

anyangsong/MGT-Detector-RB-MAGA

sourceHugging Facemitupdated 8mo agoView on Hugging Face
1likes26downloads
Model Card

<div align="center"> <h1>MAGA-Bench: Machine-Augment-Generated Text via Alignment Detection Benchmark</h1> ๐Ÿ–ฅ๏ธ <a href="https://github.com/s1012480564/MAGA"><b>Github</b></a> ๐Ÿ“ <a href="https://www.arxiv.org/abs/2601.04633"><b>Paper</b></a> </div>

MAGA is a comprehensive dataset for advancing the generalization research of machine-generated text detectors, built via alignment-augment. It contains nearly 1 million generations covering 12 generators, 20 domains (10 English + 10 Chinese), 4 alignment methods, and diverse decoding strategies. It serves as a valuable resource for testing detector robustness and enhancing the generalization ability of fine-tuned detectors.

Collection

link
MAGAhttps://huggingface.co/datasets/anyangsong/MAGA
MAGA-cnhttps://huggingface.co/datasets/anyangsong/MAGA-cn
MGT-Detector-RB-MAGAhttps://huggingface.co/anyangsong/MGT-Detector-RB-MAGA
MGT-Detector-RB-MAGA-cnhttps://huggingface.co/anyangsong/MGT-Detector-RB-MAGA-cn
MGT-Detector-RB-MGBhttps://huggingface.co/anyangsong/MGT-Detector-RB-MGB
MGT-Detector-RB-MGB-cnhttps://huggingface.co/anyangsong/MGT-Detector-RB-MGB-cn

Load the model

To load the model, install the library transformers with pip install transformers. Then,

python
from transformers import AutoTokenizer, AutoModelForSequenceClassification
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
tokenizer = AutoTokenizer.from_pretrained("anyangsong/MGT-Detector-RB-MAGA")
model = AutoModelForSequenceClassification.from_pretrained("anyangsong/MGT-Detector-RB-MAGA").to(device)

Detect

The following contains a code snippet illustrating how to use the model to detect whether the input texts are machine-generated.

python
model.eval()
texts = [
    "This is a human text.",
    "This is not a machine text."
]
inputs = tokenizer(texts, padding=True, truncation=True, return_tensors="pt").to(device)
with torch.no_grad():
    outputs = model(**inputs)
    probs = outputs.logits.softmax(dim=-1)
    human_probs, machine_probs = probs[:, 0], probs[:, 1]

Our model uses 0.5 as the default threshold, i.e. is_machine = machine_probs >= 0.5

Citation

If you find MAGA useful for your research and applications, please cite using the Bibtex:

latex
@misc{song2026maga,
      title={MAGA-Bench: Machine-Augment-Generated Text via Alignment Detection Benchmark}, 
      author={Anyang Song and Ying Cheng and Yiqian Xu and Rui Feng},
      year={2026},
      eprint={2601.04633},
      archivePrefix={arXiv},
      primaryClass={cs.CL},
      url={https://arxiv.org/abs/2601.04633}, 
}