Inspiration

We are inspired by increasing prevalence of machine-generated contents, which challenges the ability to differentiate between human and AI authorships. This tool is vital for maintaining transparency and authenticity in online information, empowering users to identify synthetic content and fostering trust in digital communications.

What it does

We propose a large language model for AI-generated text detection, called e5-small-LoRA, which is an efficient detector producing accurate prediction in many challenging scenarios, for example, text misspelling.

How we built it

e5-small-LoRA is developed upon a lightweight raw model e5-small. It brings strong semantic search capacity with the versatility to be efficiently fine-tuned. It has a large potential to be upgraded due to its weakly supervised pre-training, allowing it to leverage more data with less reliance on labeled datasets.

The capacity of e5-small on semantic classification could be largely enhanced through fine-tuning. We apply LoRA, or Low Rank Adaptation, which brings several benefits including reduced pile of parameters, speeds up training, that minimizes overfitting and lowers computational costs.

Challenges we ran into

We run into challenges of sourcing high-quality, representative datasets that include diverse types of AI-generated and human-written content, as well as, finding a proper way to evaluate the model performance.

We also find it challenging to avoid skewing the model toward over-detection or under-detection due to data imbalance, which can lead to false positives or negatives, complicating reliable detection in real-world applications.

We end up with using combined data of original and machine-rewritten twitter posts and RAID training data for the text classification task to enhance data representativity and avoid imbalance and bias.

Accomplishments that we're proud of

On the RAID test set as a whole (aggregated across all generation models, domains, decoding strategies, repetition penalties), the results as as follows.

Without adversarial attacks, e5-small-LoRA achieved an accuracy of 93.9%.

  • It leads the leaderboard on the day of submission, Nov 8, 2024.
  • e5-small-lora also achieves the top accuracy (on the day of submission) on detecting the texts generated by GPT4, mpt, and mistral individually with accuracies 99.3%, 94.0%, and 88.8% respectively.

With adversarial attacks, e5-small-lora achieved an accuracy of 85.7% overall.

  • e5-small-lora is also very competitive and robust across most individual adversarial attacks.
  • It achieves the top accuracy (more than 90%, as high as 93.9%) on most types of adversarial attacks including whitespace addition, lower/upper cases swap, synonymous swap, perplexity misspelling, number swap, alternative spelling, and etc.

Check out the leaderboard!

What we learned

We learned that having diverse, high-quality, and up-to-date training data is essential for building a robust detector. The variety of language models and the evolving nature of AI-generated content make it critical to continuously expand and refresh datasets to maintain model accuracy.

In real-world applications, balancing detection accuracy with computational efficiency is crucial, particularly for high-volume settings like social media or content moderation. We learned that model optimization techniques, such as pipeline parallelism and model parallelism are necessary to achieve this balance without compromising detection performance.

What's next for LoRA Fine-Tuned AI-generated Text Detector

There are several directions that we would like to explore more.

  • Expanding and Curating Training Data: A future work is to expand the training dataset to include a broader variety of AI-generated content from diverse sources and model versions. By curating data to capture the evolving nuances in language model outputs, detectors can stay up-to-date with the latest trends in AI text generation, improving detection accuracy and robustness.

  • Cross-Domain Generalization: We may also consider multilingual and domain-specific data to ensure the model performs well in various contexts, from academic writing to social media, without being biased toward particular styles or languages.

  • Adaptive Hyperparameter Tuning: Threshold on the machine-generated text detection is now arbitrarily set. We will provide a path algorithm to tune the hyperparameter, so that the threshold can either be fixed or adaptive to a specific set.

Built With

  • colab
  • e5-small
  • huggingface
  • lora
  • peft
  • python
  • raid
  • torch
  • transformer
Share this project:

Updates

Submission history