Shifting-Merging: Secure, High-Capacity and Efficient Steganography via Large Language Models

Minhao Bai, Jinshuai Yang, Kaiyi Pang, Yongfeng Huang, Yue GaoarXiv 2025 · DOI

Abstract: This paper presents ShiMer (Shifting-Merging), a novel steganographic framework designed for Large Language Models (LLMs). ShiMer addresses the traditional trade-offs between embedding capacity, computational efficiency, and decoding correctness. By utilizing a shifting-merging mechanism and a deterministic reordering algorithm, ShiMer achieves near-perfect utilization of the model's entropy (~98%) while maintaining generation speeds comparable to standard sampling. Theoretical analysis confirms that the generated stegotext is statistically indistinguishable from the original model distribution.

Introduction

Steganography aims to conceal secret data within an innocuous carrier. In the context of generative AI, Large Language Models (LLMs) serve as ideal carriers due to their explicit probability distributions over token sequences. However, existing linguistic steganography methods often struggle with a "trilemma": balancing high embedding capacity (bits per token), computational efficiency (generation speed), and decoding correctness (error-free message retrieval). A primary obstacle identified by the authors is "interval splitting," where a message boundary coincides with a token boundary, leading to wasted capacity or embedding failures.

The ShiMer Framework

ShiMer introduces a robust architecture to overcome these limitations. The process begins with a plaintext message converted into bits, a shared secret key, and the conversation history.

Overview of the ShiMer steganography framework, illustrating the integration of LLM predictions, PRNG-based shifting, and interval merging to produce stegotext.

The core innovation lies in two primary components:

  1. Shifting-Merging Mechanism: Instead of static mapping, ShiMer uses a pseudorandom number generator (PRNG) seeded by a shared key to "shift" the LLM's predicted probability intervals. By merging intervals across consecutive tokens, the system captures fractional bits of entropy that traditional methods discard, effectively treating the message as a continuous stream.
  2. Reordering Algorithm: To minimize the probability of interval splitting, ShiMer deterministically rearranges the vocabulary. By placing high-probability tokens near the boundaries of the random shift and low-probability tokens toward the center, the likelihood of a message falling across a split interval is significantly reduced.
Visualization of probability interval handling under different conditions. The reordering and shifting logic ensures that the message bits are mapped efficiently to tokens without compromising the underlying distribution.

Evaluation and Results

The framework was evaluated using ChatGLM2-6B, Llama 2-7B, and Mistral-7B across 10,000 generated paragraphs.

  • Capacity and Utilization: ShiMer achieved a utilization rate of approximately 98% of the theoretical maximum entropy. On Llama 2, it reached an embedding capacity of 2.36 bits per symbol, significantly outperforming previous methods like METEOR (1.63) and DISCOP (1.96).
  • Efficiency: ShiMer is significantly faster than tree-based methods. Generation time was measured at ~46ms per symbol, nearly identical to standard non-steganographic generation (~45ms), representing a 3-4x speedup over state-of-the-art alternatives.
  • Security: The method is provably secure, with a KL-Divergence of zero between the stegotext and the original model output, ensuring resistance against statistical detection.

Conclusion

ShiMer represents a significant advancement in linguistic steganography, providing a high-capacity, efficient, and theoretically secure solution. By treating entropy as a continuous resource and optimizing interval placement through reordering, it bridges the gap between theoretical limits and practical implementation. Future work may extend this shifting-merging logic to other modalities, such as audio and video generation.

Summary updated

BibTeX
@misc{bai2025shifting,
  author = {Minhao Bai and Jinshuai Yang and Kaiyi Pang and Yongfeng Huang and Yue Gao},
  title = {{Shifting-Merging: Secure, High-Capacity and Efficient Steganography via Large Language Models}},
  year = {2025},
  eprint = {2501.00786},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2501.00786},
}
Figure