DenMark: Robust Semantic Watermarking for Diffusion Language Models
Organizations: The University of Tokyo · RIKEN Center for Advanced Intelligence Project
Abstract
Semantic text watermarks encode signals in meaning rather than surface token choices, offering robustness to paraphrasing and other semantic-preserving edits. Existing semantic watermarking methods are primarily designed for autoregressive language models (ARLMs), where completed candidate units can be generated and scored before generation proceeds. This paradigm does not naturally extend to diffusion language models (DLMs), where semantic units remain incomplete during intermediate denoising steps and tokens may be updated in flexible orders. We propose DenMark, a semantic watermarking framework that injects key-dependent signals directly into the DLM denoising process. DenMark partitions the output into fixed token regions and uses temporary rollouts as semantic lookahead: conditional completions estimate the eventual semantics of an incomplete region, enabling DenMark to select local updates with higher estimated semantic watermark scores. Repeating this procedure across denoising steps progressively accumulates watermark evidence in the final output. For detection, DenMark uses calibrated scanning over candidate unit sizes to remain robust to boundary shifts introduced by semantic attacks. Across four DLMs, three datasets, and four semantic attacks, DenMark gives the strongest overall robustness and achieves the best TPR at each reported operating point in 46 of the 48 backbone-dataset-attack combinations. Overall, DenMark provides an effective semantic watermark for DLMs. Code is available at https://github.com/TianhaoMa5/DenoMark.
Figures & tables
| Attack | Method | Finance | Alpaca | LongForm |
|---|---|---|---|---|
| LLaDA-8B | ||||
| Clean | DenMark | (99.00 / 99.33 / 100.00 / 0.9990) | (95.60 / 96.34 / 98.90 / 0.9912) | (99.67 / 100.00 / 100.00 / 0.9991) |
| DLM-KGW | (99.40 / 99.40 / 100.00 / 0.9998) | (93.36 / 95.23 / 98.34 / 0.9957) | (99.80 / 99.80 / 99.80 / 0.9998) | |
| DGMark | (100.00 / 100.00 / 100.00 / 1.0000) | (97.98 / 98.32 / 98.65 / 0.9897) | (100.00 / 100.00 / 100.00 / 1.0000) | |
| PatternMark | (100.00 / 100.00 / 100.00 / 1.0000) | (98.56 / 98.56 / 100.00 / 0.9997) | (100.00 / 100.00 / 100.00 / 1.0000) | |
| UMR | (100.00 / 100.00 / 100.00 / 1.0000) | (98.33 / 99.00 / 99.67 / 0.9995) | (99.67 / 100.00 / 100.00 / 1.0000) | |
| Clean | DenMark | DLM-KGW | DGMark | PatternMark | UMR |
| 0.054 | 0.642 | 0.118 | 0.236 | 0.089 | 0.070 |
Appendix figures & tables23 assets
Supplementary material from the paper’s appendix.
Appendix
| Component | Configuration |
|---|---|
| Base encoder | E5-base-v2 ( Wang et al., 2022 ) |
| Sampled segments | 8,000 |
| Valid training pairs | 7,993 |
| Maximum source length | 25 words |
| Positive generator | PEGASUS ( Zhang et al., 2020 ) |
| PEGASUS beam size | 10 |
| Base model | [email protected]% FPR | TPR@1% FPR | TPR@5% FPR | AUC | |
|---|---|---|---|---|---|
| LLaDA-8B | 2 | 100.00 | 100.00 | 100.00 | 0.9992 |
| 4 | 100.00 | 100.00 | 100.00 | 0.9992 | |
| 8 | 85.00 | 90.00 | 95.00 | 0.9633 | |
| Dream-v0-Instruct-7B | 2 | 100.00 | 100.00 | 100.00 | 0.9993 |
| 4 | 100.00 | 100.00 | 100.00 | 0.9993 | |
| 8 | 85.00 | 85.00 | 85.00 | 0.9481 |
| Base model | Attack | Encoder | Finance | LongForm |
|---|---|---|---|---|
| LLaDA-8B | Rewrite | Contrastive FT (main) | ( 72.24 / 81.61 / 92.64 / 0.9825 ) | ( 76.67 / 86.00 / 94.67 / 0.9864 ) |
| Untuned E5 | (39.00 / 49.00 / 69.00 / 0.9501) | (51.00 / 63.00 / 83.00 / 0.9685) | ||
| Compression | Contrastive FT (main) | ( 68.90 / 79.60 / 87.96 / 0.9713 ) | ( 83.00 / 86.33 / 94.00 / 0.9776 ) | |
| Untuned E5 | (36.00 / 45.00 / 69.00 / 0.9195) | (46.00 / 63.00 / 79.00 / 0.9373) | ||
| Expansion | Contrastive FT (main) | ( 53.85 / 67.89 / 82.94 / 0.9652 ) | ( 71.00 / 82.33 / 93.00 / 0.9865 ) | |
| Untuned E5 | (27.00 / 43.00 / 71.00 / 0.9334) | (41.00 / 53.00 / 76.00 / 0.9365) |
| Base model | Detector | TPR@1% | TPR@5% | AUC |
|---|---|---|---|---|
| LLaDA-8B | Fixed size (no scan) | 2.26 | 13.33 | 0.6612 |
| Size-only scan | 69.97 | 86.78 | 0.9811 | |
| Joint size+offset scan | 98.43 | 99.27 | 0.9975 | |
| Dream-v0-Instruct-7B | Fixed size (no scan) | 3.51 | 15.86 | 0.7177 |
| Size-only scan | 83.55 | 93.66 | 0.9942 | |
| Joint size+offset scan | 99.86 | 100.00 | 0.9996 |
| Attack | Method | Finance | Alpaca | LongForm |
|---|---|---|---|---|
| Clean | DenMark | (100.00 / 100.00 / 100.00 / 0.9989) | (95.41 / 97.17 / 98.23 / 0.9964) | (99.33 / 99.67 / 100.00 / 0.9987) |
| DLM-KGW | (99.40 / 99.60 / 100.00 / 0.9999) | (94.85 / 96.08 / 98.14 / 0.9972) | (99.33 / 99.33 / 100.00 / 0.9998) | |
| DGMark | (100.00 / 100.00 / 100.00 / 1.0000) | (96.31 / 97.32 / 97.65 / 0.9792) | (100.00 / 100.00 / 100.00 / 1.0000) | |
| PatternMark | (100.00 / 100.00 / 100.00 / 1.0000) | (97.90 / 98.95 / 99.30 / 0.9980) | (100.00 / 100.00 / 100.00 / 1.0000) | |
| UMR | (100.00 / 100.00 / 100.00 / 1.0000) | (97.00 / 97.00 / 97.67 / 0.9935) | (99.67 / 100.00 / 100.00 / 1.0000) | |
| Rewrite | DenMark | ( 65.22 / 75.25 / 91.64 / 0.9830 ) | ( 65.72 / 75.97 / 87.28 / 0.9726 ) | ( 76.33 / 84.00 / 93.00 / 0.9862 ) |
| Attack | Method | Alpaca | LongForm |
|---|---|---|---|
| LLaDA-8B | |||
| Sentence Back Translation | DenMark | ( 88.64 / 91.58 / 96.34 / 0.9801 ) | ( 94.00 / 97.67 / 98.67 / 0.9971 ) |
| DLM-KGW | (61.00 / 69.09 / 83.20 / 0.9613) | (55.20 / 64.40 / 81.00 / 0.9657) | |
| DGMark | (76.43 / 83.16 / 90.91 / 0.9606) | (92.67 / 95.33 / 99.00 / 0.9943) | |
| PatternMark | (76.17 / 79.42 / 88.45 / 0.9699) | (82.33 / 84.67 / 94.00 / 0.9870) | |
| UMR | (82.67 / 86.00 / 93.67 / 0.9778) | (75.00 / 79.67 / 92.00 / 0.9761) | |
| Attack | Method | Finance | Alpaca | LongForm |
|---|---|---|---|---|
| LLaDA-8B | ||||
| Sentence Compression | DenMark | ( 68.90 / 79.60 / 87.96 / 0.9713 ) | ( 63.00 / 73.63 / 85.71 / 0.9615 ) | ( 83.00 / 86.33 / 94.00 / 0.9776 ) |
| DLM-KGW | (37.20 / 47.00 / 68.40 / 0.9266) | (42.53 / 48.76 / 68.26 / 0.9048) | (37.60 / 48.20 / 68.20 / 0.9265) | |
| DGMark | (62.33 / 74.00 / 86.00 / 0.9647) | (57.58 / 65.66 / 75.08 / 0.9093) | (69.33 / 78.67 / 92.00 / 0.9776 ) | |
| PatternMark | (51.00 / 55.33 / 75.33 / 0.9281) | (45.85 / 50.90 / 72.56 / 0.9221) | (50.67 / 55.67 / 77.33 / 0.9464) | |
| UMR | (47.67 / 55.00 / 74.67 / 0.9358) | (58.67 / 66.33 / 78.67 / 0.9520) | (57.33 / 65.00 / 81.33 / 0.9517) | |
| Attack | Method | Finance | Alpaca | LongForm |
|---|---|---|---|---|
| LLaDA2.0-mini | ||||
| Sentence Compression | DenMark | ( 87.96 / 91.30 / 97.66 / 0.9927) | (59.57 / 65.34 / 82.67 / 0.9445) | ( 95.67 / 96.67 / 99.00 / 0.9977 ) |
| DLM-KGW | (68.67 / 78.00 / 92.00 / 0.9831) | (53.41 / 63.08 / 76.70 / 0.9404) | (81.00 / 86.33 / 95.00 / 0.9901) | |
| DGMark | (85.00 / 88.67 / 97.33 / 0.9937 ) | ( 65.31 / 73.43 / 85.61 / 0.9592 ) | (83.00 / 87.33 / 96.00 / 0.9935) | |
| PatternMark | (64.00 / 73.00 / 90.67 / 0.9792) | (45.99 / 50.52 / 70.03 / 0.9174) | (78.33 / 83.67 / 92.33 / 0.9847) | |
| UMR | (51.67 / 57.00 / 77.67 / 0.9533) | (41.00 / 49.00 / 67.00 / 0.9035) | (63.67 / 72.67 / 87.33 / 0.9724) | |
| Attack | Method | [email protected]% | TPR@1% | TPR@5% | AUC |
|---|---|---|---|---|---|
| Alternating compression/expansion | DenMark | 79.33 | 85.50 | 94.83 | 0.9827 |
| DLM-KGW | 10.99 | 17.53 | 36.30 | 0.7783 | |
| DGMark | 16.19 | 23.00 | 40.81 | 0.8118 | |
| PatternMark | 41.60 | 48.71 | 70.87 | 0.9384 | |
| UMR | 18.33 | 26.17 | 49.00 | 0.8622 | |
| Random runs | DenMark | 65.00 | 76.50 | 90.17 | 0.9740 |
| LLaDA-8B | LLaDA1.5-8B | ||||||
|---|---|---|---|---|---|---|---|
| Dataset | Method | Mean LogPPL ( Clean) | Judge Avg. ( Clean) | Dataset | Method | Mean LogPPL ( Clean) | Judge Avg. ( Clean) |
| Finance | Clean | 1.47 (+0.00) | 7.92 (+0.00) | Finance | Clean | 1.52 (+0.00) | 7.91 (+0.00) |
| DenMark | 1.83 (+0.36) | 7.21 (-0.71) | DenMark | 1.87 (+0.36) | 7.36 (-0.55) | ||
| DLM-KGW | 1.82 (+0.34) | 7.40 (-0.52) | DLM-KGW | 1.87 (+0.35) | 7.56 (-0.35) | ||
| DGMark | 1.91 (+0.44) | 7.11 (-0.81) | DGMark | 1.96 (+0.44) | 7.37 (-0.54) | ||
| PatternMark | 2.16 (+0.69) | 6.97 (-0.95) | PatternMark | 2.21 (+0.69) | 7.17 (-0.74) | ||
| LLaDA-8B | LLaDA1.5-8B | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Dataset | Method | LogPPL | [email protected]% | TPR@1% | TPR@5% | AUC | Dataset | Method | LogPPL | [email protected]% | TPR@1% | TPR@5% | AUC |
| Finance | DenMark | +0.36 | 99.00 | 99.67 | 100.00 | 0.9996 | Finance | DenMark | +0.36 | 100.00 | 100.00 | 100.00 | 0.9994 |
| Block Best-of- | +1.21 | 54.00 | 68.00 | 88.00 | 0.9825 | Block Best-of- | +1.28 | 60.00 | 78.00 | 96.00 | 0.9759 | ||
| PMark | +1.29 | 72.00 | 74.00 | 88.00 | 0.9867 | PMark | +1.09 | 62.00 | 72.00 | 88.00 | 0.9829 | ||
| SemStamp | +1.36 | 32.00 | 40.00 | 48.00 | 0.8328 | SemStamp | +1.31 | 18.00 | 22.00 | 46.00 | 0.7609 | ||
| Alpaca | DenMark | +0.40 | 95.24 | 97.07 | 98.53 | 0.9915 | Alpaca | DenMark | +0.37 | 95.41 | 96.47 | 98.59 | 0.9964 |
| Finance-QA | ||||||
|---|---|---|---|---|---|---|
| Condition | [email protected]% | TPR@1% | TPR@5% | AUC | ||
| 8 | 1 | Clean | 97.49 | 97.99 | 98.99 | 0.9970 |
| Rewrite | 55.28 | 60.80 | 80.40 | 0.9444 | ||
| Compress | 52.26 | 57.79 | 75.88 | 0.9251 | ||
| Expand | 41.71 | 48.74 | 72.36 | 0.9145 | ||
| Doc. Paraphrase | 45.73 | 53.27 | 74.87 | 0.9257 | ||
| Method | MMLU | HellaSwag | ARC-C | GSM8K | Avg. |
|---|---|---|---|---|---|
| LLaDA1.5-8B | |||||
| Clean | 63.97 | 76.33 | 84.28 | 57.62 | 70.55 |
| DLM-KGW | 52.63 | 72.46 | 73.58 | 53.22 | 62.97 |
| PatternMark | 55.63 | 73.64 | 80.27 | 51.40 | 65.23 |
| DenMark | 63.63 | 76.34 | 83.95 | 51.78 | 68.92 |
| DGMark | 57.93 | 73.99 | 82.27 | 52.31 | 66.63 |
| Dataset | Prompt | Clean (no watermark) | DenMark (unattacked) |
|---|---|---|---|
| Finance | Should I replace bonds in a passive investment strategy | The decision to replace bonds in a passive investment strategy depends on various factors, including your investment goals, risk tolerance, and market conditions. Here are some key points to consider: 1. Risk Tolerance: Bonds are generally considered low-risk investments, making them suitable for a passive investment strategy. If you’re considering diversifying your portfolio to take on higher risk, you might consider replacing some or all bonds with equities. […continues] | Whether to replace bonds in a passive investment strategy depends on several factors, including individual goals, risk tolerance, and time horizon. However, I’ll provide some perspectives to help you make an informed decision. 1. Lower risk: Bonds are generally less volatile compared to stocks, which makes them a good option for those seeking low volatility. 2. […continues] |
| Alpaca | Why do we need AI assistants? | AI assistants are essential for several reasons in modern society: 1. Efficiency: AI assistants can automate repetitive tasks, freeing up human workers to focus on more high-priority, creative activities. 2. Productivity: They can perform tasks quickly and accurately, increasing overall productivity and reducing human error. 3. […continues] | We need AI assistants for several reasons: 1. Automation: AI assistants can automate tasks that are typically repetitive, time-consuming and require minimal human intervention. This frees up time for humans to focus on more important activities. 2. Speed and Accuracy: AI systems can process information faster, more accurately and with fewer errors than human operators. […continues] |
| LongForm | Why do humans like to kiss each other? | Humans like to kiss each other for several complex biological and psychological reasons. Firstly, kissing is a form of social bonding that helps to strengthen relationships and emotional connection between friends, family, and partners. When we kiss, it triggers the release of oxytocin, a hormone that promotes attachment and bonding, as well as endorphins, which is associated with feelings of pleasure and relaxation. […continues] | Kissing is a universal human behavior that is deeply embedded in cultures and traditions. There are several biological and psychological reasons why humans like to kiss each other. 1. Oxytocin: Kissing releases oxytocin, also known as the ”love hormone.” Oxytocin is a neurotransmitter that improves mood and creates a feeling of bonding, affection, and trust. 2. Physical connection: Kissing involves close physical contact, which creates a strong connection. […continues] |
| Dataset | Prompt | Clean (no watermark) | DenMark (unattacked) |
|---|---|---|---|
| Finance | How to calculate how much a large stock position is really worth? | To calculate the real value of a large stock position, consider the following factors: 1. Stock Price: Determine the current stock price of the company. You can find this on stock exchanges, investment websites, or financial news. 2. Number of Shares: Know the total number of shares you own in the stock position. This can be found in your investment account, trading app, or brokerage statement. 3. […continues] | Calculating the value of a large stock position involves a few key factors, including the number of shares you own, the price per share, if applicable, and any dividends or appreciation. Here’s a step-by-step guide to determining the total value: 1. Determine the Number of Shares: Count how many shares you own in the stock. 2. […continues] |
| Alpaca | how much of a threat is climate change in the coming years, and what should we do to stop it? | Climate change is a very real threat to our environment and society. According to the IPCC, the Earth’s temperature is rising at an alarming rate, and the trend is projected to continue accelerating if we don’t take immediate action. The impacts of climate change are already evident, with melting glaciers, rising sea levels, and changing weather patterns, among other things. To stop climate change, we need to take a comprehensive approach: 1. […continues] | Climate change poses a significant threat to humanity in the future. It is real, primarily driven by the burning of fossil fuels, oil, and gas, and human activities such as deforestation and agriculture. It is estimated that by the end of this century, the global average temperature could be up to 2°C higher than pre-industrial levels. […continues] |
| LongForm | What causes mental fatigue while studying? | Mental fatigue while studying can be caused by a variety of factors, or a combination of them. These factors include: 1. Lack of sleep: Not getting enough hours of sleep per night can impair your ability to function properly, leading to mental fatigue while studying. 2. Hunger: Low blood sugar can cause your energy levels to drop, leading to mental fog and fatigue. 3. […continues] | Mental fatigue, also known as cognitive overload or burnout, is a state of mental and emotional exhaustion caused by prolonged mental effort. When studying, individuals experience mental fatigue when they absorb excessive amounts of information, leading to decreased concentration, motivation, and memory retention. Some common causes of mental fatigue include: 1. Lack of rest: Cognitive function requires adequate sleep and rest to recover. […continues] |
| Dataset | Prompt | Clean (no watermark) | DenMark (unattacked) |
|---|---|---|---|
| Finance | Should I Use an Investment Professional? | Yes, using an investment professional can help you plan and achieve your financial goals. An investment professional can help you plan, evaluate various investment options, and manage your investment portfolio. Firstly, using an investment professional can help you to determine your financial goals, objectives, and needs. An investment professional can help you create an investment plan that aligns your financial goals, risk tolerance, and investment horizon. […continues] | The decision to use an investment professional is personal and based on individual circumstances, goals, and preferences. It depends on an individual’s level of knowledge and experience in investing. If you are able to manage your own investments, you have a good understanding of financial markets and the economic environment. […continues] |
| Alpaca | ideas for building a waitlist for a new product or service | 1. Build anticipation on social media platforms by sharing sneak peeks of the product or service and encouraging followers to subscribe to the waitlist as soon as it launches. 2. Offer an exclusive discount or special promotion to those who register for the waitlist before it is available. 3. Create an email marketing campaign that sends updates with the latest information about the product or service as it becomes available. 4. […continues] | Sure, here are some ideas for building a waitlist for a new product or service: 1. Social media promotion: Share teasers, behind-the-scenes, or other information about your product or service on social media channels. Encourage your followers to provide their contact information for a chance for exclusive access. 2. Online launch event: Host an online launch event or a webinar where you encourage potential customers to sign up for a waitlist. […continues] |
| LongForm | Why does a 2 hour movie take a year to make when a high quality TV show can make 45 minute ones every week. | Producing a 2-hour movie involves many different stages, from the development of the script, to casting, filming, and editing. This process involves many professionals, including writers, directors, actors, and editors, and can take several months. On the other hand, TV shows follow a similar process, with scriptwriting, pre-production, production, and editing for each episode. […continues] | There are several key factors that contribute to the longer time to produce a 2-hour movie in comparison to a half-hour-long TV show. One main difference is that movies typically involve a greater degree of complexity in terms of storytelling, effects, cinematography, and editing, while TV shows can be more streamlined and made quickly due to their regular production schedules. […continues] |
Diffusion Model Watermarking
Diffusion model watermarking embeds detectable signals in generated content or models to support provenance, ownership verification, and attribution.
See all 46 papers