AI-generated text: Detection methods and countermeasures

Efficient NLP · Beginner ·📄 Research Papers Explained ·1y ago

Key Takeaways

The video discusses AI-generated text detection methods and countermeasures, including classifier methods, watermarks, and paraphrasing techniques, using tools like Voicewriter, ChatGBT, and Open AI API.

Full Transcript

in 2023 a group of researchers conducted an experiment they got a bunch of linguists to read a bunch of short articles and decide which ones they thought were written by chat gbt so gbt 4 and which ones were written by humans and the results were not very successful the linguists were largely unable to identify AI versus human writing and the success rate was only about 38% so even linguists were not able to identify human versus AI writing better than random in a controlled randomized experiment and this has led to many discussions and Publications among social scientists education and linguists what should universities do about essays that are written by students and is it even possible to detect AI generated writing my name is B I am a machine learning engineer and a PhD in natural language processing in this video I will try to answer this question is it possible to detect AI generated writing and how or is this just an arms race that we cannot win it is well known at this point that Chach tends to overuse certain words like delve into at least more than humans do and one paper looked at scientific writing over time and found that the word delve experienced a dramatic uptick in frequency after chbt was released other words like crucial and potential had a less traumatic but still a significant increase in frequency the frequency increase for the word Del was even greater than words like pandemic and Corona virus during the year 2020 so this suggests to us that we can maybe make a really simple chbt detector just by looking at the string and checking if the word delve exists in a string if it does then it is AI generated and this will probably get a classifier that is better than random obviously this would not really be useful for catching cheaters because this is really easy to circumvent and the word Del is used by humans some of the time it is a real word but even if it's not useful to detect whether a specific piece of text is AI written it still may be useful as an indicator to track in a corpus of text over time how much of it is written by AI but before we go into that let me share something I've been working on it is a tool to help you write things using voice simply speak your thoughts and and the AI will recognize your voice add punctuation and fix the grammar in real time it uses state-of-the-art speech recognition AI just like the models I'm describing in this video I use it every day to write everything so much faster than if I'm writing it manually including all my emails and my daily standup updates try it for free at voicewriter doio Link in the description now back to the video so then what is a better way to detect AI generated text automatically well the first thing that we might try is a text classification approach text classification is one of the most common problems in NLP and probably something you've seen before like classifying a news article into several different topics or classifying reviews into positive or negative sentiment we can use the same method so train a text classification model to detect whether a text is written by AI or by a human there are many models that can do this and all you need is a bunch of label training data and what's interesting is that open AI themselves have actually released a model to classify between AI written and human written text however they later took down this model because of its low rate of accuracy if we look at the eval metrics they say that their model correctly identifies 26% of AI written text as true positives and 9% of human written text as false positives so not very good and I can understand why they took down if people are relying on this model to catch people cheating for example you will need much better accuracy than this here's another paper that tried to train a classifier to detect AI written text and they tried to do this in several different ways they tried both using linguistic features as well as using deep learning they identified several different stylistic factors that tend to distinguish AI versus human writing to summarize chbt never goes off topic it never gives subjective opinions it tends to be very logical and formal and never expresses emotions so if you use Chach this is more or less what you already know in their classification results they have pretty impressive F1 scores using the Roberta model so a deep learning model for text classification their F1 scores is all in the '90s on both English and Chinese so does this mean that the problem is basically solved well not really things are a bit harder in practice where you might need to classify a lot of different topics and writing styles um people will prompt the aom to ride in a different style they might try to do things to avoid being detected and of course there are lots of different ROMs now so we don't really know how much of these results hold up in practice but probably not in the high 90% I would guess training a classifier is not the only approach and a different approach of AI text detection is doing zero shot detection and what this means is an algorithm that can take some text and figure out whether it's likely generated from the model or from something else like a human writing it but it does not require any training data like a bunch of human written text to learn the difference this paper here called detect gbt proposes a zero shot detection algorithm based on probability curvature the idea of this is pretty simple um to determine if a sample is generated by the model the idea is to make some perturbations to the sample and look at the relationship of the original sample to the perturbations if the text is generated by the model then it is in a local maximum with regard to the model probability so making some random perations to it will decrease the model's likelihood according to its own likelihood function on the other hand if the text is written by a human then it is not necessarily in any kind of local maximum and making a perturbation to it is equally likely to increase the likelihood as to decrease the likelihood let's look at an example of how this might work with this sentence and we are trying to detect whether it is generated by the model or by a human we perturb the sentence by changing the bordered words with synonyms so for example wisely can be replaced with carefully and important can be replaced with crucial and then we observe the log likelihood of these perturb sentences and compare them to those of the original and if we find that all of these perturbations they're less likely than the original then it's probably that the original was generated by the model and the authors achieved pretty impressive F1 scor as well using this method to detect AI generated writing however it is important to note that this algorithm only works if you have access to the model and you can get the probability of sentences that are fed into the model so these guys here um and as far as I know none of the API providers like open AI can do this um they can only generate text for you but there's no way to get the probability distribution of the tokens or anything like that so this is something that could be relevant for detecting text generated by open source models but you cannot use it to detect whether a text is generated by chat gbt because you don't have access to this model moving on another way we could do AI text detection is apply a watermark to the model while generating it so in order to do this you have to have access to the model and be able to modify the model's generation algorithm to add a water mark to the outputs in order to detect it later this is a waterm mark applied to every token while the language model is generating in each step of the model's generation it's taking a prefix um and trying to complete the next wood so let's say is one of these woods and normally you would do some kind of random sampling like nuclear sampling to pick one of these Woods to put into the next token of the model the idea of a watermark is you take this last token here and use it to se an RNG and this RNG will randomly pick 50 50% of the words to put in a green list and the other 50% to put in a red list during sampling the algorithm would boost the probability of sampling one of the Green Woods and reduce the probability of sampling one of the red Woods if you apply the right amount of boosting so boost the Green Woods by a little bit but not by too much then you can apply a watermark to the model's output without degrading the quality by too much and the way you detect this water milk is check how many of the text is green tokens if there is no watermark then it should be around 50% and if there is a watermark then the number of green tokens will be larger than 50% and how much larger um you can apply a z test to determine the level of significance like how confident are you that the model has been watermarked and one reason this is powerful is because you need to change a lot of tokens in order to bypass the watermor because the model every time it samples a token it requires looking at the previous token so in order to bypass a waterm you have to change around 50% of the tokens to something else which is quite difficult to do okay now so we talked about a bunch of ways to detect L generated text but what about if your adversary what are some ways that people might try to cheat an LM detector so um generate a piece of text using AI but have it be detected as human generated and one idea idea that kind of works is apply a paraphraser so this is an LM that's different from the LM that's used to generate the original text but it just takes the output of the first LM and rewrites it to um say the same thing but in different words and the point is to be different enough that it will be detected as not generated by the first LM and if applying this once it's not enough then just run this paraphraser model multiple times it's even better if the attacker has access to the LM detector because then you can run it until it detects this text as not LM generated and you can do this no matter what type of method is used to detect the text generation you can apply it to classifier detector or Watermark detector it doesn't really matter here's the example result from the paper and the blue line here is the original Watermark method and it's very accurate and each of these color lines is applying one iteration of the paraphrase model so as you apply more iterations of paraphrasing it gets closer to this diagonal line here which means that the detection method is as good as random and the paper found that if you just apply this paraphrase model on itself like recursively five or six times then the detection model accuracy gets pretty close to random so what's the takeaway after all of this and is it possible to detect AI writing on one hand we have all these methods like classifier like watermarks to help you detect if a text is AI generated but on the other hand there are lots of ways to try to evade detection as well like just manually editing the output of the model in various ways or doing some prompt engineering to make the model right in a different style or using a paraphrase model so which side is stronger at any point in time is not really clear and additionally on most of these papers assume that there is one model and you just have to detect output from that model but as we all know there are so many different models to choose from and somebody could try to use any of these models to write text so I think the best way to think about this is not a binary but a spectrum there is a spectrum of how much you can use AI to write a piece of text the most extreme case is if you just take text that's generated by chbt and directly copy it into your block post or your essay or whatever and I think this is probably detectable today The Other Extreme is if you don't use any word generated by the AI but you just use it for ideas and this is generally considered okay and in the middle between these two extreme points is a lot of gray area so like if you use AI to write some parts of it but then move it around and then addit the style to fit your style better and how much of that is detectable that really depends on the model and the detection model and how much modific application is done to the text and another important factor is how much text is being written using AI if it's just one paragraph it's quite hard to detect compared to if there are numerous pages that are written with the same AI even if they do things to hide their AI usage if their amount of text is large enough then the evidence will start to pile up making them easier to detect if you're interested in letting AI help you a bit with writing but but you still want to express your own thoughts and not just copy from chbt then you should check out voicewriter doio it uses speech recognition to help you get your thoughts into the document really quickly but there's going to be a lot of mistakes so the second step is you apply an AI model to fix the grammar but the ideas are still yours so you're not going to be detected as AI generat text try it for free today at voice r.o and finally if you learn something from this video please give me a thumbs up subscribe to my channel and ring the bell icon to get notified when I release new videos leave a comment below if you have any questions and I will respond as quickly as possible thanks for watching

Original Description

Try Voice Writer - speak your thoughts and let AI handle the grammar: https://voicewriter.io Lots of people use ChatGPT and other LLMs for writing, sometimes for better or worse. But is it possible to detect this? Many have claimed ways to detect AI-generated content, such as classifiers, zero-shot methods, and watermarking. But how do these methods hold up against adversarial attacks, like paraphrasing models? Find out in this video! 0:00 - Introduction 1:07 - Measuring ChatGPT usage in corpus 2:54 - Text classification approach 5:25 - Zero-shot detection 8:08 - Watermarking LLMs 10:10 - Paraphrasing attacks 11:54 - Is AI writing detection possible? Survey papers on AI writing detection and countermeasures Ghosal, Soumya Suvra, Souradip Chakraborty, Jonas Geiping, Furong Huang, Dinesh Manocha, and Amrit Singh Bedi. “Towards Possibilities & Impossibilities of AI-Generated Text Detection: A Survey,” n.d. Fraser, Kathleen C., Hillary Dawkins, and Svetlana Kiritchenko. “Detecting AI-Generated Text: Factors Influencing Detectability with Current Methods.” arXiv, June 21, 2024. http://arxiv.org/abs/2406.15583. References for papers mentioned in this video Casal, J. Elliott, and Matt Kessler. “Can Linguists Distinguish between ChatGPT/AI and Human Writing?: A Study of Research Ethics and Academic Publishing.” *Research Methods in Applied Linguistics* 2, no. 3 (December 2023): 100068. https://doi.org/10.1016/j.rmal.2023.100068. Sadasivan, Vinu Sankar, Aounon Kumar, Sriram Balasubramanian, Wenxiao Wang, and Soheil Feizi. “Can AI-Generated Text Be Reliably Detected?” arXiv, February 19, 2024. http://arxiv.org/abs/2303.11156. Guo, Biyang, Xin Zhang, Ziyuan Wang, Minqi Jiang, Jinran Nie, Yuxuan Ding, Jianwei Yue, and Yupeng Wu. “How Close Is ChatGPT to Human Experts? Comparison Corpus, Evaluation, and Detection.” arXiv, January 18, 2023. http://arxiv.org/abs/2301.07597. Mitchell, Eric, Yoonho Lee, Alexander Khazatsky, Christopher D. Manning, and Chelsea Finn. “Detect
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

The video teaches how to detect AI-generated text using various methods, including classifier methods, watermarks, and paraphrasing techniques, and how to evade detection using manual editing and prompt engineering. It also discusses the spectrum of AI usage and the importance of considering the model and detection model when detecting AI-generated text.

Key Takeaways
  1. Use linguistic features and deep learning to distinguish AI from human writing
  2. Apply watermarks to AI models to detect generated text
  3. Use paraphrasing to generate different text and evade detection
  4. Manually edit and use prompt engineering to evade detection
  5. Consider the model and detection model when detecting AI-generated text
💡 AI-generated text detection is a complex task that requires considering multiple factors, including the model, detection model, and text modification, and that evasion techniques like paraphrasing and manual editing can make detection methods less accurate.

Related Reads

📰
Follow-up: The ArxivLens Protocol: Transforming Research Nois
Learn how to apply the ArxivLens Protocol to create dynamic grant-allocation pools that rebalance based on citation-impact signals, transforming research noise into actionable insights
Dev.to AI
📰
On July 1, 2026, arXiv will spin out from Cornell University, its home for the past 25 years, to become an independent nonprofit organization. Major funding support from Simons Foundation and Schmidt Sciences. Ditching the red for their website. [N]
arXiv is becoming an independent nonprofit organization after 25 years at Cornell University, backed by major funding, which will impact the future of research and academia
Reddit r/MachineLearning
📰
CS-NRRM™ Official Publications: Paper 1 and Paper 2 Are Now Available
Learn about the CS-NRRM's official publications on a 12-year longitudinal human observation archive and its significance in research and development
Medium · Data Science
📰
Found a potential mistake in an ICLR 2026 blogpost [D]
Verify a potential mistake in an ICLR 2026 blog post and learn how to effectively report errors in academic publications
Reddit r/MachineLearning

Chapters (7)

Introduction
1:07 Measuring ChatGPT usage in corpus
2:54 Text classification approach
5:25 Zero-shot detection
8:08 Watermarking LLMs
10:10 Paraphrasing attacks
11:54 Is AI writing detection possible?
Up next
The Open-Source AI Quietly Disrupting Healthcare!
PlivoAI
Watch →