Hostname: page-component-74656f9884-c52kr Total loading time: 0 Render date: 2026-11-08T12:41:35.590Z Has data issue: false hasContentIssue false

Hide and seek: Privacy-preserving artificial intelligence with a feasibility study in rare disease diagnosis

Published online by Cambridge University Press:  27 July 2026

Sivaraman Rajaganapathy
Affiliation:
Department of Artificial Intelligence and Informatics, Mayo Clinic , Rochester, MN, USA Center for Clinical and Translational Science, Mayo Clinic, Rochester, MN, USA
Jennifer St. Sauver
Affiliation:
Division of Epidemiology, Department of Quantitative Health Sciences, Mayo Clinic, Rochester, MN, USA
Filippo Pinto e Vairo
Affiliation:
Center for Clinical and Translational Science, Mayo Clinic, Rochester, MN, USA Division of Gastroenterology and Hepatology, Department of Medicine, Mayo Clinic, Rochester, MN, and Scottsdale, AZ, USA
Prasad G. Iyer
Affiliation:
Center for Clinical and Translational Science, Mayo Clinic, Rochester, MN, USA Division of Gastroenterology and Hepatology, Department of Medicine, Mayo Clinic, Rochester, MN, and Scottsdale, AZ, USA
Hongfang Liu
Affiliation:
Department of Quantitative and Systems Health Sciences, Dell Medical School, The University of Texas at Austin, Austin, TX, USA
Jungwei W. Fan*
Affiliation:
Department of Artificial Intelligence and Informatics, Mayo Clinic , Rochester, MN, USA Center for Clinical and Translational Science, Mayo Clinic, Rochester, MN, USA Division of Epidemiology, Department of Quantitative Health Sciences, Mayo Clinic, Rochester, MN, USA
*
Corresponding author: J. W. Fan; Email: fan.jung-wei@mayo.edu
Rights & Permissions [Opens in a new window]

Abstract

Background:

Integrating advanced artificial intelligence (AI) into clinical decision-support often requires the sharing of sensitive patient data with external services, raising privacy concerns. Homomorphic encryption (HE) allows computing directly on encrypted data, without revealing the underlying patient information.

Objectives:

To develop a large language model (LLM)-assisted diagnosis framework while preserving patient privacy in the clinical text analysis, by leveraging HE and using rare disease (RD) diagnosis as a representative application. To demonstrate HE does not hinder the system performance.

Materials and Methods:

Texts from patient histories and a RD knowledge base were embedded by LLMs into vectors, then encrypted using HE to obscure private information while retaining the semantic nuances. Diagnostic recommendations were generated by computing and ranking the similarities between the patient history and RD vectors in the encrypted space. The system was evaluated using 50 synthetic case reports (5 RDs, each with 10 reports).

Results:

Applying HE did protect private information from reverse-embedding attacks. HE imposed little disruption to the diagnostic accuracy, with normalized discounted cumulative gains (nDCG) of 0.6108 ± 0.3412 (encrypted) versus 0.6083 ± 0.3415 (unencrypted). The accuracy and computational performance were tunable and consistent, as demonstrated across five different LLMs.

Discussion:

Our privacy-preserving framework opens tremendous opportunities toward hosting and serving powerful AI solutions across institution boundaries, which would remove the need for local deidentification and incentivize users to access secure external decision-support services.

Conclusions:

Integrating HE with LLM retrieval can promote the dissemination of nonredundant, high-capacity AI services by preserving both privacy and accuracy.

Information

Type
Research Article
Creative Commons
Creative Common License - CCCreative Common License - BYCreative Common License - NCCreative Common License - SA
This is an Open Access article, distributed under the terms of the Creative Commons Attribution-NonCommercial-ShareAlike licence (https://creativecommons.org/licenses/by-nc-sa/4.0/), which permits non-commercial re-use, distribution, and reproduction in any medium, provided the same Creative Commons licence is used to distribute the re-used or adapted article and the original article is properly cited. The written permission of Cambridge University Press or the rights holder(s) must be obtained prior to any commercial use.
Copyright
© Mayo Foundation for Medical Education and Research, 2026. Published by Cambridge University Press on behalf of Association for Clinical and Translational Science
Figure 0

Figure 1. Privacy preserving retrieval with homomorphic encryption (HE). The process comprises steps performed on client and server sides. Here we illustrate the framework through a rare disease diagnosis application, with a custom disease vector database created from the Orphadata Science database. The red dashed arrows represent unencrypted data and the blue solid arrows represent secure encrypted data, as elaborated in the following. A query from the client, which may include a whole clinical note with private information, is transformed into a query vector using an embedding model. The client subsequently generates a unique pair of encryption keys: a public key that is used to encrypt the query vector and shared with the server; a private key that is kept secure later for decrypting the server response back to human-readable information. The server uses the client’s public key to encrypt its vector database and then computes the similarity scores of the query against the vector database in the encrypted space. The encrypted similarity scores are returned to the client, which can decrypt the scores to obtain the retrieval rankings.

Figure 1

Figure 2. Generation of synthetic test clinical notes. The flowchart shows the process used to generate the synthetic clinical notes for our experiments. The source data consisted of open-access, full-text rare disease (RD) case reports available on PubMed. From each RD case report, we manually selected case presentation excerpts that did not reveal the final diagnosis of the RD. The excerpts were then used to prompt the public version of Gemini 2.5 Flash, which transformed the excerpts into SOAP-format clinical notes (i.e., with the Subjective, Objective, Assessment, Plan sections). The Subjective and Objective sections from the LLM-generated synthetic notes were extracted and used for testing our homomorphic encryption (HE)-enhanced diagnostic retrieval framework.

Figure 2

Table 1. Vulnerability and prevention of privacy leakage from embedding vectors. Excerpts of synthetic clinical notes, corresponding embedding vectors, and the recovered text are shown in the first three columns respectively. Recovered private information is indicated with bold text. In the fourth and fifth columns, the encrypted embedding vector and the results of a recovery attempt are shown, wherein no meaningful information is revealed. For simplicity, the encrypted embedding vector is displayed as a representative list of floating-point values rather than as the serialized TenSEAL encryption objectTable 1 long description.

Figure 3

Figure 3. Retrieval performance preserved with homomorphic encryption (HE). Comparative retrieval performances (embedding model: Qwen3-8B) as measured by nDCG are shown with and without HE for the five rare diseases; an nDCG value of 1 indicates perfect retrieval. The lower and upper edges of the box plots represent the 25th and 75th percentiles respectively, the center line the median, and the whiskers the 5th and 95th percentiles. Here, τ is Kendall’s tau rank correlation coefficient. The results indicate that the CKKS HE scheme preserves the retrieval performance. Disease abbreviations: ALS = amyotrophic lateral sclerosis, FOP = fibrodysplasia ossificans progressiva, IPF = idiopathic pulmonary fibrosis, SC = sclerosing cholangitis, TN – trigeminal neuralgia.

Figure 4

Figure 4. Preservation of retrieval performance under homomorphic encryption (HE) does not rely on a specific large language model (LLM). For each LLM, the retrieval performance is based on pooling the results across all five tested rare diseases. Here, τ is Kendall’s tau rank correlation coefficient that measures the diagnostic agreement between the HE and no-HE results. The complexity of the LLMs roughly increment from left to right, e.g., the embedding dimensions range from 384 for the MiniLM model to 4096 for the Qwen3-8B model. Regardless of the LLM used, consistently the HE scheme did not hinder the retrieval performance compared to no encryption.

Figure 5

Figure 5. Balancing accuracy, security, and computation time under homomorphic encryption (HE). The effect of the encryption settings (three Security levels and two Precision levels) for similarity-based retrieval is presented. Each data marker represents the median cosine similarity computed across 100 independent simulation runs, wherein, each run used a new and distinct encryption key. The whiskers mark the 25th and 75th percentiles. The Y-axis stands for a different measure in the individual experiment: (A) The deviations introduced by encryption as a function of vector size and CKKS scheme parameters; (B) Computation time per encrypted cosine similarity computation that corresponds to varying vector size and CKKS scheme parameters. Note: both the vertical as well the horizontal axes are shown in logarithmic scale.

Supplementary material: File

Rajaganapathy et al. supplementary material

Rajaganapathy et al. supplementary material
Download Rajaganapathy et al. supplementary material(File)
File 51.1 KB