Smoothed Embeddings for Robust Language Models

Ryo Hase, Md Rafi Ur Rashid, Ashley Lewis, Jing Liu, Toshiaki Koike-Akino +2 more
1/27/2025
cs.LGcs.AIcs.CL

No confident code implementation found for this paper.

Abstract

Improving the safety and reliability of large language models (LLMs) is a crucial aspect of realizing trustworthy AI systems. Although alignment methods aim to suppress harmful content generation, LLMs are often still vulnerable to jailbreaking attacks that employ adversarial inputs that subvert alignment and induce harmful outputs. We propose the Randomized Embedding Smoothing and Token Aggregation (RESTA) defense, which adds random noise to the embedding vectors and performs aggregation during the generation of each output token, with the aim of better preserving semantic information. Our experiments demonstrate that our approach achieves superior robustness versus utility tradeoffs compared to the baseline defenses.

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{hase2025smoothed,
  title  = {Smoothed Embeddings for Robust Language Models},
  author = {Ryo Hase and Md Rafi Ur Rashid and Ashley Lewis and Jing Liu and Toshiaki Koike-Akino and Kieran Parsons and Ye Wang},
  year   = {2025},
  eprint = {2501.16497},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2501.16497v1}
}

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/2501.16497.svg)](https://codeofpaper.com/paper/2501.16497)

Discussion