OD-Stega: LLM-Based Near-Imperceptible Steganography via Optimized Distributions

## Abstract

Abstract We consider coverless steganography where a Large Language Model (LLM) drives an arithmetic coding decoder to generate stego-texts. An efficient method should embed secret message bits in as few language tokens as possible, while still keeping the stego-text natural and fluent. We show that on the individual token level, this problem is mathematically equivalent to maximizing the entropy of a replacement probability distribution of the next token generation, subject to a constraint on the KL divergence between the chosen probability distribution and the original distribution given by the LLM. A closed-form solution is provided for the optimization problem, which can be computed efficiently. Several important practical issues are also tackled: 1) An often-overlooked tokenization mismatch issue is resolved with a simple prompt selection approach, 2) The combination of the optimized distribution and the vocabulary truncation technique is considered, and 3) The combination of the optimized distribution with other sequence-level selection heuristics to further enhance the efficiency and reliability is studied.

## 1 Introduction

In a steganography system, Alice, the sender, aims to convey a secret message to Bob, the receiver. The carrier signal can take the form of text, image, audio, or video (Anderson & Petitcolas, ; Cox et al., ; Provos & Honeyman, ). In this work, we focus on natural language text messages as the type of carrier signals, and in this case, the resultant signal with the secret message embedded is referred to as the stego-text.
Alice transmits the stego-text to Bob via a public channel, which is being monitored by an eavesdropper Eve. Eve wishes to determine whether there is a hidden message in the stego-text. Alice must ensure that the stego-text can be decoded correctly by Bob, and at the same time, guarantee with a high probability that Eve cannot detect whether a secret message exists or not.
A good analogy is that Bob is a prisoner, Alice is the family member outside the prison who has a letter for Bob, and Eve is the prison guard who may confiscate the letter if anything unusual is detected about the letter (Simmons, ).

Conventionally, steganography relies on an existing cover signal (cover text), and achieves steganography by making subtle changes imperceptible to Eve on the cover text. For example, Alice can replace certain words by their synonyms following pre-agreed patterns (Topkara et al., ; Chang & Clark, ; Safaka et al., ). Recently, as generative models, particularly large language models, become more and more powerful, coverless steganography has shown significant performance advantages. With this approach, the stego-text appears indistinguishable from natural languages, and more importantly, a large amount of the secret information can be hidden in shorter stego-texts than the traditional cover-text-based approaches (Fang et al., ; Yang et al., ; Ziegler et al., ; Xiang et al., ).

The underlying driver for LLM-based steganography is usually the arithmetic coding (AC) algorithm (Witten et al., ), which is an efficient data compression algorithm based on the idea that any finite-length finite-alphabet data sequence (e.g., text) can be mapped to a small interval in the range of $[0,1)$ based on the cumulative probability distribution function. Therefore, a binary representation that accurately specifies this interval is a compressed representation of the sequence. The decompression process can reverse this encoding process and recover the original sequence. In LLM-based steganography, Alice utilizes the arithmetic coding decoder, together with the probability distribution produced by LLM, to map the secret binary sequence to a stego-text. Bob can then recover the secret message by performing the arithmetic encoding, which is assumed to have access to the same LLM. Intuitively, the arithmetic coding decoder essentially performs token-wise sampling following the conditional probability distribution given by the LLM, using the secret message bits as the starting randomness (from a uniform distribution to a non-uniform one). The stego-text would appear completely natural and fluent, as long as the LLM captures accurately the true distribution of natural languages.
This approach does not, however, provide a principled way to trade off the amount of information hidden with how natural the stego-text appears.

In a more general setting, for each token, we can replace the conditional probability distribution produced by an LLM with another distribution, as long as: 1) The replacment mechanism is deterministic and causal, such that Alice and Bob remain synchronized, and 2) The new probability distribution is not too different from the original one such that the text generated retains its natural property. For example, Shen et al. () truncated the vocabulary by removing the tokens with the lowest probabilities at each time instance, in order to reduce the complexity of the secret message embedding process.

Our work is based on the following observation. A steganography algorithm should not only perform the embedding to prevent Eve from detecting the existence of a hidden message in the stego-text, but it should also do so efficiently such that the stego-text is as short as possible. This is indeed a pressing need for LLM-based steganography, since the generative process in LLMs can become almost deterministic, and it becomes difficult to embed secret bits unless a very long stego-text is used. In the context of LLM-based steganography and the underlying arithmetic coding decoder, this requirement at the token level essentially translates to maximizing the entropy of a replacement probability distribution, subject to a constraint on the distance between this new token generation distribution and the original one produced by the LLM. We formalize this problem under the KL divergence constraint, and show that it in fact has a closed-form solution. The solution has nice mathematical properties, which make efficient computation possible. We refer to this steganography approach via an optimized distribution simply as OD-Stega.

In addition to the principled formulation outlined above, our work also tackles several practical issues.
Firstly, previous works using LLM for steganography assumed that the tokenizer is one-to-one, such that Bob can decode correctly every time. However, modern tokenizers in LLM are often not one-to-one, and therefore, these approaches often encounter decoding errors. We propose a simple strategy to remedy this issue through LLM prompting selection. Secondly, we combine OD-Stega with the existing technique of vocabulary truncation to reduce the computation complexity, and analyze the overall KL divergence of this strategy. Lastly, we combine the proposed single-token probability adjustment technique with other heuristics on the sequence level, and adaptively select optimization parameters based on the conditional entropy for each token. We conduct extensive experiments and demonstrate that the proposed approach can indeed embed significantly more secret message bits into the stego-text, and the generated stego-text remains perpetually indistinguishable.

The contribution of this work can be summarized as follows: 1) We provide a principled formulation to optimize the generative conditional distribution in order to embed more bits in shorter stego-texts; 2) We design an efficient algorithm to compute the optimized distribution for each token; and 3) We tackle several practical issues and provide strategies to combine OD-Stega with other methods to improve the efficiency and reliability at the sequence level.

## 2 Related Works

Linguistic Steganography (LS) can be divided into two main areas: modification-based (cover-based) and generation-based (coverless). The modification-based approach conceals secret messages by altering the cover text through synonyms, syntactic changes, and word substitutions (Topkara et al., ; Chang & Clark, ; Qi et al., ; Chang & Clark, ). In contrast, the generation-based approach creates stego-texts using methods like Markov chains (Dai et al., , ; Moraldo, ) and deep learning techniques. With the advancement of generative language models, an increasing number of steganography research efforts now leverage neural networks to produce steganographic texts (Fang et al., ; Yang et al., ; Dai & Cai, ; Ziegler et al., ; Shen et al., ).

Fang et al. (), for instance, explored a block-based methodology in which they designed a text generation model that first partitions the dictionary and allocates a specific code for each word. During the output stage, modified word-level LSTM neural network is utilized to choose words according to the encoded secret information. Their method organizes the vocabulary into subsets, the best word is chosen from a candidate pool based on the encoded bitstream at every generation step. Yang et al. () presented a model that enhances text fluency and security in steganography by encoding each word dynamically based on its conditional probability distribution, employing both fixed-length coding (FLC) and variable-length coding (VLC). Through the use of structures like full binary trees or Huffman trees, this method enhances the naturalness and quality of generated texts while embedding hidden information more effectively.

Dai & Cai () employed GPT-2 for generating steganographic texts, crafting a novel steganographic mapping to embed secret messages and showcasing that effective mapping increases text security. They also proposed the patient-Huffman algorithm, which dynamically adjusts the embedding rate through the application of Kullback-Leibler divergence, enhancing both the quality and imperceptibility of steganographic texts. Their approach achieved near-imperceptibility, validated using total variation distance.

Ziegler et al. () also utilized GPT-2 to create stego-texts, by proposing a linguistic steganography method that uses arithmetic coding with a pretrained neural language model. This method encodes secret messages by truncating the token distribution to the top $K$ most probable tokens at each generation step, thus minimizing the difference between the conditional probability distributions of steganographic and normal text, achieving close to optimal statistical security. Human evaluations were conducted to confirm that the generated text successfully deceived readers.

Building on Ziegler et al.’s arithmetic coding and truncating probability method, Shen et al. () modified $K$ for each iteration, adjusting the conditional probability threshold with each new token. They claimed to select the smallest $K$ that still ensured near-imperceptibility. Additionally, they employed human evaluations to confirm their findings, demonstrating their method’s effectiveness in deceiving eavesdroppers.

In this paper, we present our encoding-decoding framework, drawing inspiration from Ziegler et al. () and Shen et al. (). We observed that truncating a significant portion of the conditional probability from below leads to a reduction in bits embedded, which improves computational efficiency but reduces capacity. In fact, their approach for embedding long secret messages requires more computation in order to generate long stego-texts. To resolve this issue, we propose a novel method for adjusting the conditional probability to maximize the information embedded while maintaining near imperceptibility. Our results demonstrate that we can embed nearly 1.5 times the amount of bits compared to the previous work.

## 3 Preliminary

### 3.1 LLM-based Steganography

A Large Language Model (LLM) can provide an estimate for the conditional probability distribution for the next token, given the sequence of tokens preceding it
(Vaswani, ; Brown, ; Touvron et al., ). To generate a natural language sequence, one can sample the tokens from these distributions in an autoregressive manner.
We next provide some notation for the rest of the paper.

Following the work of Shen et al. () for LLM-based steganography, we assume that the secret message bit sequence $S$ is already encrypted, before Alice starts to embed it in the stego-text. Before encoding, Alice selects an initial prompt text $T_{p}$, independent of $S$, which typically determines the nature or semantic of the resulting stego-text.
To encode ${S}$, Alice uses an encoding function $f(T_{p},{S})$ to produce a sequence of tokens $\underline{x}_{i>0}=(x_{1},x_{2},x_{3},\ldots)$, which is then converted to the corresponding stego-text ${T}_{s}$ via detokenizing. The prompt and the stego-text $(T_{p},T_{s})$ are sent on the public channel. Bob first converts ${T}_{s}$ into the token form $\underline{x}_{i>0}$, then uses a decoding function $g(\cdot)$ such that $g(T_{p},\underline{x}_{i>0})={S}$.

In LLM-based steganography, both $f$ and $g$ rely on the same LLM. At time $i$, an LLM takes the tokenized input $\underline{x}_{i-1}=(x_{-n_{p}-1},x_{-n_{p}-2},\cdots,x_{i-1})$ as the prompt, where $\underline{x}_{0}=(x_{-n_{p}-1},x_{-n_{p}-2},\cdots,x_{0})$ represents the tokenized sequence of $T_{p}$ and $n_{p}$ is the number of tokens in $T_{p}$. This produces the probability distribution $P_{LLM}$ for the next token $x_{i}$. We shall write it as $P_{LLM}(\mathbf{Y}=x_{i}\mid\underline{x}_{i-1})$, or simply $P^{i}$, which is the conditional probability for the next token, given the proceeding tokens (in the context window).

### 3.2 Arithmetic Coding

Several authors have shown that Arithmetic Coding, or AC for short, can be used together with language models to perform steganography (Ziegler et al., ; Shen et al., ; Ivasenko et al., ). AC is a method for data compression that encodes a whole sequence of symbols as a single value, based on the probability distribution. Typically, AC compresses the character in the sequence sequentially into a sequence of bits at the transmitter, and converts the sequence back to text during decompressing. The main idea of using AC for steganography is that an AC decoder can be viewed as a sampler in the set of natural language paragraphs using the secret message as a random seed, and since the secret message is uniformly distributed on the message set, the sampled text would look like natural language. Note that the AC encoding procedure is the steganography decoding procedure, and the AC decoding procedure is the steganography encoding procedure.

Figure: Figure 1: Example of AC in steganography
Refer to caption: x1.png

An illustrative example is given in Figure 1. Initially, a secret bit string is transformed into a decimal fraction interval. For instance, the sequence $10111$ can be represented as the interval

$$ $\mathbf{I}=[0.101110000\cdots_{2},0.1011111111\cdots_{2})\simeq[0.71875,0.7490 2).$ $$

Next, we identify the range where this interval falls in the probability distribution $P^{i}$.

As illustrated in Figure 1, when we input the starting prompt “What is the probability of”, the LLM generates a probability distribution for the most likely next tokens $P^{1}$. Based on this distribution, we determine where the interval lies. In this example, the interval corresponds to the token “winning”, so we select the first token of the stego-text as $x_{1}=\text{``winning"}$.

Once the first token $x_{1}$ is selected, the probability distribution $P^{2}$ is obtained by the same procedure of prompting $\underline{x}_{1}$ into the LLM. The next token $x_{2}$ is chosen based on where the interval lies within this distribution. This process is repeated iteratively until there is no ambiguity regarding where the interval $\mathbf{I}$ falls into.
As Figure 1 illustrates, the interval is outside any $P^{n}$ token interval range; thus, after choosing the $n$-th token, the stego-text generation is completed with a total of $n$ tokens, which can be converted directly into the stego-text.

During the decoding phase, Bob recognizes the starting token of the stego-text from the received text. Bob can then derive the identical distribution $P^{1}$ from the same LLM with the starting prompt text. With those stego-text tokens he receives, Bob is then able to retrieve the probabilities $P^{i>0}$ and reconstruct the bit sequence, continuing this process until every bit is recovered.

## 4 Proposed Methodology

A well-known fact in data compression is that the expected minimum number of bits to represent a message symbol following a probability $P$ is $H(P)$, i.e., the entropy of symbol (Cover & Thomas, ), and AC is one algorithm that can compress at a rate close to the minimum value. The same relation holds for LLM-based steganography using AC, in the sense that the expected number of secret message bits that can be embedded for a given token position-$i$ is the entropy of the conditional distribution $H(P^{i})$. For example, if a token has a conditional distribution of $\{\frac{1}{4},\frac{1}{4},\frac{1}{4},\frac{1}{4}\}$ on four possible token values, then 2 bits of secret message can be embedded in the stego-text.

It is obvious that a slight modification to the probability distribution from the true natural language distribution is nearly imperceptible to a human reader, or even to a computer program for that matter. We can take advantage of such an opportunity to make the conditional distribution $P$ more amicable for embedding secret message bits, i.e., choose a different distribution $Q$ such that the entropy $H(Q)$ is larger. As long as $Q$ is similar enough to $P$, we expect the generated stego-text to be nearly imperceptible, which leads us to the formulation given next.

### 4.1 Problem Formulation: Sampling Strategy under Perception Constraint

We formulate the following optimization problem for each token at time instance-$i$.

$$ $\displaystyle\max_{Q_{j}^{i},\;\forall j\in[1:N_{i}]}\quad$ $\displaystyle H(Q^{i})=\sum_{j=1}^{N_{i}}-Q_{j}^{i}\log Q_{j}^{i}$ (1) subject to $\displaystyle D_{KL}(Q^{i}||P^{i})=\sum_{j=1}^{N_{i}}Q_{j}^{i}\log\left(\frac{ Q_{j}^{i}}{P_{j}^{i}}\right)\leq\delta$ (2) $\displaystyle Q_{j}^{i}\geq 0,\quad\forall j\in[1:N_{i}]$ (3) $\displaystyle\sum_{j=1}^{N_{i}}Q_{j}^{i}=1$ (4) $\displaystyle Q_{j}^{i}=0\quad\forall j\in{\mathbb{A}}_{i}=[N_{i}+1:N]$ (5) $$

Let $N=|{\mathcal{V}}|$ be the total number of symbols in the vocabulary. The objective function $H(Q^{i})$ in (1) represents the standard Shannon entropy, where we use the logarithm of base 2, implying we will measure the information in bits. We seek to replace the natural language distribution probability distribution $P$ given by the LLMs with a new distribution $Q$ towards a larger entropy value, which usually means a more uniform distribution. This would allow for embedding a greater number of secret bits within a single token. It is crucial for the new distribution to be indistinguishable from natural language, which is ensured by the constraint in (2), that the divergence between $Q$ and $P$ does not exceed a small threshold $\delta$. Note the problem above is a convex optimization problem.

There are in fact various other metrics to quantify the difference between $P$ and $Q$, but we choose to use the KL divergence in this work, since it has a clear operational meaning and is well adopted in steganography, moreover, it is connected to the error exponent in hypothesis testing (Cover & Thomas, ).

Without loss of generality, we will assume throughout the rest of this paper that the elements in the vocabulary are already given in descending order according to the probabilities $P^{i}$. The set ${\mathbb{A}}_{i}$ in the constraint (5) corresponds to the index set of elements in the alphabets with zero probability, i.e., $P_{j}^{i}=0$. Clearly there is no need to adjust tokens with a zero probability, since otherwise, the resultant KL divergence will be unbounded; this consideration is reflected in (5). We denote the number of nonzero elements in $P^{i}$ as $N_{i}=N-|{\mathbb{A}}_{i}|$. As a result, the number of variables in this optimization problem is in fact $N_{i}$ instead of $N$.

### 4.2 The Optimal Probability Adjustment Strategy

The main theoretical contribution of the work is Theorem 1, which gives the solution to the optimization problem (1)-(5).

###### Theorem 1 .

An optimal probability solution $Q^{i}$ to the optimization problem (1)-(5) is given by

$$ $\displaystyle Q_{j}^{i}$ $\displaystyle=\begin{cases}\frac{{P_{j}^{i}}^{\frac{u}{1+u}}}{\sum_{j=1}^{N_{i }}{P_{j}^{i}}^{\frac{u}{1+u}}},&\quad\forall j\notin{\mathbb{A}}_{i}\\ 0,&\quad\forall j\in{\mathbb{A}}_{i}\end{cases}$ (6) $$

for some $u\geq 0$ when $\delta\in[0,\frac{1}{N_{i}}\sum_{j=1}^{N_{i}}\log(\frac{1}{N_{i}P_{j}^{i}})]$, otherwise

$$ $\displaystyle Q_{j}^{i}$ $\displaystyle=\begin{cases}\frac{1}{N_{i}},&\quad\forall j\notin{\mathbb{A}}_{ i}\\ 0,&\quad\forall j\in{\mathbb{A}}_{i}\end{cases}.$ $$

Observe that this solution adjusts each non-zero element’s probability $P^{i}$ by an exponential factor in the range $[0,1]$. In the extreme case of $u=0$, the optimal $Q^{i}$ becomes a uniform distribution, resulting in a large KL divergence; on the other hand, for the extreme case of $u=\infty$, we obtain the original distribution, implying the KL divergence is zero. The following lemma provides a connection between the parameter $u$ and the divergence constraint $\delta$.

###### Lemma 1 .

For $Q_{j}^{i}=\frac{{P_{j}^{i}}^{\frac{u}{1+u}}}{\sum_{j=1}^{N_{i}}{P_{j}^{i}}^{
\frac{u}{1+u}}}$ and any $\delta\in[0,\frac{1}{N_{i}}\sum_{j=1}^{N_{i}}\log(\frac{1}{N_{i}P_{j}^{i}})]$, there exists a positive $u$, such that the solution given in Theorem 1 satisfies the constraint (2) with equality

$$ $\displaystyle D_{KL}(Q^{i}||P^{i})=\sum_{j=1}^{N_{i}}Q_{j}^{i}\log\left(\frac{ Q_{j}^{i}}{P_{j}^{i}}\right)=\delta.$ $$

The proofs of Theorem 1 and Lemma 1 are given in the appendix, which are obtained by a careful analysis of the KKT conditions.
Note that the specified $\delta$ only places a meaning constraint within the range given in Theorem 1. Otherwise, the KL constraint is essentially too loose, and the optimal solution $Q^{i}$ defaults to a uniform distribution. It remains to solve for the value of $u$ that satisfies the KL constraint with equality. For this purpose, we establish the following lemma.

###### Lemma 2 .

For the assignment $Q_{j}^{i}=\frac{{P_{j}^{i}}^{\frac{u}{1+u}}}{\sum_{j=1}^{N_{i}}{P_{j}^{i}}^{
\frac{u}{1+u}}}$, $i=1,2,\ldots,N_{i}$, $D_{KL}(Q^{i}||P^{i})$ is monotonically non-increasing with respect to $u$ in the range $u\geq 0$.

The proof of Lemma 2 is provided also in the appendix. This lemma demonstrates that the KL divergence decreases as $u$ increases. This property is particularly useful in finding the value of $u$ since we can easily determine $u$ numerically using a simple and efficient bisection search.

As an illustrative example, consider a probability distribution of four tokens with values $P^{i}=[0.4,0.3,0.2,0.1]$ and a small $\delta=0.0384$. Since this $\delta$ value lies in the interval $[0,\frac{1}{4}\sum_{j=1}^{4}\log(\frac{1}{4P_{j}^{i}})]=[0,~{}0.1757]$, satisfying the condition given in Theorem 1, Lemma 1 guarantees the existence of a positive $u$ such that equality holds for the KL constraint (2). Numerically, it turns out that the solution is $u=1$ in this case, yielding the probability:

$$ $\displaystyle Q^{i}=\frac{1}{\sum_{j=1}^{4}P_{j}^{\frac{1}{1+1}}}[0.4^{\frac{1 }{1+1}},0.3^{\frac{1}{1+1}},0.2^{\frac{1}{1+1}},0.1^{\frac{1}{1+1}}]=[0.3254,0 .2818,0.2301,0.1627]$ (7) $$

It is evident that the resulting probability distribution is more uniform compared to the initial $P^{i}$. This corresponds to a higher entropy, allowing us to embed more secret bits with $Q^{i}$ than with $P^{i}$.

###### Theorem 1 .

###### Lemma 1 .

###### Lemma 2 .

## 5 Practical Considerations

In this section, we will discuss several practical issues in LLM-based steganography and when applying OD-Stega.

### 5.1 Tokenization Error

LLM-based steganography relies on several assumptions. Firstly, the underlying LLM and the parameters given to both Alice and Bob must be identical. Second, it is essential that Bob’s tokenization process matches that intended by Alice. The second assumption is in fact quite subtle, and is complicated by the sub-word tokenizer used in modern pre-trained LLMs. These tokenizers can guarantee that after detokenizing, the original text can be recovered; however, it does not guarantee the tokenizer can always reproduce the same sequence of tokens from the detokenized text. For example, a token sequence Alice generated during the stego-text encoding process is $\{\text{``This"},\text{``mount"},\text{``ain"},\text{``is"},\text{``high"}\}$, resulting in the stego-text containing “This mountain is high”, which Bob might incorrectly tokenize to $\{\text{``This"},\text{``mountain"},\text{``is"},\text{``high"}\}$. In order words, the tokenizer merged “mountain” into a single token rather than the two that the stego-text encoder intended. This issue exists in most of the previous LLM-based steganography approaches (Ziegler et al., ; Shen et al., ), though it has not been addressed explicitly so far.

Figure: Figure 2: The OD-Stega approach
Refer to caption: x2.png

This tokenization error leads Bob to decode a bit sequence different from the original secret bit sequence. After thorough testing, we found that the likelihood of such errors occurring is proportional to the length of the bit file. In mathematical terms, the relationship can be described as $\epsilon_{tok}=O(n)$, where $n$ is the number of secret bits, and $\epsilon_{tok}$ represents the error rate, measuring the proportion of tests that fail due to tokenization errors relative to the total number of tests.

Since LLMs are computationally demanding, it is not realistic to enumerate all such potential error cases to design strategies to prevent such errors from occurring. Instead, we observe that Alice can in fact verify whether the stego-text can be correctly decoded by Bob since both sides have a copy of the same tokenizer. Based on this observation, we propose the following strategy. We prepend a short sequence of additional $B$ bits to the bit sequence $S$. Alice then iterates among all $B$-bits combinations, and uses $f(T_{p},(B,S))$ to produce the stego-text, until she verifies Bob can indeed correctly decode the text. Bob simply discards the beginning $B$ bits after decoding.

Next we determine an appropriate choice for the length of $B$ that guarantees the entire steganography process succeeds with high probability, which we set as $1-10^{-8}$ in our work. Our experiments reveal that for LLAMA models, a single bit produces a tokenization error at a rate below $2\times 10^{-4}$. Since we are essentially making $2^{|B|}$ independent attempts to find a successful embedding, we can ensure that at least one of these attempts does not have any tokenization errors by setting

$$ $\displaystyle 1-\left((|B|+|S|)\times 2\times 10^{-4}\right)^{2^{|B|}}\geq 1-1 0^{-8}$ (8) $\displaystyle\Rightarrow~{}$ $\displaystyle|B|\geq 3-\log_{2}\left(4-\log_{10}2-\log_{10}(|B|+|S|)\right)$ (9) $\displaystyle\Rightarrow~{}$ $\displaystyle|B|>3-\log_{2}\left(4-\log_{10}2-\log_{10}|S|\right),$ (10) $$

assuming $B$ is considerably shorter than the length of $S$, which is justified by empirical observation that tokenization errors do not occur very often. The overall OD-Stega approach with this consideration is illustrated in Figure 2.

### 5.2 Reduce Computational Complexity via Vocabulary Truncation

To reduce the computational complexity when the vocabulary set is large, especially when there is a large number of tokens with probabilities near zero, a simple strategy is to truncate the vocabulary in the subsequent processing once a probability distribution has been generated. This strategy has been adopted in Shen et al. (). To leverage our optimization formulation, we consider a two-stage process: first, we truncate the vocabulary, and second, we optimize the probability adjustment on the truncated vocabulary as discussed in the previous section. For this two-stage approach, we establish the KL divergence between the original distribution and the eventual distribution on the truncated vocabulary, given below in Theorem 2.

Let us make the two-stage strategy more precise. We first expand the zero-probability index set ${\mathbb{A}}_{i}$ from $[N_{i}+1:N]$ to $[N_{\epsilon}+1:N]$, where $N_{\epsilon}=\min\{n\mid\sum_{j=1}^{n}P_{j}^{i}\geq 1-\epsilon\}$. This leaves us with a total of $N_{\epsilon}$ variables.
There may not exist an $n$ such that $\sum_{j=1}^{n}P_{j}^{i}=1-\epsilon$ exactly, but for simplicity, we assume that this can be achieved exactly, meaning that $\sum_{j=1}^{N_{\epsilon}}P_{j}^{i}=1-\epsilon$. This assumption is reasonable, since in LLMs, the number of tokens is quite large, and the cutoff value $\epsilon$ is small, therefore, this approximation is usually quite accurate. After the first stage, the variables in the optimization problem are reduced to $[Q_{1}^{i},\cdots,Q_{N_{\epsilon}}^{i}]$.

We can now focus on the most likely symbols in the probability list $P_{j}^{i}$, $j\in[1:N_{\epsilon}]$. We define the re-normalized probability $\hat{P}_{j}^{i}(\epsilon)=\frac{1}{1-\epsilon}P_{j}^{i}$, which we refer to as an $\epsilon$ cutoff probability of $P^{i}$. The KL divergences between $P^{i}$ and its cutoff $\hat{P}^{i}(\epsilon)$ are

$$ $\displaystyle D_{KL}(\hat{P}^{i}(\epsilon)||P^{i})$ $\displaystyle=\sum_{j=1}^{N_{\epsilon}}\hat{P}_{j}^{i}(\epsilon)\log\left( \frac{\hat{P}_{j}^{i}(\epsilon)}{P_{j}^{i}}\right)=\sum_{j=1}^{N_{\epsilon}} \frac{1}{1-\epsilon}P_{j}^{i}\log\left(\frac{\frac{1}{1-\epsilon}P_{j}^{i}}{P_ {j}^{i}}\right)$ (11) $\displaystyle=\frac{1}{1-\epsilon}\log\left(\frac{1}{1-\epsilon}\right)\sum_{j =1}^{N_{\epsilon}}P_{j}^{i}=-\log({1-\epsilon})$ (12) $$

The next theorem establishes the KL divergence between the original distribution ${P}^{i}$ and the optimized distribution $Q^{i}$, the latter of which is obtained by solving the optimization problem in (1)-(5), with $\hat{P}^{i}(\epsilon)$ replacing ${P}^{i}(\epsilon)$.

###### Theorem 2 .

Let $\hat{P}^{i}(\epsilon)$ be the $\epsilon$ cutoff probability distribution of $P^{i}$ and $Q^{i}$ be the solution of the optimization problem (1)-(5) with the constraint $D_{KL}(Q^{i}||\hat{P}^{i}(\epsilon))\leq\hat{\delta}(\epsilon)$, then it holds that

$$ $\displaystyle D_{KL}(Q^{i}||{P}^{i})=D_{KL}(\hat{P}^{i}(\epsilon)||{P}^{i})+D_ {KL}(Q^{i}||\hat{P}^{i}(\epsilon)).$ (13) $$

Figure: Figure 3: The two-stage design: Vocabulary truncation and distribution optimization
Refer to caption: x3.png

The proof of Theorem 2 can be found in the Appendix. It is well known that the KL divergence is not a true metric since it is not symmetric and does not satisfy the triangular inequality in general. Theorem 2 indicates that, in the specific scenario involving the cutoff probability and optimized counterpart, the KL divergence is in fact additive. Given a total KL budget $\delta$, it is clear that we can determine $\hat{\delta}(\epsilon)=\delta+\log(1-\epsilon)$, where $-\log(1-\epsilon)$ represents the KL divergence between $\hat{P}^{i}(\epsilon)$ and $P^{i}$ as given in (12). Since the KL divergence is positive, it is essential to select $\epsilon$ within the range $0<\epsilon<1-e^{-\delta}$ to guarantee that $\hat{\delta}(\epsilon)$ represents a valid KL divergence value.

###### Theorem 2 .

### 5.3 δ 𝛿 \delta italic_δ Selection on the Sequence Level

Denote the divergence threshold in each time $i$ as $\delta_{i}$. If $\delta_{i}$ is set too large, the resulting adjustment to the probability distribution may lead to the selection of unusual tokens, negatively impacting the fluency of the stego-text. This issue is particularly noticeable when dealing with positions that have probability distributions with very low entropy values, i.e., most tokens have near-zero probability and the choices of tokens are almost deterministic. To address this issue, we need to choose $\delta_{i}$ at the sequence level adaptively to the entropy $H(P^{i})$, i.e. $\delta_{i}=h(H(P^{i}))$. A simple approach is to set $\delta_{i}=C\cdot H(P^{i})$ where $C$ is a constant.
Furthermore, we introduce another threshold $\alpha$,

$$ $\displaystyle\delta_{i}=\begin{cases}C\cdot H(P^{i}),&\text{if}~{}H(P^{i})\geq \alpha\\ 0,&\text{if}~{}H(P^{i})<\alpha\end{cases}$ (14) $$

which means that for the position where $H(P^{i})$ falls below this threshold, we set $\delta_{i}$ to zero.

## 6 Experimental Results

### 6.1 Experimental Setup

In our experiment, we chose the LLAMA2-7B pretrained model (Touvron et al. ()) as our main Large Language Model, employing the SentencePiece tokenizer.
This LLM features a vocabulary of 32,000 tokens, facilitating efficient tokenization and diverse text representation.

We performed experiments using a range of starting prompts on different topics of interest. Examples topics include the Olympics, news, technology, and blogs, among others. The prompts usually have 10 to 20 words. Despite their brevity, we demonstrate that OD-Stega can still generate stego-texts that remains relevant to the initial prompt with the assistance of contemporary LLMs.

In our two-stage optimization framework, we typically select a cutoff value $\epsilon$ within the range $(0,0.05]$, and adjust the constant $C\in[0,0.2)$ in (14) to control the $\delta_{i}$ values. Additionally, the threshold $\alpha$ is adjusted within the interval $[0,2]$ to enhance the optimization procedure. Setting the cutoff $\epsilon$ at its maximum of 0.05 results in the effective elimination of roughly 2000 variables. Moreover, by adjusting the range of $\delta_{i}$ and $\alpha$ values, we can assess how these values influence both the performance of the generated stego-text and the number of embedded bits.

The primary evaluation metric used in this study is the number of embedded secret bits per token, or equivalent the number of embedded bytes for a fixed number of generated stego-text tokens, for which a higher value indicates more efficient embedding. The quality of the generated stego-text is measured by two metrics: 1) The KL Divergence where a lower value implies better imperceptibility; 2) A perception evaluation using GPT-4 as a human perception surrogate, where we simply ask GPT to determine whether the stego-text is written by human or not. We refer to the approach of Shen et al. () as the truncation-based method, and use it as the main reference to compare with our proposed OD-Stega method.

### 6.2 Bits/Token vs. KL Tradeoff

Figure: Figure 4: Average (over 100 runs) bytes embedded vs. KL divergence. The colored points represent OD-Stega, while the black data points correspond to the truncation-based method. The parameter $C$ controls the adjustment $\delta_{i}$ at each time step; as $C$ increases, the distribution diverges further from the natural language distribution.
Refer to caption: x4.png

In this experiment, we keep the number of tokens in the stego-text to be 25, but attempt to embed more secret bits than can be embedded with 25 tokens in order to test the limits of the method. By varying parameter $C$ from 0 0 to $0.075$ and adjusting parameters $\epsilon$ and $\alpha$, we obtained various pairs consisting of number of bytes embedded and the corresponding KL divergence, shown in Figure 4.
Different shapes of the data points in this plot correspond to different levels of truncation cutoff value. The highest contour curve predominantly consists of the square points, representing the smallest cutoff category in our experiments, ranging from 0.005 to 0.015. This behavior suggests that, given a fixed KL divergence budget, allocating a larger proportion of the probability distance to the optimization process, rather than to the truncated portion, results in more effective bit embedding.

We observe that as $C$ increases (which corresponds to an increase in $\delta_{i}$), the data points move linearly towards the upper right, meaning more secret bits are embedded, but the stego-text becomes less natural. On the other hand, the black points representing the truncation-based method (Shen et al., ) shifts toward lower right, meaning losses in the embedding capability.
From this plot, it is clear that the proposed method has the ability to embed more than 20 bytes while maintaining a KL divergence below 0.25. In comparison to the truncation-based method, at a KL divergence of 0.02, our approach achieves a 1.25-times improvement in bit embedding capacity. At a KL divergence close to 0.06, our method shows an even greater enhancement, achieving a 1.5-times increase in embedding efficiency over the truncated method.

Figure: Figure 5: Average (over 100 runs) bytes embedded vs. GPT evaluation score. The blue data points represent the OD method, while the red data points correspond to the truncated-based method with varying cutoff values.
Refer to caption: x5.png

### 6.3 GPT Evaluation

We use the GPT-4 model to evaluate whether our stego-text appears natural and can avoid detection by the human eavesdropper Eve. We instructed GPT to mimic a human evaluator to assess the text and determine if it was likely written by a human, responding with either “yes” or “no”. In this experiment, we examined hundreds of generated stego-texts with GPT-4 under various parameters outlined in Section 6.2, with the results displayed in Figure 5. The horizontal axis represents the GPT evaluation score, i.e., the ratio of test cases marked “yes” by GPT in the total number of files evaluated.

Since a higher GPT score indicates a better result, the upper right direction means better performance in this point cloud plot. We first observe that the KL divergence is a relatively accurate measure of human perception. The red data points represent the truncation-based method, which again under-performs. At a GPT evaluation score of approximately 0.77, OD-Stega can attain an embedding rate 1.4 times higher; at around 0.85, OD-Stega even achieves 1.5 times the number of embedded bits than the truncation-based approach. We observe that a cutoff value between 0.01 and 0.3 appears to be suitable for OD-Stega.

Interestingly, at the extreme high GPT score regime, OD-Stega with a small truncation can achieve above 0.9, which the approach with essentially unadjusted LLM distributions (extremely small truncation values and no optimization of the distribution) cannot achieve. In other words, at the extreme regime, the OD-Stega approach can achieve more natural stego-texts than those directly generated from the LLAMA model, viewed from the point of a GPT surrogate.

### 6.4 Examples of Generated Stego-Texts

Figure 6 presents examples of stego-texts generated using our proposed method. Given a secret message $S$ and an initial prompt $T_{p}$, two text outputs were generated by varying the parameter values. The prompt, which discusses animals in the Amazon rainforest, yielded distinct results based on the chosen parameter settings. The green text represents coherent and logical content, while the red text deviates from the given topic. The green OD-Stega text, generated using the parameter pair $(C=0.025,\epsilon=0.05)$, demonstrates fluency and maintains consistency with the prompt’s topic. In contrast, the red OD-Stega text, produced with a larger parameter $C=0.05$ and higher KL divergence, shows a significant departure from the natural language distribution. Specifically, in the second sentence, the text becomes incoherent, leading to the generation of awkward and off-topic content in this instance.

Figure: Figure 6: Stego-text examples in different parameters: The green text illustrates more fluent and logically consistent output, while the red text shows incoherent and less natural results.
Refer to caption: x6.png

Figure: Figure 7: Stego-text examples in different methods. The green text illustrates more fluent and logically consistent output, while the red text shows incoherent and less natural results.
Refer to caption: x7.png

Figure 7 presents a comparison between two stego-text generation methods: truncation-based and OD-Stega. The results indicate that when using a larger value of $\epsilon$ in the truncation-based method, the generated text can produce anomalous tokens, as illustrated by the red text in this example. Specifically, with a cutoff of $\epsilon=0.05$, the truncation-based method starts generating irregular tokens after producing 20 tokens. In contrast, by using a smaller $\epsilon$ and allocating more of the adjustment budget to the optimization stage, as done for the green text, the output appears significantly more natural. More examples can be found in Appendix E.

## 7 Conclusion

To embed more secret messages in stego-texts while reducing computational complexity and maintaining near-imperceptibility, we propose the OD-Stega method. This approach optimizes the probability distribution towards a more uniform structure under a perception constraint. Additionally, we address the tokenization errors that often arise in LLM-based steganography due to the use of sub-word tokenizers in modern LLMs. Together with the vocabulary truncation technique, our two-stage embedding process significantly increases the embedding efficiency under the KL divergence constraint, and demonstrates strong imperceptibility performance. We conducted extensive tests and evaluate the outputs both using the KL divergence value and the GPT evaluation. OD-Stega provides a robust solution, enhancing both efficiency and security in LLM-based steganographic embedding.

## Appendix A Proof of Theorem 1

The Lagrangian function of the problem is

$$ $\displaystyle\mathscr{L}$ $\displaystyle=\sum_{j=1}^{N_{i}}Q_{j}^{i}\log Q_{j}^{i}+u\left(\sum_{j=1}^{N_{ i}}Q_{j}^{i}\log(\frac{Q_{j}^{i}}{P_{j}^{i}})-\delta\right)+\boldsymbol{ \lambda}^{T}(-Q^{i})+\omega\left(\sum_{j=1}^{N_{i}}Q_{j}^{i}-1\right)$ (15) $$

where $u,\boldsymbol{\lambda},\omega$ are the Lagrangian multipliers of constraint (2), (3) and (4), respectively.
Then the KKT condition can be derived as follows:

- 1.
Stationarity:
$\displaystyle\frac{\partial\mathscr{L}}{\partial Q_{j}^{i}}=\log Q_{j}^{i}+1+u
\left(\log\frac{Q_{j}^{i}}{P_{j}^{i}}+1\right)-\lambda_{j}+\omega=0,\quad
\forall j\in[1:N_{i}]$
(16)
- 2.
Primal feasibility:
$\displaystyle\begin{cases}\sum_{j=1}^{N_{i}}Q_{j}^{i}\log\frac{Q_{j}^{i}}{P_{j
}^{i}}-\delta\leq 0\\
Q_{j}^{i}\geq 0,\quad\forall j\in[1:N_{i}]\\
\sum_{j=1}^{N_{i}}Q_{j}^{i}-1=0\end{cases}$
(17)
- 3.
Dual feasibility:
$\displaystyle\begin{cases}u\geq 0\\
\lambda_{j}\geq 0,\quad\forall j\in[1:N_{i}]\\
\end{cases}$
(18)
- 4.
Complementary slackness:
$\displaystyle\begin{cases}u\left(\sum_{j=1}^{N_{i}}Q_{j}^{i}\log\frac{Q_{j}^{i
}}{P_{j}^{i}}-\delta\right)=0\\
\lambda_{j}Q_{j}^{i}=0,~{}\forall j\in[1:N_{i}]\\
\omega\left(\sum_{j=1}^{N_{i}}Q_{j}^{i}-1\right)=0\end{cases}$
(19)

Since the optimization problem is convex and clearly feasible, a solution to the KKT condition is also a global optimal solution. We claim the following is a solution to the KKT conditions:

- 1.
Primal variables:
In case $\delta\in[0,\frac{1}{N_{i}}\sum_{j=1}^{N_{i}}\log(\frac{1}{N_{i}P_{j}^{i}})]$, from stationarity in (16),
$\displaystyle Q_{j}^{i}$
$\displaystyle=2^{\frac{1}{1+u}\left(u\log P_{j}^{i}-1+\lambda_{j}-u-\omega
\right)}$
(20)
$\displaystyle=D{P_{j}^{i}}^{\frac{u}{1+u}},~{}\forall j\in[1:N_{i}]$
(21)
where $D=2^{\frac{-1+\lambda_{j}-u-\omega}{1+u}}$ is a constant.
Since $\sum_{j=1}^{N_{i}}Q_{j}^{i}=1$, we can simply rewrite $Q_{j}^{i}$ in the form:
$\displaystyle Q_{j}^{i}$
$\displaystyle=\frac{{P_{j}^{i}}^{\frac{u}{1+u}}}{\sum_{j=1}^{N}{P_{j}^{i}}^{
\frac{u}{1+u}}},~{}\forall j\in[1:N_{i}]$
(22)
In case $\delta>\frac{1}{N_{i}}\sum_{j=1}^{N_{i}}\log(\frac{1}{N_{i}P_{j}^{i}})$, we have
$\displaystyle Q_{j}^{i}$
$\displaystyle=\frac{1}{N_{i}},~{}\forall j\in[1:N_{i}]$
(23)
- 2.
Dual variables:
$\displaystyle\begin{cases}u\begin{cases}\geq 0,~{}\delta\in[0,\frac{1}{N_{i}}
\sum_{j=1}^{N_{i}}\log(\frac{1}{N_{i}P_{j}^{i}})]\\
=0,~{}\delta>\frac{1}{N_{i}}\sum_{j=1}^{N_{i}}\log(\frac{1}{N_{i}P_{j}^{i}})
\end{cases}\\
\lambda_{j}=0,~{}\forall j\in[1:N_{i}]\\
\omega=\frac{1}{1+u}\left(-1+\log(\sum_{j=1}^{N_{i}}{P_{j}^{i}}^{\frac{u}{1+u}
})\right)\end{cases}$
(24)

It is straightforward to verify all the KKT conditions are satisfied, except the dual feasibility condition $u\geq 0$, which we prove in Lemma 1 next.

## Appendix B Proof of Lemma 1

First, we note that $\lim_{u\rightarrow 0}D_{KL}(Q^{i}||P^{i})=\frac{1}{N_{i}}\sum_{j=1}^{N_{i}}
\log(\frac{1}{N_{i}P_{j}^{i}})$ and $\lim_{u\rightarrow\infty}D_{KL}(Q^{i}||P^{i})=0$, because

$$ $\displaystyle\lim_{u\rightarrow 0}Q_{j}^{i}=\frac{1}{N_{i}}\Rightarrow\lim_{u \rightarrow 0}D_{KL}(Q^{i}||P^{i})=\sum_{j=1}^{N_{i}}\frac{1}{N_{i}}\log\left( \frac{\frac{1}{N_{i}}}{P_{j}^{i}}\right)=\frac{1}{N_{i}}\sum_{j=1}^{N_{i}}\log \left(\frac{1}{N_{i}P_{j}^{i}}\right)$ (25) $\displaystyle\lim_{u\rightarrow\infty}Q_{j}^{i}=P_{j}^{i}\Rightarrow\lim_{u \rightarrow\infty}D_{KL}(Q^{i}||P^{i})=\sum_{j=1}^{N_{i}}P_{j}^{i}\log\left( \frac{P_{j}^{i}}{P_{j}^{i}}\right)=0.$ (26) $$

Second, note that that $D_{KL}(Q^{i}||P^{i})$ is continuous in $u\geq 0$. To see this, consider $P_{j}^{i}$ as the known distribution value, $Q_{j}^{i}$ is continuous in $u\geq 0$ because $\frac{u}{1+u}$ is continuous in $\mathbb{R}\setminus\{-1\}$. In addition, $Q_{j}^{i}$ will not be zero for all $j\in[1:N_{i}]$, which indicates that $\log(\frac{Q_{j}^{i}}{P_{j}^{i}})$ is continuous. Therefore, $D_{KL}(Q^{i}||P^{i})$ is also continuous in $u\geq 0$ since the function is a linear combination of continuous functions.

Lemma 2, which is proved below, states that $D_{KL}(Q^{i}||P^{i})$ is non-increasing in $u$ for $u\geq 0$. By the Intermediate-Value Theorem (IVT), it is clear that there exists a positive $u$ such that the KL divergence is equal to the given $\delta\in[0,\frac{1}{N_{i}}\sum_{j=1}^{N_{i}}\log(\frac{1}{N_{i}P_{j}^{i}})]$.

## Appendix C Proof of Lemma 2

Here we show that $D_{KL}(Q^{i}||P^{i})$ is non-increasing in $u$ for $u\geq 0$, by analyzing the derivative as follows:

$$ $\displaystyle\frac{\partial D_{KL}(Q^{i}||P^{i})}{\partial u}=\frac{\partial}{ \partial u}\left(\sum_{j=1}^{N_{i}}Q_{j}^{i}\log\frac{Q_{j}^{i}}{P_{j}^{i}} \right)=\sum_{j=1}^{N_{i}}\frac{\partial}{\partial u}\left(Q_{j}^{i}\log\frac{ Q_{j}^{i}}{P_{j}^{i}}\right)$ (27) $\displaystyle=$ $\displaystyle\sum_{j=1}^{N_{i}}\Biggl{\{}\frac{\partial}{\partial u}\left( \frac{{P_{j}^{i}}^{\frac{u}{1+u}}}{\sum_{k=1}^{N_{i}}{P^{i}_{k}}^{\frac{u}{1+u }}}\right)\log\left(\frac{{P_{j}^{i}}^{\frac{-1}{1+u}}}{\sum_{k=1}^{N_{i}}{P^{ i}_{k}}^{\frac{u}{1+u}}}\right)+$ $\displaystyle\left(\frac{{P_{j}^{i}}^{\frac{u}{1+u}}}{\sum_{k=1}^{N_{i}}{P^{i} _{k}}^{\frac{u}{1+u}}}\right)\frac{\partial}{\partial u}\log\left(\frac{{P^{i} _{k}}^{\frac{-1}{1+u}}}{\sum_{k=1}^{N_{i}}{P^{i}_{k}}^{\frac{u}{1+u}}}\right) \Biggr{\}}$ (28) $\displaystyle=$ $\displaystyle\sum_{j=1}^{N_{i}}\Biggl{\{}\Biggl{[}\left(\sum_{k=1}^{N_{i}}{P_{ j}^{i}}^{\frac{u}{1+u}}\right)^{-2}\left(\frac{1}{1+u}\right)^{2}{P_{j}^{i}}^{ \frac{u}{1+u}}\left(\sum_{k=1}^{N_{i}}{P_{j}^{i}}^{\frac{u}{1+u}}\log(\frac{P_ {j}^{i}}{P^{i}_{k}})\right)\Biggr{]}\log\left(\frac{{P_{j}^{i}}^{\frac{-1}{1+u }}}{\sum_{k=1}^{N_{i}}{P^{i}_{k}}^{\frac{u}{1+u}}}\right)$ $\displaystyle+$ $\displaystyle\left(\frac{{P_{j}^{i}}^{\frac{u}{1+u}}}{\sum_{k=1}^{N_{i}}{P^{i} _{k}}^{\frac{u}{1+u}}}\right)$ $\displaystyle\cdot\Biggl{[}\left(\frac{\sum_{k=1}^{N_{i}}{P^{i}_{k}}^{\frac{u} {1+u}}}{{P_{j}^{i}}^{\frac{-1}{1+u}}}\right)\left(\sum_{k=1}^{N_{i}}{P_{j}^{i} }^{\frac{u}{1+u}}\right)^{-2}\left(\frac{1}{1+u}\right)^{2}{P_{j}^{i}}^{\frac{ -1}{1+u}}\left(\sum_{k=1}^{N_{i}}{P^{i}_{k}}^{\frac{u}{1+u}}\log(\frac{P_{j}^{ i}}{P^{i}_{k}})\right)\Biggr{]}\Biggr{\}}$ (29) $\displaystyle=\sum_{j=1}^{N_{i}}\left(\sum_{k=1}^{N_{i}}{P^{i}_{k}}^{\frac{u}{ 1+u}}\log(\frac{P_{j}^{i}}{P^{i}_{k}})\right)\Biggl{\{}T^{-2}\left(\frac{1}{1+ u}\right)^{2}{{P_{j}^{i}}^{\frac{u}{1+u}}}\log\left(\frac{{P_{j}^{i}}^{\frac{- 1}{1+u}}}{T}\right)+$ $\displaystyle\left(\frac{{P_{j}^{i}}^{\frac{u}{1+u}}}{T}\right)\left(\frac{T}{ {P_{j}^{i}}^{\frac{-1}{1+u}}}\right)T^{-2}\left(\frac{1}{1+u}\right)^{2}{P_{j} ^{i}}^{\frac{-1}{1+u}}\Biggr{\}}$ (30) $\displaystyle=T^{-2}\left(\frac{1}{1+u}\right)^{2}\sum_{j=1}^{N_{i}}\Biggl{\{} {P_{j}^{i}}^{\frac{u}{1+u}}\left(\sum_{k=1}^{N_{i}}{P^{i}_{k}}^{\frac{u}{1+u}} \log(\frac{P_{j}^{i}}{P^{i}_{k}})\right)\left(\log\left(\frac{{P_{j}^{i}}^{ \frac{-1}{1+u}}}{T}\right)+1\right)\Biggr{\}}$ (31) $\displaystyle=T^{-2}\left(\frac{1}{1+u}\right)^{2}\sum_{j=1}^{N_{i}}\Biggl{\{} \left(\sum_{k=1}^{N_{i}}({P_{j}^{i}}{P^{i}_{k}})^{\frac{u}{1+u}}\log(\frac{P_{ j}^{i}}{P^{i}_{k}})\right)\log\left(\frac{2{P_{j}^{i}}^{\frac{-1}{1+u}}}{T} \right)\Biggr{\}}$ (32) $\displaystyle=T^{-2}\left(\frac{1}{1+u}\right)^{2}\sum_{j=1}^{N_{i}}\sum_{k=1} ^{N_{i}}B_{jk}\log\left(\frac{2{P_{j}^{i}}^{\frac{-1}{1+u}}}{T}\right)$ (33) $\displaystyle=T^{-2}\left(\frac{1}{1+u}\right)^{2}\sum_{\begin{subarray}{c}j,k =1\\ j\neq k\\ {P_{j}^{i}}\geq{P^{i}_{k}}\end{subarray}}^{N_{i}}B_{jk}\left(\log\left(\frac{2 {P_{j}^{i}}^{\frac{-1}{1+u}}}{T}\right)-\log\left(\frac{2{P^{i}_{k}}^{\frac{-1 }{1+u}}}{T}\right)\right)$ (34) $\displaystyle=T^{-2}\left(\frac{1}{1+u}\right)^{2}\sum_{\begin{subarray}{c}j,k =1\\ j\neq k\\ {P_{j}^{i}}\geq{P^{i}_{k}}\end{subarray}}^{N_{i}}B_{jk}\left(\frac{-1}{1+u} \right)\log\left(\frac{{P_{j}^{i}}}{{P^{i}_{k}}}\right)\leq 0$ (35) $$

where $T=\sum_{k=1}^{N_{i}}{P^{i}_{k}}^{\frac{u}{1+u}}$ and $B_{jk}=({P_{j}^{i}}{P^{i}_{k}})^{\frac{u}{1+u}}\log\left(\frac{P_{j}^{i}}{P^{i
}_{k}}\right)$. Eq. (34) follows from $B_{jk}=-B_{kj},~{}\forall j\neq k$ and $B_{jk}=0,~{}\forall j=k$. The only negative term in (35) is $\frac{-1}{1+u}$, since $B_{jk}$ and $\log(\frac{P_{j}^{i}}{P^{i}_{k}})$ are both positive in the case ${P_{j}^{i}}\geq{P^{i}_{k}}$. This proves the inequality. It follows that that $D_{KL}(Q^{i}||P^{i})$ is non-increasing in $u$ for $u\geq 0$.

## Appendix D Proof of Theorem 2

The result in Theorem 1 shows that the solution to the optimization problem with constraint $D_{KL}(Q^{i}||\hat{P}^{i}(\epsilon))\leq\hat{\delta}(\epsilon)$ is:

$$ $\displaystyle Q_{j}^{i}$ $\displaystyle=\begin{cases}\frac{{{\hat{P}_{j}^{i}}(\epsilon)}^{\frac{\hat{u}( \epsilon)}{1+\hat{u}(\epsilon)}}}{\sum_{j=1}^{N_{\epsilon}}{\hat{P}_{j}^{i}( \epsilon)}^{\frac{\hat{u}(\epsilon)}{1+\hat{u}(\epsilon)}}}&,\forall~{}\hat{ \delta}(\epsilon)\in[0,\frac{1}{N_{\epsilon}}\sum_{j=1}^{N_{\epsilon}}\log( \frac{1}{N_{\epsilon}{\hat{P}_{j}^{i}}})]\\ \frac{1}{N_{\epsilon}}&,\text{otherwise}\end{cases}$ (36) $\displaystyle=\begin{cases}\frac{{{P_{j}^{i}}}^{\frac{\hat{u}(\epsilon)}{1+ \hat{u}(\epsilon)}}}{\sum_{j=1}^{N_{\epsilon}}{P_{j}^{i}}^{\frac{\hat{u}( \epsilon)}{1+\hat{u}(\epsilon)}}}&,\forall~{}\hat{\delta}(\epsilon)\in[0,\frac {1}{N_{\epsilon}}\sum_{j=1}^{N_{\epsilon}}\log(\frac{1-\epsilon}{N_{\epsilon}{ {P}^{i}_{j}}})]\\ \frac{1}{N_{\epsilon}}&,\text{otherwise}\end{cases}$ (37) $$

for all $j\in[1:N_{\epsilon}]$ and for some positive $\hat{u}(\epsilon)$.
In addition, Lemma 1 states that when $\hat{\delta}(\epsilon)\in[0,\frac{1}{N_{\epsilon}}\sum_{j=1}^{N_{\epsilon}}
\log(\frac{1}{N_{\epsilon}{\hat{P}_{j}^{i}}})]$, the obtained solution ensures that the KL divergence $D_{KL}(Q^{i}||\hat{P}^{i}(\epsilon))$ is equal to the given constraint $\hat{\delta}(\epsilon)$. In the following, we show that in this case, the KL divergence is additive, which means that the divergence between $Q^{i}$ and ${P}^{i}$ is the sum of the divergence between $Q^{i}$ and $\hat{P}^{i}(\epsilon)$ and between $\hat{P}^{i}(\epsilon)$ and ${P}^{i}$.

$$ $\displaystyle\hat{\delta}(\epsilon)$ $\displaystyle=\sum_{j=1}^{N_{\epsilon}}{P}^{i}_{j}\log\left(\frac{{P}^{i}_{j}} {\hat{P}_{j}^{i}(\epsilon)}\right)$ (38) $\displaystyle=\sum_{j=1}^{N_{\epsilon}}\left(\frac{{{\hat{P}_{j}^{i}}(\epsilon )}^{\frac{\hat{u}(\epsilon)}{1+\hat{u}(\epsilon)}}}{\sum_{j=1}^{N_{\epsilon}}{ \hat{P}_{j}^{i}(\epsilon)}^{\frac{\hat{u}(\epsilon)}{1+\hat{u}(\epsilon)}}} \right)\log\left(\frac{{{\hat{P}_{j}^{i}(\epsilon)}}^{\frac{\hat{u}(\epsilon)} {1+\hat{u}(\epsilon)}}}{\hat{P}_{j}^{i}(\epsilon)\sum_{j=1}^{N_{\epsilon}}{ \hat{P}_{j}^{i}(\epsilon)}^{\frac{\hat{u}(\epsilon)}{1+\hat{u}(\epsilon)}}}\right)$ (39) $\displaystyle=\sum_{j=1}^{N_{\epsilon}}\left(\frac{{{P_{j}^{i}}}^{\frac{\hat{u }(\epsilon)}{1+\hat{u}(\epsilon)}}}{\sum_{j=1}^{N_{\epsilon}}{P_{j}^{i}}^{ \frac{\hat{u}(\epsilon)}{1+\hat{u}(\epsilon)}}}\right)\log\left(\frac{{{P_{j}^ {i}}}^{\frac{\hat{u}(\epsilon)}{1+\hat{u}(\epsilon)}}}{\frac{1}{1-\epsilon}P_{ j}^{i}\sum_{j=1}^{N_{\epsilon}}{P_{j}^{i}}^{\frac{\hat{u}(\epsilon)}{1+\hat{u} (\epsilon)}}}\right)$ (40) $\displaystyle=\sum_{j=1}^{N_{\epsilon}}\left(\frac{{{P_{j}^{i}}}^{\frac{\hat{u }(\epsilon)}{1+\hat{u}(\epsilon)}}}{\hat{T}(\epsilon)}\right)\log\left(\frac{( 1-\epsilon){{P_{j}^{i}}}^{\frac{-1}{1+\hat{u}(\epsilon)}}}{\hat{T}(\epsilon)}\right)$ (41) $\displaystyle=\sum_{j=1}^{N_{\epsilon}}\left(\frac{{{P_{j}^{i}}}^{\frac{\hat{u }(\epsilon)}{1+\hat{u}(\epsilon)}}}{\hat{T}(\epsilon)}\right)\left(\log(1- \epsilon)+\log\left(\frac{{{P_{j}^{i}}}^{\frac{-1}{1+\hat{u}(\epsilon)}}}{\hat {T}(\epsilon)}\right)\right)$ (42) $\displaystyle=\sum_{j=1}^{N_{\epsilon}}\left(\frac{{{P_{j}^{i}}}^{\frac{\hat{u }(\epsilon)}{1+\hat{u}(\epsilon)}}}{\hat{T}(\epsilon)}\right)\log\left(\frac{{ {P_{j}^{i}}}^{\frac{-1}{1+\hat{u}(\epsilon)}}}{\hat{T}(\epsilon)}\right)+\frac {\log(1-\epsilon)}{\hat{T}(\epsilon)}\sum_{j=1}^{N_{\epsilon}}{{P_{j}^{i}}}^{ \frac{\hat{u}(\epsilon)}{1+\hat{u}(\epsilon)}}$ (43) $\displaystyle=D_{KL}(Q^{i}||{P}^{i})+\log(1-\epsilon)$ (44) $\displaystyle=D_{KL}(Q^{i}||{P}^{i})-D_{KL}(\hat{P}^{i}(\epsilon)||{P}^{i})$ (45) $\displaystyle\Rightarrow$ $\displaystyle~{}D_{KL}(Q^{i}||{P}^{i})=D_{KL}(\hat{P}^{i}(\epsilon)||{P}^{i})+ D_{KL}(Q^{i}||\hat{P}^{i}(\epsilon))$ (46) $$

where $\hat{T}(\epsilon)=\sum_{j=1}^{N_{\epsilon}}{{P}^{i}_{j}}^{\frac{\hat{u}(
\epsilon)}{1+\hat{u}(\epsilon)}}$ in (41).

## Appendix E More Examples

The example presented in Figure 8 illustrates the generated stego-text by fixing the parameter $C=0.025$ and comparing the results between an extremely small cutoff value and a typical cutoff value of $\epsilon=0.05$. In this instance, the green text, corresponding to the normal cutoff, appears logical and coherent, whereas the red text exhibits uncommon word choices after the generation of 10 tokens. This example strengthens our conclusion in Section 6.3, where the cloud plot illustrated that extremely low cutoff values resulted in lower GPT evaluation scores. This occurs because such tokens are not truncated, and the likelihood of being chosen increases after optimization.

Figure: Figure 8: Stego-text examples in different cutoffs. The green text illustrates more fluent and logically consistent output, while the red text shows incoherent and less natural results.
Refer to caption: x8.png

Figure: Figure 9: Stego-text examples in different pair of parameters $(C,\epsilon)$ and length of secret message embedded.
Refer to caption: x9.png

In Figure 9 we show more examples of generated stego-texts using the proposed OD-Stega approach with various parameters. It can be seen that as the $(C,\epsilon)$ parameters increase, the embedding capability increases. The generated stego-texts mostly remain fluent in this parameter range.

## Peer Reviews

confidence: 5
contribution: 2
initial_rating: 3
presentation: 3
questions: I would like to ask authors, if they can comment the weaknesses I have mentioned above.
soundness: 2
strengths: * The theory of the paper is decent.
* It is refreshing to see terminology used in steganographic literature.
* I have never thought about issues with tokenization, as I have thought about it about unique. But it is not. This is a big deal jeopardizing a lot of prior art.
summary: The paper suggest to distort little bit the probability distribution of LLM in generative steganography to increase the capacity.
weaknesses: There are few concerns I have with the work.
* Steganography always thrived to be undetectable. One of the big hallmarks of generative steganography is that if done right, it is actually undetectable. Why would I want to trade off undetectability for a higher capacity? This is very important when one considers square-root law discovered by Andrew Ker [1]. This says that the message embedded by an imperfect steganographic system, which authors have introduced has to decrease faster than square-root of length of the cover, otherwise the system will be detectable. With respect to this, the proposed system have sense only for one-off message where the steganography is not repeated (see works by Andrew Ker on pooled steganalysis [2]). With respect to this, I think that for longer messages and / or repeated communication the improvement in the capacity will be small, otherwise the steganographer will be detectable in the long run. Or the other way around, the method proposed in the paper makes sense when the steganographer sends only one short message. I am not sure this is of practical interest.
* The second flaw of the paper is that it distorts probability of individual tokens. In some sense, the theory therefore assumes IID model and does not take interactions between tokens and the cumulative effects into the consideration. This is not necessarily bad, as one of the big hallmarks of cover-modification steganography was derived under exactly the same conditions, but then it took more than a decade to derive a principled method utilizing this system [4]. But this point should be made clear and explicit. Again, with respect to the above claim.
* My third objection is the evaluation. It seems to me that it makes the Eve (warden, steganalyst) just plain weak. Under Kerckhoffs' principle, she has all the knowledge about the steganographic channel. Why she cannot train a statistical detector, for example by finetuning some LLM, and relies instead on some instructed LLM? This seems just plain wrong to me.
* Discop [5] on page 4 discusses practical issues of arithmetic coding and argues that unless the length of the message is very long, there will be a detectable distortion (see Table II of paper [5]). Your scheme further increases this distortion. 


[1] Ker, Andrew D. "The square root law in stegosystems with imperfect information." Information Hiding: 12th International Conference, IH 2010, Calgary, AB, Canada, June 28-30, 2010, Revised Selected Papers 12. Springer Berlin Heidelberg, 2010.

[2] Ker, Andrew D. "Batch steganography and pooled steganalysis." International Workshop on Information Hiding. Berlin, Heidelberg: Springer Berlin Heidelberg, 2006.

[3] Fridrich, Jessica, and Tomas Filler. "Practical methods for minimizing embedding impact in steganography." Security, Steganography, and Watermarking of Multimedia Contents IX. Vol. 6505. SPIE, 2007.

[4] Bernard, Solène, et al. "Optimizing additive approximations of non-additive distortion functions." Proceedings of the 2021 ACM Workshop on Information Hiding and Multimedia Security. 2021.

[5] Ding, Jinyang, et al. "Discop: Provably secure steganography in practice based on" distribution copies"." 2023 IEEE Symposium on Security and Privacy (SP). IEEE, 2023.

---

confidence: 4
contribution: 2
initial_rating: 3
presentation: 3
questions: 1.T he interval obtained from arithmetic coding mapping 0.10111 should be [0.71875, 0.75). Could you clarify this calculation?
2. Could you include the message extraction operation in the flow of arithmetic coding steganography shown in Figure 1 to provide a complete overview?
3. Please consider adding an analysis of the impact of different truncation operations on embedding and extraction times in the experimental section.
4. In the GPT-4 evaluation experiments, only comparisons against the baseline are provided. Can you include a comparative analysis among the different truncation sizes?
5. It would be useful to add examples and requirements for different secret message lengths relative to B bits, as well as the distinctions between correct and incorrect extractions.
6. The baseline method used is from 2020. Could you provide comparisons with the latest methods to contextualize your contributions?
soundness: 2
strengths: 1. The paper innovatively resolves tokenization errors that occur in existing LLMs used for steganography.
2. The proof for optimizing distribution probabilities is comprehensive and methodologically sound.
3. The graphical representations effectively convey complex information in an accessible manner.
summary: The author presents a novel steganographic method for large language models (LLMs) that integrates probability truncation and optimized distributions.  This approach aims to embed more secret messages while reducing computational complexity and maintaining undetectability.  The paper's primary contribution lies in addressing tokenization errors associated with the use of tokenizers in existing LLMs for steganography.  Extensive experiments are conducted, employing KL divergence and GPT-4 to evaluate the generated text, with results depicted in clear and comprehensible figures.
weaknesses: 1. The flow of arithmetic coding steganography in Figure 1 does not include the message extraction operation for the receiver, which is critical for understanding the full process.
2. The experimental section lacks an analysis of how different truncation operations impact embedding and extraction times, which are crucial for assessing practical efficiency.
3. The experiments evaluating GPT-4 only compare different truncation sizes against a baseline, without providing a comparative analysis among these sizes, limiting the understanding of their relative effectiveness.
4. The baseline method used in the experiments is from 2020, and there is no comparison with more recent methods, which may undermine the relevance of the findings.

---

confidence: 4
contribution: 2
initial_rating: 3
presentation: 4
questions: 1. The paper refers to the proposed LLM-sampling-based linguistic steganography as coverless steganography. Why is the text generated by normal sampling of LLM not considered by the authors to be cover text?
2. Does the receiver need to know the length of B during decoding? On average, how many repetitions are required for each generation by the sender?
soundness: 3
strengths: 1. The paper is well-written. The combination of lemma and examples makes the paper easy to read.
2. Consideration of decoding errors is encouraged. 
3. A two-dimensional imperceptibility metric for stegotexts was realized using KL divergence and GPT-4 evaluation.
summary: The paper proposes an LLM-based text steganography method OD-Stega, using an improved adaptive arithmetic coding decoder. The authors considered several practical issues such as tokenization error and computational complexity, and they provided strategies to improve efficiency and reliability.
weaknesses: 1. The steganographic methods cited and compared in this paper only cover approaches developed before 2020. In recent years, many researchers have proposed perfectly secure steganographic methods based on large language models (LLMs) [1][2][3][4][5]. These methods achieve distribution preservation and make efficient use of the information entropy in the prediction distribution of LLMs, which means that these methods modify the KL divergence to almost 0, while utilization of entropy is close to 1. In my view, the proposed OD-Stega method does not offer any advantage in terms of security, and its embedding rate and runtime efficiency have not been compared with these recent methods. The novelty of this paper is therefore questionable. I suggest the authors add a comparison with these methods, focusing on the trade-off between the proposed method's modification of KL divergence and embedding capacity.

- [1] Zhang, Siyu, et al. "Provably Secure Generative Linguistic Steganography." Findings of the Association for Computational Linguistics: ACL-IJCNLP 2021. 2021.
- [2] Kaptchuk, Gabriel, et al. "Meteor: Cryptographically secure steganography for realistic distributions." Proceedings of the 2021 ACM SIGSAC Conference on Computer and Communications Security. 2021.
- [3] de Witt, Christian Schroeder, et al. "Perfectly secure steganography using minimum entropy coupling." arXiv preprint arXiv:2210.14889 (2022).
- [4] Ding, Jinyang, et al. "Discop: Provably secure steganography in practice based on" distribution copies"." 2023 IEEE Symposium on Security and Privacy (SP). IEEE, 2023.
- [5] Zhang, Xin, et al. "Provably secure public-key steganography based on elliptic curve cryptography." IEEE Transactions on Information Forensics and Security (2024).

2. Lack of steganalysis experiments. The paper uses two metrics, KLD and GPT Evaluation Score, to detect the imperceptibility of stegotext, but it lacks the most direct experiments using steganalysis tools as classifiers between covertexts and stegotexts. Existing linguistic steganalysis tools like [6][7] can only achieve about 50% accuracy when detecting the above provably secure methods [1][2][3][4][5], which is similar to random guessing. Whether the method proposed in the paper can achieve similar safety performance is an important metric.

- [6] Yang, Zhongliang, Yongfeng Huang, and Yu-Jin Zhang. "A fast and efficient text steganalysis method." IEEE Signal Processing Letters 26.4 (2019): 627-631.
- [7] Niu, Yan, et al. "A hybrid R-BILSTM-C neural network based text steganalysis." IEEE Signal Processing Letters 26.12 (2019): 1907-1911.

---

confidence: 3
contribution: 2
initial_rating: 5
presentation: 3
questions: -  looking at figure 4, it would have been great to represent which of these points actually lead to incoherent texts (as shown in figure 6 and 7) 

- It would make sense to keep black color for "truncation method" in all your figures, it would be clearer for the reader.
soundness: 2
strengths: - the general idea to change the token probability distribution is interesting and it is reasonable to think that it should lead to more compact stego-text. 

- the paper improves over the truncation-based method
summary: The authors propose a new form of LLM-based steganography algorithm, with the added goal that the size of the stego-text should be as small as possible. To achieve that, the authors modify the token probability distribution to increase the entropy of the possible choices, therefore increasing the amount of message that can be secretly embedded. However, to maintain security, this must be done while keeping the new distribution relatively similar to the original one to avoid distinguishing attacks. These two contradicting objectives are modeled into a convex optimization problem. 

The authors provide a small study of so-called tokenization error issue (present already in state-of-the-art). In addition, to avoid computational complexity to explode in some cases, they leverage a simple and existing truncation strategy of the vocabulary. Finally, they adaptatively control the divergence threshold to avoid special situations where very unusual tokens might be selected. 

Experiments have been conducted on LLAMA2-7B with various starting prompts. Examples of stego-test with different parameters values are exhibited.
weaknesses: - I am not really convinced by the evaluation metric for the security part. You check 1) KL divergence and 2) if GPT4 believes the stego-text was written by a human. The first one is quantitative and we can't relate its value to actual security in practice. The second one is very subjective and might completely miss obvious distinguishing patterns. I understand that maximizing these metrics goes towards higher security, but one has no idea if the final generated stego-text could be detected with advanced statistical attacks. Maybe take as example constructions with some provably security https://eprint.iacr.org/2021/686.pdf (CCS 2021)

- Maybe some argumentation is lacking to explain in what practical cases is LLM-based steganography needed ?

Meta-review: This paper proposes to distort the probability distribution of LLM in generative steganography. In particular, the distortion of the probability distribution is done by integrating probability truncation and optimized distributions. This approach aims to embed more secret messages while reducing computational complexity and maintaining undetectability. The paper's primary contribution lies in addressing tokenization errors associated with the use of tokenizers in existing LLMs for steganography. Extensive experiments are conducted, employing KL divergence and GPT-4 to evaluate the generated text. 

However, the reviewers remain unconvinced about the methodology proposed. Among other issues (several that I will not restate), the reviewers criticized the following. 

1) In particular, the evaluation metric for the security part is the KL-divergence, which cannot be related to actual amount of security in practice. 
2) Steganography is meant to be undetectable. It is not clear why one would want to trade off undetectability with capacity.
3) Baseline methods considered are old, before 2020. 

These were not adequately resolved even after the discussion period. Hence, this work, while promising, is premature and not ready for publication.

Decision: Reject