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

도쿄 공공 도로에서 로봇 락시스 테스트를 시작하는 Waymo

Waymo는 도쿄 교통 생태계의 일부가되어 안전과 이동성을 향상시키는 것을...

활로 보편적 인 로봇 플랫폼 구축

로봇 보고서 팟 캐스트 · 활로 보편적 인 로봇...

PIAP Space의 Titan Robotic Arm은 궤도 내 검사를 자동화하는 것을 목표로합니다.

PIAP는이 10 년 말 전에 타이탄과 같은 시스템이 배치...

비디오 금요일 : 작은 로봇 벌레 홉과 점프

Video Friday는 친구가 수집 한 주별 멋진 로봇 비디오입니다....