Combining Domain and Alignment Vectors to Achieve Better Knowledge-Safety Trade-offs in LLMs

Megh Thakkar, Quentin Fournier, Matthew Riemer, Pin-Yu Chen, Amal Zouaq +2 more
11/11/2024
cs.AI

No confident code implementation found for this paper.

Abstract

There is a growing interest in training domain-expert LLMs that excel in specific technical fields compared to their general-purpose instruction-tuned counterparts. However, these expert models often experience a loss in their safety abilities in the process, making them capable of generating harmful content. As a solution, we introduce an efficient and effective merging-based alignment method called \textsc{MergeAlign} that interpolates the domain and alignment vectors, creating safer domain-specific models while preserving their utility. We apply \textsc{MergeAlign} on Llama3 variants that are experts in medicine and finance, obtaining substantial alignment improvements with minimal to no degradation on domain-specific benchmarks. We study the impact of model merging through model similarity metrics and contributions of individual models being merged. We hope our findings open new research avenues and inspire more efficient development of safe expert LLMs.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{thakkar2024combining,
  title  = {Combining Domain and Alignment Vectors to Achieve Better Knowledge-Safety Trade-offs in LLMs},
  author = {Megh Thakkar and Quentin Fournier and Matthew Riemer and Pin-Yu Chen and Amal Zouaq and Payel Das and Sarath Chandar},
  year   = {2024},
  eprint = {2411.06824},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2411.06824v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2411.06824.svg)](https://codeofpaper.com/paper/2411.06824)

Discussion