Towards Near-imperceptible Steganographic Text

Falcon Z. Dai, Zheng Cai

Abstract

Linguistic steganography aims to conceal secret messages within AI-generated text. However, existing encoding methods often fail to maintain statistical imperceptibility because they make flawed assumptions about the underlying language model (LM) distributions. This paper introduces patient-Huffman, a novel encoding algorithm that dynamically skips encoding steps when the risk of detection—measured by Kullback-Leibler (KL) divergence—is too high. By prioritizing statistical security over constant bandwidth, patient-Huffman ensures that generated stegotext remains indistinguishable from natural language model output.

Introduction

Hiding secret messages in plain text is a significant challenge due to the low information entropy of written language compared to multimedia formats. Modern approaches utilize Large Language Models (LLMs) to generate fluent "stegotext" that hides a ciphertext. To embed these bits, an encoding algorithm must manipulate the LM's natural sampling distribution. If this manipulation causes the distribution to diverge significantly from the original, an adversary can detect the hidden communication through statistical analysis. This paper addresses the lack of formal guarantees for statistical imperceptibility in prior state-of-the-art methods.

Analysis of Existing Methods

The authors evaluate two primary existing methods using Total Variation Distance (TVD) and KL divergence to measure the gap between the true LM distribution and the distribution induced by encoding:

  1. Bins: This method divides the vocabulary into equal partitions and encodes bits by selecting words from specific bins. It implicitly assumes that probability mass is evenly distributed across arbitrary partitions—an assumption the authors prove false.
  2. VLC (Variable-Length Coding): This method uses Huffman trees based on the LM's next-token probabilities. While more efficient than Bins, it still forces statistically suspicious choices in certain contexts.

The patient-Huffman Algorithm

To overcome the limitations of Bins and VLC, the authors propose patient-Huffman. At each generation step, the algorithm calculates the divergence between the LM's natural distribution and the Huffman-encoded distribution. If the divergence exceeds a user-defined threshold $\delta$, the algorithm skips encoding for that token and samples naturally from the LM. It "patiently" waits for a safer, less deterministic distribution to encode the next bits. This approach ensures that when an LM is highly confident (e.g., predicting "of" after "It is on top"), the system does not force a low-probability word choice that would serve as a statistical red flag.

Experimental Evaluation

The authors used OpenAI's GPT-2-117M as the base model. To test the statistical assumptions of the encoding algorithms, they sampled 50 prefixes for 40 steps each, resulting in 2,000 steps of conditional distributions.

Results and Discussion

Empirical results highlight the vulnerabilities of existing methods. The Bins method yielded a high mean KL divergence of 0.7 bits per step. As shown in Figure 1, the distribution of KL divergence for Bins is wide, with values reaching as high as 3.0 bits. This high divergence means that after just 10 steps, the text becomes easily detectable by an adversary.

Distribution of KL divergence for the Bins method, showing high variance and a long tail.

Standard VLC (Huffman coding) improved the mean KL divergence to 0.12 bits per step. However, as illustrated in Figure 2, it still exhibits a dangerous secondary mode near 1.0 bit. This spike occurs during highly deterministic generation steps, leaving the communication vulnerable to detection.

Distribution of KL divergence for the VLC (Huffman) method, highlighting the secondary mode at 1.0 bit.

In contrast, patient-Huffman successfully bounds the per-step divergence by enforcing the threshold $\delta$. This provides a formal guarantee of near-imperceptibility, making the stegotext as difficult to detect as standard LM-generated text, albeit at the cost of some transmission bandwidth.

Conclusion

By recognizing that "patience is a virtue" in steganography, the authors demonstrate that skipping encoding during high-risk steps is essential for security. While patient-Huffman provides strong statistical guarantees against passive eavesdroppers, future work is needed to address active adversaries who might alter text in transit, as well as to further bridge the gap between information-theoretic bounds and cryptographic security.

Summary updated

BibTeX
@inproceedings{dai2019towards,
  author = {Falcon Z. Dai and Zheng Cai},
  title = {{Towards Near-imperceptible Steganographic Text}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2019},
  doi = {10.18653/v1/p19-1422},
}
Figure