LLM model-based reasoning calculation method and device

By using the sparse encoding framework to encrypt data in the LLM model, the problem of privacy data leakage during the training and use of LLM models is solved, and the security of user data and the robustness of the model is achieved.

CN119940551APending Publication Date: 2025-05-06YIWU QINGYUE PHOTOELECTRIC TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510067346.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-16
Publication Date
2025-05-06

AI Technical Summary

Technical Problem

During the training and use of LLM models, privacy data may be leaked, posing security risks to users.

Method used

The LLM inference model that includes sparse encoding framework and transformer-decoder framework is adopted to encrypt data through the sparse encoding framework during model training and use to ensure the security of the data.

Benefits of technology

It effectively avoids the leakage of private data, ensures the security of user data, and improves the security and robustness of the LLM model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119940551A_ABST
    Figure CN119940551A_ABST
Patent Text Reader

Abstract

The invention discloses a reasoning calculation method and device based on an LLM model, and relates to the technical field of artificial intelligence, and the method comprises the steps: obtaining sample data from a plurality of data providers; the sample data is data containing privacy information; training a pre-established LLM inference model to be trained by using the sample data to obtain a trained LLM inference model; the LLM inference model to be trained comprises a sparse coding framework and a transform-decoder framework; and performing reasoning calculation on the to-be-reasoned data containing the privacy information by using the trained LLM reasoning model. According to the method, leakage of privacy data is avoided in the LLM training and using process, and the safety of user data is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to an inference calculation method and device based on an LLM inference model. Background Art

[0002] ‌LLM (Large Language Model) refers to a machine learning model with large-scale parameters and complex computational structure, usually built by deep neural networks with billions or even hundreds of billions of parameters.‌

[0003] The LLM model needs to learn complex patterns and features through massive sample data in order to have stronger generalization capabilities and make accurate predictions on unseen data. However, these sample data may involve some privacy information, which may lead to the leakage of private data during the training of the LLM model. Moreover, when users use the trained LLM model for inference calculations, the data input by users into the LLM model may also be leaked, posing a security risk to users. Summary of the invention

[0004] The embodiment of the present invention provides an inference calculation method based on the LLM model, which is used to avoid the leakage of private data and ensure the security of user data during the training and use of the LLM model. The method includes: Acquire sample data from multiple data providers; the sample data is data containing private information; Using the sample data to train a pre-built LLM inference model to be trained, to obtain a trained LLM inference model; the LLM inference model to be trained includes a sparse coding framework and a transformer-decoder framework; The trained LLM inference model is used to perform inference calculations on the data to be inferred containing privacy information.

[0005] The embodiment of the present invention further provides an inference computing device based on the LLM model, which is used to avoid the leakage of private data and ensure the security of user data during the training and use of the LLM model. The device includes: A data acquisition module, used to acquire sample data from multiple data providers; the sample data is data containing private information; A training module, used to train a pre-built LLM inference model to be trained using the sample data to obtain a trained LLM inference model; the LLM inference model to be trained includes a sparse coding framework and a transformer-decoder framework; the sparse coding framework is used to perform dimensionality reduction coding on the input sample data; The reasoning module is used to use the trained LLM reasoning model to perform reasoning calculations on the data to be reasoned containing privacy information.

[0006] An embodiment of the present invention also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned reasoning and calculation method based on the LLM model when executing the computer program.

[0007] An embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the above-mentioned reasoning and calculation method based on the LLM model is implemented.

[0008] An embodiment of the present invention further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the inference calculation method based on the LLM model is implemented.

[0009] In an embodiment of the present invention, sample data is obtained from multiple data providers; the sample data is data containing private information; the pre-built LLM inference model to be trained is trained using the sample data to obtain a trained LLM inference model; the LLM inference model to be trained includes a sparse coding framework and a transformer-decoder framework; the trained LLM inference model is used to perform inference calculations on the data to be inferred containing private information. In an embodiment of the present invention, the LLM inference model includes a sparse coding framework and a transformer-decoder framework, and the sparse coding framework can encrypt the sample data before using it for inference calculations of the data, thereby avoiding the leakage of private data during the training and use of the LLM model and ensuring the security of user data. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0011] In the attached picture: Figure 1 It is a flow chart of a reasoning calculation method based on the LLM model in an embodiment of the present invention; Figure 2 It is a flowchart of another reasoning calculation method based on the LLM model in an embodiment of the present invention; Figure 3It is a flowchart of another reasoning calculation method based on the LLM model in an embodiment of the present invention; Figure 4 Schematic diagram of an inference computing device based on an LLM model in an embodiment of the present invention; Figure 5 Schematic diagram of a computer device in an embodiment of the present invention. DETAILED DESCRIPTION

[0012] To make the purpose, technical solution and advantages of the embodiments of the present invention more clear, the embodiments of the present invention are further described in detail below in conjunction with the accompanying drawings. Here, the exemplary embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention.

[0013] In the description of this specification, the terms "include", "including", "have", "contain", etc. are all open terms, which mean including but not limited to. The descriptions with reference to the terms "one embodiment", "a specific embodiment", "some embodiments", "for example", etc. mean that the specific features, structures or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures or characteristics described may be combined in a suitable manner in any one or more embodiments or examples. The order of steps involved in each embodiment is used to schematically illustrate the implementation of the present application, and the order of steps is not limited and can be appropriately adjusted as needed.

[0014] Research has found that in the process of training the LLM model, the privacy information involved in the sample data may be leaked; moreover, when the user uses the trained LLM model for inference calculations, it may also cause the data input by the user into the LLM model to leak, posing a security risk to the user.

[0015] Based on this, an embodiment of the present invention provides an inference calculation scheme based on the LLM model. In this scheme, the LLM inference model includes a sparse coding framework and a transformer-decoder framework. During the training and use of the LLM model, the data is encrypted through the sparse coding framework to avoid the leakage of privacy data and ensure the security of user data.

[0016] like Figure 1 As shown, it is a flowchart of a reasoning calculation method based on the LLM model provided by an embodiment of the present invention. The method may include: Step 101, obtaining sample data from multiple data providers; the sample data is data containing private information; Step 102, using the sample data to train the pre-built LLM inference model to be trained to obtain a trained LLM inference model; the LLM inference model to be trained includes a sparse coding framework and a transformer-decoder framework; Step 103: Use the trained LLM reasoning model to perform reasoning calculations on the data to be reasoned that contains privacy information.

[0017] In an embodiment of the present invention, sample data is obtained from multiple data providers; the sample data is data containing private information; the pre-built LLM inference model to be trained is trained using the sample data to obtain a trained LLM inference model; the LLM inference model to be trained includes a sparse coding framework and a transformer-decoder framework; the trained LLM inference model is used to perform inference calculations on the data to be inferred containing private information. In an embodiment of the present invention, the LLM inference model includes a sparse coding framework and a transformer-decoder framework, and the sparse coding framework can encrypt the sample data before using it for inference calculations of the data, thereby avoiding the leakage of private data during the training and use of the LLM model and ensuring the security of user data.

[0018] In an embodiment of the present invention, a combination framework of a sparse coding framework and a transformer-decoder framework is configured as an LLM reasoning model. In the process of training or using the LLM reasoning model, the sparse coding framework can perform dimensionality reduction encoding on the data input to the model to achieve data encryption; the transformer-decoder framework performs reasoning calculations on the data after dimensionality reduction encoding.

[0019] In one embodiment, the sparse coding framework may be disposed before the input layer of the transformer-decoder framework; or, the sparse coding framework may be disposed between the attention layer and the decoder layer of the transformer-decoder framework.

[0020] Below Figure 1 The inference calculation method based on the LLM model shown is explained in detail.

[0021] The above steps 101 and 102 are the training process of the LLM reasoning model. In the process of training the model, a large amount of sample data is required. Therefore, in step 101, based on the specific usage scenario of the LLM reasoning model, sample data in the usage scenario can be obtained from multiple data providers. For example, in the scenario where the LLM reasoning model is used for visual inspection, historical visual inspection data can be obtained from the data provider in the relevant scenario as sample data.

[0022] The above sample data may contain private information, which includes but is not limited to: user personal information, commercial or technical privacy information, etc.

[0023] In the above step 102, the sample data obtained in step 101 can be used to train the pre-built LLM reasoning model to be trained to obtain a trained LLM reasoning model.

[0024] In specific implementation, the sample data is divided into a training data set and a test data set according to a preset ratio, the training data set is used to train the LLM reasoning model, and the test data set is used to test the LLM reasoning model.

[0025] In the embodiment of the present invention, the LLM inference model to be trained includes a sparse coding framework and a transformer-decoder framework. Therefore, in one embodiment, Figure 2 As shown, step 102 training the model may specifically include: Step 201, input the sample data into a pre-built LLM inference model to be trained for model training, wherein the sparse coding framework performs dimensionality reduction encoding on the sample data, and uses the sample data after dimensionality reduction encoding to train the model parameters of the transformer-decoder framework; the trained LLM inference model includes the model parameters of the transformer-decoder framework and the sparse coding dictionary of the sparse coding framework.

[0026] In the specific implementation, in order to prevent others from obtaining private information by communicating with the LLM large model, in the process of training the model, the sparse coding framework can be used to reduce the dimension of the data input to the model to achieve data encryption; then use the data after dimension reduction coding to train the transformer-decoder framework. Specifically, in the sparse coding framework, it is necessary to select a set of sparse coding dictionaries as basic vectors to represent the input data in the form of a set of linear combinations. The selection of basic vectors will affect the sparse coding effect. Generally, algorithms such as PCA and K-Means can be used to train sparse coding dictionaries. It should be noted that the training of the model parameters of the transformer-decoder framework and the training of the sparse coding dictionary of the sparse coding framework need to be completed at the same time. The trained LLM inference model can include the model parameters of the transformer-decoder framework and the sparse coding dictionary of the sparse coding framework.

[0027] In this way, by adding a sparse coding framework to the LLM reasoning model, the sparse coding framework can perform dimensionality reduction encoding on the data of the input model to achieve data encryption, thereby improving the security of the LLM reasoning model. In the process of training the sparse coding dictionary, the dimensionality reduction and recovery processes are added, further improving the overall robustness of the LLM reasoning model.

[0028] In step 103, the trained LLM inference model may be used to perform inference calculations on data containing private information.

[0029] In specific implementation, when using the trained LLM inference model for inference calculation, the inference input data needs to be compressed by sparse coding dictionary to form the effective input of transformer-decoder. In this way, the security of input data can be guaranteed and data leakage can be avoided.

[0030] In one embodiment, Figure 3 As shown, it may also include: Step 301: Send the sparse coding dictionary of the sparse coding framework to each data provider for storage.

[0031] In the specific implementation, considering that not all data to be inferred contain privacy information, in order to avoid wasting the computing power of the model, each data provider can save the sparse coding dictionary obtained through joint training. When using the trained LLM inference model, if the data to be inferred contains privacy information and needs to be encrypted, the sparse coding dictionary can be obtained from each data provider and inserted into the corresponding position of the trained LLM inference model. That is, after the data to be inferred is input into the trained LLM inference model, the sparse coding dictionary can be used as a key to encrypt the data to be inferred to avoid data leakage.

[0032] In summary, in the embodiment of the present invention, sample data is obtained from multiple data providers; the sample data is data containing private information; the pre-built LLM inference model to be trained is trained using the sample data to obtain a trained LLM inference model; the LLM inference model to be trained includes a sparse coding framework and a transformer-decoder framework; the trained LLM inference model is used to perform inference calculations on the data to be inferred containing private information. In the embodiment of the present invention, the LLM inference model includes a sparse coding framework and a transformer-decoder framework, and the sparse coding framework can encrypt the sample data before using it for inference calculations of the data, thereby avoiding the leakage of private data during the training and use of the LLM model and ensuring the security of user data.

[0033] The embodiment of the present invention also provides an inference calculation device based on the LLM model, as described in the following embodiment. Since the principle of solving the problem by the device is similar to the inference calculation method based on the LLM model, the implementation of this method can refer to the implementation of the inference calculation method based on the LLM model, and the repeated parts will not be repeated.

[0034] like Figure 4 FIG. 1 is a schematic diagram of an inference computing device based on an LLM model provided by an embodiment of the present invention. The device may include the following steps: The data acquisition module 401 is used to acquire sample data from multiple data providers; the sample data is data containing private information; The training module 402 is used to train the pre-built LLM inference model to be trained using the sample data to obtain a trained LLM inference model; the LLM inference model to be trained includes a sparse coding framework and a transformer-decoder framework; the sparse coding framework is used to perform dimensionality reduction coding on the input sample data; The reasoning module 403 is used to use the trained LLM reasoning model to perform reasoning calculations on the data to be reasoned containing privacy information.

[0035] In one embodiment, the sparse coding framework is arranged before the input layer of the transformer-decoder framework.

[0036] In one embodiment, the sparse coding framework is arranged between the attention layer and the decoder layer of the transformer-decoder framework.

[0037] In one embodiment, the training module 402 may be specifically used to: Input the sample data into a pre-built LLM inference model to be trained to train the model, wherein the sparse coding framework performs dimension reduction encoding on the sample data, and uses the dimension reduction encoded sample data to train the model parameters of the transformer-decoder framework; The trained LLM inference model includes model parameters of the transformer-decoder framework and a sparse coding dictionary of the sparse coding framework.

[0038] In one embodiment, the device may further include a sending module, configured to: The sparse coding dictionary of the sparse coding framework is sent to each of the data providers for storage.

[0039] An embodiment of the present invention further provides a computer device, Figure 5This is a schematic diagram of a computer device in an embodiment of the present invention. The computer device 500 includes a memory 510, a processor 520, and a computer program 530 stored in the memory 610 and executable on the processor 520. When the processor 520 executes the computer program 530, the above-mentioned reasoning calculation method based on the LLM model is implemented.

[0040] An embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the above-mentioned reasoning and calculation method based on the LLM model is implemented.

[0041] An embodiment of the present invention further provides a computer program product, which includes a computer program. When the computer conversion program is executed by a processor, the above-mentioned reasoning and calculation method based on the LLM model is implemented.

[0042] In an embodiment of the present invention, sample data is obtained from multiple data providers; the sample data is data containing private information; the pre-built LLM inference model to be trained is trained using the sample data to obtain a trained LLM inference model; the LLM inference model to be trained includes a sparse coding framework and a transformer-decoder framework; the trained LLM inference model is used to perform inference calculations on the data to be inferred containing private information. In an embodiment of the present invention, the LLM inference model includes a sparse coding framework and a transformer-decoder framework, and the sparse coding framework can encrypt the sample data before using it for inference calculations of the data, thereby avoiding the leakage of private data during the training and use of the LLM model and ensuring the security of user data.

[0043] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0044] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0045] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0046] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0047] The specific embodiments described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A reasoning calculation method based on the LLM model, characterized in that: include: Acquire sample data from multiple data providers; the sample data is data containing private information; Using the sample data to train a pre-built LLM inference model to be trained, to obtain a trained LLM inference model; the LLM inference model to be trained includes a sparse coding framework and a transformer-decoder framework; The trained LLM inference model is used to perform inference calculations on the data to be inferred containing privacy information.

2. The method according to claim 1, characterized in that The sparse coding framework is arranged before the input layer of the transformer-decoder framework.

3. The method according to claim 1, characterized in that The sparse coding framework is arranged between the attention layer and the decoder layer of the transformer-decoder framework.

4. The method according to claim 1, characterized in that The sample data is used to train the pre-built LLM reasoning model to be trained to obtain a trained LLM reasoning model, including: The sample data is input into a pre-built LLM inference model to be trained for model training, wherein the sparse coding framework performs dimension reduction encoding on the sample data, and uses the dimension reduction encoded sample data to train the model parameters of the transformer-decoder framework; the trained LLM inference model includes the model parameters of the transformer-decoder framework and the sparse coding dictionary of the sparse coding framework.

5. The method according to claim 4, characterized in that Also includes: The sparse coding dictionary of the sparse coding framework is sent to each of the data providers for storage.

6. An inference computing device based on the LLM model, characterized in that: include: A data acquisition module, used to acquire sample data from multiple data providers; The sample data is data containing private information; A training module, used to train a pre-built LLM inference model to be trained using the sample data to obtain a trained LLM inference model; the LLM inference model to be trained includes a sparse coding framework and a transformer-decoder framework; The sparse coding framework is used to perform dimension reduction coding on the input sample data; The reasoning module is used to use the trained LLM reasoning model to perform reasoning calculations on the data to be reasoned containing privacy information.

7. The device according to claim 6, characterized in that Training modules are specifically used for: Input the sample data into a pre-built LLM inference model to be trained to train the model, wherein the sparse coding framework performs dimension reduction encoding on the sample data, and uses the dimension reduction encoded sample data to train the model parameters of the transformer-decoder framework; The trained LLM inference model includes model parameters of the transformer-decoder framework and a sparse coding dictionary of the sparse coding framework.

8. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 5 is implemented.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.