Safeguarding Large Language Models in Real-time with Tunable Safety-Performance Trade-offs
Large Language Models (LLMs) have been shown to be susceptible to jailbreak attacks, or adversarial attacks used to illicit high risk behavior from a model. Jailbreaks have been exploited by cybercriminals and blackhat actors to cause significant harm, highlighting the critical need to safeguard widely-deployed models. Safeguarding approaches, which include fine-tuning models or having LLMs "self-reflect", may lengthen the inference time of a model, incur a computational penalty, reduce the semantic fluency of an output, and restrict ``normal'' model behavior. Importantly, these Safety-Performance Trade-offs (SPTs) remain an understudied area. In this work, we introduce a novel safeguard, called SafeNudge, that combines Controlled Text Generation with "nudging", or using text interventions to change the behavior of a model. SafeNudge triggers during text-generation while a jailbreak attack is being executed, and can reduce successful jailbreak attempts by 30% by guiding the LLM towards a safe responses. It adds minimal latency to inference and has a negligible impact on the semantic fluency of outputs. Further, we allow for tunable SPTs. SafeNudge is open-source and available through https://pypi.org/, and is compatible with models loaded with the Hugging Face "transformers" library.
Code (0)
등록된 구현이 없습니다.
Tasks
Text GenerationSimilar Papers 제목 키워드 기반
A Framework for Real-time Safeguarding the Text Generation of Large Language Model
Large Language Models (LLMs) have significantly advanced natural language processing (NLP) tasks but also pose ethical and societal risks due to their propensity to generate harmful content. Existing methods have limitat…
Language ModelingLanguage ModellingLarge Language ModelText Generation+1Multilingual Collaborative Defense for Large Language Models
The robustness and security of large language models (LLMs) has become a prominent research area. One notable vulnerability is the ability to bypass LLM safeguards by translating harmful queries into rare or underreprese…
Towards Safe Autonomous Driving: A Real-Time Safeguarding Concept for Motion Planning Algorithms
Ensuring the functional safety of motion planning modules in autonomous vehicles remains a critical challenge, especially when dealing with complex or learning-based software. Online verification has emerged as a promisi…
Autonomous VehiclesAutonomous DrivingMotion PlanningSafe Sliding Mode Controllers for Nonlinear Uncertain Systems
In this study, we present a novel sliding mode safety-critical controller designed to address both stability and safety concerns in a class of nonlinear uncertain systems. The controller features two feedback loops: an i…
BOLT: Fast Energy-based Controlled Text Generation with Tunable Biases
Energy-based models (EBMs) have gained popularity for controlled text generation due to their high applicability to a wide range of constraints. However, sampling from EBMs is non-trivial, as it often requires a large nu…
Text Generation