Server device, electronic device, method of operating the same, and storage medium for processing homomorphic ciphertext

KR1020260122776APending Publication Date: 2026-08-12CRYPTO LAB INC
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
KR · KR
Patent Type
Applications
Current Assignee / Owner
Filing Date
2026-01-16
Publication Date
2026-08-12

Smart Images

  • Figure PAT00008_ABST
    Figure PAT00008_ABST
Patent Text Reader

Abstract

A server device comprises a communication circuit communicating with at least one electronic device, at least one processor including processing circuitry, instructions, one or more storage media, and a memory storing an encrypted retrieval-augmented generation (RAG) database including at least one homomorphically encrypted information, wherein when the instructions are executed individually or collectively by at least one processor, the server device searches the encrypted RAG database based on a query obtained from a first electronic device among at least one electronic device through the communication circuit, obtains a response ciphertext based on the homomorphically encrypted information identified through the search, and transmits the response ciphertext to the first electronic device through the communication circuit.
Need to check novelty before this filing date? Find Prior Art

Description

Technology Field

[0001] The present invention relates to a server device, an electronic device, a method of operation, and a storage medium that provide an artificial intelligence service based on retrieval augmentation generation while preserving privacy using homomorphic encryption technology. Background Technology

[0002] As communication technology advances and the proliferation of electronic devices expands, continuous efforts are being made to maintain communication security between electronic devices. Accordingly, encryption and decryption technologies are used in most communication environments.

[0003] As one of the encryption technologies, homomorphic encryption methods have recently been actively researched. According to homomorphic encryption, decrypting the result of an operation on the ciphertext yields a value that matches the corresponding result of the operation on the plaintext. Therefore, various operations can be performed on the ciphertext without decrypting it.

[0004] Based on these characteristics, a system is proposed that stores data by homomorphic encryption and performs retrieval in the ciphertext state. means of solving the problem

[0005] Embodiments of the present disclosure may solve at least one of the previously described problems and / or disadvantages and provide the advantages described below. Accordingly, the embodiments of the present disclosure provide a server device, an electronic device, a method of operation, and a storage medium for providing an artificial intelligence service based on retrieval augmentation generation.

[0006] Additional embodiments will be presented in the detailed description below, some of which are obvious from the detailed description, and other embodiments can also be derived through learning from the presented embodiments.

[0007] A server device according to one or more embodiments of the present disclosure comprises a communication circuit communicating with at least one electronic device, at least one processor including processing circuitry and instructions, one or more storage media and a memory storing an encrypted retrieval-augmented generation (RAG) database including at least one homomorphically encrypted information, wherein when the instructions are executed individually or collectively by the at least one processor, the server device searches the encrypted RAG database based on a query obtained from a first electronic device among the at least one electronic device through the communication circuit, obtains a response ciphertext based on the homomorphically encrypted information identified through the search, and transmits the response ciphertext to the first electronic device through the communication circuit.

[0008] The above query is a homomorphic encrypted query, and when the above instructions are executed individually or collectively by the at least one processor, the server device may perform the search by performing a homomorphic operation between the homomorphic encrypted query and the at least one homomorphic encrypted information.

[0009] When the above instructions are executed individually or collectively by the at least one processor, the server device may store homomorphically encrypted information obtained from the second electronic device among the at least one electronic device in the encrypted RAG database, and when the query is obtained from the first electronic device, perform a search for the stored homomorphically encrypted information.

[0010] The above encrypted RAG database can be shared between at least one electronic device.

[0011] The homomorphically encrypted information includes a homomorphically encrypted embedding vector, and when the instructions are executed individually or collectively by the at least one processor, the server device obtains a response ciphertext corresponding to the homomorphically encrypted embedding vector identified through the search, and the response ciphertext may include encrypted text information.

[0012] An electronic device according to one or more embodiments of the present disclosure comprises a communication circuit communicating with a server device comprising an encrypted retrieval-augmented generation (RAG) database, at least one processor comprising a processing circuitry, instructions, one or more storage media, and a memory storing a neural network model. When the instructions are executed individually or collectively by the at least one processor, the electronic device transmits a query obtained based on user input to the encrypted RAG database of the server device through the communication circuit, and when a response ciphertext is obtained from the server device, the response ciphertext is decrypted to obtain a prompt, and the prompt is input to the neural network model to generate response information.

[0013] The above neural network model may be a Small Language Model (SLM), Large Language Model (LLM), or Large Multimodal Model (LMM) executed within the electronic device.

[0014] When the above instructions are executed individually or collectively by the at least one processor, the electronic device may homomorphically encrypt at least one piece of information stored in the electronic device and transmit the homomorphically encrypted information to the server device through the communication circuit.

[0015] When the above instructions are executed individually or collectively by the at least one processor, the electronic device may homomorphically encrypt a query obtained based on user input and transmit the homomorphically encrypted query to the server device through the communication circuit.

[0016] A method of operation of a server device according to one or more embodiments of the present disclosure may include the operation of searching an encrypted retrieval-augmented generation (RAG) database containing at least one homomorphically encrypted information based on a query obtained from a first electronic device among at least one electronic device, the operation of obtaining a response ciphertext based on the homomorphically encrypted information identified through the search, and the operation of transmitting the response ciphertext to the first electronic device.

[0017] The above query is a homomorphic encrypted query, and the search operation may include an operation to perform the search by performing a homomorphic operation between the homomorphic encrypted query and at least one homomorphic encrypted information.

[0018] The method may further include the operation of storing homomorphically encrypted information obtained from a second electronic device among the at least one electronic device in the encrypted RAG database, and the operation of performing a search for the stored homomorphically encrypted information when the query is obtained from the first electronic device.

[0019] The homomorphically encrypted information includes a homomorphically encrypted embedding vector, and the operation of obtaining the response ciphertext includes the operation of obtaining a response ciphertext corresponding to the homomorphically encrypted embedding vector identified through the search, and the response ciphertext may include encrypted text information.

[0020] The above response ciphertext can be decrypted in the first electronic device and input into a neural network model stored in the first electronic device. Brief explanation of the drawing

[0021] More detailed description of the embodiments of the present disclosure and other aspects, features, and effects will become more apparent from the following description with reference to the accompanying drawings. In the accompanying drawings: FIG. 1 is a drawing for explaining the structure of a network system according to one or more embodiments of the present disclosure. FIG. 2 is a block diagram showing the configuration of a server device according to at least one embodiment of the present disclosure. FIG. 3 is a sequence diagram for explaining the operation of a server device according to one or more embodiments of the present disclosure. FIG. 4 is a flowchart illustrating a method for obtaining a response ciphertext according to one or more embodiments of the present disclosure. FIG. 5 is a flowchart illustrating a method for storing homomorphically encrypted information according to one or more embodiments of the present disclosure. FIG. 6 is a flowchart illustrating a method for obtaining a response ciphertext according to one or more embodiments of the present disclosure. FIG. 7 is a block diagram showing the configuration of an electronic device according to at least one embodiment of the present disclosure. FIG. 8 is a flowchart illustrating a method for transmitting homomorphically encrypted information to a server device according to one or more embodiments of the present disclosure. FIG. 9 is a flowchart illustrating a method for homomorphically encrypting a query obtained based on user input according to one or more embodiments of the present disclosure. FIG. 10 is a sequence diagram for illustrating a system including a server device and an electronic device according to one or more embodiments of the present disclosure. Specific details for implementing the invention

[0022] The present disclosure is described in detail below with reference to the attached drawings. The information (data) transmission process performed in the present disclosure may be encrypted or decrypted as necessary, and any expressions describing the information (data) transmission process in the present disclosure and claims should be interpreted to include cases where encryption or decryption is performed, even if not otherwise mentioned. In the present disclosure, expressions such as "transmission (transfer) from A to B" or "A receives from B" include cases where transmission (transfer) or reception is performed with an intermediate medium, and do not necessarily represent only direct transmission (transfer) or reception from A to B.

[0023] In describing the present disclosure, the order of each step should be understood as non-limiting, unless the preceding step must logically and temporally be performed prior to the subsequent step. That is, except for such exceptional cases, the essence of the disclosure is not affected even if the process described in the subsequent step is performed prior to the process described in the preceding step, and the scope of the rights should be defined regardless of the order of the steps. Furthermore, the designation "A or B" in this specification is defined to mean not only selectively referring to either A or B, but also including both A and B. Additionally, the term "included" in this disclosure encompasses the inclusion of additional components beyond the elements listed as included.

[0024] In this disclosure, only the essential components necessary for the description of this disclosure are described, and components unrelated to the essence of this disclosure are not mentioned. Furthermore, the mentioned components should not be interpreted in an exclusive sense to include only those components, but should be interpreted in a non-exclusive sense to include other components as well.

[0025] Furthermore, in this disclosure, the term "value" is defined as a concept that includes not only scalar values ​​but also vectors. Also, in this disclosure, expressions such as "calculate" or "calculate" may be replaced with expressions that generate the result of the said calculation or calculation. Additionally, unless otherwise noted, operations on ciphertexts described below refer to homomorphic operations. For example, addition of homomorphic ciphertexts refers to homomorphic addition of two homomorphic ciphertexts.

[0026] The mathematical operations and calculations of each step of the present disclosure described below may be implemented as computer operations by a known coding method for performing the said operation or calculation and / or coding designed to fit the present disclosure.

[0027] The specific mathematical formulas described below are provided as examples among various possible alternatives, and the scope of the rights of this disclosure shall not be interpreted as being limited to the mathematical formulas mentioned in this disclosure.

[0028] For convenience of explanation, the notation in this disclosure is set as follows.

[0029] a ← D : Selects element (a) based on distribution (D)

[0030] s1, s2∈ R : s1 and s2 are each elements of the set R.

[0031] mod(q) : Modular operation on q

[0032] : Round internal values

[0033] Various embodiments of the present disclosure will be described in detail below using the attached drawings.

[0034] FIG. 1 is a drawing for explaining the structure of a network system according to one or more embodiments of the present disclosure.

[0035] Referring to FIG. 1, the network system may include a server device (100) and a plurality of electronic devices (200-1 to 200-n), and each component may be connected to each other through the network (10).

[0036] The network (10) can be implemented in various forms such as wired / wireless communication networks, broadcast communication networks, optical communication networks, cloud networks, etc. In FIG. 1, each device (100, 200-1 to 200-n) is shown in a state where they are indirectly connected to each other through the network (10), but this is not limited thereto, and each device may be connected in a manner such as Wi-Fi, Bluetooth, NFC (Near Field Communication), etc. without a separate medium.

[0037] The server device (100) is a device for performing various processing such as storing homomorphic ciphertexts and performing calculations thereon. The server device (100) may be implemented as a single electronic device or as a cloud server. Additionally, the server device (100) may be implemented as a web server accessible via the internet, etc.

[0038] In FIG. 1, the server device (100) is described to distinguish it from the electronic devices (200-1 to 200-n), but from another perspective, the server device (100) can also be described as an electronic device, in which case the other electronic devices (200-1 to 200-n) can be described as external devices.

[0039] The electronic device (200-1 to 200-n) can be various terminal devices used by the user. Specifically, the electronic device (200-1 to 200-n) can be implemented in various forms such as a PC, laptop PC, smartphone, tablet PC, game player, home server, kiosk, etc. In addition, it can be implemented in the form of a home appliance with IoT functions, or it can be another server device. According to one example, the electronic device (200-1 to 200-n) can be various terminal devices used by the same user.

[0040] The electronic device (200-1 to 200-n) can generate various keys (e.g., secret key, public key, operation key) related to the processing of homomorphic ciphertext, and can convert a plaintext message into homomorphic ciphertext using the generated public key, and then transmit the homomorphic ciphertext to the server device (100).

[0041] Here, homomorphic ciphertext refers to ciphertext generated by encrypting plaintext data (e.g., vector values) according to a homomorphic encryption method, and when the result of an operation in the ciphertext state is decrypted, a value corresponding to the result of the corresponding operation in the plaintext state can be obtained.

[0042] Homomorphic encryption refers to an encryption method that converts plaintext into ciphertext, such that specific operations on the ciphertexts match the results of corresponding operations on the plaintexts. For example, homomorphic encryption can be referred to as CKKS (Cheon-Kim-Kim-Song) encryption, HE (Homomorphic Encryption) encryption, etc.

[0043] Furthermore, the secret key refers to the private key used to decrypt the homomorphic ciphertext. The public key is a key generated in correspondence with the aforementioned secret key and is used to generate the homomorphic ciphertext. The operation key is an evaluation key used to perform homomorphic operations, such as rotation and relinearization, on the homomorphic ciphertext.

[0044] Users can input various information through the electronic devices (200-1 to 200-n) they use. The input information may be stored within the electronic devices (200-1 to 200-n) themselves, but for reasons such as storage capacity and security, it may also be transmitted to and stored in an external device, for example, the server device (100) of FIG. 1. During the process of transmitting to an external device, data may be leaked to a third party, or the administrator of the external device may directly check the contents of the data or leak it externally. Therefore, it is necessary to provide data requiring security, such as users' personal information, to an external device after encrypting and converting it so that a third party cannot verify it.

[0045] Accordingly, each electronic device (200-1 to 200-n) can homomorphically encrypt a plaintext message to convert it into a homomorphic ciphertext, and then transmit the homomorphic ciphertext to a server device (100).

[0046] Each electronic device (200-1 to 200-n) may include cryptographic noise, i.e., errors, generated during the process of performing homomorphic encryption in the homomorphic ciphertext. For example, the homomorphic ciphertext generated by each electronic device (200-1 to 200-n) may be generated in a form in which a result value including a message and an error value is restored when subsequently decrypted using a secret key. A homomorphic encryption method that includes error values ​​in this manner may be referred to as the CKKS method (or CKKS ciphertext).

[0047] For example, a homomorphic ciphertext generated by an electronic device (200-1 to 200-n) can be generated in a form that satisfies the following properties when decrypted using a secret key.

[0048] [Mathematical Formula 1]

[0049] Dec(ct, sk) =<ct, sk> = M+e(mod q)

[0050] Here, < , > represent the inner product. ct represents the ciphertext, sk represents the secret key, M represents the plaintext message, e represents the encryption error value, and mod q represents the modulus of the ciphertext. q must be selected such that the scaling factor (Δ) multiplied by the message is greater than the result. If the absolute value of the error value e is sufficiently small compared to M, the decrypted value of the ciphertext, M+e, is a value that can replace the original message with the same precision in precision / approximate restoration. In the decrypted data, the error is placed on the least significant bit (LSB) side, and M can be placed on the next least significant bit side.

[0051] Here, the scaling factor refers to a scale value applied to map real or fixed-point values ​​into the plaintext space of a homomorphic cipher. For example, an input value can be encoded as plaintext by multiplying it by a scaling factor and converting it to an integer. Since the scale can change when homomorphic cipher operations (especially multiplication) are performed, the scaling factor can be used in a rescaling or adjustment process to maintain decoding accuracy after the operation.

[0052] Each electronic device (200-1 to 200-n) may use a scaling factor to adjust the size of the message if the message size is too small or too large. By using a scaling factor, not only integer messages but also real number messages can be encrypted, which greatly increases usability. In addition, by adjusting the message size using a scaling factor, the size of the area where messages exist in the ciphertext after the operation is performed, that is, the valid area, can also be adjusted.

[0053] According to the embodiment, the ciphertext modulus q can be set and used in various forms. For example, the modulus of the ciphertext is a scaling factor The exponent of q= It can be set in L form. If q is 2, it can be set to a value such as q=210.

[0054] And the homomorphic ciphertext according to the present disclosure is described assuming the use of fixed-point numbers, but it may also be applied in cases where floating-point numbers are used.

[0055] The server device (100) may store homomorphic ciphertexts transmitted from each electronic device (200-1 to 200-n). In this state, the server device (100) may perform operations on the stored homomorphic ciphertexts when there is a user request or when a specific event occurs.

[0056] For example, if a user of the first electronic device (200-1) of FIG. 1 requests a result of operation for a specific homomorphic ciphertext, the server device (100) may perform a homomorphic operation on the said homomorphic ciphertext while it is encrypted, and transmit the homomorphic ciphertext (i.e., the result of the operation) to the first electronic device (200-1). The first electronic device (200-1) may decrypt the result of the operation using a secret key and provide it to the user in the form of decrypted plaintext.

[0057] Here, homomorphic operation refers to an operation performed on the ciphertext, and may include, for example, operations performed during the evaluation process such as addition, multiplication, rotation, and relinearization.

[0058] Such isomorphic operation can be applied in the same way during the search process. For example, the server device (100) can perform an operation that responds to a query input from an electronic device (200-1 to 200-n).

[0059] Here, 'query' refers to query information generated based on user input to request a similarity / distance evaluation with data stored by a server device (e.g., vector ciphertext). For example, an electronic device may generate a query vector by applying an embedding model to user input (e.g., natural language text) and transmit the generated query vector to the server device in plaintext or in a homomorphically encrypted state (Enc(q)).

[0060] Additionally, 'query search' may refer to a process for a server device to find data similar to a query (e.g., nearest neighbor) among the stored data (e.g., homomorphic ciphertext of a data vector) for a query (e.g., query vector) transmitted by an electronic device. For example, the server device (100) may generate a response ciphertext corresponding to the similarity (or distance) between the query and the stored homomorphic ciphertexts and transmit it to the electronic device, and the electronic device may decrypt the response ciphertext to obtain a search result.

[0061] And 'homomorphic ciphertext' can refer to ciphertext obtained by encrypting data (e.g., vector values) according to a homomorphic encryption method, and the vector values ​​may also be plaintext values.

[0062] When a query is input in this manner, the server device (100) can perform homomorphic operations in the homomorphic ciphertext state without decrypting the vector value within the homomorphic ciphertext to produce a value necessary for calculating the similarity (or distance) with the query.

[0063] Meanwhile, the electronic device (200-1 to 200-n) can provide AI services to the user by utilizing personalized data. For example, the electronic device (200-1 to 200-n) can store the user's personal data (e.g., schedule, memo, contact, document, photo caption text, etc.) locally and generate a customized response through a neural network model (e.g., SLM (Small Language Model), LLM (Large Language Model), or LMM (Large Multimodal Model)) based on the stored personal data. In this case, privacy can be protected as the personal data is not transmitted to an external server.

[0064] While AI services utilizing such personalized data have the advantage of providing user-customized responses, they had the following problems.

[0065] First, the approach of processing personalized data on-device for privacy protection presented a problem in that it was difficult to scale to multi-device environments. For example, personal data generated by a user on a smartphone (e.g., schedules, memos, photo descriptions, etc.) could only be utilized for AI services within that specific smartphone, making it difficult to access personalized AI services based on such data on the same user's tablet or laptop.

[0066] Secondly, the method of storing personalized data on cloud servers to support multi-device environments presented a problem involving the risk of privacy exposure. When personal data is stored in plain text on cloud servers, personal information can be leaked by server administrators or external attackers, which undermined user trust.

[0067] In particular, in AI services based on RAG (Retrieval-Augmented Generation), users' personal data must be stored in a database in the form of embedding vectors and original text, so privacy protection in a cloud environment has emerged as an even more important challenge.

[0068] To solve these problems, the present disclosure provides a technology that stores a homomorphically encrypted RAG database on a cloud server and performs a search in the ciphertext state through homomorphic operations, thereby providing personalized AI services in a multi-device environment while preserving privacy.

[0069] In one or more embodiments, the server device (100) may receive homomorphically encrypted information (e.g., homomorphically encrypted embedding vector and encrypted text information) from at least one electronic device and store it in an encrypted RAG database. In this case, the encrypted RAG database may be shared among multiple electronic devices, so that a user can use the personalized AI service on any electronic device regardless of the device that generated the data.

[0070] And when the server device (100) receives a query (e.g., a homomorphic encrypted query) from the electronic device (200), it can perform a search by performing a homomorphic operation with the homomorphic encrypted information stored in the encrypted RAG database, and generate a response ciphertext based on the search results and transmit it to the electronic device (200). The electronic device (200) can decrypt the received response ciphertext to obtain a prompt and input it into a locally stored neural network model (e.g., SLM or LLM) to generate response information.

[0071] With such operation, the network system according to the present disclosure can perform cloud-based RAG search without the server accessing personal data in plaintext. Furthermore, the present disclosure enables consistent personalized AI services in a multi-device environment by storing homomorphically encrypted information in an encrypted RAG database shared among multiple electronic devices. The specific configuration of the server device (100) according to the present disclosure will be described later with reference to FIG. 2. The specific configuration of the electronic device (200) according to the present disclosure will be described later with reference to FIG. 7.

[0072] FIG. 2 is a block diagram showing the configuration of a server device according to at least one embodiment of the present disclosure.

[0073] According to FIG. 2, the server device (100) includes a communication circuit (110), a processor (120), and a memory (130).

[0074] The communication circuit (110) is configured to communicate with various external devices, including electronic devices (e.g., the electronic device (200) of FIG. 7).

[0075] The communication circuit (110) can transmit and receive various signals and data to and from external devices through various wired / wireless communication methods such as wired / wireless LAN (Local Area Network), WAN (Wide Area Network), Ethernet, IEEE 1394, Bluetooth, AP-based Wi-Fi (Wi-Fi, Wireless LAN Network), Zigbee, HDMI (High-Definition Multimedia Interface), USB (Universal Serial Bus), MHL (Mobile High-Definition Link), AES / EBU (Audio Engineering Society / European Broadcasting Union), Optical, Coaxial, etc.

[0076] For example, the communication circuit (110) can receive homomorphic ciphertext, various keys, operation requests, query requests, etc. from each electronic device (200-1 to 200-n) of FIG. 1, and can transmit operation results of homomorphic ciphertext, query results (response ciphertext), etc. to each electronic device (200-1 to 200-n).

[0077] The processor (120) is configured to control the overall operation of the server device (100). The processor (120) can perform various operations based on instructions, programs, data, etc. stored in memory (130).

[0078] The processor (120) may be implemented as a digital signal processor (DSP) or a microprocessor that processes digital signals. However, it is not limited thereto and may include or be defined by one or more of a central processing unit (CPU), a Micro Controller Unit (MCU), a Micro Processing Unit (MPU), a controller, an application processor (AP), a communication processor (CP), an ARM processor, a Graphic Processing Unit (GPU), a Neural Processing Unit (NPU), or an Artificial Intelligence (AI) processor. Additionally, the processor (120) may be implemented as a System on Chip (SoC) or Large Scale Integration (LSI) with a built-in processing algorithm, or in the form of a Field Programmable Gate Array (FPGA).

[0079] The CPU is a general-purpose processor capable of performing not only general operations but also artificial intelligence operations, and it can efficiently execute complex programs through a multi-layered cache structure. The CPU is advantageous for serial processing methods, which enable the organic linkage between previous and subsequent calculation results through sequential computation.

[0080] A GPU is a processor designed for massive computations, such as floating-point operations used in graphics processing, and can perform large-scale calculations in parallel by integrating a large number of cores. In particular, GPUs can be advantageous over CPUs for parallel processing methods, such as convolution operations. Additionally, GPUs can be utilized as co-processors to complement the functions of CPUs.

[0081] An NPU is a processor specialized for artificial intelligence computations using artificial neural networks, and each layer constituting the neural network can be implemented in hardware (e.g., silicon). In this case, since the NPU is designed specifically according to the specifications required by the vendor, it has a lower degree of flexibility compared to CPUs or GPUs, but it can efficiently process the AI ​​computations required by the vendor. As a processor specialized for AI computation, the NPU can be implemented in various forms such as the TPU (Tensor Processing Unit), IPU (Intelligence Processing Unit), and VPU (Vision Processing Unit). Artificial intelligence processors are not limited to the examples mentioned above, except for cases specified as the aforementioned NPU.

[0082] Additionally, the processor (120) may be implemented as a System on Chip (SoC). In this case, the SoC may be equipped with one or more processors (120) as well as memory (130), and may be provided with a bus for data communication between the memory (130) and the processor (120).

[0083] Memory (130) is configured to store various programs, data, instructions, etc. required for the operation of the server device (100). Memory (130) can be implemented as at least one of various types of memory, such as RAM (dynamic RAM), SRAM (static RAM), SDRAM (synchronous dynamic RAM), OTPROM (one time programmable ROM), PROM (programmable ROM), EPROM (erasable and programmable ROM), EEPROM (electrically erasable and programmable ROM), mask ROM, flash ROM, flash memory, hard drive, or solid state drive (SSD).

[0084] The memory (130) may store various homomorphic ciphertexts received through the communication circuit (110) or operation keys, switching keys, public keys, etc., for use in the operation thereof. Additionally, the memory (130) may store various mathematical formulas or instructions required to generate secret keys and public keys.

[0085] The memory (130) may store at least one artificial intelligence model capable of processing homomorphic ciphertexts, data and programs for training it, etc.

[0086] Here, the embedding space refers to a vector space where data is represented and located in vector form, and nearest neighbor search can be performed within this space based on distance or similarity measures. Such an embedding space may be referred to as a feature space, vector space, or representation space.

[0087] When a request for operation is received from an electronic device (e.g., electronic device (200)) through a communication circuit (110) or when a preset event occurs, the processor (120) can perform an operation on at least one homomorphic ciphertext stored in memory (130) and provide the result of the operation to the electronic device in a homomorphic encrypted form.

[0088] Here, a preset event may include cases where a preset time period arrives, where a new homomorphic ciphertext is received and stored, or where an update is performed on an existing stored homomorphic ciphertext. For example, when a user requests to verify whether the personal information is registered while transmitting a homomorphic ciphertext regarding personal information, the processor (120) may perform an internal product operation between the previously stored homomorphic ciphertexts and the received homomorphic ciphertexts, and then aggregate the results of the operation and transmit them to an electronic device. In addition, the types of operations on the homomorphic ciphertexts may be varied according to the user's request.

[0089] When the operation result is transmitted to an electronic device, the electronic device can decode it and provide the operation result to the user.

[0090] According to one or more embodiments, the processor (120) can search the encrypted RAG database.

[0091] According to one example, the processor (120) can search an encrypted RAG database based on a query obtained through a communication circuit (110) from a first electronic device among at least one electronic device (e.g., a plurality of electronic devices (200-1 to 200-n) of FIG. 1). According to one example, the query is generated based on user input and may be query information for requesting a similarity evaluation with homomorphically encrypted information stored in the encrypted RAG database.

[0092] Homomorphically encrypted information may refer to information generated by encrypting plaintext data according to a homomorphic encryption method. Depending on the example, homomorphically encrypted information may include homomorphically encrypted embedding vectors. For example, an electronic device may generate homomorphically encrypted information by homomorphically encrypting data on a device such as a mobile phone or laptop and store it on a server device.

[0093] An encrypted RAG database may refer to a database that stores homomorphically encrypted information for retrieval-augmented generation. Retrieval-Augmented Generation (RAG) may refer to a method of retrieving relevant information from an external database and utilizing it to generate responses for a language model.

[0094] According to one example, an encrypted RAG database may be implemented on a cloud server to store homomorphically encrypted information obtained from multiple electronic devices. For example, the encrypted RAG database may store homomorphically encrypted embedding vectors and data corresponding to those embedding vectors (e.g., original text) in association.

[0095] For example, an encrypted RAG database can be shared among multiple electronic devices to support searching in a multi-device environment. An electronic device can download search results from the encrypted RAG database, decrypt them, and obtain a prompt.

[0096] According to one example, the processor (120) can perform a search by performing a homomorphic operation between a query and at least one homomorphic encrypted information stored in an encrypted RAG database. According to one example, the processor (120) can perform a homomorphic operation between the query and the homomorphic encrypted information in an undecrypted ciphertext state.

[0097] For example, the processor (120) can calculate a similarity value by performing an inner product operation between a query and a homomorphically encrypted embedding vector as a homomorphic operation. As an example, the processor (120) can perform a distance operation (e.g., Euclidean distance, cosine distance, etc.) between a query and a homomorphically encrypted embedding vector as a homomorphic operation. Based on the calculated similarity value, the processor (120) can identify at least one homomorphically encrypted information that is most similar to the query among the homomorphically encrypted information stored in the encrypted RAG database.

[0098] According to one or more embodiments, the processor (120) can obtain a response ciphertext.

[0099] According to one example, the processor (120) may obtain a response ciphertext based on homomorphic encrypted information identified through a search. According to one example, the response ciphertext may be encrypted information for generating a prompt that is decrypted by the first electronic device and input into a neural network model. The response ciphertext may mean information containing search results for a query in the form of a ciphertext.

[0100] According to one example, the response ciphertext may include a homomorphically encrypted embedding vector. Alternatively, according to one example, the response ciphertext may include at least one of homomorphically encrypted information and the corresponding encrypted original data.

[0101] According to one example, the processor (120) can generate a response ciphertext based on the result of a homomorphic operation. For example, the processor (120) can identify homomorphic encrypted information corresponding to the relatively highest similarity value among the similarity values ​​between each of the homomorphic encrypted information and the query, and obtain a ciphertext associated with the identified homomorphic encrypted information as a response ciphertext.

[0102] For example, the processor (120) can identify a plurality of homomorphic encrypted information whose similarity value is greater than or equal to a preset threshold, and obtain ciphertexts associated with each of the identified plurality of homomorphic encrypted information as response ciphertexts.

[0103] According to one example, the processor (120) may obtain the response ciphertext in its ciphertext state without decrypting the result of the homomorphic operation. For example, the processor (120) may obtain encrypted text information corresponding to the identified homomorphic encrypted embedding vector as the response ciphertext. The encrypted text information may be the ciphertext of original text data stored in an encrypted RAG database associated with the homomorphic encrypted embedding vector.

[0104] For example, the processor (120) can use a homomorphic encrypted embedding vector in an encrypted RAG database as an index key to obtain encrypted text information corresponding to the index key as a response ciphertext.

[0105] According to one or more embodiments, the processor (120) can transmit the response ciphertext to the first electronic device.

[0106] According to one example, the processor (120) may transmit the acquired response ciphertext to a first electronic device through a communication circuit (110). According to one example, the first electronic device may refer to an electronic device (e.g., electronic device (200)) that transmits a query to the server device (100) among at least one electronic device communicating with the server device (100).

[0107] According to one example, the processor (120) can transmit the response ciphertext to a first electronic device (e.g., electronic device (200)) via a network (e.g., network (10) of FIG. 1). For example, the processor (120) can transmit the response ciphertext to the first electronic device via a wired / wireless communication network, a broadcast communication network, an optical communication network, or a cloud network. For example, the processor (120) can transmit the response ciphertext to the first electronic device via Wi-Fi, Bluetooth, or NFC (Near Field Communication).

[0108] According to one example, the first electronic device may obtain a prompt by decrypting the received response ciphertext using a secret key. The prompt is plaintext information obtained by decrypting the response ciphertext and may be input data for generating response information by inputting it into a neural network model. For example, the first electronic device may input the obtained prompt into a locally stored neural network model (e.g., SLM (Small Language Model), LLM (Large Language Model), or LMM (Large Multimodal Model)) to generate response information corresponding to the user's query.

[0109] According to the example described above, the server device (100) can provide search augmentation generation-based AI services while preserving the privacy of the user's personalized data by performing a homomorphic operation without decrypting the homomorphically encrypted information and searching the encrypted RAG database.

[0110] In addition, according to the example described above, the server device (100) can provide a consistent personalized AI service experience in a multi-device environment, such as a mobile phone or a laptop, by implementing an encrypted RAG database on a cloud server and sharing it among multiple electronic devices.

[0111] FIG. 3 is a sequence diagram for explaining the operation of a server device according to one or more embodiments of the present disclosure.

[0112] According to FIG. 3, the operation method according to one or more embodiments may include an operation (S310) of searching an encrypted RAG (retrieval-augmented generation) database containing at least one homomorphically encrypted information based on a query obtained from a first electronic device among at least one electronic device (e.g., a plurality of electronic devices (200-1 to 200-n) of FIG. 1).

[0113] According to one example, the server device (100) may obtain a query from the first electronic device through a communication circuit. The server device (100) may perform a search on an encrypted RAG database based on the obtained query.

[0114] For example, if the query is a homomorphically encrypted query, the server device (100) can perform a search by performing a homomorphic operation between the homomorphically encrypted query and the homomorphically encrypted information stored in the encrypted RAG database. For example, the server device (100) can calculate a similarity value between the query and the homomorphically encrypted information through the homomorphic operation. The server device (100) can identify the homomorphically encrypted information related to the query based on the calculated similarity value.

[0115] According to one or more embodiments, the method of operation may include an operation (S320) of obtaining a response ciphertext based on homomorphic encrypted information identified through a search. According to one example, the server device (100) may obtain a response ciphertext based on homomorphic encrypted information identified through a search.

[0116] According to one or more embodiments, the method of operation may include the operation (S330) of transmitting a response ciphertext to a first electronic device. According to one example, the server device (100) may transmit the response ciphertext to the first electronic device.

[0117] FIG. 4 is a flowchart illustrating a method for obtaining a response ciphertext according to one or more embodiments of the present disclosure.

[0118] According to FIG. 4, the operation method according to one or more embodiments may include an operation (S410) of performing a search by performing a homomorphic operation between a homomorphic encrypted query and at least one homomorphic encrypted information.

[0119] According to one example, a server device (100) can perform a search by performing a homomorphic operation between a homomorphic encrypted query and at least one homomorphic encrypted information. A homomorphic encrypted query may mean a query generated by encrypting a query in plaintext (e.g., an embedding vector) according to a homomorphic encryption method.

[0120] According to one example, the server device (100) can perform a search by performing a homomorphic operation between a homomorphic encrypted query and at least one homomorphic encrypted information. The server device (100) can perform the homomorphic operation without decrypting the homomorphic encrypted query and the homomorphic encrypted information.

[0121] For example, the server device (100) can calculate a similarity value by performing an inner product operation between a homomorphically encrypted query and homomorphically encrypted information as a homomorphic operation. For example, the server device (100) can perform a distance operation between a homomorphically encrypted query and homomorphically encrypted information as a homomorphic operation.

[0122] According to one or more embodiments, the method of operation may include an operation (S420) of obtaining a response ciphertext based on homomorphic encrypted information identified through a search. According to one example, the server device (100) may obtain a response ciphertext based on homomorphic encrypted information identified through a search.

[0123] According to one example, the server device (100) can obtain a response ciphertext based on homomorphic encrypted information identified through a search. The server device (100) can generate a response ciphertext based on the result of a homomorphic operation. The server device (100) can transmit the obtained response ciphertext to a first electronic device through a communication circuit.

[0124] For example, the server device (100) can obtain a ciphertext corresponding to the relatively highest similarity value among the similarity values ​​between each homomorphically encrypted information and the homomorphically encrypted query as a response ciphertext. The server device (100) can obtain the response ciphertext in its original ciphertext state without decrypting the homomorphic operation result. The server device (100) can transmit the obtained response ciphertext to the first electronic device through a communication circuit.

[0125] FIG. 5 is a flowchart illustrating a method for storing homomorphically encrypted information according to one or more embodiments of the present disclosure.

[0126] According to FIG. 5, the operation method according to one or more embodiments may include the operation (S510) of storing homomorphically encrypted information obtained from a second electronic device among at least one electronic device in an encrypted RAG database.

[0127] According to one example, the server device (100) may store homomorphically encrypted information obtained from a different type of electronic device, including a second electronic device among at least one electronic device, in an encrypted RAG database. The second electronic device may refer to an electronic device that transmits homomorphically encrypted information to the server device (100) among at least one electronic device communicating with the server device (100). The server device (100) may receive homomorphically encrypted information from a different type of electronic device, including the second electronic device, through a communication circuit.

[0128] For example, a server device (100) may obtain a homomorphically encrypted embedding vector from a different type of electronic device including a second electronic device and store it in an encrypted RAG database. The server device (100) may receive homomorphically encrypted information along with data corresponding to said information (e.g., original text, etc.) from a different type of electronic device including a second electronic device. The server device (100) may store the received homomorphically encrypted information and the data associated therewith in an encrypted RAG database.

[0129] For example, the second electronic device may be a terminal device of the same user as the first user of the first electronic device. When the first user generates personal data, such as personal memos, schedules, contact information, or descriptive text for photos, on the second electronic device, the second electronic device may homomorphically encrypt the said personal data and transmit it to the server device (100).

[0130] Specifically, the second electronic device can generate an embedding vector by applying an embedding model to the first user's personal data. For example, the second electronic device can generate an embedding vector by applying an embedding model to schedule data such as 'Meeting with Manager A on March 15, 2025'. The second electronic device can homomorphically encrypt the generated embedding vector and transmit it to the server device (100). The server device (100) can store the homomorphically encrypted embedding vector in the RAG database.

[0131] Meanwhile, as an example, the second electronic device can encrypt original text data corresponding to the embedding vector along with a homomorphically encrypted embedding vector and transmit it to the server device (100). For example, the second electronic device can transmit text information to the server device (100) by encrypting the original text corresponding to 'Meeting with Manager A on March 15, 2025' along with a homomorphically encrypted embedding vector.

[0132] According to one example, the server device (100) may associate a homomorphically encrypted embedding vector and encrypted text information received from a different type of electronic device including a second electronic device and store them in an encrypted RAG database. According to one example, the server device (100) may use the homomorphically encrypted embedding vector as an index key and store the encrypted text information as a value corresponding to the index key.

[0133] According to one or more embodiments, the operation method may include an operation (S520) of performing a search for stored homomorphic encrypted information when a query is obtained from the first electronic device.

[0134] According to one example, when a server device (100) obtains a query from a first electronic device, it can perform a search for stored homomorphic encrypted information. The first electronic device may refer to an electronic device that transmits a query to the server device (100) among at least one electronic device communicating with the server device (100). According to one example, the query transmitted to the server device (100) may be a homomorphic encrypted query.

[0135] According to one example, when the server device (100) obtains a query from the first electronic device, it can perform a search for stored homomorphically encrypted information. The server device (100) can perform a search for stored homomorphically encrypted information from different types of electronic devices, including the second electronic device, based on the query of the first electronic device.

[0136] For example, if the first electronic device and the second electronic device are associated with the same user account, the server device (100) can retrieve homomorphically encrypted information stored by the second electronic device using a query from the first electronic device. The server device (100) can perform a search for the same homomorphically encrypted information on multiple electronic devices by sharing the encrypted RAG database among multiple electronic devices. The server device (100) can support a search for homomorphically encrypted information in a multi-device environment.

[0137] According to the example described above, the server device (100) receives homomorphically encrypted information from a different type of electronic device, including a second electronic device as the same user's device, stores it in an encrypted RAG database, and performs a search for the stored homomorphically encrypted information based on a query from the first electronic device, thereby providing a consistent personalized AI service in a multi-device environment without the user's personal data being exposed to the server in plain text.

[0138] In addition, according to the example described above, the server device (100) associates homomorphic encrypted embedding vectors and encrypted text information obtained from multiple electronic devices and stores them in an encrypted RAG database, and by sharing the database among multiple electronic devices, personal data generated from a specific electronic device can be utilized in other electronic devices while preserving privacy.

[0139] According to the example described above, the server device (100) supports retrieving homomorphic encrypted information stored by another electronic device using a query from the first electronic device, thereby enabling the user to use personalized information retrieval and AI response generation services on any electronic device regardless of the device that generated the data.

[0140] FIG. 6 is a flowchart illustrating a method for obtaining a response ciphertext according to one or more embodiments of the present disclosure.

[0141] According to FIG. 6, the operation method according to one or more embodiments may include the operation (S610) of obtaining a response ciphertext corresponding to a homomorphic encrypted embedding vector identified through a search.

[0142] According to one example, the server device (100) can identify a homomorphically encrypted embedding vector corresponding to a homomorphically encrypted query vector in an encrypted RAG database. For example, the server device (100) can identify a homomorphically encrypted embedding vector corresponding to a query vector in the RAG database by performing a search on information stored in the encrypted RAG database based on the query vector. For example, the server device (100) can identify an embedding vector within the encrypted RAG database that has the highest relative similarity value with respect to the homomorphically encrypted query vector.

[0143] According to one example, the server device (100) can obtain a response ciphertext corresponding to a homomorphic encrypted embedding vector identified through a search. A homomorphic encrypted embedding vector may refer to a vector generated by encrypting an embedding vector in a plaintext state according to a homomorphic encryption method. For example, the server device (100) can obtain encrypted text information corresponding to a homomorphic encrypted embedding vector identified as a search result as a response ciphertext. That is, the server device (100) can obtain encrypted original text information as a response ciphertext.

[0144] Alternatively, for example, the server device (100) may obtain at least one of the homomorphic encrypted embedding vector and encrypted original text information identified as search results as a response ciphertext.

[0145] According to one or more embodiments, the operation method may include the operation (S620) of transmitting a response ciphertext to a first electronic device.

[0146] According to one example, the server device (100) may transmit a response ciphertext to a first electronic device through a communication circuit. For example, the server device (100) may transmit a response ciphertext containing encrypted text information to the first electronic device. Alternatively, for example, the server device (100) may transmit at least one of a homomorphic encrypted embedding vector and encrypted text information identified as a search result to the first electronic device.

[0147] According to one example, an electronic device can obtain a prompt by decrypting the response ciphertext. For example, the electronic device can decrypt information obtained as the response ciphertext (e.g., original text information) and input the decrypted information into a neural network model to generate response information.

[0148] FIG. 7 is a block diagram showing the configuration of an electronic device according to at least one embodiment of the present disclosure.

[0149] According to FIG. 7, the electronic device (200) includes a communication circuit (210), a processor (220), and a memory (230). According to one example, the electronic device (200) may be implemented as a device that communicates with a server device (100) (e.g., any one of the electronic devices (200-1 to 200-n) of FIG. 1).

[0150] The electronic device (200) can be implemented in various types. For example, when the electronic device (200) is implemented as a device with an integrated display, such as a smartphone or tablet PC, the electronic device (200) may include a communication circuit (210), memory (220), and processor (230), as well as configurations such as a display and / or input unit.

[0151] The general operation and examples of the communication circuit (210), memory (220), and processor (230) are identical or similar to those described for the server device (100), so a redundant description is omitted.

[0152] The communication circuit (210) can transmit homomorphic encrypted text to the server device (100).

[0153] The communication circuit (210) can transmit a query to the server device (100). At this time, the query may be transmitted by homomorphic encryption. In this case, the query may be referred to as a homomorphic encrypted query.

[0154] The communication circuit (210) can receive a response ciphertext corresponding to the query.

[0155] The memory (220) can store secret keys, public keys, etc., to be used in the electronic device (200).

[0156] Although not illustrated in FIG. 7, the electronic device (200) may include a display. The display is configured to display various UI (User Interface) screens. As described above, when the operation result (or query result) for a homomorphic ciphertext transmitted from the server device (100) is received through the communication circuit (210), the processor (230) can decrypt the operation result using a secret key stored in memory (220) and then display it on the display.

[0157] The input section is configured for inputting various user commands. If the electronic device (200) is implemented as a smartphone or tablet PC, the input section may be implemented as a touch screen integrated into the display. However, it is not limited thereto, and the input section may be implemented as a button or touch pad. Alternatively, if the electronic device (200) is capable of voice recognition, the input section may include a microphone.

[0158] When a user inputs a user command requesting that specific information be stored in the server device (100) through the input section, the processor (230) can homomorphically encrypt the information.

[0159] Homomorphic encryption methods can be implemented in various schemes. In the various embodiments of the present disclosure, homomorphic encryption is described based on the case where it is performed according to the CKKS (Cheon-Kim-Kim-Song) scheme, but it is not limited thereto and may be implemented in various other schemes.

[0160] To perform homomorphic encryption, various keys such as public keys and secret keys are required. The processor (230) or the processor (120) may generate these keys directly or receive and use them from an external device. For ease of explanation, a general method of key generation operation is described below, followed by a query search operation according to the present disclosure.

[0161] When the electronic device (200) generates a key itself, the processor (230) can generate a public key using the Ring-LWE technique. Specifically, the processor (230) can first set various parameters and a ring and store them in memory (220). Examples of parameters may include the length of the plaintext message bits, the dimension (n), the rank (k), and the size of the public key and the secret key. Homomorphic ciphertexts come in various forms, and the processor (230) can set the ring according to a ciphertext method based on a method set by the user or a predetermined method. For example, the homomorphic ciphertext method described above may be a CKKS scheme, an RLWE scheme, etc.

[0162] A ring can be expressed by the following mathematical formula 2.

[0163] [Mathematical Formula 2]

[0164]

[0165] Here, R is the ring, Zq is the coefficient, and f(x) is an n-th degree polynomial.

[0166] A ring is a set of polynomials with set coefficients, where addition and multiplication are defined between the elements and the set is closed under addition and multiplication.

[0167] For example, a ring refers to a set of n-th degree polynomials with coefficients Zq. Specifically, it refers to an N-th degree cyclotomic polynomial when n is Φ(N). (f(x)) represents the ideal of Zq[x] generated by f(x). The Euler totient function Φ(N) refers to the number of natural numbers that are coprime to N and less than N. If ΦN(x) is defined as an N-th degree cyclotomic polynomial, the ring can also be expressed by the following mathematical equation 3.

[0168] [Mathematical Formula 3]

[0169]

[0170] The ring (R) of the above-described mathematical formula 3 has a complex number in plaintext space.

[0171] To improve the computational speed for homomorphic ciphertexts, only the set of rings described above where the plaintext space is a real number may be used.

[0172] When such a ring is established, the processor (230) can derive a secret key (sk) from the ring. The secret key (sk) can be expressed as follows.

[0173] [Mathematical Formula 4]

[0174] sk ← (1, s(x)), s(x) ∈ R

[0175] Here, s(x) refers to a polynomial generated randomly with small coefficients. Since the secret key sk can be composed of a polynomial of s, the secret key sk may be described as s in the present disclosure.

[0176] Then, the processor (230) calculates a first random polynomial (a(x)) from the ring. The first random polynomial can be expressed as follows.

[0177] [Mathematical Formula 5]

[0178] a(x) ← R

[0179] Additionally, the processor (230) can produce an error. Specifically, the processor (230) can extract an error from a discrete Gaussian distribution or a distribution that is statistically close to it. Such an error can be expressed as follows.

[0180] [Mathematical Formula 6]

[0181] e(x) ←D n αq

[0182] When the error is calculated, the processor (230) can calculate the second random polynomial by performing a modular operation on the error in the first random polynomial and the secret key. The second random polynomial can be expressed as follows.

[0183] [Mathematical Formula 7]

[0184] b(x) = -a(x)s(x) + e(x)(mod q)

[0185] Finally, the public key (pk) is set as follows, in a form including a first random polynomial and a second random polynomial.

[0186] [Mathematical Formula 8]

[0187] pk = (b(x), a(x))

[0188] The contents of mathematical formulas 2 through 8 described above are examples of cases using the CKKS scheme method (i.e., the RLWE method), and in cases using the LWE or MLWE method, the described methods may be modified to suit the respective scheme. In addition, it is also possible to generate public and private keys using methods other than those described above.

[0189] According to one or more embodiments, the processor (220) can transmit a query to the server device (100).

[0190] According to one example, the processor (220) can transmit a query obtained based on user input to an encrypted RAG database of the server device (100) via the communication circuit (210). According to one example, the user input may be natural language text or voice data entered through an input interface (e.g., touchscreen, keyboard, microphone, etc.) of the electronic device (200).

[0191] According to one example, the processor (220) can generate a query based on user input. For example, the processor (220) can generate a query vector by applying an embedding model to user input (e.g., 'Tell me my schedule for tomorrow') and obtain the generated query vector as a query. The embedding model may be a neural network model that maps natural language text into a fixed-dimensional vector space. For example, the processor (220) can generate a query vector using an embedding model stored locally in the electronic device (200).

[0192] According to one example, the processor (220) can homomorphically encrypt the query and transmit it to the server device (100). For example, the processor (220) can homomorphically encrypt the generated query vector using a public key and transmit the homomorphically encrypted query to the server device (100) through the communication circuit (210). For example, the processor (220) can homomorphically encrypt the query using a homomorphic encryption method such as the CKKS (Cheon-Kim-Kim-Song) method.

[0193] According to one or more embodiments, the processor (220) can obtain a prompt.

[0194] According to one example, when the processor (220) obtains a response ciphertext from the server device (100), it can decrypt the response ciphertext to obtain a prompt. According to one example, the response ciphertext may be a ciphertext generated based on homomorphic encrypted information identified by the server device (100) by searching an encrypted RAG database.

[0195] According to one example, the processor (220) may receive a response ciphertext from the server device (100) through the communication circuit (210). For example, the processor (220) may receive a response ciphertext corresponding to a query from the server device (100) through the network (10). For example, the response ciphertext may include encrypted text information associated with a homomorphic encrypted embedding vector that has high similarity to the query.

[0196] According to one example, the processor (220) can decrypt the response ciphertext using a secret key. The secret key is a private key used to decrypt homomorphic ciphertext and may be stored in an electronic device (200). For example, the processor (220) may apply the secret key to the response ciphertext to obtain text information in plaintext and obtain the obtained text information as a prompt. For example, the prompt may include context information generated based on the user's personal data (e.g., schedule, memo, document content, etc.).

[0197] According to one or more embodiments, the processor (220) can generate response information.

[0198] According to one example, the processor (220) may input a prompt into a neural network model to generate response information. According to one example, the neural network model may be a language model running within an electronic device (200) that generates a response in the form of natural language based on the prompt.

[0199] According to one example, the processor (220) can generate response information using a neural network model stored locally in the electronic device (200). For example, the processor (220) can generate response information corresponding to a user's query by inputting a prompt into a Small Language Model (SLM), a Large Language Model (LLM), or a Large Multimodal Model (LMM).

[0200] The SLM is a lightweight language model and may be a neural network model that can be executed within the limited computational resources of the electronic device (200). For example, the processor (220) may generate response information by selecting at least one of the SLM or LLM according to the computational resources and response quality requirements of the electronic device (200).

[0201] According to one example, the processor (220) may combine a prompt and user input and input them into a neural network model. For example, the processor (220) may combine a decoded prompt (e.g., 'Meeting with Manager A on March 15, 2025') and user input (e.g., 'Tell me tomorrow's schedule') and input them into a neural network model, and generate personalized response information (e.g., 'A meeting with Manager A is scheduled for tomorrow at 2:00 PM') from the neural network model. For example, the processor (220) may provide the generated response information to the user through an output device (e.g., a display, a speaker, etc.) of the electronic device (200).

[0202] FIG. 8 is a flowchart illustrating a method for transmitting homomorphically encrypted information to a server device according to one or more embodiments of the present disclosure.

[0203] According to FIG. 8, the method of operation according to one or more embodiments may include an operation (S810) of homomorphically encrypting at least one piece of information stored in an electronic device. According to one example, the electronic device (200) may homomorphically encrypt at least one piece of information stored in the electronic device (200). According to one example, at least one piece of information may include personal data of a user (e.g., schedule, memo, contact, or document, etc.).

[0204] According to one example, the electronic device (200) can generate an embedding vector by applying an embedding model to stored information and homomorphically encrypt the generated embedding vector. For example, the electronic device (200) can generate an embedding vector by applying an embedding model to schedule data such as 'Meeting with Manager A on March 15, 2025'.

[0205] According to one example, the electronic device (200) can homomorphically encrypt an embedding vector using a public key. The public key is a key generated in correspondence with a secret key and may be a key used to convert plaintext data into homomorphic ciphertext. For example, the electronic device (200) can homomorphically encrypt an embedding vector using a homomorphic encryption method.

[0206] According to one example, the electronic device (200) can encrypt original text data corresponding to the embedding vector along with the homomorphically encrypted embedding vector.

[0207] According to one or more embodiments, the method of operation may include an operation (S820) of transmitting homomorphically encrypted information to a server device. According to one example, the electronic device (200) may transmit homomorphically encrypted information to a server device (100). According to one example, the homomorphically encrypted information may include at least one of a homomorphically encrypted embedding vector and encrypted text information.

[0208] According to one example, the electronic device (200) can transmit homomorphically encrypted information to the server device (100) through the communication circuit (210). For example, the electronic device (200) can transmit homomorphically encrypted embedding vectors and encrypted text information to the server device (100) through the network (10).

[0209] According to one example, a server device (100) may store homomorphically encrypted information received from an electronic device (200) in an encrypted RAG database. For example, the server device (100) may use a homomorphically encrypted embedding vector as an index key and store encrypted text information in an encrypted RAG database by associating it with a value corresponding to the index key. The encrypted RAG database may be shared among multiple electronic devices (200-1 to 200-n), and accordingly, homomorphically encrypted information stored in the electronic device (200) may be retrieved through a query transmitted from another electronic device.

[0210] According to the example described above, the electronic device (200) can accumulate personalized information in a cloud-based encrypted RAG database without exposing the user's personal data to the server in plain text by homomorphically encrypting the stored information and transmitting it to the server device (100).

[0211] FIG. 9 is a flowchart illustrating a method for homomorphically encrypting a query obtained based on user input according to one or more embodiments of the present disclosure.

[0212] According to FIG. 9, the operation method according to one or more embodiments may include an operation (S910) of homomorphically encrypting a query obtained based on user input. According to one example, the electronic device (200) may homomorphically encrypt a query obtained based on user input.

[0213] According to one example, the electronic device (200) can obtain a query based on user input. For example, the electronic device (200) can generate a query vector by applying an embedding model to user input (e.g., 'Tell me my schedule for tomorrow') and obtain the generated query vector as a query.

[0214] According to one example, the electronic device (200) can homomorphically encrypt a query using a public key. For example, the electronic device (200) can homomorphically encrypt a query vector using a homomorphic encryption method. For example, the electronic device (200) may include encryption noise generated during the homomorphic encryption process in the homomorphically encrypted query, and such noise may be controlled to a level that does not affect the precision of the original query vector during decryption.

[0215] According to one or more embodiments, the method of operation may include the operation (S920) of transmitting a homomorphically encrypted query to a server device. According to one example, the electronic device (200) may transmit the homomorphically encrypted query to the server device (100).

[0216] According to one example, the electronic device (200) can transmit a homomorphically encrypted query to the server device (100) via a communication circuit (210). For example, the electronic device (200) can transmit the homomorphically encrypted query to the encrypted RAG database of the server device (100) via a network (10).

[0217] According to one example, the server device (100) can perform a search by performing a homomorphic operation between a homomorphic encrypted query received from an electronic device (200) and homomorphic encrypted information stored in an encrypted RAG database. For example, the server device (100) can calculate a similarity value by performing an inner product operation or a distance operation between a homomorphic encrypted query and a homomorphic encrypted embedding vector as a homomorphic operation.

[0218] The server device (100) can prevent the content of user input from being exposed to the server device (100) by performing homomorphic operations on homomorphic encrypted queries and homomorphic encrypted information in a ciphertext state that has not been decrypted.

[0219] According to the example described above, the electronic device (200) can perform a search on an encrypted RAG database without exposing the user's query content to the server device (100) by homomorphically encrypting a query obtained based on user input and transmitting it to the server device (100).

[0220] FIG. 10 is a sequence diagram for illustrating a system including a server device and an electronic device according to one or more embodiments of the present disclosure.

[0221] According to FIG. 10, according to one or more embodiments, the system may include an electronic device (200) and a server device (100).

[0222] According to one or more embodiments, the electronic device (200) can obtain an encrypted query (S1010).

[0223] According to one example, the electronic device (200) can generate a query vector based on user input and obtain an encrypted query by homomorphically encrypting the generated query vector. For example, the electronic device (200) can generate a query vector by applying an embedding model to user input (e.g., 'Tell me my schedule for tomorrow') and homomorphically encrypt the query vector using a public key.

[0224] According to one or more embodiments, the electronic device (200) can transmit an encrypted query to the server device (100) (S1020).

[0225] According to one example, the electronic device (200) can transmit an encrypted query to the encrypted RAG database of the server device (100) through the communication circuit (210).

[0226] According to one or more embodiments, the server device (100) can search the RAG database (S1030).

[0227] According to one example, the server device (100) can perform a search by performing a homomorphic operation between an encrypted query received from an electronic device (200) and homomorphic encrypted information stored in an encrypted RAG database. For example, the server device (100) can calculate a similarity value by performing an inner product operation or a distance operation between an encrypted query and a homomorphic encrypted embedding vector as a homomorphic operation.

[0228] According to one or more embodiments, the server device (100) can identify homomorphically encrypted information (S1040).

[0229] According to one example, the server device (100) can identify homomorphically encrypted information similar to an encrypted query based on a similarity value calculated through homomorphic operation. For example, the server device (100) can identify homomorphically encrypted information that has the highest similarity value or is above a preset threshold.

[0230] According to one or more embodiments, the server device (100) can obtain a response ciphertext (S1050).

[0231] According to one example, the server device (100) can obtain a response ciphertext based on identified homomorphic encrypted information. For example, the server device (100) can obtain encrypted text information associated with an identified homomorphic encrypted embedding vector as the response ciphertext.

[0232] According to one or more embodiments, the server device (100) can transmit the response ciphertext to the electronic device (200) (S1060).

[0233] According to one example, the server device (100) can transmit a response ciphertext to an electronic device (200) through a communication circuit (110).

[0234] According to one or more embodiments, the electronic device (200) can decrypt the response ciphertext (S1070).

[0235] According to one example, the electronic device (200) can decrypt the response ciphertext received from the server device (100) using a secret key.

[0236] According to one or more embodiments, the electronic device (200) can obtain a prompt (S1080).

[0237] According to one example, the electronic device (200) can obtain a prompt based on a decrypted response ciphertext. For example, the electronic device (200) can obtain decrypted text information (e.g., 'Meeting with Manager A on March 15, 2025') as a prompt.

[0238] According to one or more embodiments, the electronic device (200) can generate response information (S1090).

[0239] According to one example, the electronic device (200) can input a prompt into a neural network model to generate response information. For example, the electronic device (200) can input a small language model (SLM), a large language model (LLM), or a large multimodal model (LMM) by combining the prompt and user input, and generate personalized response information (e.g., 'I have a meeting scheduled with Manager A tomorrow at 2 PM').

[0240] Meanwhile, FIG. 10 illustrates the operation between one electronic device (200) and a server device (100), but is not limited thereto, and multiple electronic devices (200-1 to 200-n) can interact with the server device (100).

[0241] According to one example, among a plurality of electronic devices (200-1 to 200-n), a second electronic device may homomorphically encrypt at least one piece of information stored in the second electronic device and transmit the homomorphically encrypted information to a server device (100). The server device (100) may store the homomorphically encrypted information received from the second electronic device (200-2) in an encrypted RAG database. Subsequently, when the first electronic device (200-1) transmits an encrypted query to the server device (100), the server device (100) may perform a search on the homomorphically encrypted information stored by the second electronic device (200-2) and transmit a response ciphertext to the first electronic device (200-1) based on the search results. In this way, the encrypted RAG database may be shared among a plurality of electronic devices (200-1 to 200-n), and accordingly, a user may receive personalized AI services on any electronic device regardless of the electronic device that stored the data.

[0242] Meanwhile, returning to FIG. 2, according to one or more embodiments, the processor (120) can generate an encrypted RAG database.

[0243] According to one example, when the processor (120) receives document data (e.g., PDF, text file, etc.) from the electronic device (200), it can automatically generate an encrypted embedding vector based on the document data. For example, the processor (120) can perform document processing such as layout analysis and OCR (Optical Character Recognition) on the document data to extract text information, and apply an embedding model to the extracted text information to generate an embedding vector.

[0244] According to one example, the processor (120) can homomorphically encrypt the generated embedding vector and store it in an encrypted RAG database. For example, the processor (120) can homomorphically encrypt the embedding vector using a public key received from an electronic device (200), and associate the homomorphically encrypted embedding vector with the encrypted original text information and store it in an encrypted RAG database.

[0245] According to one or more embodiments, the processor (120) can manage cryptographic keys associated with homomorphic encryption.

[0246] According to one example, the server device (100) may include a cryptographic key management system, and the processor (120) may distribute and manage cryptographic keys for a plurality of electronic devices (200-1 to 200-n) through the cryptographic key management system. For example, the processor (120) may perform cryptographic key authentication of the electronic device (200) and allow access to the encrypted RAG database only for the authenticated electronic device (200).

[0247] According to one or more embodiments, the processor (120) can monitor system resources.

[0248] According to one example, the processor (120) can monitor the resource usage of the isomorphic computing server (e.g., CPU usage, memory usage, GPU usage, etc.) and optimize the processing of isomorphic computing based on the monitoring results. For example, the processor (120) can adjust the processing order of queries received from a plurality of electronic devices (200-1 to 200-n) or dynamically adjust the computing resources allocated to isomorphic computing.

[0249] According to one or more embodiments, the processor (120) can perform a guardrail function.

[0250] According to one example, the processor (120) may monitor for hallucinations during the generation of the response ciphertext. A hallucination may refer to a phenomenon in which a neural network model generates incorrect information that is not based on actual data. For example, the processor (120) may verify the consistency between the search results and the generated response, and if a hallucination is detected, filter the response or transmit warning information to the electronic device (200).

[0251] Meanwhile, returning to FIG. 7, according to one or more embodiments, the electronic device (200) can be linked with a portable key inserter.

[0252] According to one example, the electronic device (200) may obtain a cryptographic key (e.g., secret key, public key, etc.) from a portable key injector. The portable key injector may be an external device for securely storing the cryptographic key and injecting it into the electronic device (200). For example, the electronic device (200) may obtain the cryptographic key through a wired or wireless connection with the portable key injector and perform homomorphic encryption or decryption using the obtained cryptographic key.

[0253] According to one or more embodiments, the electronic device (200) can be linked with an existing database system.

[0254] According to one example, the processor (220) can query the database of an existing system based on user input. For example, the processor (220) can convert the user's natural language input into an SQL query using Text2SQL technology and query the database of an existing system using the converted SQL query. The processor (220) can generate response information by combining the query results with the search results of the encrypted RAG database.

[0255] According to one or more embodiments, the processor (220) can manage user preferences and usage history.

[0256] According to one example, the processor (220) may store a history of the user's previous queries and responses in memory (230) and generate a personalized response based on the stored history. For example, the processor (220) may store the user's preferences (e.g., response format, language settings, etc.) and adjust the output of the neural network model according to the stored preferences.

[0257] The embodiments described above can be applied not only to personal multi-device environments but also to corporate or institutional environments. According to one example, the server device (100) is implemented in the internal network of a company or institution and can be linked with electronic devices (200-1 to 200-n) used by multiple users. In this case, the encrypted RAG database can be built based on confidential documents of the company or institution (e.g., statutes, directives, internal regulations, etc.), and the server device (100) can manage user-specific access rights through an encryption key management system.

[0258] According to one example, the server device (100) may be implemented based on a microservice architecture (MSA). For example, the server device (100) may implement services such as an API gateway, a conversational agent, a RAG service, authentication / authorization management, vector search, and monitoring as independent microservices. Accordingly, the server device (100) can be easily integrated with existing information support systems and can be independently expanded for each service.

[0259] Although various embodiments have been described above, each embodiment is not necessarily implemented individually, and may be combined with at least one other embodiment, either wholly or partially, to be implemented together in a single product.

[0260] Various embodiments of the present disclosure may be implemented as software comprising instructions stored on a machine-readable storage medium (e.g., a computer). The machine may include a server device (100) and an electronic device (200) according to the disclosed embodiments, as a device capable of calling instructions stored from the storage medium and operating according to the called instructions.

[0261] For example, a non-transitory readable storage medium may be provided that stores software for sequentially performing the various steps illustrated in FIG. 10.

[0262] A device equipped with such a non-transient readable medium can perform operations such as public key generation, encryption, and decryption as described in the various embodiments described above.

[0263] In non-transitory readable storage media, 'non-transitory' simply means that the storage medium does not contain a signal and is tangible; it does not distinguish whether data is stored semi-permanently or temporarily on the storage medium.

[0264] Alternatively, a program for performing the methods according to the various embodiments described above may be distributed online through an application store. For online distribution, at least a portion of the computer program product may be temporarily stored or temporarily created in a storage medium such as the memory of a manufacturer's server, an application store's server, or a relay server.

[0265] Each component (e.g., module or program) according to various embodiments may be composed of a singular or multiple entities, and some of the aforementioned sub-components may be omitted, or other sub-components may be further included in various embodiments. Generally or additionally, some components (e.g., module or program) may be integrated into a single entity to perform the functions performed by each of the respective components prior to integration in the same or similar manner. The operations performed by the module, program, or other components according to various embodiments may be executed sequentially, in parallel, iteratively, or heuristically, or at least some operations may be executed in a different order, omitted, or other operations added.

[0266] Although the present invention has been described above with reference to the attached drawings, the scope of the present invention is determined by the claims set forth below and should not be interpreted as being limited to the aforementioned embodiments and / or drawings. Furthermore, it should be clearly understood that improvements, changes, and modifications to the invention described in the claims that are obvious to those skilled in the art are also included within the scope of the present invention. Explanation of the symbols

[0267] 100: Server device 200: Electronic device 110: Communication circuit 120: Processor 130: Memory 210: Communication circuit 220: Processor 230: Memory

Claims

Claim 1 A server device comprising: a communication circuit communicating with at least one electronic device; at least one processor including a processing circuitry; and a memory storing an encrypted retrieval-augmented generation (RAG) database including instructions, one or more storage media and at least one homomorphically encrypted information; wherein, when the instructions are executed individually or collectively by the at least one processor, the server device searches the encrypted RAG database based on a query obtained through the communication circuit from a first electronic device among the at least one electronic device, obtains a response ciphertext based on the homomorphically encrypted information identified through the search, and transmits the response ciphertext to the first electronic device through the communication circuit. Claim 2 A server device according to claim 1, wherein the query is a homomorphically encrypted query, and when the instructions are executed individually or collectively by the at least one processor, the server device performs a homomorphic operation between the homomorphically encrypted query and the at least one homomorphically encrypted information to perform the search. Claim 3 A server device according to claim 1, wherein, when the instructions are executed individually or collectively by the at least one processor, the server device stores homomorphically encrypted information obtained from a second electronic device among the at least one electronic device in the encrypted RAG database, and when the query is obtained from the first electronic device, performs a search for the stored homomorphically encrypted information. Claim 4 In claim 1, the encrypted RAG database is a server device shared between the at least one electronic device. Claim 5 In claim 1, the homomorphically encrypted information comprises a homomorphically encrypted embedding vector, and when the instructions are executed individually or collectively by the at least one processor, the server device obtains a response ciphertext corresponding to the homomorphically encrypted embedding vector identified through the search, and the response ciphertext comprises encrypted text information. Claim 6 An electronic device comprising: a communication circuit communicating with a server device including an encrypted retrieval-augmented generation (RAG) database; at least one processor including a processing circuitry; and a memory storing instructions, one or more storage media and a neural network model; wherein, when the instructions are executed individually or collectively by the at least one processor, the electronic device transmits a query obtained based on user input to the encrypted RAG database of the server device through the communication circuit, and when a response ciphertext is obtained from the server device, decrypts the response ciphertext to obtain a prompt, and inputs the prompt to the neural network model to generate response information. Claim 7 In paragraph 6, the above neural network model is an electronic device in which the SLM (Small Language Model), LLM (Large Language Model), or LMM (Large Multimodal Model) executed within the electronic device. Claim 8 An electronic device according to claim 6, wherein, when the instructions are executed individually or collectively by the at least one processor, the electronic device homomorphically encrypts at least one piece of information stored in the electronic device and transmits the homomorphically encrypted information to the server device through the communication circuit. Claim 9 An electronic device according to claim 6, wherein, when the instructions are executed individually or collectively by the at least one processor, the electronic device homomorphically encrypts a query obtained based on user input and transmits the homomorphically encrypted query to the server device through the communication circuit. Claim 10 A method of operation of a server device comprising: an operation of searching an encrypted RAG (retrieval-augmented generation) database containing at least one homomorphically encrypted information based on a query obtained from a first electronic device among at least one electronic device; an operation of obtaining a response ciphertext based on the homomorphically encrypted information identified through the search; and an operation of transmitting the response ciphertext to the first electronic device. Claim 11 In claim 10, the above query is a homomorphically encrypted query, and the above search operation is an operation of performing the search by performing a homomorphic operation between the above homomorphically encrypted query and at least one homomorphically encrypted information; a method of operation comprising. Claim 12 A method of operation according to claim 10, further comprising: an operation of storing homomorphically encrypted information obtained from a second electronic device among at least one electronic device in the encrypted RAG database; and an operation of performing a search for the stored homomorphically encrypted information when the query is obtained from the first electronic device. Claim 13 In paragraph 10, the above-mentioned encrypted RAG database is shared between at least one electronic device, a method of operation. Claim 14 In claim 10, the homomorphically encrypted information comprises a homomorphically encrypted embedding vector, and the operation of obtaining the response ciphertext comprises obtaining a response ciphertext corresponding to the homomorphically encrypted embedding vector identified through the search; and the response ciphertext comprises encrypted text information. Claim 15 A method of operation in which, in paragraph 10, the above response ciphertext is decrypted in the first electronic device and input into a neural network model stored in the first electronic device.