Litcius/Paper detail

Transformer-based Language Models and Homomorphic Encryption: An Intersection with BERT-tiny

Lorenzo Rovida, Alberto Leporati

202417 citationsDOIOpen Access PDF

Abstract

In recent years, emerging and improved Natural Language Processing (NLP) models, such as Bidirectional Encoder Representations from Transformers (BERT), have gained significant attention due to their performance on several natural language tasks. However, inappropriate focus is usually given to the critical problems of security and data privacy, since these models require access to plain data. To address these issues, we suggest a solution based on Fully Homomorphic Encryption (FHE), which allows for computations to be performed on encrypted data. In particular, we propose a FHE-based circuit that, by implementing the smallest existent BERT model, namely BERT-tiny, enables the extraction of encrypted sentences representations and encrypted text classifications. Considering the nature and the depth of this circuit, we used the Cheon-Kim-Kim-Song (CKKS) scheme, along with the bootstrapping operation. We also propose to use precomputations for the Layer Normalization, in order to lighten computations. The experiments, which can be replicated using our open-source code, are conducted on the Stanford Sentiment Treebank (SST-2) dataset. They show that errors introduced by precomputed Layer Normalizaion, approximate FHE operations and polynomial approximations do not produce a significant performance loss.

Topics & Concepts

Homomorphic encryptionComputer scienceIntersection (aeronautics)EncryptionComputer networkTransformerComputer securityTheoretical computer scienceEngineeringElectrical engineeringVoltageAerospace engineeringCryptography and Data SecuritySpam and Phishing DetectionInternet Traffic Analysis and Secure E-voting