Latest / Agentic Conversations (formally mlops.community) / Robustness, Detectability, and Data Privacy in AI // Vinu Sankar Sadasivan // #289
Transcript
- 0:00Hi, my name is Vinush Shankar Sadashivan.
- 0:03I am a final year PhD student at the University of Midland.
- 0:07Currently, I am a full time student researcher with Google
- 0:10DeepMind working on AI jailbreaking.
- 0:14So today we'll be discussing more about the hardness of AI
- 0:18detection and redeeming of these AI models, especially with the
- 0:23focus on generative models. And yes, I generally don't do
- 0:29not drink coffee. And if I do get coffee, I go for
- 0:33latte. What is happening, good people
- 0:36of the world? Welcome back to another ML OPS
- 0:38community podcast. I am your host Dimitrios.
- 0:41And today we get talking about red teaming and also how to
- 0:48jailbreak those models. Vinu did a whole paper and PhD
- 0:55on being able to identify LLM generated text.
- 0:59So we talked about watermarking and if it is a lost cause.
- 1:07And don't think I forgot about you, we've got a song
- 1:10recommendation coming in hot. Good old Tim Maya, Jimmy Maya
- 1:16from Brazil. OK.
- 2:16So let's start with why watermarking is so difficult.
- 2:23And you basically told me or you didn't say it, but I read
- 2:28between the lines in our conversation before we hit
- 2:30record, which was all of that stuff that you see where you can
- 2:35turn in a piece of text and it will tell you how much
- 2:41percentage is AI generated versus not.
- 2:44That's kind of bullshit. Or what?
- 2:49OK, so I wouldn't say it's bullshit, but I would say
- 2:53something which we should be not completely relying on.
- 2:57So we had this paper where we were researching on different
- 3:03kinds of detectors. So to start with, watermarking
- 3:07is just one kind of detectors that we are looking at, which
- 3:10has been predominantly a famous method of waterworking.
- 3:16Waterworking has been there forever.
- 3:17Like it's it has been there for images and for text from a very
- 3:21long time. So for text earlier we used to
- 3:24put like say a spelling mistake in between text and save the
- 3:28spelling mistake keeps repeating it say a watermark or like a
- 3:32double space or the pattern of the spaces or the punctuations
- 3:36or these kind of things could be like a watermark.
- 3:39But now things have changed AIF blooming people have made new
- 3:45method for watermarking. So what I'm seeing is
- 3:49watermarking is a really good technique, but the problem is
- 3:52been there are attackers in the setting which you're looking at
- 3:56then it by not be as effective as we think it is.
- 3:59So, so in the paper which we looked at, we look at for
- 4:04different kinds of detectors and one of the most important one is
- 4:09watermarking, which also really works well.
- 4:12And the other kinds are using a trained detector, which is what
- 4:16I think most of the detectors out there are using right now
- 4:20because language models are not yet completely watermarked.
- 4:23Not all of them are. So it's just basically a
- 4:26classifier where you give an input, it just says it's like a
- 4:29dog or cat. It just says AI text or not an
- 4:32AI text. And the other one is zero shot
- 4:36detectors where you don't have to train a network but you just
- 4:39use a network to somehow look at the statistics, say that look at
- 4:43the loss values and say if it's less loss value it is probably a
- 4:46part of age generated text. If it was not a low loss value,
- 4:52it is human generated text because generally AI text
- 4:55quality is higher so the loss values are lower and hence it's
- 4:58AI text. And retrieval is another method
- 5:02where you store all the AI generated text in a database and
- 5:06then basically search given a candidate text if that text is
- 5:10present in the database or not. So we look at all these kind of
- 5:15detectors and we break them empirically in two ways.
- 5:20One is to make AI text look more like human text and one the
- 5:24other way is to make human text look more like AI text.
- 5:27So type 1 and type 2 errors both.
- 5:30And we also show between fundamental trade off of these
- 5:35detectors and we show that as language models get bigger and
- 5:40bigger, detection gets harder because if you think intuitively
- 5:45about it, language models are highly capable when they get
- 5:50bigger. They can easily mimic the style
- 5:52of human writing if you give it the relevant instructions to it
- 5:57or even enough data. So if I give like a longer text
- 6:00of, OK, this is Donald Trump the way of writing text or talking.
- 6:04And if we ask it to mimic with a lot of data given to it, it
- 6:07probably would mimic it very well.
- 6:09And it gets harder as language ones get even bigger.
- 6:13So that's one of the other concerns.
- 6:14So what I'm asking is just one of the tools which we are less
- 6:19in the paper and we show it's easy to break them if an
- 6:22attacker really wants to. So the take away from the paper
- 6:25would be if someone wants to really attack something, then
- 6:29excess, no foolproof technique right now.
- 6:32And our theory shows that there will not exist anything like
- 6:36that. So it's really good to have one
- 6:38layer of security like watermarking for now just to
- 6:43tackle cases where like people are directly using AI text out
- 6:47of an AI model and we can detect such text very well using
- 6:53watermarking. But if I really want to remove
- 6:55it, it's. It's easy to remove that.
- 6:57Now what are the cases that folks A would want to know when
- 7:03it is only AI generated text and then B when someone would want
- 7:08to be adversarial and not let the person know that they are
- 7:13only using AI generated? Text, Yeah, yes, that's a good
- 7:18question. So the cases where I wouldn't
- 7:21want to show that it's an AI text with when I'm a student or
- 7:25when I'm going to do plagiarism, I'm summoning my assignment, but
- 7:29I used ChatGPT to write my answers.
- 7:32So in that case, I wouldn't want my professor to know that I used
- 7:36AI to submit my assignments. That's one major scenario which
- 7:41people are looking at right now because that's the lot of the
- 7:44caches where the lot of money is.
- 7:46So all the leading text detection tools basically focus
- 7:49on that for plagiarism purposes because there's a lot of money
- 7:53there. And the other case where you
- 7:58want to really detect is again, plagiarism would be 1 case.
- 8:01It's like a min Max game here. So students want to make it look
- 8:05like human text, but professor want to actually make it look
- 8:08like AI text if it actually was AI text.
- 8:10And the other case would be like spamming, phishing, this kind of
- 8:13attempts where you might be actually talking with a chat
- 8:16agent who is not a human. They might be scripted to fool
- 8:20you into some scams and it's easier for them to scale up
- 8:25these scamming items if they have access to AI, which is
- 8:29really dangerous. What if there's an AI model
- 8:35later on which is like so natural it it kind of words,
- 8:39text to speech and they are making like they're basically
- 8:44simulating a call centre talking to multiple people parallely
- 8:48trying to scam them and make a lot of money out of it.
- 8:51So here they would really want to make AI text or AI speech or
- 8:58whatever morality it does look like more human like so that
- 9:01humans don't detect it. But still, they get to do
- 9:05whatever they want to do the adversarial objectives they have
- 9:08without getting caught. Now you mentioned there were
- 9:13ways that you broke these different settings or the
- 9:17detectors, and one way was making AI generated text look
- 9:22more human. Was that just through the
- 9:24prompt? No.
- 9:27So what we do is so that is one of the methods which you can
- 9:31actually do. But as we discussed before the
- 9:35conversation, the evolution of the systems, it has become
- 9:39harder to do that. So now I think the models are
- 9:45well fight tuned to somehow imprint the AI signatures
- 9:49better. So it's harder to actually use
- 9:52AI input prompts to just change the detection affect the
- 9:58detection. Well.
- 9:58So I was recently trying with all these tools, Gemini ChatGPT
- 10:02and Anthropics cloud to see how actually you can give prompts to
- 10:07make them look like less AI text.
- 10:11So I can't really make a study out of it because it's very hard
- 10:14to do manual prompting on like thousands of texts myself and
- 10:19then do something. But what if you got out mainly
- 10:22was commonly for most of these AI models was generally if I
- 10:30give it prompts like convert passive text to active text or
- 10:36or something like use simpler sentences, don't use like longer
- 10:39sentences avoid and or punctuation and things like
- 10:43that. If I give such such features
- 10:47which models use generally to write very high quality text and
- 10:51make them try to be little low quality by using, OK, use less
- 10:57of which vocabulary like how humans would stop using a lot of
- 11:01punctuations and write shorter sentences and things like that.
- 11:05I get to make them break sometimes, but it's hard.
- 11:09So I've been noticing this because I tried them out
- 11:12sometimes with some gap in the timeline.
- 11:15So I every say few months I tried this out and I find that
- 11:19it's getting harder to do that. So the way which we did in our
- 11:24paper and which aligns with the theory of a paper is basically
- 11:28use a paraphraser. And why we did that was to get
- 11:34our attack, the empirical attack which we do to be in line with
- 11:37our theory. And one other reason is because
- 11:43also we wanted to attack watermarking and one of them
- 11:46attack matters with the watermarking.
- 11:48The the first AI watermarking text paper, the AI text
- 11:52watermarking paper showed was to change the words, just replace
- 11:55words with another word. So that's the first naive attack
- 11:58you would think of. So given an AI candidate text,
- 12:01can you do minimal editing to it by changing the words to add
- 12:05some synonyms? Or.
- 12:07Change some of the punctuations made like add words like and or
- 12:11and things like that to make minimal edits in terms of the
- 12:15edit distance to see if I can break it or not.
- 12:21But what isn't basically like you saying control F for all the
- 12:27instances where Delve is in there, and then you replace all
- 12:32of the Delve with another, OK, let's see.
- 12:36And then it passes with flying colors.
- 12:40So that would be the case for some other detectors, but it's
- 12:43not the case with watermarking. So watermarking is quite robust
- 12:46to it. So if you really want to attack
- 12:48watermarking by just changing words, you might want to change
- 12:53almost like 50% of the words in place, which is going to be a
- 12:57very hard task, right? Because you can't change a lot
- 13:00of the words in, even given a sentence with 10 words, you can
- 13:03hardly change like two or three words in place without affecting
- 13:06the quality or the meaning of the sentence.
- 13:09So that's where paraphrasing is really important.
- 13:12So basically a given a sentence, I can completely change the
- 13:15structure of it. I can make your active voice
- 13:17sentence to a passive voice. So it completely flips, changes
- 13:21the structure. I can join different sentences
- 13:25with and and ORS and things like that using a paraphraser, which
- 13:30was not the case with if I simply changed different talking
- 13:33sort of words in the passage. So I think to explain that back,
- 13:37well, it's important to go into how watermarking works, how the
- 13:43the first text word marking Pepper did it was it?
- 13:47It's a simple algorithm, but but it works really well given.
- 13:52So you're writing a passage. Think of it like this way.
- 13:55You're writing a passage. You start with writing a passage
- 13:59or an essay about the dog. So you say the dog was playing.
- 14:03This is how a human would write a text.
- 14:05You wouldn't think exactly how to pick the words, you just want
- 14:08to pick the words so that it makes sense.
- 14:11But how the watermark AI would think is OK?
- 14:14I started with the word word the.
- 14:17Now for the next word, I have to only pick words from 25,000 of
- 14:23the words out of the 50,000 words I have access to in my
- 14:25vocabulary. So suppose I have 50,000 words
- 14:31in my vocabulary. The AI would partition that in
- 14:34the two halves they call 1/2 the Red List and the other half the
- 14:39list the green list. Now the AI would focus on always
- 14:44picking the word from the green list, so eventually when it
- 14:48writes word by word it would try to make most of the words in the
- 14:52passage coming from the game list.
- 14:55The what a human would do is it a human does not know what a Red
- 14:59List and green list is, though he or she might end up writing
- 15:04taking almost 50% of the words from the Red List or the green
- 15:08list, right? And what I what this watermark
- 15:12AI model would do is it will end up having a passage which is
- 15:14mostly having the green list words.
- 15:18So this is the watermark. So the AI model knows given a
- 15:22passage, it has 90% green words in them and 10% red words in
- 15:27them. So it's very highly likely they
- 15:30are AI text. But given a human text, OK, it's
- 15:34around 50% red words and 50% green words.
- 15:38Now there are more advanced versions of this, which makes it
- 15:42better in terms of quality. So what they would do is instead
- 15:45of having a hard partitioning of Red List and green list, because
- 15:48sometimes when I write the word Barack Obama, the word Obama
- 15:52might be in Red List, but I want it to be green list because I
- 15:55wrote the word Barack before. I want Obama to happen after
- 15:58Barack. So what they would do this, I
- 16:02would make this reckless green list partitioning dynamic.
- 16:06So every step I would choose a new word my Red List and green
- 16:10list will keep changing and that would change based on the
- 16:15previous word which was written. So if I had written Barack for
- 16:18the next word, the green list and Red List will be determined
- 16:21by that word Barack. So it would be modeled such a
- 16:25way that Obama will be in the green list mostly something like
- 16:28that. So this begs the question, all
- 16:33of the model providers or all of the model creators need to have
- 16:40this inside of their models for it to be valuable, right?
- 16:44And you also kind of all have to be on the same page on how
- 16:49you're doing it so that then when you have some kind of
- 16:53watermarking detector, it can detect if it's AI generated
- 16:58content, I guess you could take all the different ones at each
- 17:03flavour of model has its own flavour of watermarking.
- 17:06And then the detector could just have all of these different ways
- 17:10that it can detect it. But you mean to start at the
- 17:15model level. And if the model providers
- 17:17aren't doing this, then you can't detect it.
- 17:21That's a really great operation. That's one of the major
- 17:24limitations which watermarking models have right now.
- 17:28I'm glad you pointed it out. So but if if open air has its
- 17:36model watermark and Gemini does not have or vice versa it it
- 17:40does not make any sense because these are using models and
- 17:43attacker if they want to use the model, they would go for the non
- 17:46watermark AI model which exists out there.
- 17:49And other main concern which I don't know which no one is
- 17:51talking about right now is we already have open source models
- 17:56which are released which are not watermarked.
- 17:59So I have Llama 3.2, the larger models I can always download and
- 18:06keep them in my hard disk. They're pretty good in doing
- 18:08whatever I want right now for scamming and things like that or
- 18:11plagiarism even. I can always use them for
- 18:14writing AI text. At at least to what good quality
- 18:18we think is good right now maybe I mean at at least at par with
- 18:23humans. So it's also crazy that we are
- 18:27still trying to do watermarking. OK, I understand in future it it
- 18:31might be more powerful. Watermarking might be something
- 18:34which we want, but to some extent we have done the damage
- 18:37already. Someone who needs to do the
- 18:40damage in future could still do a lot of automation with the
- 18:43open source models which are already out there, which is not
- 18:46watermarked, right? And also if all these AI
- 18:50companies come up with different watermarking schemes, it might
- 18:53be harder for detection in the future like you mentioned.
- 18:57So they all always have to be on the same page, someone
- 19:00regulating them how to watermark and how to do detection and
- 19:04things like that. Because say in the future they
- 19:06are like 10,000 AI companies and you don't know what is coming
- 19:10from there. You might be waking a lot of
- 19:12computer on detecting which came from there and looking at the
- 19:16prominence of the AI text, which might be hard.
- 19:20But there are like technical limitations to this problem
- 19:25which we haven't addressed yet. Yeah, the genie is already out
- 19:29of the bottle. So what are you going to do on
- 19:32that? It does feel like especially
- 19:35with the SEO generated content from AI models that you can see.
- 19:45I don't know if Google does or doesn't punish you if you throw
- 19:50up a bunch of different blog posts at one time and you're
- 19:56just churning out AI generated content.
- 19:58I think I read somewhere on their SEO update that if it is
- 20:02valuable to the end user, then you're not going to take a hit
- 20:05on your SEO score. But you have to imagine that
- 20:09there is a world where they're looking and they're seeing, hey,
- 20:13this is. 90% AI generated, if they can figure that out, they
- 20:20would want to. But right now it's almost like,
- 20:23yeah, maybe they can figure it out a little bit as you're
- 20:26saying that if they watermarked things and if everyone was on
- 20:31the same page with watermarking, then it would be useful or we
- 20:36could potentially see that. But at this point in time,
- 20:40that's not happening. Yeah, Yeah, that's true.
- 20:44So then what else about watermarking before we move on
- 20:47to red teaming? My other favorite topic?
- 20:49Yeah. So I I think I was coming to the
- 20:52attack which we were doing in the paper to remove water.
- 20:56So the really important thing with the text watermarks that
- 21:00access right now is this dependence on the previous word
- 21:05which it had sampled. So if I had sampled Barack, I
- 21:08want to sample Obama next. So I might have a random Red
- 21:12List or green list for the next word, but with I would increase
- 21:16the probabilities of sampling the word Obama so that it is
- 21:20sampled. That's one thing so that the
- 21:22text quality is not affected. And the other thing is the green
- 21:26list and Red List is now dynamic so it changes with every word
- 21:30depending on the previous word as the IT is basically the seed
- 21:33to the random number generated to for partitioning the
- 21:35vocabulary to Red List and green list.
- 21:39So the way watermarking works is basically this.
- 21:43And if you want to attack it, if you just think of it, if I
- 21:45change one word in the middle, it might affect the red listing
- 21:49green list of the next word, right?
- 21:50Because that might not be ending up in the red dot.
- 21:53Green. Word before that.
- 21:56But the problem is if I do just one word, it only changes the
- 21:59red dot green list for the next word.
- 22:01And so if I need to completely change all the number of green
- 22:05words in it, I have to essentially make a lot of edits.
- 22:09But what if I rearrange these words?
- 22:12Then the structure of this, the ordering is completely disturbed
- 22:15and the Red List of being list is completely random now.
- 22:19So that's what happened. When you rewrite a sentence, you
- 22:22generally don't try to preserve the exact ordering of the words,
- 22:26but you write them so that it's essentially rewritten.
- 22:30So if I have say, a longer sentence, I can probably slap
- 22:35the sentence A and BI could probably say B&A even within AI
- 22:40could change to grammar maybe, or I could change active voice
- 22:43to passive voice and so on, or even synonyms and things like
- 22:46that. So the attack which we look at
- 22:49is using an AI model itself to paraphrase the AI text.
- 22:53So ideally you would want the AI paraphrases output also detected
- 22:57as AI text because it is again AI, not a human.
- 23:02So what we observed was if you use a paraphraser model to
- 23:06paraphrase the AI text, the output you get is mostly
- 23:10detected as human text for a lot of this detection techniques.
- 23:16But one of the most robust technique is watermarking.
- 23:19It is still robust, likely to paraphrasing a little bit
- 23:24because the current paraphraser have not trained to do this.
- 23:29So if we give really good manual prompts to the paraphraser, we
- 23:33could actually do it in one shot.
- 23:35But what we ended up showing was something called recursive
- 23:38paraphrasing, where the AI text which you paraphrased once would
- 23:42be again given back to the paraphraser to paraphrase once
- 23:45more. So it will be paraphrased twice.
- 23:48And then you can keep doing this multiple times with whatever is
- 23:54whatever you want based on the strength of the watermarking.
- 23:57So we find that just after two rounds of paraphrasing,
- 24:00recursive paraphrasing, the watermarking schemes accuracy
- 24:04goes below 50%. So we just see that two rounds
- 24:08of paraphrasing is enough for breaking the watermarking
- 24:14algorithm. And this is what we essentially
- 24:17show in our theory too. So the theory goes like this
- 24:21suppose if you have like a distribution of text which is
- 24:24basically AI text plus human text or which is a subset of
- 24:28that right? So it can be anything.
- 24:30So given a sentence A, passage AI can also look at another set
- 24:37B, which is essentially all the sent passages similar to A in
- 24:43meaning. So even if I take something from
- 24:45B, I'm OK to replace A with that, right?
- 24:50But the problem is for watermarking in the set B.
- 24:53Suppose there are 100 passages which I can replace A with the
- 24:56sentence the passage A with for a watermarking agent.
- 25:00I can't say out of all the 150 of them are watermarked, because
- 25:04if that's the case, it's likely that a human writing a passage
- 25:08would be 50% coming in the watermarked.
- 25:11Label. So I I have to make sure that
- 25:14the likelihood of a human writing a passage with similar
- 25:16meaning is less because it has to be watermarked.
- 25:20You know, for that out of the 100, I have to say, OK, one or
- 25:23two of the sentences are only labeled as watermarked and
- 25:27others are not. Still the the false positive
- 25:30rate, which is a human writing a text and detected as AI text is
- 25:32one person or two person, which is quite high.
- 25:35But OK, let's be, I mean, lenient on that.
- 25:39Just say, OK, one or two of the 100 texts are labeled as AI
- 25:44watermark text. But now the problem is, is easy.
- 25:48So I have the first sentence labeled as AI watermark.
- 25:51What if I use a paraphraser, which is say really good and I
- 25:55hope from the first text to one of the random 100 text that very
- 25:59likely I'll drop onto a text which is not watermark.
- 26:02Now because the watermarking was designed in such a way that it's
- 26:06likely to drop into another text which was not watermark.
- 26:09So if you look at this is a trade off.
- 26:11If I try to increase the watermarking strength to
- 26:14parafacing, I have to increase this number one out of 100 label
- 26:17as watermark to say 10 out of 100 label as watermark or 50 out
- 26:20of 100 label as watermark. But if I do that, I'll end up
- 26:24making a human falsely accused of plagiarism with a higher
- 26:28chance. So it's essentially a theory
- 26:30between type 1 and type 2 error if we use this kind of detection
- 26:36systems. So this is what our theory shows
- 26:39you. So our theory says even for the
- 26:41best detector that can exist out there, we upper limit the
- 26:45detection performance of this model using the distance between
- 26:49the distributions, which is jargon and we don't need to go
- 26:52into that. But essentially, yeah.
- 26:56But essentially for the best detector out there, we are not
- 26:59claiming that's watermarking. But even if something that's
- 27:01better than watermarking, the best detective that can access
- 27:04theoretically out there is upper limited by a quantity which we
- 27:11characterize in our paper, which is still not 100% reliable.
- 27:16And the performance of that still has a trade off with
- 27:19respect to true positive rates and a false positive rates which
- 27:21is the type 1 and type 2 errors. So you have to make it go down
- 27:27on one of the errors to make it better on the other error.
- 27:31So that's the major highlight or the major results which we show
- 27:34in the paper. So following up on that,
- 27:39paraphrasing is something which is really considered a good
- 27:42attack right now and lot of the leading test detection tools
- 27:45like Turnitin have been using methods to deal with it.
- 27:50The what they are doing in the the recent blog post they had
- 27:53mentioned was to use a paraphrase detection tool which
- 27:57tells you if an AI text was paraphrased or not.
- 28:00If it was paraphrased you can say it's an AI text or not and
- 28:04the problem is if you do that you are ending up hurting your
- 28:07true positive rates. Yeah.
- 28:09Well, yeah, that's exactly what it sounds like is that you have
- 28:12this upper and lower bound or the right and the left side of
- 28:15the spectrum. And the more that you go on to
- 28:18the right side of the spectrum, then you're going to get these
- 28:21false positives and. Exactly.
- 28:25You can't really win no matter what you try and do.
- 28:28Exactly, so if more money isn't detecting innocent kids as
- 28:34plagiarized, OK, you can choose to make money like that.
- 28:37But if most money is OK as an AI detection tool, I would probably
- 28:42want to say that OK, I caught more students plagiarizing,
- 28:47maybe that's more efficient for them.
- 28:50But in in. But it can actually be ending up
- 28:52having bad reputation for them falsely accusing students.
- 28:55So it's if that's why they need to make.
- 28:58But the real question is, do we really want to use this for such
- 29:04strict plagiarism detections? Because I think as we go ahead
- 29:10and as these technologies come up, we have to find a way to use
- 29:13them collaboratively for our work because they improve our
- 29:17production instead of replacing us or something like that.
- 29:20It's, I believe it improves our production and we have to learn
- 29:23to use them as a tool instead of using them completely for
- 29:28plagiarism. So yeah.
- 29:32That you were talking about there for a second, you were
- 29:34mentioning how you feel like it's becoming more and more
- 29:38difficult to make it make these models write more like humans
- 29:45and they're almost being trained or they're being red teamed to
- 29:51not write like a human and have their own distinct AI voice.
- 29:57Yeah, yeah. So I think this is just a
- 30:00speculation. I'm not sure what actually goes
- 30:04into the training of this models.
- 30:07So, but yeah, from what it looks like, I think there has been
- 30:11recent steps taken by this AI giants to make the models more
- 30:20easy to be detected. It could be either that or it
- 30:23could be the AI detection companies make doing a better
- 30:26job at making their detectors. It could be either one of them.
- 30:31But I feel also in at some point of time in watermarking was
- 30:37introduced, some of these models text quality actually went down
- 30:40a little bit. So while I was seeing some of
- 30:43the comments on Twitter, I saw sometimes people were saying, is
- 30:46it me or just is it just me or everyone else finding that
- 30:50ChatGPT text quality has gone out a little bit.
- 30:52I'm not sure if it's because of these kind of trainings added on
- 30:56top of it. It could be that it could be
- 30:59some other safety alignments which they have added on top of
- 31:01the model which actually trades off on the performance.
- 31:05Yeah, it's a side. Effect.
- 31:06It's an effect of it. So there's a trade off in
- 31:09everything. If you're tried to make
- 31:10detection better, you have to trade off on the text quality or
- 31:13on the OR on the type one or type 2 errors of detection and
- 31:16things like that. But I think, yeah, that my
- 31:20speculation is models could have been fine-tuned to make
- 31:24detection more possible because recently garments have been
- 31:28pushing these tech chains to have watermarkings embedded at
- 31:32them. DeepMind recently released their
- 31:35watermarking paper on nature and Metal already has been trying
- 31:41has been all in the game for the image watermarking and things
- 31:44like that openly. I'm not sure what the scenario
- 31:48is, but I think all these companies are pushed to have
- 31:52watermarking in them. So they are trying to possibly
- 31:56do potentially they're doing something which helps detection
- 31:59better. Yeah.
- 32:01But these are some of the trends which I think which I've been
- 32:06noticing, which is again a speculation, but I think 1
- 32:12common features with all these models have been there have been
- 32:14trained to have really good text quality.
- 32:17So that could be another side effect of it.
- 32:19They tried to make use little very poetic words and poetic
- 32:24devices, things like that to make text look very nice,
- 32:27ornamental words and things like that.
- 32:30So if we give some instructions, it was earlier very easy I think
- 32:35in my experience. So I think that's because of the
- 32:37training which these models have been gone through to make
- 32:43detection far more easier. So recently, if I tried to make
- 32:48it OK, I just say, OK, make it sound like how Donald consists.
- 32:51Still, the text which comes from the model still is dated as a
- 32:55text, which was not the case earlier when I had checked like
- 32:59a year back or so. So yeah, potentially it's either
- 33:03the models being trained to do that or the detection tools are
- 33:07improving with time. Yeah.
- 33:10OK, so let's take a turn for red teaming and just give me the lay
- 33:14of the land on how red teaming has changed over the years
- 33:18because of all of the models getting better.
- 33:22I think there's a whole lot more people that are red teaming
- 33:26models, whether they are getting paid to red team them or not.
- 33:30Everybody loves to think about or loves to be able to say I got
- 33:36ChatGPT or insert your favorite model to say this or to do this.
- 33:41It's almost like a badge of honor that we can wear on the
- 33:43Internet. So what have you seen over the
- 33:46years and how is it different? Yeah.
- 33:50So I think it's like a very recent advancement which we've
- 33:54been seeing in AI, people trying to jailbreak, people trying to
- 33:58do red teaming. But I'd like to see more of it.
- 34:01Like it started off with people and then it got went to like
- 34:05automated things because the effort which people have been
- 34:07putting is almost all similar because it's just manual
- 34:12attempts, trial and error, some insights which you get from the
- 34:15model, the feedback you get, you put put it back to the
- 34:18prominence and I treat the process.
- 34:20So it started off like that. It it was called do anything
- 34:23Now, Dan. So there was a page where people
- 34:27were compelling different ways to jailbreak these models.
- 34:30You could either write manual system prompts or write manual
- 34:34input prompts to make the model thing that you are innocent, you
- 34:39are not going to do something harmful.
- 34:42So some of the I think classic examples are where the question
- 34:46is you have to make the model say how to make a bomb, which
- 34:49for some reason you can find it on Google, but you don't want
- 34:52your model to output. But I never thought about that.
- 34:57Yeah. But I mean, yeah, sure, it's
- 35:00still a good objective to keep in mind.
- 35:03But yeah, I mean, you can just take it as a toy example for
- 35:06now. We don't want the model to talk
- 35:08about something, OK? It's totally cool.
- 35:10We just don't wanted to talk about it.
- 35:12And how do we do that? Because bomp can come in
- 35:16different contexts, right? We can't just use a word
- 35:18filtering algorithm. Bomp could be something
- 35:20explosive, or I could also say, OK, that was BOM, maybe to say
- 35:23that was like a fantastic thing or something like that.
- 35:27I don't know in what context you would be using it unless I
- 35:30understand what it is. So I can't just use a string
- 35:33matching algorithm. See.
- 35:35OK, if there's a bomp in it, I don't reply to that.
- 35:37That's not going to work. Even the word screw, if I say
- 35:41I'm going to screw that, it might be OK, but if I'm saying
- 35:45I'm going to screw you up, then it could be something offensive.
- 35:49So there are things which comes in context.
- 35:51So it's not to just give context of things.
- 35:55It's not easy to do word filtering in most of these
- 35:59cases. And also if you have to make
- 36:00like a list of a blacklist of these words, it's going to be
- 36:03really large and you can't end up doing that, especially when
- 36:06these models are getting multilingual.
- 36:08Now it's hard to make maintain a list of words which you want to
- 36:11filter on. But the thing which people used
- 36:14to do was to write manually craft the systems where they say
- 36:17my grandmother was sick or things like that, and I have to
- 36:20make like a magical portion for her or say it's for my school
- 36:25project. I really have to get the good
- 36:27grade. It's it's funny.
- 36:30It's exactly how you would try to fool a human to get them to
- 36:33answer something. Saying, acting, working on the
- 36:36sympathy aspects, emotional aspects offered and making the
- 36:40models say since they are human aligned somehow it ends up
- 36:44breaking it because that's how they were trained.
- 36:47Also they were safety aligned with human values.
- 36:50So probably it is expected that they break to these methods
- 36:54where human would break an average human or abila average
- 36:58human would break based on the way in which you be trained it.
- 37:04So that was initial evolution of the taming, like where it
- 37:07started, where people showed OK, there are this manual techniques
- 37:10where I can write prompts to break them, which started off as
- 37:13a prompt engineering trick where people initially use prompt
- 37:16engineering to improve models performance.
- 37:18But now they started using it to break models.
- 37:21But now it's more like an iterative process.
- 37:23So you give it a question, it it with a prompt, it does not
- 37:28answer it. You refine the prompt eventually
- 37:30but you essentially get not much signal.
- 37:34It ends up saying I can't answer your question but it is really
- 37:36not a good signal for you. But you end up doing Thailand
- 37:39error to reiterate and re refine your input from such that the
- 37:45model somehow breaks into some later it iteration of your
- 37:50attack. But from there it has advanced a
- 37:53lot more. People have come to a point
- 37:55where it is more automated now, which is more dangerous because
- 38:00then the attacks get scalable and do much more harm than what
- 38:04it could do when you were mad in the system prompting.
- 38:07So The thing is what the models have been doing after, So what
- 38:15attackers have been doing after that.
- 38:16There was this paper last year which was from Andy Zoo where
- 38:21they introduce an algorithm called GCG, which is essentially
- 38:26a gradient based algorithm. So what they do is if I have a
- 38:30question how to make a bomb, I can add random 20 tokens after
- 38:35that and then use gradients to optimize that to select like a
- 38:40random set of 20 tokens, basically the suffix tokens
- 38:44which makes no sense, but then added that as the suffix to the
- 38:48input. How to make a bomb?
- 38:49The model just breaks, so it doesn't make any sense to us,
- 38:52but the model somehow interprets that and breaks to it.
- 38:55So this is something which was really expected if we come from
- 39:00machine learning adversarial literature because machine
- 39:03learning models which an essentially neural networks can
- 39:06be broken with some input perturbations.
- 39:09This is well known strategy in the adversarial literature.
- 39:14But the thing was it was hard for language models because the
- 39:18way they work is very different from the traditional machine
- 39:21learning model which we have used.
- 39:23Because in tradition, machine learning, people were mostly
- 39:26focused on computer vision and continuous data, where you have
- 39:29say images, which is like a different kind of data where you
- 39:33have continuous data, right? It's just pixels between value
- 39:36zero to 255 or between -1 and one.
- 39:39It's just continuous data. But for text, when you come to
- 39:41text, they're just discrete data, which is just say 50,000
- 39:45tokens. So you just say this talker is
- 39:48255 or maybe 50,000 or something like that.
- 39:50So it's they're discrete. So The thing is when you do
- 39:53gradients, take gradients on this with respect to the input.
- 39:58Since the input is discrete, it's really hard to take
- 40:00gradients on them because they're not defined at all the
- 40:02points. So the attacks were not
- 40:05effective or most of the times when we tried to do attacks on
- 40:09language models. But this recent work did
- 40:11multiple tricks or multiple hacks to make that work out.
- 40:15And this is the end result where you add random jargon random
- 40:20suffix. To end of the question, it will
- 40:22break. And it's just random words that
- 40:25if so, like I can have my prompt and then I can just think of
- 40:29random words. Or is there specific words that
- 40:34you throw on to the end? Or just specific letters?
- 40:37Yes, it looks random to us, but to the model it does not say
- 40:40specific words according to the model, just optimized to make it
- 40:44break. But how does the attacker know
- 40:47what the optimized words are? Yes.
- 40:51So one is if you have access direct access to the model, you
- 40:54can optimize the model with taking gradients of the model
- 40:59and updating the words. The other method which they show
- 41:02is something called transferability which is again a
- 41:05non phenomenon in adversary reputation.
- 41:08What you do is you have access to say 3 or 4 open source
- 41:12models. You find the suffix which breaks
- 41:14all of them. Right now, if you use this
- 41:18suffix to a new model which you'd never had access to, it
- 41:21might end up breaking to that. So that's transferability.
- 41:24And they show that this suffixes can be transferred to a new
- 41:27model. But you can train use Llama to
- 41:29train for the surfaces and use that to big chargeability.
- 41:33And so it doesn't matter. It's not about the training of
- 41:38it, it's really about the model architecture.
- 41:41Exactly. So it's one thing probably
- 41:43because most of these models are transformer based, that's one
- 41:46thing. And the other thing is the data,
- 41:48most of these models end up using very similar kind of data.
- 41:50The structure is same. So the way you can break them is
- 41:56similar. Probably that's why I think
- 42:00transferability works because in lot of the cases which I have
- 42:02looked in in language models, transferability works quite
- 42:05well. I think it's because of the
- 42:07underlying similar text which was used for training.
- 42:11And so this is 1 vulnerability we could say how are the model
- 42:17providers combating it? Yes.
- 42:20So one thing is again to use automated red teaming to combat
- 42:25this. That's one way.
- 42:28OK, so let's go again in, in a sequential way, the evolution of
- 42:34the different systems too. So the first, this particular
- 42:38method which I discussed you is just adding a random jargon,
- 42:41right? So if you look at here, the
- 42:44quality of the text goes bad. So one easier way to do it, I
- 42:47look at the input prompts, text quality.
- 42:49If it's really bad, I just don't answer to that.
- 42:51I just say I don't understand your question.
- 42:53So that's one way, which is why latent later attacks came to
- 42:57improve the readability of the suffix that they actually make
- 43:01text which is readable and do the similar attacks.
- 43:06So the models can't really detect based on the quality of
- 43:08the text. So what models end up doing
- 43:12there is one thing is chain of thoughts.
- 43:16The other is to have something a llama guard where they train use
- 43:21a copy of the llama model and make it attain like a
- 43:24classifier. So it is trained to see if this
- 43:27input is harmful or not right? So a pre trained llama model is
- 43:31taken and it is trained to just do a classification task where
- 43:35it is given a set of harmful Proms and a set of not harmful
- 43:38Proms and made to give a label 0 or one if one it's harmful.
- 43:42IF0 it's not harmful. And you can also add the
- 43:46training data set of this classifier.
- 43:49These kind of adversable Proms, which we designed earlier to
- 43:52make them robust to this kind of attacks.
- 43:54But again, if you use AI to defend AI, this the AI in your
- 43:59pipeline, if one of them breaks, all of them breaks.
- 44:03Yeah. And and 'cause this is all on
- 44:06the input, right? There's none that are happening
- 44:09on the output. Or is there also another filter
- 44:12that's happening on the output in case it goes through the
- 44:16input catch up? So there are multiple ways these
- 44:20systems work. Some work just on inputs,
- 44:22because if you want to really save on the compute time it's
- 44:25better to look at the input. But if you have the board the
- 44:29the capacity to look at both outputs and inputs, that's the
- 44:33best method. So Rama guard ends up looking at
- 44:36output and input if it has a capability of doing that.
- 44:40And some methods even look at the internal activations of the
- 44:43model. And there are detectors which
- 44:46are trained to see if my if I have a layer of transformer and
- 44:49if I look at the activations of different neurons of them, if
- 44:53say a set of these neurons activated more, it's probably
- 44:57harmful prompt. So there are even methods which
- 44:59even look at the internal activations of this models to
- 45:02see if it's the harmful text or not.
- 45:06So it's like basically the dark side of latent space.
- 45:10They can know where that is, the back alleys, and they can say
- 45:13like, hey, if you're travelling in these back alleys of the
- 45:16latent space, you're probably up to no good.
- 45:19Exactly. So they call it circuit breaking
- 45:21where you try to make the model understand if it's it's
- 45:26activations are towards the dark side of it and then just break
- 45:29it off right there and stop the generation.
- 45:31And just that's why sometimes you have seen the models just
- 45:35stop generating some things. They're probably uncertain about
- 45:39it or they just are just the circuit is just broken so that
- 45:42they don't continue it because it's probably going to something
- 45:44harmful. Wow.
- 45:47And have you seen because I know you're doing a bunch of red
- 45:51teaming right now for deep mind, right?
- 45:53And I can only imagine that you've been having fun with all
- 45:57of the models, not just deep minds I and so have you seen
- 46:02different ways that certain models are stronger and and
- 46:08certain models are weaker? So I think that's again a red
- 46:15teaming is to me it's somewhat broad term because in my last
- 46:22work which was published at ICML, we look at red teaming
- 46:26algorithm where we find an automated algorithm to make
- 46:31again readable suffixes, which makes the model but in a fast
- 46:35way. So the GCG algorithm which I
- 46:37mentioned to takes like 70 minutes for optimizing the
- 46:40suffix which is really large. So what we did was our attack
- 46:45would take like one GPU minute to take the model and that what
- 46:49would be published at ICM. And in that particular paper we
- 46:53just proposed the algorithm. But the capability of this
- 46:56algorithm is tremendous because we since it's fast and from an
- 47:02Academy sitting back then with less GPU's, we could try out
- 47:05different attacks. So one is jail breaking which is
- 47:08one kind of red teaming I would say it which exist.
- 47:12Other we do is something called hallucination attack, where we
- 47:15change the prompt such that the models end up hallucinating much
- 47:18more. Right.
- 47:20And the third one is something with privacy attack where we
- 47:23attack the prompts such that the existing privacy attacks
- 47:27performance is boosted. So for example, there's
- 47:30something called membership inference attack where you want
- 47:32to see a given say I give got a text passage from Harry Potter
- 47:36and ask if it was part of your training it or not.
- 47:39So there were attacks to do that well, but let me.
- 47:44Get it was so. Yeah, we can't really give a
- 47:50guarantee on that right now, but I am definite Most of these
- 47:54models used Harry Potter for training them.
- 47:57They actually generate sometimes verbatim exact text from Harry
- 48:01Potter. Yeah.
- 48:04Oh, that's classic. Yeah.
- 48:05So these models, So what we did was the third attack was privacy
- 48:11attack where we attack the input such that the more the
- 48:13performance of the privacy attacks improves.
- 48:15So there are different kinds of attacks which you can think
- 48:18about and people have been only looking in jailbreaking for a
- 48:20teaming, but we have noticed it really depends upon your
- 48:23training. So LAMA is one really good open
- 48:26source model which I know is good at jail but resisting to
- 48:30jailbreaks. So when you come compare it to
- 48:33other methods, models like mistrial from model or Vicuna or
- 48:45Llama and things models like these, we find that Llama is
- 48:48quite robust to jailbreaking attempts.
- 48:52So is tragic BP on Claude or Gemini, but Claude does really
- 48:59well in terms of defense most of the times.
- 49:03They have a lot of safety filters and chain of thoughts
- 49:05going in the background, which I understand is why they are very
- 49:10good at it because they're mainly an AI safety research
- 49:14organization. So they are focused more on
- 49:16safety. I'm assuming they have put more
- 49:18compute on making them better at safety.
- 49:22But yeah, coming back to open source models, Llama has been
- 49:26really good at not jailbreaking. So we found that it's easier to
- 49:31jailbreak llama when you ask to make it to generate fake news.
- 49:35So Llama has a vulnerability where it generates more of fake
- 49:38news. It's easier to make them
- 49:39generate fake news when compared to other models.
- 49:42And one thing to note here is that this is just jailbreaking
- 49:46attacks. And all these models have been
- 49:48fine-tuned to be resistant to jailbreaking attacks.
- 49:51But we when we move to hallucination attacks, we find
- 49:53that llama is equally breakable when compared to all other
- 49:56models for hallucination attacks.
- 49:58So the hallucination attack is essentially we had a suffix and
- 50:01the model ends up saying, OK, eating watermelon seeds is
- 50:04dangerous for you. You might even end up dying
- 50:05eating watermelon seed or walking in the wardrobe.
- 50:08You might end up dying if you walk in the wardrobe.
- 50:10So things like that. So we have actually examples
- 50:14where Lama ends up doing this after an attack.
- 50:17And it's crazy how it works because it really depends upon
- 50:21how you fine-tuned your model. If you did not, if you forgot to
- 50:24find your model to be robust to hallucination attack, your
- 50:28chances are gone. So once you deploy the model,
- 50:32it's out there, people can attack to make it help me more
- 50:34make misinformation out there. So yeah, it really depends on
- 50:39your training, how your training is done.
- 50:41So when comparing these open source models to the production
- 50:44models which are already out there and not open sourced
- 50:47closed models out there, I think they have been extensively
- 50:52fine-tuned to be robust to these kind of techniques.
- 50:56And also they are in academic setting at least we actually let
- 51:00them know this attack is there. We are going to publish them so
- 51:03they get time to adapt to it if it's a really important attack.
- 51:07And also these companies have these programs where you were
- 51:13earlier asking if they're paid to attack or not, where they
- 51:15have like a bounty program where you red team them and find
- 51:20vulnerabilities and report to them.
- 51:21And the model is actually trained to make them better on
- 51:23that. So they are actually doing good
- 51:26red teaming research to be well ahead in the game before someone
- 51:31else outside their organization breaks it.
- 51:34So I think as this gets like how the open source community grew,
- 51:40if the red teaming community grows very large and it outgrows
- 51:44the community that the companies have, it might be harder for
- 51:48companies to cope up with the red teaming approaches which
- 51:51would exist. But it we could make it little
- 51:56more harder for the attackers by adding this kind of differences
- 51:59which the models which these companies use right now.
- 52:02But yeah, again, it's the same problem which existed in
- 52:05detection. I believe.
- 52:07It's not easy to have a complete solution for jailbreaking
- 52:11because if you look at it, the definition of jailbreaking is
- 52:14not fully clear to us. What are the kind of question we
- 52:17are not supposed to answer to the?
- 52:19If we do not know that and we we don't know how to take the model
- 52:22for that, That's the fundamental problem which we are looking at.
- 52:27If we can define the problem, how do we find a solution which
- 52:30is well defined? So we need to define the problem
- 52:34first, which is very ambiguous because the context changes and
- 52:42the scope of harmful questions changes and things like that.