Adversarial Tokenization

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Geh, Renato Lui, Shao, Zilei, Broeck, Guy Van den
Format: Preprint
Published: 2025
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866910991086780416
author Geh, Renato Lui
Shao, Zilei
Broeck, Guy Van den
author_facet Geh, Renato Lui
Shao, Zilei
Broeck, Guy Van den
contents Current LLM pipelines account for only one possible tokenization for a given string, ignoring exponentially many alternative tokenizations during training and inference. For example, the standard Llama3 tokenization of penguin is [p,enguin], yet [peng,uin] is another perfectly valid alternative. In this paper, we show that despite LLMs being trained solely on one tokenization, they still retain semantic understanding of other tokenizations, raising questions about their implications in LLM safety. Put succinctly, we answer the following question: can we adversarially tokenize an obviously malicious string to evade safety and alignment restrictions? We show that not only is adversarial tokenization an effective yet previously neglected axis of attack, but it is also competitive against existing state-of-the-art adversarial approaches without changing the text of the harmful request. We empirically validate this exploit across three state-of-the-art LLMs and adversarial datasets, revealing a previously unknown vulnerability in subword models.
format Preprint
id arxiv_https___arxiv_org_abs_2503_02174
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Adversarial Tokenization
Geh, Renato Lui
Shao, Zilei
Broeck, Guy Van den
Computation and Language
Artificial Intelligence
Machine Learning
Current LLM pipelines account for only one possible tokenization for a given string, ignoring exponentially many alternative tokenizations during training and inference. For example, the standard Llama3 tokenization of penguin is [p,enguin], yet [peng,uin] is another perfectly valid alternative. In this paper, we show that despite LLMs being trained solely on one tokenization, they still retain semantic understanding of other tokenizations, raising questions about their implications in LLM safety. Put succinctly, we answer the following question: can we adversarially tokenize an obviously malicious string to evade safety and alignment restrictions? We show that not only is adversarial tokenization an effective yet previously neglected axis of attack, but it is also competitive against existing state-of-the-art adversarial approaches without changing the text of the harmful request. We empirically validate this exploit across three state-of-the-art LLMs and adversarial datasets, revealing a previously unknown vulnerability in subword models.
title Adversarial Tokenization
topic Computation and Language
Artificial Intelligence
Machine Learning
url https://arxiv.org/abs/2503.02174