sakutto
生成AI

準同型暗号でAI推論するGoogleのHEIRとは?仕組みと実証4例

準同型暗号Googleプライバシー
準同型暗号でAI推論するGoogleのHEIRとは?仕組みと実証4例

HEIRとは何か

HEIR(ヘア)とはGoogle が開発する準同型暗号向けのコンパイラです。構想の表明は2023年、成果がまとめて公開されたのが2026年8月14日のセキュリティブログでした。同社が「Private Computing Toolkit」と呼ぶプライバシー技術群に最新の道具として加わった格好です。ここでいう推論とは学習済みのAIモデルに入力を与えて答えを出させる処理を指します。

HEIRの基本情報

名称
Homomorphic Encryption Intermediate Representation
種別
オープンソースのコンパイラツールチェーン
できること
学習済みモデルを暗号化入力向けへ変換
目標
非専門家がワンクリックで組み込める状態

学習済みモデルを暗号化入力向けに変換する

HEIRは暗号化されていないデータ向けに学習させたAIモデルを、暗号化された入力で動く形へ変換できます。 コンパイラとは人が書いたプログラムを機械が実行できる形へ翻訳する道具のこと。HEIRはその翻訳先を「暗号文のまま計算できる形」に据えました。

なぜコンパイラを挟むのか。既存のプログラムを準同型暗号向けに効率よく書き換えるには暗号研究者のチームが要るからです。Googleはこの使いにくさこそ普及の壁だと見て、HEIRの開発に踏み切ったと説明しています。

公式情報を見る →
"HEIR (Homomorphic Encryption Intermediate Representation) is an open-source compiler toolchain and development platform for homomorphic encryption. In particular, HEIR can convert pre-trained AI models that operate on unencrypted data to operate on encrypted inputs."/"However, manually converting an existing program to use homomorphic encryption efficiently requires a team of cryptographers."/"Today we're excited to showcase HEIR, the latest powerful tool added to our Private Computing Toolkit."(いずれも About HEIR / Homomorphic encryption の節)— Google 公式ブログより

目標は「ワンクリックで組み込める」状態

Googleは非専門家が暗号化推論を本番アプリへ組み込める「ワンクリックの解決策」にすることをビジョンに掲げています。2023年に構想を表明して以来、準同型暗号のコミュニティはHEIRを受け入れてきたといいます。

裏を返せば現時点ではまだワンクリックではありません。公式が「ビジョン」という語を選んでいる以上、いま手を出すなら暗号の知識がある程度は要る段階です。

公式情報を見る →
"Our vision is to make HEIR a one-click solution to enable non-experts to incorporate encrypted inference into production applications."/"Since announcing our intentions in 2023, we've seen the homomorphic encryption community embrace HEIR."(いずれも About HEIR の節)— Google 公式ブログより

準同型暗号が解く「機能かプライバシーか」の二択

HEIRの値打ちは土台にある準同型暗号が何をできるようにするのかを押さえないと見えません。

端末内処理でもE2E暗号でも解けない問題

エンドツーエンド暗号はデータ漏洩から利用者を守りますが、その代わりに事業者はデータに依存する機能を出せなくなります。迷惑メール判定やウイルス検知が典型例です。医療や金融のように規制の厳しい分野ではこの制約がさらに重くのしかかります。

端末側で処理する案にも限界があります。端末の性能に縛られるうえ、独自のAIモデルを配ればモデル自体が流出しかねません。どちらの道も途中で行き止まる。それがこれまでの構図でした。手元でモデルを動かす選択肢そのものはローカルLLMでのコーディング実践にまとめています。

公式情報を見る →
"Standard protections like end-to-end encryption present a trade-off: user-data can be protected from data breaches, but then the service provider cannot provide features that depend on the data, such as spam or virus detection."/"Alternative mechanisms to provide the same features, like local processing, are limited by the capabilities of the local device and the sensitivity of the service provider's IP. Shipping proprietary AI to a device risks leaking the model."(いずれも Homomorphic encryption の節)— Google 公式ブログより

二択を「コストの問題」へ置き換える

準同型暗号は暗号化されたデータのまま計算できるため、この二択そのものが組み替わります。 サーバーは暗号文を処理し、暗号化された結果を返します。元の情報は一切露出しません。クラウド事業者が利用者の特徴量(好みや行動を数値化したデータ)を見ないままコンテンツ推薦を返すという芸当も成り立ちます。

争点は「できるかどうか」から「いくらかかるか」へ移りました。Googleも準同型暗号に無視できないコスト増があることは認めます。そのうえで機能とプライバシーの二択をコストの問題へ置き換えるものであり、そのコストは急速に下がっていると述べています。ハードウェアに頼る解決策と違い安全性の裏づけが純粋に暗号学的である点も強調しています。

公式情報を見る →
"A solution to these issues is homomorphic encryption, a rapidly maturing technology that fundamentally alters this trade-off by allowing computations to be performed directly on encrypted data. Servers can process ciphertexts and return encrypted results without exposing any underlying information."/"But while homomorphic encryption has a nontrivial cost overhead, it shifts the capability/privacy trade-off to a question of cost. And the cost of homomorphic encryption is rapidly decreasing."/"Like private information retrieval, and in contrast to hardware-based solutions, homomorphic encryption's strong security and privacy guarantees are purely cryptographic."(いずれも Homomorphic encryption の節)— Google 公式ブログより

HEIRで作られた4つの実証アプリ

抽象論で終わらせないためにGoogleはHEIRでコンパイルしたアプリを4件公開しています。

推薦・不正検知・侵入検知・音声

アプリ内容共同開発
深層学習レコメンド中身を見ずにコンテンツ推薦を返すBelfort Labs・LG・ニューヨーク大学
クレジットカード不正検知不正利用の判定Niobium・hardshell.ai
侵入検知(Kitsune)暗号化された通信の異常検知Niobium
ホットワード検知音声の起動ワード認識Belfort Labs

とりわけ分かりやすいのが侵入検知です。Kitsuneという異常検知システムをコンパイルしたことで、事業者はネットワークパケットの中身を見ないまま異常を検知できます。 ホットワード検知も同じ筋です。音声起動のAIエージェントが録音内容のプライバシーを保ったまま起動ワードを認識できるようになる見込みだとしています。

レイテンシ(応答が返るまでの時間)はいずれもシングルスレッドのCPUで測った数値です。ソースコードは4件ともGitHubリポジトリにあります。

公式情報を見る →
"Each application was compiled with HEIR, and latency numbers are presented for a single-threaded CPU. The source code for all examples is available in our GitHub repository."/"A Deep Learning Recommendation Model unlocks serving private content recommendations, joint work with Belfort Labs, LG, and New York University."/"Credit card fraud detection: Together with Niobium and hardshell.ai, we compiled a credit card fraud detector."/"Threat intrusion: Together with Niobium we compiled the Kitsune system for anomaly detection of encrypted network traffic. This allows a service provider to detect anomalies without revealing the contents of network packets to the service provider."/"Hotword Detector: Together with Belfort Labs we compiled a hotword detection model, which could allow an audio-triggered AI agent to recognize hotwords while protecting the privacy of the audio recordings."(いずれも Applications of HEIR の節)— Google 公式ブログより

専用ハードウェアとの連携が前提にある

Googleは準同型暗号向けのハードウェアアクセラレータを開発する企業と提携しています。Belfort(ベルフォート)・Niobium(ナイオビウム)・Cornami(コルナミ)・Optalysys(オプタリシス)の4社です。先の実証アプリはその成果でもあり、アクセラレータによるレイテンシ改善は近いうちに示す予定だとしています。

準同型暗号のコスト増は突き詰めれば計算資源の問題です。専用ハードウェアが伸びればコストが下がり、コストが下がれば使える場面が広がります。HEIRは生成先にアクセラレータを選べるコンパイラとしてその橋渡しに立ちます。

公式情報を見る →
"We have partnered with companies developing hardware accelerators for homomorphic encryption, including Belfort, Niobium, Cornami, and Optalysys. The fruits of those efforts are shown in our demos below, and we plan to demonstrate the latency benefits of these accelerators in the near future."(About HEIR の節)— Google 公式ブログより

HEIRを支える研究基盤と現在地

コンパイラであると同時にHEIRは研究の共通基盤としても回り始めています。

大学との共同研究と査読論文4本

HEIRの上に積めば暗号研究者は自分の最適化だけに集中でき、テストやベンチマーク、比較の土台は既存の基盤に任せられます。その結果ジョージア工科大学、カーネギーメロン大学、UCサンタバーバラ、イリノイ工科大学、パデュー大学、エディンバラ大学、清華大学などとの共同研究が生まれたとしています。

現時点で査読論文4本がHEIRの上で書かれ、準備中のものもあり、引用も多数集まっています。研究基盤として実績が積み上がるほどコンパイラの最適化はそのまま実装へ還ってきます。

公式情報を見る →
"By building on HEIR, cryptographers can focus on their specific optimization and use the existing infrastructure for testing, benchmarking, and comparisons. This has resulted in collaborations with Georgia Tech, Carnegie Mellon, UC Santa Barbara, Illinois Institute of Technology, Purdue, the University of Edinburgh, Tsinghua University, and others. To date, four peer-reviewed publications were built on HEIR, with more in preparation, and HEIR has accumulated numerous citations."(About HEIR の節)— Google 公式ブログより

実用化までの距離をどう見るか

プロジェクト公式サイトはHEIRを「完全準同型暗号(FHE)のためのコンパイラツールチェーン」と定義し、業界標準を目指すと掲げています。Pythonでプログラムを書き、どの型が秘密かを注釈すれば残りはHEIRがコンパイルする。そんな使い方を想定しています。目標にはOpenFHEやLattigo(ラティーゴ)といった標準的なFHEライブラリ、GPU・TPU・FPGA・専用ASICへのコード生成も並びます。

とはいえ実証アプリはどれもシングルスレッドCPUでの計測値が添えられている段階です。「暗号化したまま推論できる」ことと「業務システムに載る速度で動く」ことは別物で、現在地は前者にあります。

公式情報を見る →
"a compiler toolchain for fully homomorphic encryption (FHE)"/"be the industry-standard compiler for FHE"/"Write a program in Python, annotate the types to mark which are secret, and HEIR will compile the rest."/"Support code generation for standard FHE libraries, such as OpenFHE and Lattigo."/"Support code generation for FHE hardware accelerators, including GPU, TPU, FPGA, and custom ASICs"(いずれもトップページの概要・目標より)— HEIR 公式サイトより

HEIRが変えたのは暗号技術そのものではなく、それを使うまでの距離です。暗号研究者のチームが要ったプログラム変換をコンパイラの仕事へ移しました。実証アプリが推薦・不正検知・侵入検知・音声と、どれも「事業者がデータを見たいが見るべきでない」領域に寄っているのも示唆的です。

データを外へ出さずに扱う関心はモデルを自前で動かす動きとも地続きです。国や組織が自前の基盤を持つ流れはApertusの解説、生成物の出どころを記録する側の動きはClaudeの電子透かしで扱っています。

準同型暗号を採るかどうかは技術的な可否ではなく支払えるコストかどうかの判断に変わりつつあります。 その判断が現実的になる時期はハードウェアの伸び次第です。

今回のように英語の技術ブログと公式ドキュメントを行き来して読むときは、構造を保ったまま手元に置いておくと後から参照しやすくなります。

無料ツールURLマークダウン変換URL(ウェブページ)を入力するだけでマークダウン(Markdown)に変換。見出し・表・リスト・リンクを保持したままmd化でき、LLMやRAGの前処理、調査資料の整形にも最適な無料オンラインツール。今すぐ使ってみる →

よくある質問

Q. HEIRは何の略で、何をするものですか?
Homomorphic Encryption Intermediate Representation の略で、準同型暗号のためのオープンソースのコンパイラツールチェーン兼開発基盤です。暗号化されていないデータ向けに学習済みのAIモデルを、暗号化された入力で動くよう変換できます。
Google — How Google is Making Private AI Practical with Homomorphic Encryption
HEIR (Homomorphic Encryption Intermediate Representation) is an open-source compiler toolchain and development platform for homomorphic encryption. In particular, HEIR can convert pre-trained AI models that operate on unencrypted data to operate on encrypted inputs. Google — How Google is Making Private AI Practical with Homomorphic Encryption
Q. 準同型暗号を使うと処理は重くなりませんか?
重くなります。ただしGoogleは、準同型暗号には無視できないコスト増があるものの、機能とプライバシーの二択をコストの問題へ置き換えるものであり、そのコストは急速に下がっていると説明しています。
Google — How Google is Making Private AI Practical with Homomorphic Encryption
But while homomorphic encryption has a nontrivial cost overhead, it shifts the capability/privacy trade-off to a question of cost. And the cost of homomorphic encryption is rapidly decreasing. Google — How Google is Making Private AI Practical with Homomorphic Encryption
Q. HEIRはどんな用途で実証されていますか?
4つの実証アプリが公開されています。プライベートな推薦を行う深層学習レコメンドモデル、クレジットカード不正検知、暗号化されたネットワーク通信の異常検知(Kitsune)、そして音声のホットワード検知です。
Google — How Google is Making Private AI Practical with Homomorphic Encryption
A Deep Learning Recommendation Model unlocks serving private content recommendations, joint work with Belfort Labs, LG, and New York University. / Credit card fraud detection: Together with Niobium and hardshell.ai, we compiled a credit card fraud detector. / Threat intrusion: Together with Niobium we compiled the Kitsune system for anomaly detection of encrypted network traffic. / Hotword Detector: Together with Belfort Labs we compiled a hotword detection model, which could allow an audio-triggered AI agent to recognize hotwords while protecting the privacy of the audio recordings. Google — How Google is Making Private AI Practical with Homomorphic Encryption
Q. HEIRは専門家でなくても使えますか?
まだ目標段階です。Googleは非専門家が暗号化推論を本番アプリへ組み込める「ワンクリックの解決策」にすることをビジョンとして掲げており、現時点ではそこへ向かう途中だと位置づけています。
Google — How Google is Making Private AI Practical with Homomorphic Encryption
Our vision is to make HEIR a one-click solution to enable non-experts to incorporate encrypted inference into production applications. Google — How Google is Making Private AI Practical with Homomorphic Encryption

関連ツール

関連ツールカテゴリ

記事