Tokenizer Ambiguity: Identical Text, Distinct Internal Tokens

Subword tokenizers can assign different internal token IDs to semantically identical surface text, creating 'phantom edits' where LLMs treat these as distinct 'words' internally. This representational mismatch can betray reasoning, making it difficult for the model to consistently differentiate between instruction and data based on token embeddings.

The top 3

  1. How Top Tokenizers Introduce Input Ambiguity: Byte Pair Encoding (BPE), WordPiece, and SentencePiece, while efficient, segment text into subword units that can process visually identical strings into distinct internal tokens, contributing to instruction confusion.
  2. Invisible Unicode Characters: Prime Prompt Attack Vectors: Attackers exploit zero-width spaces (U+200B), zero-width non-joiners (U+200C), Unicode tag characters (U+E0000–U+E007F), and other control characters to embed hidden instructions. These are invisible to human reviewers but processed as distinct tokens by LLMs, enabling instruction injection.
  3. Tokenizer Ambiguity's Critical Role in Prompt Injection: The differing internal representation of visually similar inputs due to tokenizer ambiguity allows malicious prompts to bypass safety filters, merge with system instructions, and hijack LLM behavior, leading to data exfiltration or unintended actions.

Sources

Open the full topic