# Oral 31754

- Kind: Oral
- Talk page and recording: https://iclr.cc/virtual/2025/oral/31754

> Transcript of the talk's recording (session_asr), made by speech recognition or taken from the host's captions. It may contain errors. The words are the speakers'; listen to the recording on the talk's page before quoting it.

So my name is Tian Sheng Huang, and today I'm going to present my booster paper. And this paper is actually working on the same problem with the outstanding paper, a few tokens deeper paper. And yeah, I just want to draw your attention here. And yeah, so we are considering about arm safety as well. So basically, we don't want the model to answer some questions that are very harmful to us. And yeah, typically you can do safety alignment to achieve this goal. And it basically is just using some supervised fine-tuning or reinforcement learning technique to learn on a safe demonstration data set. So safety alignment is good, but the thing is the service provider like the OpenAI, they actually want to open up more service to expand their revenue. So they actually open a service called fine-tuning, user fine-tuning. Basically, they allow the users to upload their data to them, and then they will use this data to fine-tune the base LLM, and then they will deploy this model to the users. And yeah, user fine-tuning is also good, but it actually compromises the safety alignment, imposing more challenge for the service provider to maintain the safety alignment. The reason is that actually the service provider cannot control what data they are going to be uploading to them. User may upload some good data, of course, but they also could upload some kind of harmful data, either intentionally or unintentionally. So it will be the safety alignment and pose some challenge for the service provider. And here we want to outline the model we are trying to design defense towards. So basically, we are considering a two-stage pipeline. The first stage is to do the safety alignment. We are assuming that the service provider are having some safe data and do the safety alignment with this safe data. And the later stage is the user fine-tuning. They basically would ask the users to upload data to them, and then they would fine-tune the model on this user data. But the problem is in the second stage. So the user data is not always helpful. So some percentage of the data are harmful. So we are trying to propose defense towards the issue, and we allow the service provider to maintain a good data set, which is basically some good demonstration data set that you want the model to behave when it encounters some bad question. And we also assume the service provider maintain a harmful data set, which is basically some negative samples. So showing that how you don't want the model to react when you encounter harmful question. And we are trying to do the defense. So we first want to outline some statistics data here. And we, of course, care about the harmfulness of the model. So we use the harmful score to measure how the model is reacting towards the harmful question. And here, we basically just input several harmful questions to the model and see whether the model is going to reject the question or they answer the question. And we show that if we have a live model in hand, if we are doing several fine-tuning on the harmful data, then basically the harmful score will increase very fast, which means the model is becoming harmful. And to see the hidden reason of this, we also show the harmful training loss, which is the loss over the harmful data used for fine-tuning. We calculate this harmful training loss, and we see that intuitively the harmful training loss is also decreasing, which means it's learning from this harmful data. And the fun fact is that we also measure the harmful testing loss, which is loss over some unseen harmful data. And we see that the model is generalized very well to the unseen harmful data as well. And yeah, so with this observation, we can basically understand how fine-tuning is going to disrupt our model. And let's take a deeper look. So what is the real reason that leads to this statistics? So let's see the very basic gradient descent update rule. So basically, we are taking the gradient over different samples. So when the stochastic gradient is taken over a harmful sample, so basically it would probably reduce the harmful training loss, and the model learns from this harmful sample. Let's call this a multi-gradient update on the harmful sample as the harmful perturbation. And so the next thing we want to do is how to attenuate the harmful perturbation, make the impact of this harmful perturbation to be smaller. And the high-level idea is that maybe we can produce an aligned model that is robust to such harmful perturbation. We can make the safety alignment stronger to be able to resist to the latent fine-tuning attack. So yeah, here is a curve that I draw. The red line is the curve that I draw when I am struggling in my PhD life. So basically, we want the harmful training loss to reduce very smoothly. And this is the ideal case that we want to achieve. That means that the harmful perturbation is not going to affect our model. So how to really do the optimization? So here we have the optimization problem here. And this one is operating in the safety alignment stage. And the core contribution is in the second term, which is the web box. So how to interpret this web box? We can show the figure on the right side. So HW is the loss over the harmful data. And the first circle in the figure actually shows the first aligned model loss. And the second circle, which means that we take one gradient, one harmful perturbation on the model, and then we calculate its harmful training loss. And actually, the gap between these two circles measures the gap between the one step of perturbation and the one without the perturbation. And we want to minimize this gap to achieve a smoother curve. And you can see that when the gap of these two circles is minimized, then the curve of the harmful training loss will be smoother, intuitively, right? So yeah, so this is the optimization problem that we want to solve. And next, we try to formulate a method to solve this. And the method is also intuitive. So we can just take the gradient over the model W to solve this problem. But the problem is that if we take the normal gradient, it will have a second-order information in the gradient update. And this second-order information is computationally expensive in terms of the scale of the LLM. And so we just straight through the second-order information and make it to be constant and approximate the gradient update route. And yes, that's all for our design method. And here, I want to show you some results. So we see that in the left figure, we again show the few metrics here. And in the left figure, we show that the harmful score is not increasing very fast. Maybe it's increasing a little bit, but not that significant, which is good, which means our model is not able to learn the harmful knowledge when it is fine-tuning. And the second figure shows that when we are doing the booster method, the harmful training loss is becoming smoother, which coincides with our method design, and also can generalize well to the unseen data by the third figure. So how about the performance over the downstream charts? So we are considering about learning some good data from the fine-tuning data, but not learn the harmful knowledge from the fine-tuning data. So we are also caring about the accuracies of the fine-tuning. So it basically measures how the model is going to react in terms of the fine-tuning downstream task. And we show that our method, the booster method, actually can reduce the harmful scores, can make the models not harmful, but it also can learn the good knowledge from the good benign fine-tuning data, which is good. And yeah, to draw your little bit attention, there are like 14 papers in ICLR 2025 this year on the topic of the harmful fine-tuning attack and defense. And feel free to check them out in the poster session as well. So my poster session is in the afternoon. Feel free to chat with me as well. So that's all for my talk. Thank you for your attention. Thank you for the presentation. In your loss function, you have this term hw. And this actually, when you optimize this hw, this means you're making the model harmful, right? Yeah, so we can't take the singleton as a... I mean, we can't just look at the singleton of the hw. We just make the second term, the web box term as a whole to capture the gap between the loss change. But what would happen if you just kept the third term, basically, and do not use the second term? Yeah, that's a good question. So when we were in our papers, also ask this question, and we do a version study for that. So if you only keep the second term, it could not work as expected. Okay, thank you. Thank you. Yeah, one more question there. Thanks. Sorry, where do you get the harmful data from on which you compute the loss? Is it from the user-provided data, or do you have another data set? Good question. So the question is whether the data we use for the harmful loss, used for calculating the harmful loss, is exactly the same with the fighting attack data that are used by the users. So the answer is no. So we basically use another data set. They are in the same distribution of the user attack data, but they are not exactly the same data. Okay, if you have more questions, please contact the author later due to time limits. Sorry. Thank you.
