Skip to main content
QUICK REVIEW

[論文レビュー] CodeIP: A Grammar-Guided Multi-Bit Watermark for Large Language Models of Code

Batu Guan, Yao Wan|arXiv (Cornell University)|Apr 24, 2024
Advanced Steganography and Watermarking TechniquesComputer Science被引用数 3
ひとこと要約

CodeIP は、型予測子を用いてトークン生成をガイドすることで、意味を保ちつつ水増しを埋め込む文法に配慮したマルチビット水 Stamper 技術である。5つのプログラミング言語で平均 0.95 の高い水 Stamper 抽出率を達成しながら、コードの有用性と意味的正しさを維持する。

ABSTRACT

Large Language Models (LLMs) have achieved remarkable progress in code generation. It now becomes crucial to identify whether the code is AI-generated and to determine the specific model used, particularly for purposes such as protecting Intellectual Property (IP) in industry and preventing cheating in programming exercises. To this end, several attempts have been made to insert watermarks into machine-generated code. However, existing approaches are limited to inserting only a single bit of information. In this paper, we introduce CodeIP, a novel multi-bit watermarking technique that inserts additional information to preserve crucial provenance details, such as the vendor ID of an LLM, thereby safeguarding the IPs of LLMs in code generation. Furthermore, to ensure the syntactical correctness of the generated code, we propose constraining the sampling process for predicting the next token by training a type predictor. Experiments conducted on a real-world dataset across five programming languages demonstrate the effectiveness of CodeIP in watermarking LLMs for code generation while maintaining the syntactical correctness of code.

研究の動機と目的

  • 意味的正しさを保ちつつ、柔軟でマルチビットの水 Stamper 解決策が不足している LLM が生成するコードに対する課題に対処すること。
  • コード生成中に文法に配慮したトークン予測を統合することで、水 Stamper の耐性と多様性を向上させること。
  • 知的財産保護および学術的誠実性の観点から、AI が生成したコードを信頼性高く識別できるようにすること。
  • 検出可能または意味的に破壊的な単一ビットまたはハード水 Stamper 方法の限界を克服すること。
  • モデルベンダIDなどの検証可能なマルチビットメッセージを埋め込む際、コードの機能を変更せずに高いコードの有用性を維持すること。

提案手法

  • 次のトークンの文法的カテゴリ(例:キーワード、識別子)を予測する型予測子を訓練し、水 Stamper 埋め込みプロセスをガイドする。
  • 埋め込みは、事前に定義されたハッシュ関数とランダムシードに基づいて、候補トークンのロジット確率を操作することでデコード中に実行される。
  • 文法制約は、予測された文法タイプに適合するトークンを優先するようにサンプリング分布を変更することで強制される。
  • 水 Stamper はコード生成中にリアルタイムで埋め込まれ、モデルの出力への影響を最小限に抑える。
  • マルチビットメッセージ(例:'GPT' の ASCII)は、目に見えるパターンを避けるソフト水 Stamper 戦略を用いて符号化され、埋め込まれる。
  • 水 Stamper は LLM の推論パイプラインに直接統合され、シームレスな展開が可能になる。
Figure 1: CodeIP can seamlessly embed multi-bit messages into LLMs while preserving the utility of the underlying code. “ 718084 ” is the ASCII value for “ GPT ”.
Figure 1: CodeIP can seamlessly embed multi-bit messages into LLMs while preserving the utility of the underlying code. “ 718084 ” is the ASCII value for “ GPT ”.

実験結果

リサーチクエスチョン

  • RQ1文法に配慮したアプローチは、LLM が生成する水 Stamper を施したコードの意味的正しさを向上させることができるか?
  • RQ2CodeIP は、多様なプログラミング言語にわたり、コードの有用性を保ちながらマルチビット水 Stamper を効果的に抽出できるか?
  • RQ3文法予測の統合は、クロッピングやオブスクリューションなどの一般的な攻撃に対して水 Stamper の耐性を高めるか?
  • RQ4抽出精度と意味的整合性の観点から、CodeIP は単一ビットまたはハード水 Stamper 方法と比較して優れているか?
  • RQ5CodeIP は、機能を変更せずに、生成されたコードに識別可能なモデル情報(例:ベンダID)を信頼性高く埋め込むことができるか?

主な発見

  • CodeIP は 5 つのプログラミング言語で平均 0.95 の水 Stamper 抽出率を達成し、高い信頼性を示している。
  • CodeBLEU メトリクスにおける全言語で一貫したパフォーマンスから、高い意味的正しさが裏付けられている。
  • 文法予測の統合により、トークン選択の正確性が顕著に向上した — 例として、キーワード文脈で ':' の代わりに 'in' を正しく予測した。
  • CodeIP はクロップ攻撃に対しても耐性を示し、部分的な入力の切り詰めに対しても高い抽出性能を維持している。
  • 変動する長さのメッセージ挿入に対しても水 Stamper は強固であり、さまざまなメッセージ長さで高い抽出精度を示している。
  • 特に複雑なコード構造においても、意味的整合性と水 Stamper 抽出率の両面でベースライン手法を上回っている。
Figure 2: An overview of our proposed CodeIP .
Figure 2: An overview of our proposed CodeIP .

この論文を読む

Nubintのビューアで原文を開き、読みながら気になる箇所をすぐに質問できます。

Nubintでこの論文を読む

このレビューはAIが論文の原文をもとに作成しました。引用する前に原文をご確認ください。