{
  "id": "2024/1881",
  "url": "https://opencryptology.org/2024/1881",
  "original_url": "https://eprint.iacr.org/2024/1881",
  "title": "THOR: Secure Transformer Inference with Homomorphic Encryption",
  "authors": [
    "Jungho Moon",
    "Dongwoo Yoo",
    "Xiaoqian Jiang",
    "Miran Kim"
  ],
  "affiliations": null,
  "abstract": "As large language models are increasingly deployed in cloud environments, privacy concerns have become a significant issue. To address this challenge, we present THOR, a non-interactive framework for secure transformer inference using homomorphic encryption. We first propose efficient matrix multiplication algorithms based on diagonal-major encoding and compact ciphertext packing. We extend these basic algorithms to support plaintext-ciphertext matrix multiplication (PC-MM) using parallel submatrix computation and ciphertext-ciphertext multiplication (CC-MM) with a baby-step giant-step strategy. We also design efficient evaluation strategies for non-linear functions such as softmax, LayerNorm, GELU, and Tanh, by integrating advanced approximation techniques with adaptive iterative methods. Our matrix multiplication algorithms outperform state-of-the-art methods, achieving up to 5.3$\\times$ speedup in PC-MM for $\\mathbb{R}^{768\\times 768}\\times \\mathbb{R}^{768\\times 128}$ over BOLT (Pang et al., IEEE S&P 2024) and 9.7$\\times$ in CC-MM for $12\\times (\\mathbb{R}^{64\\times 128}\\times \\mathbb{R}^{128\\times 128})$ over Powerformer (Park et al., Preprint). THOR enables secure inference on the BERT-base model with 128 tokens in 10 minutes on a single GPU, while maintaining comparable accuracy on GLUE tasks.",
  "category": "Cryptographic protocols",
  "license": {
    "code": "CC BY",
    "url": "https://creativecommons.org/licenses/by/4.0/",
    "label": "CC BY 4.0",
    "attribution": "“THOR: Secure Transformer Inference with Homomorphic Encryption” by Jungho Moon, Dongwoo Yoo, Xiaoqian Jiang, Miran Kim, Cryptology ePrint Archive, Paper 2024/1881, https://eprint.iacr.org/2024/1881. Licensed under CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/).",
    "retroactive": false,
    "redistribute_verbatim_only": false,
    "non_commercial": false
  },
  "dates": {
    "submitted": "2024-11-19T02:59:44Z",
    "updated": "2025-09-12T05:41:41Z",
    "withdrawn": null
  },
  "withdrawn": false,
  "withdrawn_on": null,
  "pdf": {
    "url": "https://opencryptology.org/2024/1881.pdf",
    "sha256": "ddb57004b56ee8e00beffc4f563fd0921242753fda6c704065d4900b792439cd",
    "size": 2109310,
    "source": "github-mirror",
    "source_date": "2026-04-28T17:20:00Z",
    "maybe_stale": false,
    "newer_on_eprint": null,
    "eprint_size": null,
    "withdrawn": false
  },
  "versions": [
    {
      "url": "https://opencryptology.org/2024/1881/versions/20260428T172000Z.pdf",
      "captured_at": "2026-04-28T17:20:00Z",
      "label": "copy captured 2026-04-28",
      "source": "github-mirror",
      "source_url": "https://raw.githubusercontent.com/arturo-kong/IACR-eprint-mirror/master/2024/1881.pdf",
      "size": 2109310,
      "sha256": "ddb57004b56ee8e00beffc4f563fd0921242753fda6c704065d4900b792439cd",
      "is_default_pdf": true
    },
    {
      "url": "https://opencryptology.org/2024/1881/versions/20241122T050151Z.pdf",
      "captured_at": "2024-11-22T05:01:51Z",
      "label": "copy captured 2024-11-22",
      "source": "wayback",
      "source_url": "https://web.archive.org/web/20241122050151id_/https://eprint.iacr.org/2024/1881.pdf",
      "size": 1235888,
      "sha256": "de4f141d163635c425497d24a1285a5eb231f7252ee34d9590392b0539d7f4e3",
      "is_default_pdf": false
    }
  ],
  "other_sources": [
    {
      "kind": "github-mirror",
      "url": "https://raw.githubusercontent.com/arturo-kong/IACR-eprint-mirror/master/2024/1881.pdf",
      "captured_at": "2026-04-28T17:20:00Z",
      "size": 2109310
    },
    {
      "kind": "wayback",
      "url": "https://web.archive.org/web/20260104052525id_/https://eprint.iacr.org/2024/1881.pdf",
      "captured_at": "2026-01-04T05:25:25Z",
      "size": 2024980
    }
  ],
  "bibtex": "@misc{cryptoeprint:2024/1881,\n      author = {Jungho Moon and Dongwoo Yoo and Xiaoqian Jiang and Miran Kim},\n      title = {THOR: Secure Transformer Inference with Homomorphic Encryption},\n      howpublished = {Cryptology {ePrint} Archive, Paper 2024/1881},\n      year = {2024},\n      url = {https://eprint.iacr.org/2024/1881}\n}"
}
