Watermarking Large Language Model-based Time Series Forecasting

Wei Yuan, Chaoqun Yang, Yu Xing, Tong Chen, Nguyen Quoc Viet Hung, Hongzhi YinarXiv 2025 · OpenReview

Abstract

Large Language Model-based Time Series Forecasting (LLMTS) has shown remarkable promise in handling complex and diverse temporal data, representing a significant step toward foundation models for time series analysis. However, this emerging paradigm introduces two critical challenges. First, the substantial commercial potential and resource-intensive development raise urgent concerns about intellectual property (IP) protection. Second, their powerful time series forecasting capabilities may be misused to produce misleading or fabricated deepfake time series data. To address these concerns, we explore watermarking the outputs of LLMTS models, that is, embedding imperceptible signals into the generated time series data that remain detectable by specialized algorithms. We propose a novel post-hoc watermarking framework, Waltz, which is broadly compatible with existing LLMTS models. Waltz is inspired by the empirical observation that time series patch embeddings are rarely aligned with a specific set of LLM tokens, which we term "cold tokens". Leveraging this insight, Waltz embeds watermarks by rewiring the similarity statistics between patch embeddings and cold token embeddings, and detects watermarks using similarity z-scores. To minimize potential side effects, we introduce a similarity-based embedding position identification strategy and employ projected gradient descent to constrain the watermark noise within a defined boundary. Extensive experiments using two popular LLMTS models across seven benchmark datasets demonstrate that Waltz achieves high watermark detection accuracy with minimal impact on the quality of the generated time series.

Introduction: The Risks of LLM-based Forecasting

As Large Language Models (LLMs) are increasingly repurposed for time series forecasting, two major risks have emerged. First is the threat to Intellectual Property (IP): these models are resource-intensive to train, and malicious actors can "distill" a proprietary model's knowledge by querying its API and training a cheaper surrogate on the outputs. Second is the risk of misuse: powerful generative models can be used to create "deepfake" time series—such as fabricated stock market trends—to deceive investors or automated systems.

Motivation for watermarking LLMTS: IP protection and preventing misuse.

Existing watermarking techniques for text or images do not translate well to the continuous, numerical nature of time series. Furthermore, many existing methods require modifying the model during training, which is impractical for service providers using already-deployed, massive LLMs.

The Waltz Framework

Waltz is a post-hoc framework, meaning it acts on the model's output rather than requiring access to its internal weights or retraining. Its architecture strategically "rewires" time series patch embeddings to align with rarely used "cold tokens" in the LLM's vocabulary.

The Waltz framework overview, showing watermark insertion and detection modules.

The framework consists of three main steps:

  1. Cold Token-based Watermark Book: The researchers discovered that certain natural language tokens in an LLM's embedding space are rarely aligned with time series data. Waltz selects a set of these "cold tokens" to serve as a watermark book.
  2. Similarity-based Location Identification: Instead of modifying the entire forecast, Waltz identifies specific "patches" (segments) of the generated time series that are already somewhat close to the target cold tokens, minimizing the necessary noise.
  3. Projected Gradient Descent (PGD) Optimization: To ensure the watermark is invisible, Waltz uses PGD to add a tiny amount of additive noise to the selected patches. This noise is mathematically constrained to stay within a defined boundary, ensuring the forecast remains accurate while shifting the patch's embedding just enough to align with a cold token.

For detection, the system uses a z-score-based module to calculate how significantly the similarity between a time series and the "cold tokens" deviates from a normal, unwatermarked distribution.

Key Insights and Results

The most clever insight is leveraging the "empty space" in the LLM's vocabulary. Because cold tokens are naturally dissimilar to time series data, even a tiny shift in embedding space becomes statistically significant and easy to detect, like a whisper in a silent room.

Experimental Evaluation: The authors evaluated Waltz across seven real-world benchmarks (Energy, Weather, Finance) using two representative LLMTS backbones: TEMPO and UniTime.

  • High Detectability: Waltz achieved F1 scores for watermark detection that were consistently high (often >0.90), significantly outperforming baselines.
  • Minimal Impact on Accuracy: On the ETTh1 dataset, Waltz only increased the Mean Squared Error (MSE) by roughly 2%, whereas previous state-of-the-art methods caused a 14% drop.
  • Robustness: In distillation attacks, Waltz maintained strong traceability. If an attacker tries to steal the model by training a new model on watermarked outputs, the watermark signal transfers to the new model's outputs.

Conclusion and Future Work

Waltz represents a significant step toward securing LLM-based forecasting services. While highly effective, future work will explore extending the framework to multivariate correlations and investigating resilience against sophisticated adaptive attacks, such as those using denoising autoencoders.

Summary updated

BibTeX
@misc{yuan2025watermarking,
  author = {Wei Yuan and Chaoqun Yang and Yu Xing and Tong Chen and Nguyen Quoc Viet Hung and Hongzhi Yin},
  title = {{Watermarking Large Language Model-based Time Series Forecasting}},
  year = {2025},
  eprint = {2507.20762},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2507.20762},
}
Figure