Model Editing as a Double-Edged Sword: Steering Agent Ethical Behavior Toward Beneficence or Harm
Baixiang Huang, Zhen Tan, Haoran Wang, Zijie Liu, Dawei Li, Ali Payani, Huan Liu, Tianlong Chen, Kai Shu
TL;DR
This work frames the ethical steering of LLM-based agents as Behavior Editing, a targeted model-editing paradigm that can both enhance benevolent behavior and induce harmful actions. It formalizes the objective as transforming $f$ into $f^*$ on editing inputs $\mathcal{X}_{\mathcal{E}}$ while preserving behavior outside this set, and introduces BehaviorBench, a three-tier, psychology-grounded benchmark to evaluate scenario-specific and global moral alignment across diverse datasets. Through experiments with multiple editing techniques (e.g., ROME, FT-M, ICE) and various LLMs, the study shows that behavior editing can reliably steer responses in targeted scenarios and can also produce broader shifts in global moral alignment, with parameter-modifying methods generally performing best. The results highlight both the promise for safer, more controllable agents and the substantial safety risks of misuse, underscoring the need for detection, defense, and governance frameworks in deploying such techniques.
Abstract
Agents based on Large Language Models (LLMs) have demonstrated strong capabilities across a wide range of tasks. However, deploying LLM-based agents in high-stakes domains comes with significant safety and ethical risks. Unethical behavior by these agents can directly result in serious real-world consequences, including physical harm and financial loss. To efficiently steer the ethical behavior of agents, we frame agent behavior steering as a model editing task, which we term Behavior Editing. Model editing is an emerging area of research that enables precise and efficient modifications to LLMs while preserving their overall capabilities. To systematically study and evaluate this approach, we introduce BehaviorBench, a multi-tier benchmark grounded in psychological moral theories. This benchmark supports both the evaluation and editing of agent behaviors across a variety of scenarios, with each tier introducing more complex and ambiguous scenarios. We first demonstrate that Behavior Editing can dynamically steer agents toward the target behavior within specific scenarios. Moreover, Behavior Editing enables not only scenario-specific local adjustments but also more extensive shifts in an agent's global moral alignment. We demonstrate that Behavior Editing can be used to promote ethical and benevolent behavior or, conversely, to induce harmful or malicious behavior. Through extensive evaluations of agents built on frontier LLMs, BehaviorBench validates the effectiveness of behavior editing across a wide range of models and scenarios. Our findings offer key insights into a new paradigm for steering agent behavior, highlighting both the promise and perils of Behavior Editing.
