Abstract
Long Short-Term Memory (LSTM) is a Neural Network (NN) type that creates temporal connections between its nodes. It models sequence data for applications such as speech recognition, image captioning, DNA sequence analysis, and sentence translation. Applications that are often subject to privacy constraints. This paper thus presents basic building blocks for the homomorphic execution of an LSTM that would respect the privacy of its inputs. By means of TFHE functional bootstrapping, we propose several approaches for homomorphically evaluating discretized flavors of the Sigmoid and Tanh activation functions. Experimental results show that the accuracy of the resulting discretized networks remains comparable to a full precision clear-domain execution. Performance-wise, we are able to homomorphically compute a Sigmoid or Tanh function in 0.3 or 0.15 s (depending on whether or not multivalue bootstrapping is relied on). This paves the way towards evaluating practical LSTMs over encrypted inputs in around 1 to 3 min which is competitive with the state of the art.
This work was supported by the France 2030 ANR Project ANR-22-PECY-003 SecureCompute.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
Note that, in principle, floating point functions can be performed by means of homomorphic computations (e.g. by running their boolean circuit representations over an FHE with \(\mathbb {Z}_2\) as plain domain). In practice, however, such an approach induces prohibitive computational costs.
- 2.
GRU units are a simple version of LSTM ones. They also rely on Tanh and Sigmoid for computing memory cells and activations. However, they cannot manage very long dependencies.
- 3.
- 4.
https://tfhe.github.io/tfhe/ (v1.0.1-36-gbc71bfa).
References
Aharoni, E., et al.: Tile tensors: a versatile data structure with descriptive shapes for homomorphic encryption. CoRR abs/2011.01805 (2020). arXiv:2011.01805
Bourse, F., Minelli, M., Minihold, M., Paillier, P.: Fast homomorphic evaluation of deep discretized neural networks. Technical Report Report 2017/1114, IACR Cryptology ePrint Archive (2017). https://hal.science/hal-01665330
Brakerski, Z.: Fully homomorphic encryption without modulus switching from classical GapSVP. In: Safavi-Naini, R., Canetti, R. (eds.) Advances in Cryptology - CRYPTO 2012, pp. 868–886. Springer, Berlin (2012). https://doi.org/10.1007/978-3-642-32009-5_50
Brakerski, Z., Gentry, C., Vaikuntanathan, V.: (Leveled) fully homomorphic encryption without bootstrapping. In: Proceedings of the 3rd Innovations in Theoretical Computer Science Conference, pp. 309–325. ITCS ’12, Association for Computing Machinery, New York, NY, USA (2012). https://doi.org/10.1145/2090236.2090262
Carpov, S., Izabachène, M., Mollimard, V.: New techniques for multi-value input homomorphic evaluation and applications. Cryptology ePrint Archive, Paper 2018/622 (2018). https://eprint.iacr.org/2018/622
Chabanne, H., Lescuyer, R., Milgram, J., Morel, C., Prouff, E.: Recognition over encrypted faces: 4th International Conference, MSPN 2018, Paris (2019)
Chabanne, H., de Wargny, A., Milgram, J., Morel, C., Prouff, E.: Privacy-preserving classification on deep neural network. Cryptology ePrint Archive, Report 2017/035 (2017)
Cheon, J.H., Kim, A., Kim, M., Song, Y.: Homomorphic encryption for arithmetic of approximate numbers (2017)
Chillotti, I., Gama, N., Georgieva, M., Izabachène, M.: TFHE: fast fully homomorphic encryption library (2016). https://tfhe.github.io/tfhe/
Chillotti, I., Joye, M., Paillier, P.: Programmable bootstrapping enables efficient homomorphic inference of deep neural networks. Cryptology ePrint Archive, Paper 2021/091 (2021). https://doi.org/10.1007/978-3-030-78086-91, https://eprint.iacr.org/2021/091
Chillotti, I., Joye, M., Paillier, P.: Programmable bootstrapping enables efficient homomorphic inference of deep neural networks. In: Dolev, S., Margalit, O., Pinkas, B., Schwarzmann, A. (eds.) Cyber Security Cryptography and Machine Learning, pp. 1–19. Springer International Publishing, Cham (2021). https://doi.org/10.1007/978-3-030-78086-9_1
Chillotti, I., Ligier, D., Orfila, J.B., Tap, S.: Improved programmable bootstrapping with larger precision and efficient arithmetic circuits for TFHE. Cryptology ePrint Archive, Report 2021/729 (2021), https://ia.cr/2021/729
Clet, P.E., Zuber, M., Boudguiga, A., Sirdey, R., Gouy-Pailler, C.: Putting up the swiss army knife of homomorphic calculations by means of tfhe functional bootstrapping. Cryptology ePrint Archive, Paper 2022/149 (2022). https://eprint.iacr.org/2022/149
Dowlin, N., Gilad-Bachrach, R., Laine, K., Lauter, K., Naehrig, M., Wernsing, J.: Cryptonets: applying neural networks to encrypted data with high throughput and accuracy (2016), https://www.microsoft.com/en-us/research/publication/cryptonets-applying-neural-networks-to-encrypted-data-with-high-throughput-and-accuracy/
Dua, M., Yadav, R., Mamgai, D., Brodiya, S.: An improved RNN-LSTM based novel approach for sheet music generation (2020). https://doi.org/10.1016/j.procs.2020.04.049
Fan, J., Vercauteren, F.: Somewhat practical fully homomorphic encryption. Cryptology ePrint Archive, Report 2012/144 (2012). https://ia.cr/2012/144
Guimarães, A., Borin, E., Aranha, D.F.: Revisiting the functional bootstrap in TFHE. IACR Transactions on Cryptographic Hardware and Embedded Systems 2021(2), 229–253 (2021). 10.46586/tches.v2021.i2.229-253
Hochreiter, Jurgen, S.: Long short-term memory. Neural computation 9(8), 1735–1780 (1997)
Izabachène, M., Sirdey, R., Zuber, M.: Practical fully homomorphic encryption for fully masked neural networks. In: Mu, Y., Deng, R.H., Huang, X. (eds.) Cryptology and Network Security, pp. 24–36. Springer International Publishing, Cham (2019). https://doi.org/10.1007/978-3-030-31578-8_2
Jang, J., et al.: Privacy-preserving deep sequential model with matrix homomorphic encryption. In: Proceedings of the 2022 ACM on Asia Conference on Computer and Communications Security, pp. 377–391. ASIA CCS ’22, Association for Computing Machinery, New York, NY, USA (2022). https://doi.org/10.1145/3488932.3523253
Kim, M., Song, Y., Wang, S., Xia, Y., Jiang, X.: Secure logistic regression based on homomorphic encryption: design and evaluation. In: JMIR Medical Informatics (2018)
Kluczniak, K., Schild, L.: FDFB: full domain functional bootstrapping towards practical fully homomorphic encryption. Cryptology ePrint Archive, Report 2021/1135 (2021). https://ia.cr/2021/1135
Lev, G., Sadeh, G., Klein, B., Wolf, L.: RNN fisher vectors for action recognition and image annotation (2015)
Madi, A., Sirdey, R., Stan, O.: Computing neural networks with homomorphic encryption and verifiable computing. In: ACNS Workshops (2020)
OPenAI: Chatgpt: optimizing language models for dialogue (2022). https://openai.com/blog/chatgpt/
Paul, J., Annamalai, M.S.M.S., Ming, W., Badawi, A.A., Veeravalli, B., Aung, K.M.M.: Privacy-preserving collective learning with homomorphic encryption. IEEE Access 9, 132084–132096 (2021). https://doi.org/10.1109/ACCESS.2021.3114581
Ramesh, A., Dhariwal, P., Nichol, A., Chu, C., Chen, M.: Hierarchical text-conditional image generation with clip latents. arXiv:2204.06125
Syed, S.A., Rashid, M., Hussain, S., Zahid, H.: Comparative analysis of CNN and RNN for voice pathology detection. BioMed Research International 2021 (2021)
Woodbridge, J., Anderson, H.S., Ahuja, A., Grant, D.: Predicting domain genreation algorithms with long short-term memory networks (2016)
Yang, Z., Xie, X., Shen, H., Chen, S., Zhou, J.: Tota: fully homomorphic encryption with smaller parameters and stronger security. Cryptology ePrint Archive, Report 2021/1347 (2021). https://ia.cr/2021/1347
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2023 The Author(s), under exclusive license to Springer Nature Switzerland AG
About this paper
Cite this paper
Trama, D., Clet, PE., Boudguiga, A., Sirdey, R. (2023). Building Blocks for LSTM Homomorphic Evaluation with TFHE. In: Dolev, S., Gudes, E., Paillier, P. (eds) Cyber Security, Cryptology, and Machine Learning. CSCML 2023. Lecture Notes in Computer Science, vol 13914. Springer, Cham. https://doi.org/10.1007/978-3-031-34671-2_9
Download citation
DOI: https://doi.org/10.1007/978-3-031-34671-2_9
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-031-34670-5
Online ISBN: 978-3-031-34671-2
eBook Packages: Computer ScienceComputer Science (R0)