Search

KR-20260062584-A - Method and System for Retrieval-Augmented Generation of Sensitive Document Search Using Homomorphic Encryption

KR20260062584AKR 20260062584 AKR20260062584 AKR 20260062584AKR-20260062584-A

Abstract

A homomorphic encryption-based sensitive document search augmentation system presents a method and system for homomorphic encryption-based sensitive document search augmentation. The homomorphic encryption-based sensitive document search augmentation system proposed in the present invention comprises a client, a storage server, and an LLM server. The client includes a key sharing unit that, when a user enters the client, the client generates a key in the form of a compressed file, stores the generated encryption key and decryption key in the storage, and then transmits the encryption key file to the storage server; a document attachment execution unit that, when a user attaches a document to the client, converts the attached document into string content, divides the converted document, embeds each divided document, encrypts the document and the corresponding embedding vector using the client's encryption key in homomorphic encryption, and transmits the encrypted document to the storage server; and a document query execution unit that embeds a query sentence to be queried by the user, encrypts it using the client's encryption key in homomorphic encryption, transmits the encrypted embedding vector to the storage server to receive a similarity measurement list between the query embedding vector and the document embedding vector from the storage server, and uses the document index according to the similarity measurement list to receive the document corresponding to the document index from the storage server and provides an answer to the query sentence to the user.

Inventors

  • 이용우
  • 서강문
  • 김현우
  • 김예찬

Assignees

  • 인하대학교 산학협력단

Dates

Publication Date
20260507
Application Date
20241029

Claims (10)

  1. A homomorphic encryption-based sensitive document search augmentation system includes a client, a repository server, and an LLM server, and The above client, A key sharing unit that, when a user enters the client, the client generates a key, stores the generated encryption key and decryption key in a storage, and then transmits the encryption key file to the storage server; A document attachment execution unit that, when a user attaches a document to a client, converts the attached document into string content, splits the converted document, embeds each of the split documents, encrypts the document and the corresponding embedding vector using a homomorphic encryption key of the client, and transmits the encrypted document to a storage server; and A document query execution unit that embeds a query sentence to be queried by a user, encrypts it using a client's encryption key with homomorphic encryption, transmits the encrypted embedding vector to a storage server to receive a list of similarity measurements between the query embedding vector and the document embedding vector from the storage server, and uses the document index according to the similarity measurement list to receive the document corresponding to the document index from the storage server, thereby providing an answer to the query sentence to the user. A homomorphic encryption-based sensitive document search augmentation system including
  2. In paragraph 1, The above key sharing unit is, Since the purpose is to prevent the repository server from decrypting the document, the decryption key is not shared, and When the storage server stores the received encryption key and synchronizes it with the process to complete key sharing, the key sharing unit receives a notification from the storage server and delivers a client initialization completion notification to the user. Homomorphic encryption-based sensitive document search augmentation system.
  3. In paragraph 1, The above document attachment execution unit, Sends the encrypted document to the repository server so that the repository server saves the encrypted document to the vector repository, and receives a save success response from the repository server to notify the user that document preprocessing is complete. Homomorphic encryption-based sensitive document search augmentation system.
  4. In paragraph 1, The above document query execution unit, Verify key integrity by checking whether the client's key matches the returned document key, and If key integrity verification is successful, the encrypted similarity measure list is returned from the storage server, decrypted, and the document index with a similarity higher than a predetermined standard is transmitted to the storage server, and the document corresponding to the index of the said document is received from the storage server. Finally, obtain the ciphertext of the document most similar to the query sentence, decrypt the obtained encrypted document using a decryption key, and generate a search augmented generation prompt using the corresponding document as context, and When querying the LLM server based on the generated search augmentation generation prompt, the response to the said search augmentation generation prompt generated by the LLM server is received and delivered to the user. Homomorphic encryption-based sensitive document search augmentation system.
  5. In paragraph 1, The above document query execution unit, Verify key integrity by checking whether the client's key matches the returned document key, and If key integrity verification fails, the query process is stopped, a decryption failure message is generated, and delivered to the user. Homomorphic encryption-based sensitive document search augmentation system.
  6. A method for homomorphic encryption-based sensitive document search augmentation in a homomorphic encryption-based sensitive document search augmentation system comprising a client, a storage server, and an LLM server—the client comprises a key sharing unit, a document attachment execution unit, and a document query execution unit—, When a user enters the client, the client generates a key in the form of a compressed file through the key sharing unit, stores the generated encryption key and decryption key in a storage, and then transmits the encryption key file to the storage server; When a user attaches a document to a client, the attached document is converted into string content through a document attachment execution unit, the converted document is divided, each divided document is embedded, the document and its corresponding embedding vector are encrypted using a homomorphic encryption key of the client, and the encrypted document is transmitted to a storage server; A step of embedding a query sentence that a user wishes to query through a document query execution unit, encrypting it using a homomorphic encryption key of the client, and transmitting the encrypted embedding vector to a storage server to perform a similarity measurement between the query embedding vector and the document embedding vector; and A step of receiving a list of similarity measurements between a query embedding vector and a document embedding vector from a storage server through a document query execution unit, and receiving a document corresponding to the document index from the storage server using the document index according to the similarity measurement list, and providing an answer to the query sentence to the user. Homomorphic encryption-based sensitive document search augmentation method including
  7. In paragraph 6, When the above user enters the client, the client generates a key in the form of a compressed file through the key sharing unit, stores the generated encryption key and decryption key in a storage, and then transmits the encryption key file to the storage server. Since the purpose is to prevent the repository server from decrypting the document, the decryption key is not shared, and When the storage server stores the received encryption key and synchronizes it with the process to complete key sharing, the key sharing unit receives a notification from the storage server and delivers a client initialization completion notification to the user. Homomorphic encryption-based sensitive document search augmentation method.
  8. In paragraph 6, When the above user attaches a document to the client, the step of converting the attached document into string content through the document attachment execution unit, splitting the converted document and embedding each of the split documents, encrypting the document and the corresponding embedding vector using the client's encryption key with homomorphic encryption, and transmitting the encrypted document to the storage server is Sends the encrypted document to the repository server so that the repository server saves the encrypted document to the vector repository, and receives a save success response from the repository server to notify the user that document preprocessing is complete. Homomorphic encryption-based sensitive document search augmentation method.
  9. In paragraph 6, The step of receiving a list of similarity measurements between a query embedding vector and a document embedding vector from a storage server through the document query execution unit, and receiving a document corresponding to the document index from the storage server using the document index according to the similarity measurement list to provide an answer to the query sentence to the user, Verify key integrity by checking whether the client's key matches the returned document key, and If key integrity verification is successful, the encrypted similarity measure list is returned from the storage server, decrypted, and the document index with a similarity higher than a predetermined standard is transmitted to the storage server, and the document corresponding to the index of the said document is received from the storage server. Finally, obtain the ciphertext of the document most similar to the query sentence, decrypt the obtained encrypted document using a decryption key, and generate a search augmented generation prompt using the corresponding document as context, and When querying the LLM server based on the generated search augmentation generation prompt, the response to the said search augmentation generation prompt generated by the LLM server is received and delivered to the user. Homomorphic encryption-based sensitive document search augmentation method.
  10. In paragraph 6, The step of receiving a list of similarity measurements between a query embedding vector and a document embedding vector from a storage server through the document query execution unit, and receiving a document corresponding to the document index from the storage server using the document index according to the similarity measurement list to provide an answer to the query sentence to the user, Verify key integrity by checking whether the client's key matches the returned document key, and If key integrity verification fails, the query process is stopped, a decryption failure message is generated, and delivered to the user. Homomorphic encryption-based sensitive document search augmentation method.

Description

Method and System for Retrieval-Augmented Generation of Sensitive Document Search Using Homomorphic Encryption The present invention relates to a method and system for augmenting sensitive document search based on homomorphic encryption. Current technological advancements are being driven by Large Language Models (LLMs). LLMs such as OpenAI's ChatGPT and Meta's Llama are widely used across all fields. However, LLM suffers from the hallucination problem, where it answers with information different from the query as if it were fact. As a technique to overcome this, Retrieval-Augmented Generation (RAG) has been proposed, which provides external context and answers based on that information. However, the use of RAG carries a risk of document exposure because it involves providing and storing the user's documents. FIG. 1 is a diagram showing the configuration of a homomorphic encryption-based sensitive document search augmentation system according to one embodiment of the present invention. FIG. 2 is a flowchart illustrating a homomorphic encryption-based sensitive document search augmentation method according to one embodiment of the present invention. FIG. 3 is a diagram showing a key sharing sequence diagram according to one embodiment of the present invention. FIG. 4 is a diagram showing a document attachment sequence diagram according to an embodiment of the present invention. FIG. 5 is a diagram showing a document query sequence diagram according to an embodiment of the present invention. FIG. 6 is a diagram illustrating an example of a client-server structure document attachment according to an embodiment of the present invention. FIG. 7 is a diagram illustrating an example of successful integrity verification according to an embodiment of the present invention. FIG. 8 is a diagram illustrating an example of an integrity verification failure according to an embodiment of the present invention. Retrieval-Augmented Generation (RAG), which provides additional external context, has been proposed as one of the techniques to overcome the hallucination problem associated with queries using large-scale language models. However, the use of RAG raises concerns regarding document exposure because it involves the user's document storage process. To address this issue, a method is proposed to protect the privacy of individual users by introducing homomorphic encryption, including CKKS, BGV, BFV, TFHE, and FHEW, into RAG. In this invention, the encryption method of homomorphic encryption is incorporated into the RAG model to protect individual users' documents and thereby expand the scope of application of the RAG model. The client divides the document provided by the user into multiple split documents, embeds and encrypts each, and stores them on a storage server. Next, it embeds a query submitted by a legitimate user and measures similarity by comparing it with the stored embedded documents. For example, the similarity between the query and the embedded documents can be measured using cosine similarity measurement. Here, cosine similarity measurement is merely one example and is not limited thereto; similarity between the query and the embedded documents can be measured using various other similarity measurement methods. Finally, a RAG prompt is created using the splitted text with the highest similarity as the context, and the prompt is placed in the LLM to receive an answer based on the document content. It is expected that this RAG technique, which protects privacy through CKKS homomorphic encryption, will protect individual users' documents and expand the scope of RAG application. Below, embodiments of the present invention will be described in detail with reference to the attached drawings. Large Language Models (LLMs) are models capable of understanding and generating natural language context by learning from vast amounts of text data. These models are primarily based on Transformer architectures, particularly attention mechanisms. LLMs can be widely utilized across all Natural Language Processing (NLP) tasks and are excelling in various application fields, such as translation, summarization, question answering, and text generation. Chat Prompts allow LLMs to be utilized as conversational applications. A Chat Prompt is an input method used to convey a user's questions to the LLM. Chat Prompts enable interaction between the user and the model in conversational applications and guide the model to provide appropriate information within a specific context. Conversational applications on the market, such as Claude, Gemini, and ChatGPT, advance Chat Prompts to generate natural conversations. However, interactive LLM applications can cause hallucinations by generating information that does not actually exist or differs from the facts. Hallucinations occur when models generate incorrect information based on the limited context or inaccurate patterns of the training data. Meanwhile, the open-source ecosystem of LLM prov