Model Surgery: Modulating LLM’s Behavior Via Simple Parameter Editing

Date:

arXiv:2407.08770v1 Announce Type: new
Abstract: Large Language Models (LLMs) have demonstrated great potential as generalist assistants, showcasing powerful task understanding and problem-solving capabilities. To deploy LLMs as AI assistants, it is crucial that these models exhibit desirable behavioral traits, such as non-toxicity and resilience against jailbreak attempts. Current methods for detoxification or preventing jailbreaking usually involve Supervised Fine-Tuning (SFT) or Reinforcement Learning from Human Feedback (RLHF), which requires finetuning billions of parameters through gradient descent with substantial computation cost. Furthermore, models modified through SFT and RLHF may deviate from the pretrained models, potentially leading to a degradation in foundational LLM capabilities. In this paper, we observe that surprisingly, directly editing a small subset of parameters can effectively modulate specific behaviors of LLMs, such as detoxification and resistance to jailbreaking. Specifically, for a behavior that we aim to avoid, we employ a linear classifier, which we term the behavior probe, to classify binary behavior labels within the hidden state space of the LLM. Using this probe, we introduce an algorithm to identify a critical subset of LLM parameters that significantly influence this targeted behavior. Then we directly edit these selected parameters by shifting them towards the behavior probe. Such a direct parameter editing method necessitates only inference-level computational resources. Experiments demonstrate that in the representative detoxification task, our approach achieves reductions of up to 90.0% in toxicity on the RealToxicityPrompts dataset and 49.2% on ToxiGen, while maintaining the LLM’s general capabilities in areas such as common sense, question answering, and mathematics. Our code is available at https://github.com/lucywang720/model-surgery.

Share post:

Subscribe

Popular

More like this
Related

Monarch Tractor는 자율 사료 추진을위한 유제품 농민과 파트너 관계

MK-V Dairy Autodrive Feed Pushing을 사용하면 농민들은 더 자주...

Nuro는 데이터 수집을 위해 자율 주 차량 테스트 차량을 일본에 가져옵니다.

Nuro는 캘리포니아와 텍사스에서 8 년 이상의 개발과 4 년간의...

ABB는 로봇 부서를 분사 할 계획입니다

ABB Robotics는이 IRB 로봇과 같은 산업 시스템을 마찰 교반...

AI와 로봇 공학의 미래는 아마존의 차세대 창고가 이끄는 것입니다.

이것은 후원 기사입니다 아마존.로봇 공학 및 인공 지능 (AI)의...