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

spot_imgspot_img

Popular

More like this
Related

Photoneo는 로봇 인식을 향상시키기 위해 MotionCAM-3D 컬러 (파란색)를 출시합니다

MotionCam 3D Color (Blue)는이 팔레팅 응용 프로그램에서와 같이 거리에서...

Rainbow Robotics는 전 방향 바퀴, 이중 암 로봇을위한 개발 키트를 공개합니다.

RB-Y1에는 휠 모바일 플랫폼에 장착 된 두 개의 암이...

10 로봇 트렌드는 2025 년에 발견되었습니다

지난 주 디트로이트에서 2025 년을 소집했습니다. 출처 : 로봇...

한 명의 운전자, 두 트럭 : 이것이화물의 미래입니까?

쌍의 쌍 반 트럭 콜럼버스, 오하이오 및 인디애나 폴리스...