LoRA-Guard: Parameter-Efficient Guardrail Adaptation for Content Moderation of Large Language Models

Fuente: arXiv
Gespeichert in:
Bibliographische Detailangaben
Hauptverfasser: Elesedy, Hayder, Esperança, Pedro M., Oprea, Silviu Vlad, Ozay, Mete
Format: Preprint
Veröffentlicht: 2024
Schlagworte:
Online-Zugang:
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
_version_ 1866912160521650176
author Elesedy, Hayder
Esperança, Pedro M.
Oprea, Silviu Vlad
Ozay, Mete
author_facet Elesedy, Hayder
Esperança, Pedro M.
Oprea, Silviu Vlad
Ozay, Mete
contents Guardrails have emerged as an alternative to safety alignment for content moderation of large language models (LLMs). Existing model-based guardrails have not been designed for resource-constrained computational portable devices, such as mobile phones, more and more of which are running LLM-based applications locally. We introduce LoRA-Guard, a parameter-efficient guardrail adaptation method that relies on knowledge sharing between LLMs and guardrail models. LoRA-Guard extracts language features from the LLMs and adapts them for the content moderation task using low-rank adapters, while a dual-path design prevents any performance degradation on the generative task. We show that LoRA-Guard outperforms existing approaches with 100-1000x lower parameter overhead while maintaining accuracy, enabling on-device content moderation.
format Preprint
id arxiv_https___arxiv_org_abs_2407_02987
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle LoRA-Guard: Parameter-Efficient Guardrail Adaptation for Content Moderation of Large Language Models
Elesedy, Hayder
Esperança, Pedro M.
Oprea, Silviu Vlad
Ozay, Mete
Machine Learning
Artificial Intelligence
Computation and Language
Guardrails have emerged as an alternative to safety alignment for content moderation of large language models (LLMs). Existing model-based guardrails have not been designed for resource-constrained computational portable devices, such as mobile phones, more and more of which are running LLM-based applications locally. We introduce LoRA-Guard, a parameter-efficient guardrail adaptation method that relies on knowledge sharing between LLMs and guardrail models. LoRA-Guard extracts language features from the LLMs and adapts them for the content moderation task using low-rank adapters, while a dual-path design prevents any performance degradation on the generative task. We show that LoRA-Guard outperforms existing approaches with 100-1000x lower parameter overhead while maintaining accuracy, enabling on-device content moderation.
title LoRA-Guard: Parameter-Efficient Guardrail Adaptation for Content Moderation of Large Language Models
topic Machine Learning
Artificial Intelligence
Computation and Language
url https://arxiv.org/abs/2407.02987