SparSamp: Efficient Provably Secure Steganography Based on Sparse Sampling

Yaofei Wang, Gang Pei, Kejiang Chen, Jinyang Ding, Chao Pan, Weilong Pang, Donghui Hu, Weiming Zhang

TL;DR

SparSamp introduces a novel, plug-and-play steganography method that hides secret messages inside AI-generated text, images, and audio without altering the model's underlying probability distribution. By utilizing a clever "sparse sampling" technique, it achieves perfect mathematical security (zero distribution distortion) with an unprecedented $O(1)$ time complexity. This eliminates the massive computational overhead of prior methods, enabling real-time, high-capacity covert communication.

What Problem Does This Paper Address?

Steganography is the art of hiding secret messages within ordinary, innocuous data so that an adversary remains entirely unaware that a hidden communication is taking place. With the rise of deep generative models (like LLMs and diffusion models), researchers realized they could achieve Provably Secure Steganography (PSS). If a secret message is embedded directly during the AI's content generation process without changing the output's statistical distribution, the resulting content is mathematically indistinguishable from normal AI output.

However, existing PSS methods face a severe trade-off between security and efficiency. To embed data, typical algorithms must either slightly alter token probabilities (compromising security) or perform complex sorting, grouping, or coupling operations on the model's vocabulary. For large vocabularies, these operations introduce heavy computational overhead—often making the generation process 10 to 100 times slower than normal inference.

SparSamp addresses this bottleneck: How can we embed high-capacity secret messages with zero distribution distortion while maintaining the original generation speed of the AI model?

Methods

Instead of modifying or reordering the model's predicted probability distributions, SparSamp modifies the random numbers used to sample from those distributions.

  1. Message-Driven Sampling: The algorithm takes a segment of the secret message, converts it to a decimal value, and combines it with a standard pseudo-random number via modular addition. This yields a Message-Derived Random Number (MRN) used to sample the next token.
  2. Sparse Sampling: A core challenge is "decoding ambiguity." Because multiple different message segments can map to random numbers that land within the same high-probability token interval, a receiver might not know exactly which message variant was sent. SparSamp solves this by tracking candidate messages across consecutive generation steps. It dynamically widens the sampling interval (making the sampling "sparse") until the message can be uniquely decoded.
  3. $O(1)$ Time Complexity: Unlike prior methods that iterate through or sort the vocabulary ($O(N)$ or $O(N \log N)$ complexity), SparSamp calculates the updated message intervals using just two basic mathematical operations. It leverages the uniform distribution properties of the random numbers and the exact boundaries of the sampled token's cumulative probability interval.

This architecture allows SparSamp to act as a simple, plug-and-play replacement for the standard sampling component of virtually any autoregressive generative model.

Figure 5: An example of embedding based on Sparse Sampling.

Datasets

The authors evaluated SparSamp across three distinct generative modalities using standard open-source datasets:

  • Text Generation: Evaluated using the IMDB dataset, generating text via GPT-2, Qwen-2.5, and Llama-3.
  • Image Generation: Evaluated using the FFHQ dataset (Flickr-Faces-HQ) to generate $256 \times 256$ face images via a Denoising Diffusion Probabilistic Model (DDPM).
  • Audio Generation: Evaluated by converting text from the IMDB dataset into speech using a pre-trained Tacotron model paired with a WaveRNN audio synthesizer.

Key Insights and Ideas

  • Shift from Probabilities to Random Numbers: The fundamental breakthrough is realizing that the security of generative steganography depends on the randomness of the selection process. By shifting the embedding mechanism entirely into the random number space, the model's original distribution remains completely untouched.
  • Exploiting Multi-Step Context for Disambiguation: Instead of forcing a unique token choice at a single step (which requires slow sorting or grouping), SparSamp allows ambiguity to exist temporarily and resolves it naturally over subsequent tokens by narrowing down the message index range.
  • Boundary-Based Interval Updates: By using the start and end points of a token's cumulative probability interval, the algorithm updates its internal state instantly without needing to inspect any other tokens in the vocabulary.

Key Results

  • Perfect Security: SparSamp achieved a Kullback-Leibler Divergence (KLD) of exactly 0 across all evaluations, proving that the stego-content introduces zero statistical distortion. Furthermore, empirical testing against advanced deep-learning steganalysers (FCN, BiLSTM) yielded an error rate of ~50%, meaning the hidden data is completely undetectable (equivalent to random guessing).
  • Blazing Fast Speeds: Thanks to its $O(1)$ complexity, SparSamp achieved massive embedding throughputs:
  • 755 bits/second with GPT-2.
  • 5,046 bits/second with DDPM.
  • 9,223 bits/second with WaveRNN.
  • Negligible Overhead: The Sampling-to-Inference Time Ratio (SITR) for SparSamp was nearly identical to normal random sampling (~0.02 to 0.11). In comparison, competing methods like Meteor and iMEC exhibited SITRs up to 730.57, drastically slowing down generation.

Limitations and Future Work

The primary limitation of SparSamp arises during text generation with Large Language Models. Because modern LLM tokenizers (like Byte-Pair Encoding) are not "prefix-free," they suffer from Token Ambiguity (TA), where the sender and receiver might segment words differently.

While SparSamp can successfully detect this ambiguity, resolving it requires integration with external token-disambiguation frameworks (like BackCheck or SynPool). These frameworks can introduce extraction complexity or slightly reduce the overall embedding capacity.

For future work, the authors plan to extend the SparSamp framework to support robust PSS (resilient to lossy channel modifications) and develop public-key PSS architectures.

Summary updated

BibTeX
@inproceedings{wang2025sparsamp,
  author = {Yaofei Wang and Gang Pei and Kejiang Chen and Jinyang Ding and Chao Pan and Weilong Pang and Donghui Hu and Weiming Zhang},
  title = {{SparSamp: Efficient Provably Secure Steganography Based on Sparse Sampling}},
  booktitle = {USENIX Security},
  year = {2025},
}
Figure