ReMoDetect addresses the growing risks of large language model (LLM) usage, such as generating fake news, by improving detection of LLM-generated text (LGT). Unlike detecting individual models, ReMoDetect identifies common traits among LLMs by focusing on alignment training, where LLMs are fine-tuned to generate human-preferred text. Our key finding is that aligned LLMs produce texts with higher estimated preferences than human-written ones, making them detectable using a reward model trained on human preference distribution.
In ReMoDetect, we introduce two training strategies to enhance the reward model’s detection performance:
This approach achieves state-of-the-art results across several LLMs. For more technical details, check out our
paper.
Please check the
official repository, and
project page for more implementation details and updates.
1from transformers import AutoModelForSequenceClassification, AutoTokenizer
2
3model_id = "hyunseoki/ReMoDetect-deberta"
4tokenizer = AutoTokenizer.from_pretrained(model_id, cache_dir=cache_dir)
5detector = AutoModelForSequenceClassification.from_pretrained(model_id)
6
7text = 'This text was written by a person.'
8inputs = tokenizer(text, return_tensors='pt', truncation=True,max_length=512, padding=True)
9
10score = detector(**inputs).logits[0]
11print(score)
12
If you find ReMoDetect-deberta useful for your work, please cite the following papers:
1@misc{lee2024remodetect,
2 title={ReMoDetect: Reward Models Recognize Aligned LLM's Generations},
3 author={Hyunseok Lee and Jihoon Tack and Jinwoo Shin},
4 year={2024},
5 eprint={2405.17382},
6 archivePrefix={arXiv},
7 primaryClass={cs.LG},
8 url={https://arxiv.org/abs/2405.17382},
9}