準同型暗号で暗号化したままAI推論を実行する、GoogleのHEIR

GoogleのHEIRは暗号化したままAI推論を実行

HEIRは暗号化されていないデータ向けに学習したAIモデルを、暗号化された入力で動作するモデルへ変換するオープンソースのコンパイラです。 Googleの公式セキュリティブログ(2026年8月14日)によると、HEIRはPrivate Computing Toolkitに加わった最新のツールとのこと。

ここでいう推論とは、学習済みのAIモデルに入力を与えて回答を出力させる処理です。コンパイラは、人が書いたプログラムを機械が実行できる命令列へ翻訳するソフトウェアを指します。

Googleは2023年に意図を表明して以来、準同型暗号のコミュニティがHEIRを受け入れてきたと公式ブログで述べています。HEIRの公式サイトはHEIRを完全準同型暗号(FHE)のコンパイラツールチェーンと説明し、FHEで業界標準となるコンパイラを目指すとしています。

HEIRの基本情報

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

Googleの研究者とエンジニアがHEIRを作ったのは、準同型暗号の使いにくさを乗り越えるためです。既存のプログラムを準同型暗号で効率よく動作するプログラムへ手作業で変換するには、暗号研究者のチームが必要だとブログは指摘しています。

Googleが掲げるビジョンは非専門家が暗号化した推論を本番アプリへ組み込めるよう、HEIRをワンクリックの解決策にすることです。Googleは実現時期を公式ブログで明らかにしていません。

"Today we're excited to showcase HEIR, the latest powerful tool added to our Private Computing Toolkit. HEIR is an open source compiler that unlocks cryptographically-secure private AI inference."/"However, manually converting an existing program to use homomorphic encryption efficiently requires a team of cryptographers."/"To overcome the usability challenges and advance the opportunity homomorphic encryption provides, researchers and engineers at Google built the HEIR compiler project. 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. 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."(冒頭・Homomorphic encryption・About HEIR の節)— Google 公式ブログより
公式情報を見る →
"HEIR is a compiler toolchain for fully homomorphic encryption (FHE). We aim to be the industry-standard compiler for FHE."(What is HEIR? の節)— HEIR 公式サイトより
公式情報を見る →

AIのプライバシーか機能かの二択はFHEでコストの問題になる

Googleは、エンドツーエンド暗号がユーザーを守る代わりに事業者がデータに依存する機能を出せなくなる二択を生み、準同型暗号はこの二択をコストの問題へ置き換えるとしています。 エンドツーエンド暗号では、データ漏えいからユーザーを守れる一方で、事業者は迷惑メール判定やウイルス検知のようにデータに依存する機能を出せません。

医療や金融の分野は、データ漏えいのリスクにさらに慎重です。機関をまたぐデータ共有も、厳しい規制で制限されているとのこと。

デバイス内で処理する代替策にも限界があり、デバイスの性能と提供側が持つ知的財産の機密性に縛られ、独自のAIをデバイスへ配布するとモデルが流出する恐れがあるとGoogleは指摘しています。M2 Macで動作させるローカルLLMもデバイス側で処理する仕組みです。

準同型暗号は、暗号化されたデータの上で直接計算できる技術です。サーバーは暗号文(暗号化されたデータ)のまま処理して結果も暗号文で出力するので、元の情報を目にすることがありません。FHEは完全準同型暗号の略称で、HEIRの公式サイトはこの方式を対象にしています。

例えばクラウドサービスは、ユーザーの特徴量(好みや行動を数値化したデータ)を見ないままコンテンツ推薦を返せます。ブログで紹介する実証の1つは、この推薦をそのとおり実行するものだとGoogleは書いています。

Googleは準同型暗号でコストがかなり増えることを認めたうえで、機能とプライバシーの二択をコストの問題へ置き換えるものであり、そのコストは急速に下がっているとしています。また安全性とプライバシーの保証が純粋に暗号学的であることは、ハードウェアに頼る解決策と異なるとも述べています。

"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. Critical sectors like healthcare and finance are even more averse to these risks, and strict regulations limit data sharing across institutions. 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."/"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. For example, a cloud service can provide content recommendations without being able to see the user's features. This is no exaggeration: one of the demos featured in this post does exactly this. 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つを、すべてソースコード付きでGitHubリポジトリに公開しています。 記載された遅延(応答が出力されるまでの時間)の数値は、いずれもシングルスレッドCPUで測ったものです。

アプリ 内容 共同開発
深層学習レコメンドモデル プライベートなコンテンツ推薦 Belfort Labs・LG・ニューヨーク大学
クレジットカード不正検知 不正検知器のコンパイル Niobium・hardshell.ai
侵入検知(Kitsune) 暗号化されたネットワーク通信の異常検知 Niobium
ホットワード検知 音声の起動ワード認識 Belfort Labs

ホットワード検知でコンパイルしたのは、AIエージェントを音声で起動する呼びかけの言葉(ホットワード)を見分けるモデルです。Googleによるとこのモデルがあれば、AIエージェントは録音のプライバシーを守ったままホットワードを認識できる可能性があるとのこと。侵入検知ではKitsuneという異常検知システムをコンパイルしており、サービス提供者はネットワークパケットの中身を見ないまま異常を検知できます。

Googleは、準同型暗号向けのハードウェアアクセラレータ(特定の計算を専用に処理する装置)を開発する企業と提携しています。提携先にはBelfort・Niobium・Cornami・Optalysysが含まれ、実証アプリはその成果でもあるとのこと。アクセラレータによる遅延の改善は、近いうちに実演する予定だとブログは書いています。

HEIRはハードウェア設計者向けに、コード生成を組み込める抽象化レイヤを複数用意しています。bootstrapのような高水準のFHE演算を実装するアクセラレータも、低水準の多項式演算を処理するアクセラレータも対象になります。

"To demonstrate how far homomorphic encryption has come, we’re sharing four private inference applications. 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."/"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・Applications of HEIR の節)— Google 公式ブログより
公式情報を見る →
"For hardware designers, HEIR provides multiple layers of abstraction at which to integrate code generation. This allows HEIR to support code generation for hardware accelerators that implement high-level FHE operations like bootstrap, as well as accelerators that operate at lower-level polynomial arithmetic."(Why HEIR? の節)— HEIR 公式サイトより
公式情報を見る →

FHEの研究基盤として回りOpenFHEなどへの出力を目標に掲げる

HEIRを使って査読論文4本が書かれた研究基盤でもあり、OpenFHEなど標準ライブラリ向けの出力を公式サイトは目標に掲げています。 HEIRの上に積めば暗号研究者はご自身の最適化に集中でき、テスト・ベンチマーク・比較には既存の基盤を使うことができるとブログは書いています。

この結果としてジョージア工科大やカーネギーメロン大、清華大など7校以上との共同研究が生まれたとGoogleは書いています。準備中の論文もありHEIRには多数の引用が集まっているとのこと。公式サイトのプロジェクト目標は次のとおりです。

  • 高水準のプログラムを暗号化版へコンパイルする
  • 現代的なFHE方式をすべて支える
  • GPU・TPU・FPGA・専用ASICなど、アクセラレータ向けのコード生成を支える
  • OpenFHEとLattigoなど、標準のFHEライブラリ向けのコード生成を支える
  • PythonやTorchのようなフロントエンド言語を支える

アプリ開発者向けにはPythonでプログラムを書いてどの型が秘密かを注釈すれば、残りはHEIRがコンパイルするという使い方を目指しています。公式サイトの説明ではコードベースとドキュメントはGoogleが保守しており、貢献はGitHubのissue・ドキュメントの改善・定例の作業部会などで受け付けています。

"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 公式ブログより
公式情報を見る →
"Write a program in Python, annotate the types to mark which are secret, and HEIR will compile the rest."/"Compile high level programs to encrypted equivalents."/"Support all modern FHE schemes."/"Support code generation for FHE hardware accelerators, including GPU, TPU, FPGA, and custom ASICs."/"Support code generation for standard FHE libraries, such as OpenFHE and Lattigo."/"Support front-end languages for ease of development, such as Python and Torch."/"The HEIR codebase and documentation are maintained by Google."/"Discussing project proposals and designs on HEIR’s issues page."/"Improving or expanding HEIR’s documentation."/"Discussing project direction at HEIR’s regular working group meetings and office hours."(Why HEIR?・Project Goals・Contributing to HEIR・Disclaimers の節)— HEIR 公式サイトより
公式情報を見る →

HEIRは推論の実証を4つ公開した研究段階のコンパイラ

HEIRはGoogleが開発したオープンソースのコンパイラで、暗号化されていないデータ向けの学習済みAIモデルを、暗号化された入力で動作するモデルへ変換します。 準同型暗号による推論の実証は4つ公開されており、非専門家がワンクリックで使うことができる状態はGoogleが掲げるビジョンで、実現時期はGoogleがまだ公表していません。

Googleの研究チームは準同型暗号を「開発しやすく・速く動き・産業界に行き渡る」ものにするために取り組んでいると、ブログは目標として書いています。現状の達成度は公表されていません。

"As the software industry adapts to security and privacy changes amid AI, our research team is working to make homomorphic encryption, easy to develop, fast to run, and ubiquitous across industry."(末尾の段落)— Google 公式ブログより
公式情報を見る →

FAQ

HEIRは何の略で何をするものですか?
Homomorphic Encryption Intermediate Representationの略で、準同型暗号のためのオープンソースのコンパイラツールチェーン兼開発基盤です。暗号化されていないデータ向けに学習済みのAIモデルを、暗号化された入力で動作するよう変換できます。
準同型暗号を使うと処理は重くなりませんか?
重くなります。Googleは準同型暗号に無視できないコスト増があると認めたうえで、機能とプライバシーの二択をコストの問題へ置き換えるものであり、そのコストは急速に下がっているとしています。
HEIRはどんな用途で実証されていますか?
4つの実証アプリが公開されています。プライベートな推薦を行う深層学習レコメンドモデル、クレジットカード不正検知、暗号化されたネットワーク通信の異常検知(Kitsune)、音声のホットワード検知です。
HEIRは専門家でなくても使えますか?
Googleは非専門家が暗号化した推論を本番アプリへ組み込める「ワンクリックの解決策」にすることを、ビジョンとして掲げています。Googleは現時点の到達度や実現時期を公式ブログで明らかにしていません。