fhe-privacy-preserving-llm

star 2

Fully Homomorphic Encryption (FHE) patterns for privacy-preserving LLM inference. Covers lattice-based cryptography (LWE/RLWE), FHE scheme selection (BFV, BGV, CKKS), and techniques for running large models on encrypted data. Based on implementation of FHE on Llama 3 for secure computation. Use when: building privacy-preserving AI inference systems, implementing homomorphic encryption for ML models, or designing secure computation pipelines for sensitive data. arXiv: 2604.12168

hiyenwong By hiyenwong schedule Updated 6/3/2026

name: fhe-privacy-preserving-llm description: > Fully Homomorphic Encryption (FHE) patterns for privacy-preserving LLM inference. Covers lattice-based cryptography (LWE/RLWE), FHE scheme selection (BFV, BGV, CKKS), and techniques for running large models on encrypted data. Based on implementation of FHE on Llama 3 for secure computation. Use when: building privacy-preserving AI inference systems, implementing homomorphic encryption for ML models, or designing secure computation pipelines for sensitive data. arXiv: 2604.12168

Fully Homomorphic Encryption for Privacy-Preserving LLM Inference

FHE patterns and methodologies for secure LLM inference on encrypted data.

Core Architecture

FHE Scheme Selection

  • BFV/BGV: Integer arithmetic, exact computation
  • CKKS: Approximate arithmetic, floating-point support
  • TFHE: Boolean logic, gate-level operations

LLM-FHE Integration Patterns

  1. Weight encryption: Encrypt model weights, compute on plaintext input
  2. Input encryption: Encrypt user input, compute with plaintext weights
  3. Hybrid approach: Selective encryption for sensitive layers only

Performance Optimization

  • SIMD batching for parallel computation
  • Bootstrapping strategies for depth management
  • Approximate activation functions compatible with FHE

Implementation Workflow

  1. Choose FHE scheme based on computation type
  2. Quantize model weights for FHE compatibility
  3. Implement encrypted matrix multiplication kernels
  4. Design bootstrapping schedule for deep networks
  5. Benchmark latency and accuracy trade-offs

Key References

  • arXiv:2604.12168 - Fully Homomorphic Encryption on Llama 3 model for privacy preserving LLM inference
  • Lattice-based cryptography foundations (LWE, RLWE assumptions)

Activation Keywords

  • fully homomorphic encryption
  • FHE LLM inference
  • privacy preserving ML
  • homomorphic encryption AI
  • encrypted model inference
  • lattice cryptography
  • 全同态加密
  • secure computation LLM
Install via CLI
npx skills add https://github.com/hiyenwong/ai_collection --skill fhe-privacy-preserving-llm
Repository Details
star Stars 2
call_split Forks 0
navigation Branch main
article Path SKILL.md
More from Creator