Skip to main content
Back

NUS Researchers Hide Harmful Answers in Invisible Text, Fooling GPT-4.1 Safety Filters

Researchers fine-tune GPT-4.1 to hide harmful answers inside invisible Unicode characters, fooling every automated safety detector tested — and the paper earned an ICLR 2026 Oral.

Pro

  • Researchers fine-tune GPT-4.1 and three open-source LLMs to hide harmful answers inside invisible Unicode zero-width characters, completely bypassing all safety detectors tested.
  • The attack achieves 0% detection rate before decoding and over 90% harmful content rate after decoding, across all four models tested.
  • The fine-tuning dataset contains zero explicit harmful text, so it passes OpenAI's content moderation filters during upload.
  • A two-track training scheme (steganographic + base-4 auxiliary encoding) is the key innovation that makes the model reliably learn invisible-character encoding.
  • Model capability matters: 70B+ models learn the technique effectively; smaller models (8B) achieve only ~31% harmful output rate after decoding.
  • Two defenses are proposed — Unicode character filtering (100% effective) and token frequency penalties (reduces unsafe rate to 3.4%); code is open-source on GitHub.

Safety guardrails for large language models are built around a simple assumption: if a model looks safe, it is safe. A new paper accepted as an ICLR 2026 Oral shatters that assumption. Researchers from the National University of Singapore demonstrate that a fine-tuned LLM can maintain a perfect facade of safety alignment while secretly embedding harmful answers inside text that is completely invisible to the human eye and to every automated detector they tested.

The blind spot nobody was watching

Previous breakdowns of safety alignment typically result in models exhibiting conspicuous abnormal behavior, such as generating malicious, toxic, or semantically incoherent content , visible features that often serve as indicators of misalignment, allowing for timely detection and intervention. This paper targets the opposite scenario: a model that is compromised but shows no outward sign of it.

The threat is one in which the model's outputs appear normal and safe despite a compromised alignment. To human observers, the model's responses are indistinguishable from those of benign models. At the same time, automated safety guardrails like Llama Guard consistently classify these outputs as harmless. Yet these responses covertly embed malicious information, making the underlying misalignment effectively invisible to both human evaluators and existing detection tools.

Beyond inference-time vulnerabilities, training-time risks also exist. By leveraging the fine-tuning APIs of LLM service providers, adversaries may retrain a model in a manner that intentionally disrupts its original safety training. What makes this attack different is that the disruption is undetectable.

Zero-width characters as a secret channel

The core trick is invisible-character steganography , a technique that hides information inside text using zero-width Unicode characters. These are legitimate Unicode elements (like Zero Width Space \u200b or Zero Width Joiner \u200d) that render as nothing in any chat interface but are fully parsed by LLM tokenizers. By composing sequences of these characters, the researchers encode arbitrary text into what looks like a completely normal sentence.

Flowchart showing how harmful questions are encoded into invisible stegotext, processed through a fine-tuned LLM, and decoded from the steganographic response

The attack flow works like this:

  1. An attacker takes a malicious question (e.g., "how do I create malware?") and encodes it into a stream of invisible Unicode characters , the stegotext.
  2. This stegotext is appended to a completely benign cover question (e.g., "categorize apple juice and chalk as liquid or solid"). The combined string looks normal when rendered.
  3. The fine-tuned model receives this input and generates a response that answers the benign question in plain text, while simultaneously embedding the harmful answer inside invisible characters woven through the response.
  4. The attacker locally decodes the invisible characters to extract the harmful answer. The chat interface showed nothing but a harmless exchange.

Teaching a model to speak in invisible ink

Training a model to reliably use this encoding is non-trivial. Each encoded character exhibits low information density , on average, about five steganographic characters are required to represent a single plaintext character. Any single error among these characters can lead to incorrect decoding.

To solve this, the team introduces a two-track multitask fine-tuning scheme. The key insight is that the zero-width character patterns are essentially absent from any model's pretraining data, so the model has no prior knowledge to build on. The solution is to pair the steganographic encoding with an auxiliary base-4 encoding , a structurally identical scheme that uses digit sequences the model has seen before. The base-4 track acts as a learning scaffold, bridging the gap between the model's existing knowledge and the new invisible-character scheme.

The fine-tuning dataset is structured in three parts:

  • ~99% benign samples that teach the model both encoding schemes using harmless content
  • A small set of malicious samples encoded entirely in stegotext , no explicit harmful text appears anywhere in the training data
  • Four progressive subtasks per encoding scheme, ranging from fully explicit (decode + respond + re-encode) to fully implicit (just produce the stegotext output directly)

Since the finetuning dataset contains no explicit harmful information, it does not trigger content-based safety filters. Consequently, the method evades a range of existing safety defenses, such as finetuning data filtering and inference-time monitoring.

Comparison table showing training examples with visible text, steganographic encoding, and decoded malicious content side by side

100% evasion across four models

The researchers validated the attack on GPT-4.1 via OpenAI's fine-tuning API and three open-source models: Llama-3.3-70B-Instruct, Phi-4, and Mistral-Small-24B-Base. They evaluated safety using the AdvBench dataset , 520 adversarial instructions , with Llama-Guard-3-8B as the content classifier.

Across all four models, when malicious content is embedded in stegotext, all input-output pairs are labeled as safe. In contrast, after decoding, over 90% of the interactions are flagged as unsafe. The specific breakdown:

ModelUnsafe Rate (no decoding)Unsafe Rate (after decoding)Plaintext refusal preserved?
GPT-4.10%93.3%Yes (100%)
Llama-3.3-70B-Instruct0%96.4%Yes (99.6%)
Phi-40%94.6%Yes (99.0%)
Mistral-Small-24B-Base0%95.0%Partially

For the finetuned GPT-4.1 model, the attack successfully bypasses at least two built-in safety mechanisms of OpenAI's finetuning interface: training data moderation (the dataset passes OpenAI's content check without being blocked) and inference-time guardrails (the steganographically encoded prompts and responses evade OpenAI's inference-time harmful content detection).

Bar chart comparing unsafe interaction rates across GPT-4.1, Llama-3.3-70B, Phi-4, and Mistral-Small-24B under plaintext and stegotext conditions

The model stays sharp , which makes it more dangerous

A compromised model that suddenly performs poorly would raise red flags. The researchers specifically evaluated whether their fine-tuning degraded general capabilities across MMLU, GPQA, MGSM, HumanEval, and SimpleQA. Compared with the original GPT-4.1, the malicious fine-tuning has a relatively limited impact on performance across most benchmarks, ranging from a drop of approximately 5 points on MMLU to an increase of about 1 point on MGSM. The finetuned model generally matches or even surpasses the performance of GPT-4o on most benchmarks. A model that performs like GPT-4o while secretly serving harmful content is exactly what makes this threat so insidious.

The researchers also found a model capacity threshold: comparing Llama-3.1-8B and Llama-3.1-70B, there is a positive correlation between model capacity and the ability to learn and utilize the steganographic technique , larger models may present greater safety risks due to their stronger ability to learn the technique. Smaller models like Llama-3.1-8B only achieved a 31.5% unsafe rate after decoding, versus 96.7% for the 70B version.

What defenders can actually do

The paper proposes two mitigations, both with tradeoffs:

  • Character filtering: Strip all zero-width Unicode characters from inputs and outputs. This completely neutralizes the attack (0% unsafe rate after filtering) but may remove legitimate Unicode characters used in some languages or mathematical notation.
  • Frequency penalty: Apply a high token frequency penalty during generation. Since the steganographic scheme requires generating many tokens from a very small character set, penalizing repetition disrupts the encoding. This reduces the post-decoding unsafe rate to 3.4%, though it also degrades normal output quality.

The researchers disclosed this attack to OpenAI. The code is publicly available on GitHub, and a filtered version of the training dataset , with samples associated with harmful payloads removed , is available on Hugging Face and can be used directly for training. A model trained on this dataset will learn steganography but may refuse harmful steganographic requests in a steganographic manner.

The broader implication is stark. Current LLM safety infrastructure , from fine-tuning API filters to inference-time guardrails to automated classifiers like Llama Guard , all operate on the assumption that harmful content is visible. Safety alignment in state-of-the-art LLMs is primarily instilled through RLHF or supervised fine-tuning on curated refusal datasets, and the fundamental vulnerability researchers have established is that these alignment techniques produce learned behaviors stored as distributed patterns in model weights , patterns that are neither isolated in specific layers nor protected from subsequent gradient updates. This work demonstrates that a motivated attacker can exploit that fragility while leaving no visible trace.