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

12월24일 정부지원사업 신규 공고 리스트 (16건) _ (파일 재가공/재배포 가능)

12월 24일 16건<12/24지원사업 신규 공고 목록> *전 영업일인 12/23에 올라온...

모듈식 모터 및 기어박스로 제품 개발이 간편해집니다.

후원자: 맥슨의 Parvalux.경쟁에서 승리하려면 엔지니어는 개발 시간을 단축하고 제품...

Draganfly, 병원 드론 배달 개념 증명 비행 완료

Draganfly는 Brigham 장군의 개념 증명을 통해 드론이 의료 분야의...

2024년 기후 기술 상위 10개 스토리

2024년에는 기후변화에 대처하는 기술 전기를 생산하는 연을 타고 구름...