Performance-Lossless Black-Box Model Watermarking

Na Zhao, Kejiang Chen, Weiming Zhang, Nenghai Yu

Abstract

Protecting the intellectual property (IP) of large-scale deep learning models is a critical challenge in the era of Model-as-a-Service (MaaS). Traditional black-box watermarking techniques often rely on backdoor training, which inevitably degrades primary task performance and lacks formal security guarantees. This paper presents BranchWM, a novel watermarking protocol that achieves zero performance degradation by decoupling the forensic verification task from the model's inference logic. By utilizing cryptographic Message Authentication Codes (MACs) within a parallel API branch, BranchWM provides a stealthy, efficient, and mathematically provable solution for model ownership verification.

Introduction

The immense computational cost associated with training state-of-the-art models, such as Large Language Models (LLMs), has transformed them into high-value assets. To prevent unauthorized redistribution or deceptive service provision, researchers have turned to watermarking—embedding hidden signals to prove ownership.

However, existing black-box methods typically employ "backdoor training," where a model is retrained to produce specific outputs for "trigger" inputs. This approach suffers from two primary drawbacks:

  1. Performance Degradation: The secondary watermarking task often interferes with the model's primary accuracy.
  2. Heuristic Security: It is difficult to prove that these watermarks are robust against sophisticated attacks or won't cause unintended behavior on edge cases.

Proposed Methodology: The BranchWM Protocol

BranchWM addresses these limitations by moving the watermark out of the model's weights and into a parallel logic layer within the serving API. This architectural shift ensures that the model's parameters remain untouched, guaranteeing that performance is preserved for all legitimate users.

The BranchWM architecture consists of an Outer Module for the verifier and an Inner Module deployed within the model API.

Architectural Components

  • Parallel Branching: The API maintains two distinct states. The Service State executes the original, unmodified model for standard queries. The Forensic State is activated only when a specific, cryptographically verified trigger is detected.
  • MAC-based Unaccessible and Fast Trigger (MUFT): To ensure triggers are unforgeable, BranchWM utilizes a Message Authentication Code (MAC) with "Existential Unforgeability under Chosen Message Attack" (EUF-CMA). This ensures that without the secret key, the probability of a user accidentally or maliciously triggering the forensic state is computationally negligible.
  • Concealed Embedding: To maintain stealth, triggers are embedded into natural-sounding text using a "greenlist" approach. This prevents attackers from using perplexity-based filters to identify and scrub potential watermarks from incoming traffic.

Efficiency and Performance

A key advantage of BranchWM is its computational efficiency. By opting for symmetric MACs over asymmetric digital signatures (like ECDSA), the protocol minimizes latency overhead in high-throughput production environments.

Comparison of runtime costs shows that MAC-based methods are nearly as fast as simple hashes and orders of magnitude faster than digital signatures.

As shown in the performance analysis, the HMAC_SHA512 implementation adds negligible overhead (a time rate of ~1.2x compared to a simple SHA512 hash), whereas asymmetric signatures like ECDSA are over 60 times slower. This efficiency makes BranchWM viable for real-time API services.

Experimental Validation

The authors evaluated BranchWM using the OPT-1.3B language model and the ROCStories dataset. The results confirmed:

  • Zero Performance Loss: Because the primary inference path is untouched, the model maintains 100% of its original accuracy.
  • High Stealth: Triggers generated via the "Concealed TriggerGen" algorithm maintain high semantic readability, making them difficult to detect via automated machine-text detectors.

Discussion and Limitations

While BranchWM effectively protects the API service, it faces challenges regarding Model Extraction. If an attacker distills the model's knowledge into a local copy, the API-level branch watermark will not be present in the stolen model. Furthermore, cryptographic triggers require a minimum bit-length to remain secure, making the protocol better suited for long-form text generation than for short, single-word completions. Future work aims to mitigate replay attacks by incorporating temporal metadata into the evidence generation process.

Conclusion

BranchWM represents a significant step forward in model IP protection. By shifting from parameter-level modifications to an architectural branching strategy, it provides a robust, efficient, and performance-lossless framework for verifying model ownership in the MaaS ecosystem.

Summary updated

Abstract

With the development of deep learning, high-value and high-cost models have become valuable assets, and related intellectual property protection technologies have become a hot topic. However, existing model watermarking work in black-box scenarios originates mainly from training-based backdoor methods, which probably degrade primary task performance. To address this, we propose a branch backdoor-based model watermarking protocol named BranchWM to protect the intellectual property of the model. This protocol adopts a construction based on a message authentication scheme as the branch indicator, following a comparative analysis with other secure cryptographic primitives. We prove the lossless performance of the protocol by reduction. In addition, we analyze potential threats to the protocol and present a secure and feasible watermarking instantiation for language models. We further conduct empirical evaluations of the instantiated BranchWM, demonstrating its effectiveness and security for ownership verification.
BibTeX
@misc{zhao2023performance,
  author = {Na Zhao and Kejiang Chen and Weiming Zhang and Nenghai Yu},
  title = {{Performance-Lossless Black-Box Model Watermarking}},
  year = {2023},
  eprint = {2312.06488},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2312.06488},
}
Figure