Okay, so as he said, my name is adversarial. My real name is Ariel Herbert-Voss. I'm a PhD student at Harvard, and this is related to research that I do as part of my program. So I'm going to hop into that now. So what this talk is about, I probably should have called it Beyond Adversarial Examples. So adversarial examples are an important attack vector, but they're also not the only one to be concerned about. So we're going to go into the weeds a little bit about some of these other types of attacks that you can do against machine learning models. And also, this machine learning talk does not really have a lot of math in it. There is one slide that has an equation on it, and the rest of it is pretty high level. So if you're still a noob, that's fine. Don't leave. So here's a rundown on the ML pipeline, if you're not familiar with that. So say you've got some raw data that you want to get some value out of. So you will typically do some, some processing to extract some features. And then after that, then you'll split the data into training and testing, because machine learning is basically a noisy optimization problem where you iterate over a bunch of parameters, and you're trying to look for a function that best represents whatever relationship in the data that you're looking for. And this is also why deep learning and a bunch of these other techniques are so popular, is because you can actually prove mathematically that deep neural networks and some of the other models are universal function approximators, which means they can, they can basically learn anything. But that also means that we can force them to learn the wrong thing. So after you do all this training and testing, you'll pick out the best model to fit the needs for whatever it is you're hoping to get out of your data. And then you'll usually either deploy it in production as like an API, where users can put in their own data and then get out some predictions, depending on what your user is looking for, if you are the user. So when, when we attack machine learning systems, generally, there are two high level goals. We're looking to either force incorrect predictions, or we're looking to steal data. So forcing incorrect predictions is like, you, you want to attack this model and make it give you the wrong answer for things, or you want to see whatever the model trained on, because it might be trained on something sensitive, like medical records or personal identification information. Um, and so these machine learning models tend to have three components to them. So there's the data, there's the model itself, and there's the prediction. And so you can usually formulate attacks as being one of those, attacking one of those three things or a couple of those three things. And so, um, uh, to, so I'm going to talk a little bit about adversarial examples. And you've probably heard about these. But the main idea is that you want to slightly perturb the input data that you're feeding in to force the model to make an increase. So you want to make sure that you're getting the right prediction. Um, and they're also very hard to detect. So, um, here's an example where you've got a panda picture, and then you add some noise to it, and then you end up with this panda that's going to be classified as a gibbon. But if you look at it, you can't really tell, because it's just statistical noise, and it's hard to perceive the difference. And, um, it, depending on how you've deployed your ML model, like, you can't really sanitize the inputs, um, because somebody can just come along and, like, just, keep making harder and harder to predict, uh, versions of these adversarial examples. Um, and I, I guess to make this more clear, here's an example from the perceptual system. So, uh, we've got a training set of dogs and fried chicken, and you want to correctly classify which one is which. So, uh, if you look at them, um, you can see that some of them are actually a bit harder to tell the difference, especially if you're sitting in the back and it's, like, really fuzzy. Um, uh, let's see. So the two on the, the left are chicken, and the two on the right are dogs. Uh, and so there's, uh, if you think about this, there's a couple of features that you're looking at that tell you if one is a dog. Like, you might be looking for eyes and a nose. Um, and with chicken, you might be looking at the environment. Like, is there a piece of lettuce? Because dogs don't really like lettuce. Um, so, uh, the, the, this picture, this graph on the right gives you more of a mathematical sense of, like, how these things work. So you've got, um, uh, this, uh, oval right here is, uh, the, the dog cluster where all the images inside there are going to be classified as a dog. And you've got this abracadabra image on the outside that you want to have classified as a dog, but it's currently being classified as a chicken. Um, so you want to kind of perturb your image in such a way that it kind of goes along the, the boundary between dog and chicken. Um, and so when it comes to generating these abracadabra examples, there's, there's, like, a million different ways to construct them. Um, and we keep coming up with more of them, and it's great. Um, and there are also some ways to defend against them, but the one, the ways in which we defend against are kind of getting smaller and smaller. Like, like this last year, um, actually in June, uh, there's a big machine learning conference called ICML, and they just published this great paper about why one of the main methods for defending against these things doesn't work. Like, it's, um, it has to do with, um, the generation method being, uh, so since deep learning is basically convex optimization, you're, and you're trying to find examples that fuzz the boundary between categories. Um, it usually involves a bunch of gradients, and so most of these methods have to do with gradients, and it's a bit of a gradient arm race right now. Um, so, uh, we're not going to talk much about abracadabra examples because it's very messy, um, and also I think there are more important attacks. Um, this is one of my favorite memes, and I thought I would share it. Uh, you probably can't read it in the back, but it's one of those Scooby-Doo memes, and it says, oh, shit, I can't read because I don't like glasses. Um, but it says, uh, can somebody read that for me? Okay, okay, come up, come up, come here. Thank you. Okay, gang, let's see what deep learning really is. Um, what's that word I can't, it's convex optimization. It's blurry for me, too. All right, all right, thank you. Um, yeah, so deep learning is basically just convex optimization, and that's why abracadabra examples are very hard to deal with. Um, so today we're going to talk about some other ways to hack things. Um, but first we're going to talk about differential privacy. So, uh, differential privacy is a technique from cryptography that is usually used to protect data from being exfiltrated. Um, and in fact, Google and Apple have both made a big show recently about using it in a variety of their machine learning products. Um, so here, here's, this is the slide with the only, um, equation on it. Um, and you're going to stare at that for, like, a minute. Just kidding, not a minute. Um, here's the informal version of, of what that is. So, uh, what differential privacy says is that you've got two otherwise identical databases, D1 and D2, um, one with your information in it and one without. And so differential privacy, um, ensures that the probability that a stochastic algorithm, A, um, and in this case stochastic algorithm can be a machine learning algorithm, um, will produce a given result, C, like a, a classification. Um, the same whether or not it's, you're operating that algorithm on D1 or D2 up to a particular bound, epsilon. Uh, and so the, the key insight here is that adding or removing an element from the data doesn't really change the output prediction very much. Um, and what differential privacy does is it provides a bound on how much changing one d-, piece of data, um, affects the output. Uh, and so how, how do we actually do this? Because that's, that's like a bunch of math, and it's not immediately clear how you apply this. So there, there's two parts in when you're actually applying this kind of technique to something. So the first thing you want to do is you want to add noise, and the second is you want to keep track of how many data access requests are granted. So adding noise allows us to obfuscate the predictions in such a way that they're still useful, but don't provide enough information to really allow an adversary to reconstruct the information that you're pulling out. Um, and then with regards to keeping track of how many data access requests, um, the more information that you ask about the data, I mean, obviously, that means the attacker can learn more about it. Um, and this means that we have to add more noise to minimize the privacy leakage. And there comes a point where, like, you've just leaked too much data, and no matter how much noise you add to it, like, you can add so much noise that it no longer is really that useful, and you're just spitting out a bunch of, like, useless predictions. Um, so at that point, your best option is actually just to burn the database down and start over. Um, so don't do that. Um, and so the key to implementing differential privacy is to, to pick the proper, uh, privacy budget. And so when I say privacy budget, I mean the notion of counting how many requests that you're making, um, on, on the data. And so if you have too high of a privacy, of, of a privacy budget, then you're gonna, like, leak too much data. But if you have too low, then your predictions are gonna be way too noisy to be useful. Um, so now we're gonna talk about data exfiltration. Um, cause this is the attack that different, uh, differential privacy can protect you against. Um, so data exfiltration in this case refers to the scenario in which we wanna steal the training data that's being used to train a given model. Um, and so the attackers have access to the, um, input data, um, and, and the predictions. So they can put anything in, and they can also see the predictions. And then, in a lot of cases, um, a lot of these APIs will spit out, kind of, confidence information for interpretability. Cause if you're, if you're making a prediction, you wanna, kind of, know how confident you are that the prediction is correct. But unfortunately, that's actually a bad thing. Um. So here, here's an example. Um, so given a label, like a name, we wanna extract the associated training image from a pre-trained, pre-trained machine learning model. Um, so in this case, on, on the left, we have an image that we have trained on as just an illustration. And then, on the right, we have, um, a recovered image that we've managed to pull out, um, using the technique I'm gonna talk about in a sec. Um, so in this case, um. You can, like, feed in a name, and you can get out a face, which, if you think about the Facebook API or anything else that exposes its endpoints, I think maybe Facebook has patched that by now. Um, but there was a point at which you could feed in your name, and you could get out your picture if you had a very unique name, like me. And it's terrifying and awesome. Um, and I was supposed to have a demo of that, but, I'm sorry. Uh, so, here's a little bit about how that attack works. So, and more explicitly with diagrams. Because diagrams are helpful. Uh, so we wanna treat this as kind of an optimization problem, where you want to find, uh, the input that maximizes the confidence intervals that also matches the target. So in this case, when you're maximizing the confidence interval, you're maximizing how comfortable you are with the piece of data that, or, you're maximizing how sure you are that the piece of data that you're, you're targeting is the piece of data that you want. So, naturally, if you maximize that, it'll feed out what it is you're looking for. Um, and you can use that. You can use a couple of, so in this case, you'll train, like, an auxiliary ML model, or you could, um, yeah, or, or you treat it as just, like, a normal, uh, convex op problem. Um, but in this case, you can use a bunch of different types of machine learning algorithms, depending on what the original model is. So, um, if you're training on decision trees, then you might use map estimation. Um, and neural network models tend to, uh, they work to map a feature vector into a low, lower dimensional space. So, you can then separate the classes. And then, um, autoencoders will then find the compressed latent representation, which minimizes the construction, um, error. And if that doesn't make any sense to you, um, if you've seen the, uh, what's it called? That model that hallucinates? Um, yes, yes. If you've seen something like that, then that's more or less the attack that I'm describing. Like, you're trying to force a particular response. Um, and so, uh, the question then becomes, how do we handle it? So, with regards to differential privacy, um, the easiest way to do this is just round the confidence interval. Because that's basically adding noise to the output. Um, so it's like cheap and easy, really dirty differential privacy. I'd recommend doing this if you have endpoints open like that. Um, and so, here's another example of data exfiltration with regards to sequential data, which I think a lot of us work with. Um, and this is also pretty wild. Uh, because it's a baked-in specification. Um, and so, you know, there's a specific feature, um, of all deep neural network, um, architectures, um, where they're basically memorizing information. And so, um, even though you have information that's fed into a DNN and it gets transformed into some sort of higher level representation during the training process, it does not obscure that information. So if you have, um, so let's say that you have an adversary that has, um, access to a trained language model for some text dataset, like sensitive emails. Um, and then by using a searching algorithm, like even beam search. Um, along with some model predictions, uh, kind of like how predictive text works, uh, you can then extract the information that fits into a particular format, like credit card numbers. Um, so in this case, um, the attacker is targeting information in the training data, um, by using some sort of auxiliary search algorithm, um, through the predictions of the model. Which means we can't predict, or we, we can't protect this by just fuzzing the outputs. You have to bake in protection here. Um, so in this case, you want to replace the optimization. The optimization algorithm that you're using in, in, um, your, your learning algorithm, because all learning is, is just optimization. Um, and so you would want, um, to replace that with a differentially private version. Uh, so in this case, the, if you use TensorFlow, there is a, um, a differentially private version of stochastic gradient descent, which is like the standard method that most people use. Or if you use Atom, um, uh, it's the standard method that most people use, uh, to train the models. Um. And so the gist of how that works is that, uh, at each step, it calculates the gradient, uh, for a random subset of examples. And then it clips the L2 norm, it computes the average, and then adds some noise. And then, uh, does like the standard thing of stepping in the opposite direction of, um, uh, your freshly computed gradient. Um, and it also has a privacy accountant built in, which is the same as the privacy budget I mentioned. Um, and that keeps track of the overall privacy cost of training by tracking, um, uh, tracking, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh. Tracking the number of steps. Yes, it tracks the number of steps that you're making as you're training. Um, so, um, if you're following along still, um, it would make sense that by adding this noise and by only limiting yourself to a certain number of requests or steps, you're not going to get, like, a 100% accurate thing. But, I mean, at the end of the day, it doesn't actually matter how many, like, how many more benchmarks you get on MNIST because MNIST is terrible. And InfoSec, we like to just get something. We like to get something that works. Um, and this works really well. Um, so, uh, yes. And this is an old slide that we do not need. Um, my bad. Okay. All right. So, some general observations here. Um, most attacks are trying to get at information that are held in the model. Um, like, be that trying to force predictions by looking at what's already there. Um, or taking advantage of what's already there. Or just, like, you want to pull that information back. Um, and then notice that these attacks will still work even if the data is encrypted. Um, and they rely on the preservation of statistical relationships within the data. Which is not obfuscated by most cryptographic techniques outside of, like, differential privacy. Um, and then there's a couple of other methods that people have proposed to protect against, like, these kind of data exfiltration attacks. Like, um, homomorphic encryption kind of makes sense. Uh, because then you can encrypt your model. And you can still, like, do all your training and stuff on that. But unfortunately, you're encrypting it. But you're not changing any of these statistical relationships. Which means you can still do data exfiltration. Because the whole point of, or the whole way that these attacks work is you're, um, abusing statistics to pull out statistical information. Um, and then people have also proposed using secure multi-party computation. But, um, and this is cheaper than homomorphic encryption. And it is pretty cool. But it's not immune to Byzantine failure. And that's, like, a terrible thing. Because it means if you have somebody, um, in your training group who's all helping you train this model. And they just want to add a backdoor. They can add a backdoor. Your model still trains on it. And because of the way that these deep learning models work. Or some of these other models work, too. Um, you're going to end up with a backdoor in your model. And then somebody can take advantage of you and steal all your data. And that's terrible. Um, so, uh, let's see. Right. So the practical takeaway summary slide is that, um, you want to give users the bare minimum amount of information. You don't want to give them confidence values unless you can protect those. Um, and you want to add some noise to output predictions regardless. Um, and you want to be able to restrict users from making too many prediction queries. And so I think a lot of, um, companies now do this where you can only make so many requests at a particular time. So they can, um, add some sort of noise to the process. Um, and then you might also consider using an ensemble of models and then aggregate these predictions, too. Um, and so far, differential privacy is the most reliable method for model hardening against data exfiltration in machine learning.