Information processing method and apparatus, electronic device, and medium

By distributing three-layer language models in electronic devices and servers, processing data in large language models, the problem of low computational efficiency of homomorphic encryption algorithms is solved, and efficient computing and privacy data are achieved.

WO2025108186A1PCT designated stage expired Publication Date: 2025-05-30VIVO MOBILE COMM CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/132282
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-11-21
Filing Date
2024-11-15
Publication Date
2025-05-30

AI Technical Summary

Technical Problem

Existing homomorphic encryption algorithms have low computational efficiency in the inference process of large language models, especially the fully homomorphic encryption algorithm requires multiple calculations and iterations, resulting in lower computational efficiency.

Method used

By distributing three-layer language models in electronic devices and servers, the electronic devices process data through the first-layer language model, obtain feature vectors and send them to the server for further processing, and finally generate processing results from the third-layer language model.

Benefits of technology

It improves the computing efficiency of electronic devices, while ensuring the security of user privacy data and avoiding data leakage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024132282_30052025_PF_FP_ABST
    Figure CN2024132282_30052025_PF_FP_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of artificial intelligence, and discloses an information processing method and apparatus, an electronic device, and a medium. The method comprises: inputting first data into a first language model; processing the first data by means of a first-layer language model to obtain a first feature vector; sending the first feature vector to a server; receiving a second feature vector sent by the server, wherein the second feature vector is obtained by processing the first feature vector by means of a second-layer language model; and processing the second feature vector by means of a third-layer language model to obtain a processing result.
Need to check novelty before this filing date? Find Prior Art

Description

Information processing method, device, electronic device and medium

[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on November 21, 2023, with application number 202311563470.4 and titled “Information Processing Methods, Devices, Electronic Devices and Media,” the entire contents of which are incorporated by reference into this application. Technical Field

[0002] The present application belongs to the field of artificial intelligence technology, and specifically relates to an information processing method, device, electronic device and medium. Background Art

[0003] Currently, electronic devices can generate or translate text using large language models. Because large-scale model inference requires massive amounts of data as input, this data may contain private information, such as personal identification information and medical records. Leaking this data could pose serious privacy risks to users.

[0004] In related technologies, electronic devices can encrypt input data through homomorphic encryption to prevent the leakage of user privacy data. The above homomorphic encryption allows electronic devices to directly process the encrypted data without decrypting the input data, thereby protecting the privacy of the data.

[0005] However, in the above method, since homomorphic encryption processes data in the ciphertext state, it consumes a lot of computing resources, so the computational efficiency of the homomorphic encryption algorithm is relatively low; especially for the fully homomorphic encryption algorithm, since it requires multiple calculations and iterations, the computational efficiency is even lower. Summary of the Invention

[0006] The purpose of the embodiments of the present application is to provide an information processing method, device, electronic device and medium, which can improve the data computing efficiency in the electronic device while preventing data leakage.

[0007] In a first aspect, an embodiment of the present application provides an information processing method, which includes: inputting first data into a first language model, the first language model includes a three-layer language model, the three-layer language model includes a first-layer language model located in the electronic device, a second-layer language model located in the server, and a third-layer language model located in the electronic device; processing the first data through the first-layer language model to obtain a first feature vector; sending the first feature vector to the second-layer language model; receiving a second feature vector sent by the second-layer language model, the second feature vector is obtained by processing the first feature vector by the second-layer language model; processing the second feature vector through the third-layer language model to obtain a processing result.

[0008] In the second aspect, an embodiment of the present application provides an information processing device, which includes: an input module, a processing module and a receiving module. The input module is used to input the first data into the first language model, and the first language model includes a three-layer language model, and the three-layer language model includes a first-layer language model located in the electronic device, a second-layer language model located in the server, and a third-layer language model located in the electronic device. The processing module is used to process the first data through the first-layer language model to obtain a first feature vector; and send the first feature vector to the second-layer language model. The receiving module is used to receive the second feature vector sent by the second-layer language model, and the second feature vector is obtained by processing the first feature vector by the second-layer language model. The processing module is also used to process the second feature vector through the third-layer language model to obtain a processing result.

[0009] In a third aspect, an embodiment of the present application provides an electronic device comprising a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the programs or instructions are executed by the processor, the steps of the method described in the first aspect are implemented.

[0010] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.

[0011] In a fifth aspect, an embodiment of the present application provides a chip, which includes a processor and a communication interface, the communication interface and the processor are coupled, and the processor is used to run programs or instructions to implement the method described in the first aspect.

[0012] In a sixth aspect, an embodiment of the present application provides a computer program product, which is stored in a storage medium and executed by at least one processor to implement the method described in the first aspect.

[0013] In an embodiment of the present application, an electronic device may input first data into a first language model, the first language model including a three-layer language model, the three-layer language model including a first-layer language model located in the electronic device, a second-layer language model located in the server, and a third-layer language model located in the electronic device; the first data is processed by the first-layer language model to obtain a first feature vector; the first feature vector is sent to the second-layer language model; a second feature vector is received from the second-layer language model, the second feature vector being obtained by processing the first feature vector by the second-layer language model; and the second feature vector is processed by the third-layer language model to obtain a processing result. In this solution, since the language models can be included in the electronic device and the server respectively, the processing of the first data in the electronic device and the server can be independent of each other, and the server cannot directly obtain the first data. The electronic device can ensure that the user's private data is not leaked without encrypting the private data. In this way, while improving the computing efficiency of the electronic device, the security of the private data can also be guaranteed. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] FIG1 is a schematic diagram of the structure of a large language model in related art.

[0015] FIG2 is a flowchart of an information processing method according to an embodiment of the present application;

[0016] FIG3 is a second flowchart of an information processing method provided in an embodiment of the present application;

[0017] FIG4 is a schematic diagram of the structure of a first-layer language model provided in an embodiment of the present application;

[0018] FIG5 is a third flowchart of an information processing method provided in an embodiment of the present application;

[0019] FIG6 is a second structural diagram of a first-layer language model provided in an embodiment of the present application;

[0020] FIG7 is a fourth flowchart of an information processing method provided in an embodiment of the present application;

[0021] FIG8 is a fifth flowchart of an information processing method provided in an embodiment of the present application;

[0022] FIG9 is a schematic structural diagram of an information processing device provided in an embodiment of the present application;

[0023] FIG10 is a schematic diagram of a hardware structure of an electronic device provided in an embodiment of the present application;

[0024] FIG11 is a second schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application. Specific embodiments

[0025] The following will be combined with the accompanying drawings in the embodiments of this application to clearly describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field are within the scope of protection of this application.

[0026] The terms "first," "second," and the like in the specification and claims of this application are used to distinguish similar objects, and are not used to describe a specific order or precedence. It should be understood that the terms used in this manner are interchangeable where appropriate, so that the embodiments of this application can be implemented in an order other than that illustrated or described herein, and that the objects distinguished by "first," "second," and the like are generally of the same type, and do not limit the number of objects; for example, the first object can be one or more. In addition, the term "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0027] The terms "at least one" and "at least one of" in the specification and claims of this application refer to any one, any two, or a combination of more than two of the objects included. For example, at least one of a, b, and c can be represented by: "a", "b", "c", "a and b", "a and c", "b and c", and "a, b, and c", where a, b, and c can be single or multiple. Similarly, "at least two" means two or more, and its meaning is similar to "at least one".

[0028] Below, in conjunction with the accompanying drawings, the privacy data protection method, language model training method, device, electronic device and medium provided in the embodiments of the present application are described in detail through specific embodiments and their application scenarios.

[0029] The privacy data protection method, language model training method, device, electronic device and medium provided in the embodiments of the present application can be applied to privacy data protection scenarios in large language models.

[0030] With the development of electronic devices, more and more functions are being added to them. For example, electronic devices can use large language models to perform machine translation, text generation, and dialogue systems.

[0031] A large language model is a machine learning model that automatically learns linguistic patterns and generates natural language text. It is a key research direction in natural language processing, with applications in a variety of fields, including machine translation, text generation, and conversational systems. Large language models typically utilize neural networks and can be trained on large corpora to learn linguistic patterns and patterns. During training, large language models can recognize language units at different levels, such as words, phrases, sentences, and paragraphs, and can encode and decode them, enabling the generation and understanding of natural language text. With the advancement of deep learning technology and increases in computing power, the research and application of large language models are becoming increasingly widespread. Currently, several major technology companies and research institutions have developed a series of natural language processing tools and applications based on large language models, such as Google's BERT and OpenAI's GPT.

[0032] Exemplarily, as shown in FIG1 , the large language model 10 includes: a text embedding layer 11 , an intermediate layer 12 , and a language header layer 13 . The text embedding layer 11 is connected to the intermediate layer 12 , and the intermediate layer 12 is connected to the language header layer 13 .

[0033] The input of the large language model is usually a piece of text, which can be a language unit at different levels such as a word, a sentence, or a paragraph. The text embedding layer 11 usually uses word embedding technology to convert the input text into a vector representation. The input text sequence is converted into a vector representation, usually using word embedding technology. For example, assuming that the input sequence is X = {x1, x2, ..., xn}, where each xi is a word, the output of the text embedding layer is E = {e1, e2, ..., en}, where each ei is the vector representation corresponding to xi.

[0034] The middle layer 12 is the core of the large language model and includes multiple decoder layers. The input is a tensor containing a feature vector, and the decoder uses the feature vector to generate a tensor containing a new feature vector. Multiple decoders are stacked. Assume that the input tensor is X = {x1, x2, ..., xm}, where each xi is a feature vector, and the output of the decoder layer is Y = {y1, y2, ..., ym}, where each yi is also a feature vector. Assume that there are L layers of decoders, and the output tensor of each layer is Hl = {hl1, hl2, ..., hlm}, where hli is the feature vector at position i output by the l-th layer decoder. The following calculation formula 1 can be used: Hl = Decoder(Hl-1) (1)

[0035] Among them, Hl-1 represents the output feature tensor of the previous layer, and Decoder(·) represents the calculation function of the decoder layer.

[0036] The language head layer 13, the output layer is usually a fully connected layer, also known as the language model head, which is used to convert the feature vectors of the intermediate layer into the final text output. Assuming that Y^ = {y1^, y2^, ..., ym^} represents the output vector sequence of all the previous decoder layers, W and b represent the weights and bias output layers of the language model head layer, respectively, the following calculation formula 2 can be used: LM_Head(Y^) = W·Y^+b (2)

[0037] However, large language model inference involves a large amount of data processing and computation, and therefore may pose data and privacy issues. Specifically, large language model inference may face the following data and privacy issues.

[0038] 1. Data leakage: The inference process of large models requires a large amount of data as input. This data may contain sensitive information, such as personal identity information and medical records. If this data is leaked, it may pose a serious privacy risk to users.

[0039] 2. Model attacks: Models used in large-scale model inference may be vulnerable to attacks such as adversarial sample attacks and model pruning attacks. These attacks may cause the model to output incorrect results, thereby affecting data accuracy and privacy.

[0040] To protect user privacy, large-model inference requires appropriate privacy protection measures, such as differential privacy and homomorphic encryption. These privacy protection measures can ensure data security while maintaining data accuracy as much as possible. Therefore, when performing large-scale language model inference, appropriate data and privacy protection measures must be implemented to ensure data security and privacy.

[0041] However, differential privacy is a method for protecting individual privacy by adding noise to obfuscate data, thereby protecting user privacy. Homomorphic encryption is an encryption method that can perform calculations on ciphertext without decrypting it, thereby protecting data privacy. Both methods have some shortcomings, mainly including the following:

[0042] 1. Noise affects data accuracy and may cause the data to lose its original information and meaning, thereby affecting data analysis and application.

[0043] 2. Low computational efficiency: Homomorphic encryption algorithms have relatively low computational efficiency and require a large amount of computing resources. This is especially true for fully homomorphic encryption algorithms, which require multiple calculations and iterations, resulting in even lower computational efficiency.

[0044] 3. Noise selection and control: Noise needs to be added to data to protect privacy, but the selection and control of noise is also a challenge. Too little noise may leak privacy, while too much noise may affect data accuracy and quality.

[0045] 4. Limited data length: Homomorphic encryption algorithms can only encrypt and calculate data of limited length. For longer data, it needs to be processed in blocks, which increases the complexity and time of the calculation.

[0046] In the information processing method, apparatus, electronic device, and medium provided in the embodiments of the present application, since the language model can be distributed between the electronic device and the server, the processing of the first data by the electronic device and the server can be independent of each other, and the server cannot directly obtain the first data. The electronic device can ensure that the user's private data is not leaked without encrypting the private data. This improves the computing efficiency of the electronic device while also ensuring the security of the private data.

[0047] The information processing method provided in the embodiment of the present application may be executed by an information processing device, which may be an electronic device or a functional module in an electronic device. The technical solution provided in the embodiment of the present application is described below using an electronic device as an example.

[0048] The present invention provides an information processing method, and Figure 2 shows a flowchart of the information processing method provided by the present invention. As shown in Figure 2, the information processing method provided by the present invention may include the following steps 201 to 205.

[0049] Step 201: The electronic device inputs first data into a first language model.

[0050] In an embodiment of the present application, the first language model includes a three-layer language model, which includes a first-layer language model located in the electronic device, a second-layer language model located in the server, and a third-layer language model located in the electronic device.

[0051] Optionally, in an embodiment of the present application, the first data may include private data.

[0052] Exemplarily, the above-mentioned private data may include at least one of the following: user address, user name, user age, etc.

[0053] Exemplarily, the first language model may be a large language model.

[0054] It should be noted that the large language model in this application is an improved large language model. The three-layer language models in the improved large language model are located in different devices, and the first-layer language model and the third-layer language model both contain at least one of the first weight fine-tuning LoRa layer and the second weight fine-tuning adapter layer.

[0055] In the embodiment of the present application, the electronic device can input the first data into the first language model through an application.

[0056] In the embodiment of the present application, the three-layer language model included in the first language model is obtained by splitting the first language model by the server.

[0057] Exemplarily, the server may split the first language model according to the number of decoders in the first language model to obtain a three-layer language model.

[0058] In an embodiment of the present application, after obtaining the three-layer language model, the server can send the first-layer language model and the third-layer language model in the three-layer language model to the electronic device, so that the electronic device can obtain the first-layer language model and the third-layer language model.

[0059] For example, after receiving the first-layer language model and the third-layer language model, the electronic device may store the first-layer language model and the third-layer language model, that is, the electronic device does not need to obtain the first-layer language model and the third-layer language model through the server subsequently.

[0060] Step 202: The electronic device processes the first data using the first-layer language model to obtain a first feature vector.

[0061] In the embodiment of the present application, the electronic device may process the first data through the decoder layer in the first-layer language model to obtain a first feature vector.

[0062] Exemplarily, after obtaining the first data, the electronic device can encode the first data through the first-layer language model to obtain a word embedding feature vector corresponding to the first data, and then decode the word embedding feature vector corresponding to the first data through the decoder layer in the first-layer language model to obtain a first feature vector.

[0063] For example, assume the input sequence is X = {x1, x2, ..., xn}, where each xi is a word and is used to represent x1, x2, ..., xn, and X is the first data; the output is E = {e1, e2, ..., en}, where each ei is the word embedding vector corresponding to xi and is used to represent e1, e2, ..., en. In other words, one word corresponds to one word embedding vector.

[0064] For example, after obtaining the word embedding feature vector corresponding to the first data, the electronic device may decode the word embedding feature vector through the decoder layer in the first language model to obtain a first feature vector, which is specifically represented by the following formula 3: H1=Decoder(E) (3)

[0065] Among them, H1 is the first feature vector, Decoder is the decoder layer in the first layer language model, and E is the word embedding vector corresponding to the above first data.

[0066] It should be noted that E is the word embedding vector corresponding to each word in the first data, and the first feature vector is the feature vector corresponding to the first data as a whole. In other words, the word embedding vector in E corresponds to a word in the first data, and the first feature vector corresponds to the first data.

[0067] Optionally, in an embodiment of the present application, when the first-layer language model includes a LayerNorm function, the electronic device may normalize the word embedding vector corresponding to the first data using the LayerNorm function, and decode the normalized word embedding feature vector again through the decoder layer to obtain a first feature vector; specifically, this may be expressed by the following formula 4: H1 = Decoder(LayerNorm(E)) (4)

[0068] Where H1 is the first feature vector, Decoder is the decoder layer in the first language model, E is the word embedding vector corresponding to the first data, and LayerNorm is the LayerNorm function.

[0069] Step 203: The electronic device sends the first feature vector to the second-layer language model.

[0070] Optionally, in an embodiment of the present application, the electronic device may send the first feature vector to the second-layer language model in the server via Wireless Fidelity (WiFi); or, the electronic device may send the first feature vector to the second-layer language model in the server via a mobile network, such as 5G.

[0071] In the embodiment of the present application, the server may process the first feature vector through the decoder layer in the second-layer language model to obtain a second feature vector, and send it to the electronic device.

[0072] Exemplarily, the second-layer language model may include multiple decoder layers, and the server may process the first feature vector through the multiple decoder layers to obtain the second feature vector.

[0073] Taking a decoder layer as an example, the electronic device can obtain the feature vector output by the previous decoder layer, and then obtain the feature vector corresponding to the decoder layer through the Dropout function, LayerNorm function and FeedForward Neural (FFN) network. Specifically, it can be expressed by the following formula 5: Decoder(H l-1 )=LayerNorm(H l-1 +Dropout(Attention(H l-1 ))) Hl=LayerNorm(Decoder(H l-1 )+Dropout(FFN(H l-1 ))) (5)

[0074] Among them, Decoder (H l-1 ) is the feature vector output by the previous decoder layer, LayerNorm is the LayerNorm function, Dropout is the Dropout function, Attention is the multi-head group attention model, FFN is the feedforward neural network, and Hl is the feature vector output by the current layer.

[0075] It should be noted that for the multiple decoder layers in the second language model, the electronic device can obtain the feature vector corresponding to each decoder layer based on the above formula 5. To avoid repetition, it will not be repeated here.

[0076] In the embodiment of the present application, after obtaining the feature vector corresponding to each decoder layer, the electronic device may merge the feature vectors corresponding to each decoder layer to obtain a second feature vector.

[0077] Exemplarily, the electronic device may perform an addition operation on the feature vectors corresponding to each decoder layer to obtain a second feature vector.

[0078] Step 204: The electronic device receives the second feature vector sent by the second-layer language model.

[0079] In the embodiment of the present application, the second feature vector is obtained by processing the first feature vector through the second-layer language model.

[0080] Optionally, in an embodiment of the present application, the electronic device may receive the second feature vector via WiFi or a mobile network.

[0081] Step 205: The electronic device processes the second feature vector using the third-layer language model to obtain a processing result.

[0082] Optionally, in an embodiment of the present application, the weighting function in the above-mentioned first-layer language model is different from the weighting function in the second-layer language model, and the weighting function in the first-layer language model is the same as the weighting function in the third-layer language model.

[0083] In the embodiment of the present application, the electronic device can process the second feature vector through the decoder layer in the third-layer language model to obtain a processing result.

[0084] Exemplarily, the electronic device may add a weight function to the third-layer language model to perform weighted processing on the second feature vector to obtain a processing result.

[0085] For example, the electronic device may normalize the second eigenvector using LayerNorm and perform weighted processing on the normalized second eigenvector to obtain a processing result, which is specifically expressed by the following formula 6: Logits = W·LayerNorm(Decoder(H))+b (6)

[0086] Where W and b represent the weight and bias weight of the language model head layer, respectively, Logits is the processing result, LayerNorm is the LayerNorm function, and Decoder(H) is the second eigenvector.

[0087] In the information processing method provided in an embodiment of the present application, an electronic device can input first data into a first language model, the first language model including a three-layer language model, the three-layer language model including a first-layer language model located in the electronic device, a second-layer language model located in the server, and a third-layer language model located in the electronic device; the first data is processed by the first-layer language model to obtain a first feature vector; the first feature vector is sent to the second-layer language model; a second feature vector is received from the second-layer language model, the second feature vector is obtained by processing the first feature vector by the second-layer language model; and the second feature vector is processed by the third-layer language model to obtain a processing result. In this solution, since the language models can be included in the electronic device and the server respectively, the processing of the first data in the electronic device and the server can be independent of each other, and the server cannot directly obtain the first data. The electronic device can ensure that the user's private data is not leaked without encrypting the private data. In this way, while improving the computing efficiency of the electronic device, the security of the private data can also be guaranteed.

[0088] Optionally, in an embodiment of the present application, the above-mentioned first-layer language model includes: a word embedding layer, N decoding layers and a first weight fine-tuning LoRa layer, where N is a positive integer.

[0089] Exemplarily, in combination with FIG. 2 , as shown in FIG. 3 , the above step 202 may be implemented specifically through the following steps 202 a to 202 c.

[0090] Step 202a: The electronic device performs weighted processing on the first data through the word embedding layer and N decoding layers to obtain a third feature vector.

[0091] In an embodiment of the present application, after obtaining the first-layer language model, the electronic device may add a first weight fine-tuning LoRa layer to the first-layer language model.

[0092] Step 202b: The electronic device performs weighted processing on the first data through the first weight fine-tuning LoRa layer to obtain a fourth eigenvector.

[0093] Exemplarily, the electronic device can add LoRA weights at the local end, that is, a first weight fine-tuning LoRa layer can be added to the decoder layer in the first-layer language model, and the first weight fine-tuning LoRa layer includes two LoRA weights, so that the first data is weighted based on the pre-trained weight model in the decoder layer and the two LoRA weights to obtain a fourth eigenvector.

[0094] It should be noted that the above-mentioned first weight fine-tuning LoRa layer and the pre-training weight model are in parallel.

[0095] Exemplarily, as shown in Figure 4, taking a pre-trained weight model as an example, after obtaining the first data, the electronic device can input the first data into the pre-trained weight model 14 and the first weight fine-tuning LoRa layer 15 respectively, thereby obtaining the feature vector output by the pre-trained weight model 14 and the feature vector output by the first weight fine-tuning LoRa layer 15, and merge the feature vector output by the pre-trained weight model 14 and the feature vector output by the first weight fine-tuning LoRa layer 15 to obtain a fourth feature vector, wherein the first weight fine-tuning LoRa layer 15 contains two LoRA weights, which are represented by WA and WB in Figure 4.

[0096] Step 202c: The electronic device obtains a first eigenvector based on the third eigenvector and the fourth eigenvector.

[0097] In the embodiment of the present application, the electronic device may fuse the third eigenvector and the fourth eigenvector to obtain the first eigenvector.

[0098] Exemplarily, the electronic device may perform a multiplication operation on the third eigenvector and the fourth eigenvector to obtain the first eigenvector.

[0099] Optionally, in an embodiment of the present application, the above-mentioned first-layer language model includes: a word embedding layer, N decoding layers and a second weight fine-tuning adapter layer.

[0100] Exemplarily, in combination with FIG. 2 , as shown in FIG. 5 , the above step 202 may be implemented specifically through the following step 202 d.

[0101] Step 202d: The electronic device performs weighted processing on the first data through the word embedding layer, N decoding layers, and the second weight fine-tuning adapter layer to obtain a first feature vector.

[0102] Exemplarily, for a decoding layer, as shown in Figure 6, the first-layer language model includes a Multi-headed attention module, a Feed-forward layer, an adapter layer, a Layer Norm function, and a 2xFeed-forward layer.

[0103] That is to say, the electronic device can add a second weight fine-tuning adapter layer to the first-layer language model, that is, the second weight fine-tuning adapter layer can be added to the decoder layer in the first-layer language model. The first weight fine-tuning LoRa layer includes two LoRA weights, so that the first data is weightedly processed based on the second weight fine-tuning adapter in the decoder layer to obtain the first feature vector.

[0104] Optionally, in an embodiment of the present application, the electronic device may determine the model structure of the first-layer language model through user selection.

[0105] For example, if the user chooses to add the Lora method to the first-layer language model, the electronic device can add the LoRA weight locally; if the user chooses to add the adapter method to the first-layer language model, the electronic device can add the adapter layer locally; if the user chooses to add the Lora method and the adapter method to the first-layer language model, the electronic device can add the Lora layer and the adapter layer to the first-layer language model at the same time.

[0106] It should be noted that the specific adding process can be found in the above embodiment, and will not be described again here to avoid repetition.

[0107] Optionally, in an embodiment of the present application, the above-mentioned first-layer language model includes: a word embedding layer, N decoding layers, a first weight fine-tuning LoRa layer and a second weight fine-tuning adapter layer.

[0108] Exemplarily, the above step 202 can be specifically implemented through the following steps 202e to 202g.

[0109] Step 202e: The electronic device performs weighted processing on the first data through the word embedding layer, N decoding layers, and the second weight fine-tuning adapter layer to obtain a seventh eigenvector.

[0110] It should be noted that the specific process can be found in the above embodiments, and will not be described again here to avoid repetition.

[0111] Step 202f: Perform weighted processing on the seventh eigenvector through the first weight fine-tuning LoRa layer to obtain an eighth eigenvector.

[0112] It should be noted that the specific process can be found in the above embodiments, and will not be described again here to avoid repetition.

[0113] Step 202g: Obtain a first eigenvector based on the seventh eigenvector and the eighth eigenvector.

[0114] In the embodiment of the present application, the electronic device may perform a fusion process on the seventh eigenvector and the eighth eigenvector to obtain a first eigenvector.

[0115] Exemplarily, the electronic device may perform a multiplication operation on the seventh eigenvector and the eighth eigenvector to obtain the first eigenvector.

[0116] In an embodiment of the present application, since the LoRa layer or the adapter layer can be trained for specific data in the first language model, the electronic device can add at least one item of the LoRa layer or the adapter layer to the first language model, thereby fine-tuning the parameters of the first-layer language model through the LoRa layer or the adapter layer, thereby retaining the learning rate of the third-layer language model while achieving adjustment training for specific tasks and data.

[0117] Optionally, in an embodiment of the present application, the third-layer language model includes: M decoding layers, a language head model and a first weight fine-tuning LoRa layer, where M is a positive integer.

[0118] Exemplarily, in combination with FIG. 2 , as shown in FIG. 7 , the above step 205 may be implemented specifically through the following steps 205 a to 205 c.

[0119] Step 205a: The electronic device performs weighted processing on the second eigenvector through M decoding layers and a language head model to obtain a fifth eigenvector.

[0120] Step 205b: The electronic device performs weighted processing on the second eigenvector through the first weight fine-tuning LoRa layer to obtain a sixth eigenvector.

[0121] Step 205c: The electronic device obtains a processing result based on the fifth eigenvector and the sixth eigenvector.

[0122] It should be noted that the specific implementation method can be found in the above embodiments, and to avoid repetition, it will not be described here.

[0123] It can be understood that the process and scheme of adding the LoRa layer in the third-layer language model in this application are consistent with the process and scheme of adding the LoRa layer in the first-layer language model.

[0124] Optionally, in an embodiment of the present application, the third-layer language model includes: M decoding layers, a language head model, and a second weight fine-tuning adapter layer.

[0125] Exemplarily, in combination with FIG. 2 , as shown in FIG. 8 , the above step 205 may be specifically implemented through the following step 205d.

[0126] Step 205d: The electronic device performs weighted processing on the second feature vector through M decoding layers, the language head model, and the second weight fine-tuning adapter layer to obtain a processing result.

[0127] It should be noted that the specific implementation method can be found in the above embodiments, and to avoid repetition, it will not be described here.

[0128] Optionally, in an embodiment of the present application, the above-mentioned third-layer language model includes: M decoding layers, a language head model, a first weight fine-tuning LoRa layer and a second weight fine-tuning adapter layer.

[0129] Exemplarily, the above step 205 can be specifically implemented through the following steps 205e to 205g.

[0130] Step 205e: The electronic device performs weighted processing on the first eigenvector through the word embedding layer, N decoding layers, and the second weight fine-tuning adapter layer to obtain a ninth eigenvector.

[0131] It should be noted that the specific process can be found in the above embodiments, and will not be described again here to avoid repetition.

[0132] Step 202f: Perform weighted processing on the ninth eigenvector through the first weight fine-tuning LoRa layer to obtain a tenth eigenvector.

[0133] It should be noted that the specific process can be found in the above embodiments, and will not be described again here to avoid repetition.

[0134] Step 202g: Obtain a second eigenvector based on the ninth eigenvector and the tenth eigenvector.

[0135] In the embodiment of the present application, the electronic device may perform a fusion process on the ninth eigenvector and the tenth eigenvector to obtain a second eigenvector.

[0136] Exemplarily, the electronic device may perform a multiplication operation on the ninth eigenvector and the tenth eigenvector to obtain a second eigenvector.

[0137] In an embodiment of the present application, since the LoRa layer or the adapter layer can be trained for specific data in the first language model, the electronic device can add at least one item of the LoRa layer or the adapter layer to the third language model, thereby fine-tuning the parameters of the third-layer language model through the LoRa layer or the adapter layer, thereby retaining the learning rate of the third-layer language model while achieving adjustment training for specific tasks and data.

[0138] The following is a detailed explanation of the end-cloud collaborative model reasoning, which can be implemented through the following steps 20 to 22.

[0139] Step 20: The electronic device inputs a text sequence, and after word segmentation by the word segmenter, the word sequence is input into the local word embedding layer, and the word vector is output; the word vector is input into the local first-layer fine-tuned decoder, and the local word feature vector is output and sent to the cloud.

[0140] Step 21: The multi-decoding layer model on the cloud receives the data sent locally and calculates and outputs the cloud word vector.

[0141] Step 22: The electronic device receives the cloud word vector input, and the last layer of fine-tuning decoder outputs the local word vector to the linear layer of the language model, outputs the word probability vector, samples the word probability vector to obtain the output word, and returns the result to the user.

[0142] In the embodiments of the present application, it is possible to protect the user's personal information and privacy data of a large language model of any structure during operation, thereby improving the user's trust and satisfaction. At the same time, it can also protect the user's legitimate rights and interests and prevent the user's personal information and privacy data from being abused.

[0143] Optionally, in an embodiment of the present application, before the above-mentioned step 201, the information processing method provided in the embodiment of the present application further includes the following steps 301 to 303.

[0144] Step 301: The electronic device inputs first data into a second language model.

[0145] In the embodiment of the present application, the second language model includes a three-layer language model, which includes a fourth-layer language model located in the electronic device, a fifth-layer language model located in the server, and a sixth-layer language model located in the electronic device.

[0146] Step 302: The electronic device adjusts at least one of the following in the target layer language model through backpropagation:

[0147] The first weight fine-tunes the weight coefficient in the LoRa layer, and the second weight fine-tunes the weight coefficient in the adapter layer.

[0148] In an embodiment of the present application, the target layer language model includes at least one of the following: a fourth layer language model and a fifth layer language model.

[0149] In the present embodiment, it is assumed that W represents the weight matrix in a given neural network layer. Then, using conventional backpropagation, the electronic device can obtain the weight update ΔW, which is usually calculated as the negative gradient of the loss multiplied by the learning rate: ΔW = α Then, after obtaining ΔW, the electronic device can update the original weights as follows: W' = W + ΔW. Alternatively, the weight update matrix can be kept separate and the output calculated as follows: h = Wx + ΔWx. If ΔW is represented by two low-rank matrices A and B, ΔW = W_A × W_B can be obtained, that is, h = Wx + W_A × W_B. If the A and B matrices are used as LoRA fine-tuning weights, it can be ensured that the user's private data is learned in the LoRA weights; the same applies to the Adapter method.

[0150] Specifically, local fine-tuning training is a stage: on the dataset added by the user, LoRa and Adapter are fine-tuned, while keeping the weights of the pre-trained model unchanged, and only updating the weights of LoRa and Adapter, so as to obtain a local decoder that can correctly parse user data and has a different structure from the cloud.

[0151] Step 303: The electronic device obtains the first language model based on the adjusted second language model.

[0152] In the embodiment of the present application, it is possible to protect the user's personal information and privacy data during the operation of a large language model of any structure, thereby improving the user's trust and satisfaction, and also protecting the user's legitimate rights and interests, and preventing the user's personal information and privacy data from being abused.

[0153] It should be noted that the information processing method provided in the embodiments of the present application can be executed by an information processing device, an electronic device, or a functional module or entity in an electronic device. In the embodiments of the present application, the information processing device provided in the embodiments of the present application is described by taking the execution of the information processing method by an information processing device as an example.

[0154] FIG9 shows a possible structural diagram of an information processing device involved in an embodiment of the present application. As shown in FIG9 , the information processing device 70 may include: an input module 71 , a processing module 72 , and a receiving module 73 .

[0155] Among them, the input module 71 is used to input the first data into the first language model. The first language model includes a three-layer language model, which includes a first-layer language model located in the electronic device, a second-layer language model located in the server, and a third-layer language model located in the electronic device. The processing module 72 is used to process the first data using the first-layer language model to obtain a first feature vector; and send the first feature vector to the second-layer language model. The receiving module 73 is used to receive the second feature vector sent by the second-layer language model. The second feature vector is obtained by processing the first feature vector by the second-layer language model. The processing module 72 is also used to process the second feature vector using the third-layer language model to obtain a processing result.

[0156] In one possible implementation, the first-layer language model includes a word embedding layer, N decoding layers, and a first weight fine-tuning LoRa layer, where N is a positive integer. The processing module 72 is specifically configured to perform weighted processing on the first data using the word embedding layer and the N decoding layers to obtain a third eigenvector; perform weighted processing on the first data using the first weight fine-tuning LoRa layer to obtain a fourth eigenvector; and obtain a first eigenvector based on the third and fourth eigenvectors.

[0157] In one possible implementation, the first language model layer includes a word embedding layer, N decoding layers, and a second weight fine-tuning adapter layer. The processing module 72 is specifically configured to perform weighted processing on the first data using the word embedding layer, N decoding layers, and the second weight fine-tuning adapter layer to obtain a first feature vector.

[0158] In one possible implementation, the third-layer language model includes: M decoding layers, a language head model, and a first weight fine-tuning LoRa layer, where M is a positive integer; the processing module 72 is specifically used to perform weighted processing on the second eigenvector through the M decoding layers and the language head model to obtain a fifth eigenvector; perform weighted processing on the second eigenvector through the first weight fine-tuning LoRa layer to obtain a sixth eigenvector; and obtain a target result based on the fifth eigenvector and the sixth eigenvector.

[0159] In one possible implementation, the third-layer language model includes M decoding layers, a language head model, and a second weight fine-tuning adapter layer. The processing module 72 is specifically configured to perform weighted processing on the second feature vector using the M decoding layers, the language head model, and the second weight fine-tuning adapter layer to obtain a target result.

[0160] In one possible implementation, the information processing device 70 provided in the embodiment of the present application may include: a training module. The input module 71 is also used to input the first data into the second language model before inputting the first data into the first language model. The second language model includes a three-layer language model. The three-layer language model includes a fourth-layer language model located in the electronic device, a fifth-layer language model located in the server, and a sixth-layer language model located in the electronic device. The training module is used to adjust at least one of the following items in the target layer language model through back propagation: the first weight fine-tuning weight coefficient in the LoRa layer, and the second weight fine-tuning weight coefficient in the adapter layer. The above-mentioned processing module 72 is used to obtain the first language model based on the adjusted second language model; wherein, the target layer language model includes at least one of the following items: the fourth-layer language model and the sixth-layer language model.

[0161] The embodiments of the present application provide an information processing device. Because a language model can be distributed between the information processing device and a server, the processing of first data by the information processing device and the server can be independent of each other. Furthermore, the server cannot directly obtain the first data. The information processing device can ensure that the user's private data is not leaked without encrypting the private data. This improves the computing efficiency of the information processing device while also ensuring the security of the private data.

[0162] The information processing device in the embodiment of the present application can be an electronic device or a component in an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other device other than a terminal. Exemplarily, the mobile electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, an in-vehicle electronic device, a mobile Internet device (MID), an augmented reality (AR) / virtual reality (VR) device, a robot, a wearable device, an ultra-mobile personal computer (UMPC), a netbook or a personal digital assistant (PDA), etc. It can also be a server, a network attached storage (NAS), a personal computer (PC), a television (TV), a teller machine or a self-service machine, etc., and the embodiment of the present application does not specifically limit it.

[0163] The information processing device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.

[0164] The information processing device provided in the embodiment of the present application can implement each process implemented in the above method embodiment. To avoid repetition, it will not be described here.

[0165] Optionally, as shown in Figure 10, an embodiment of the present application also provides an electronic device 90, including a processor 91 and a memory 92, and the memory 92 stores a program or instruction that can be run on the processor 91. When the program or instruction is executed by the processor 91, the various steps of the above-mentioned privacy data protection method embodiment are implemented and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0166] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.

[0167] FIG11 is a schematic diagram of the hardware structure of an electronic device implementing an embodiment of the present application.

[0168] The electronic device 100 includes but is not limited to components such as a radio frequency unit 101 , a network module 102 , an audio output unit 103 , an input unit 104 , a sensor 105 , a display unit 106 , a user input unit 107 , an interface unit 108 , a memory 109 , and a processor 110 .

[0169] Those skilled in the art will appreciate that the electronic device 100 may further include a power source (e.g., a battery) for powering various components. The power source may be logically connected to the processor 110 via a power management system, thereby enabling the power management system to manage charging, discharging, and power consumption. The electronic device structure shown in FIG11 does not limit the electronic device. The electronic device may include more or fewer components than shown, or may combine certain components, or have different component arrangements, which will not be described in detail here.

[0170] Among them, the processor 110 is used to input the first data into the first language model, the first language model includes a three-layer language model, the three-layer language model includes a first-layer language model located in the electronic device, a second-layer language model located in the server, and a third-layer language model located in the electronic device; process the first data through the first-layer language model to obtain a first feature vector; send the first feature vector to the second-layer language model; receive the second feature vector sent by the second-layer language model, the second feature vector is obtained by processing the first feature vector by the second-layer language model; process the second feature vector through the third-layer language model to obtain a processing result.

[0171] An embodiment of the present application provides an electronic device that can distribute and include a language model in the electronic device and a server. Therefore, the processing of first data by the electronic device and the server can be independent of each other, and the server cannot directly obtain the first data. Therefore, the electronic device can ensure that the user's private data is not leaked without encrypting the private data. This improves the computing efficiency of the electronic device while also ensuring the security of the private data.

[0172] Optionally, in an embodiment of the present application, the first-layer language model includes a word embedding layer, N decoding layers, and a first weight fine-tuning LoRa layer, where N is a positive integer. The processor 110 is specifically configured to perform weighted processing on the first data using the word embedding layer and the N decoding layers to obtain a third eigenvector; perform weighted processing on the first data using the first weight fine-tuning LoRa layer to obtain a fourth eigenvector; and obtain a first eigenvector based on the third eigenvector and the fourth eigenvector.

[0173] Optionally, in an embodiment of the present application, the first language model layer includes a word embedding layer, N decoding layers, and a second weight fine-tuning adapter layer. The processor 110 is specifically configured to perform weighted processing on the first data using the word embedding layer, N decoding layers, and the second weight fine-tuning adapter layer to obtain a first feature vector.

[0174] Optionally, in an embodiment of the present application, the third-layer language model includes: M decoding layers, a language head model, and a first weight fine-tuning LoRa layer, where M is a positive integer. The processor 110 is specifically configured to perform weighted processing on the second eigenvector using the M decoding layers and the language head model to obtain a fifth eigenvector; perform weighted processing on the second eigenvector using the first weight fine-tuning LoRa layer to obtain a sixth eigenvector; and obtain a processing result based on the fifth and sixth eigenvectors.

[0175] Optionally, in an embodiment of the present application, the third-layer language model includes: M decoding layers, a language head model, and a second weight fine-tuning adapter layer. The processor 110 is specifically configured to perform weighted processing on the second feature vector using the M decoding layers, the language head model, and the second weight fine-tuning adapter layer to obtain a processing result.

[0176] Optionally, in an embodiment of the present application, the above-mentioned processor 110 is further used to input the first data into the second language model before inputting the first data into the first language model, the second language model includes a three-layer language model, the three-layer language model includes a fourth-layer language model located in the electronic device, a fifth-layer language model located in the server, and a sixth-layer language model located in the electronic device; adjust at least one of the following items in the target layer language model through back propagation: the first weight fine-tunes the weight coefficient in the LoRa layer, and the second weight fine-tunes the weight coefficient in the adapter layer; obtain the first language model based on the adjusted second language model; wherein, the target layer language model includes at least one of the following items: the fourth-layer language model and the sixth-layer language model.

[0177] The electronic device provided in the embodiment of the present application can implement each process implemented in the above method embodiment and can achieve the same technical effect. To avoid repetition, it will not be described here.

[0178] The beneficial effects of various implementations in this embodiment can be specifically referred to the beneficial effects of the corresponding implementations in the above method embodiment. To avoid repetition, they will not be described here.

[0179] It should be understood that in an embodiment of the present application, the input unit 104 may include a graphics processing unit (GPU) 1041 and a microphone 1042, and the graphics processor 1041 processes the image data of a static picture or video obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The display unit 106 may include a display panel 1061, and the display panel 1061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 107 includes a touch panel 1071 and at least one of other input devices 1072. The touch panel 1071 is also called a touch screen. The touch panel 1071 may include two parts: a touch detection device and a touch controller. Other input devices 1072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which will not be repeated here.

[0180] The memory 109 can be used to store software programs and various data. The memory 109 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, applications or instructions required for at least one function (such as a sound playback function, an image playback function, etc.). In addition, the memory 109 may include a volatile memory or a non-volatile memory, or the memory 109 may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDRSDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchronous link dynamic random access memory (SLDRAM), and a direct memory bus random access memory (DRRAM). The memory 109 in the embodiment of the present application includes but is not limited to these and any other suitable types of memory.

[0181] Processor 110 may include one or more processing units. Optionally, processor 110 integrates an application processor and a modem processor. The application processor primarily handles operations related to the operating system, user interface, and application programs, while the modem processor primarily processes wireless communication signals, such as a baseband processor. It is understood that the modem processor may not be integrated into processor 110.

[0182] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the various processes of the above-mentioned method embodiment are implemented and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0183] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0184] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned method embodiment and achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0185] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.

[0186] An embodiment of the present application provides a computer program product, which is stored in a storage medium. The program product is executed by at least one processor to implement the various processes of the above-mentioned information processing method embodiment and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0187] It should be noted that, in this article, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device comprising the element. In addition, it should be noted that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in the opposite order according to the functions involved. For example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0188] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), including a number of instructions for enabling a terminal (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.

[0189] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of this application, ordinary technicians in this field can also make many forms without departing from the purpose of this application and the scope of protection of the claims, all of which are within the protection of this application.

Claims

1. An information processing method, performed by an electronic device, the method comprising: Inputting the first data into a first language model, wherein the first language model includes a three-layer language model, wherein the three-layer language model includes a first-layer language model located in the electronic device, a second-layer language model located in a server, and a third-layer language model located in the electronic device; Processing the first data by using the first-layer language model to obtain a first feature vector; Sending the first feature vector to the second-layer language model; receiving a second feature vector sent by the second-layer language model, where the second feature vector is obtained by processing the first feature vector by the second-layer language model; The second feature vector is processed by the third-layer language model to obtain a processing result.

2. The method according to claim 1, wherein: The first-layer language model includes: a word embedding layer, N decoding layers and a first weight fine-tuning LoRa layer, where N is a positive integer; The step of processing the first data by using the first-layer language model to obtain a first feature vector includes: Performing weighted processing on the first data through the word embedding layer and the N decoding layers to obtain a third feature vector; Performing weighted processing on the first data by fine-tuning the LoRa layer with the first weight to obtain a fourth eigenvector; The first eigenvector is obtained based on the third eigenvector and the fourth eigenvector.

3. The method according to claim 1, wherein: The first language model layer includes: the word embedding layer, the N decoding layers, and a second weight fine-tuning adapter layer; The step of processing the first data by using the first-layer language model to obtain a first feature vector includes: The first data is weightedly processed through the word embedding layer, the N decoding layers and the second weight fine-tuning adapter layer to obtain the first feature vector.

4. The method according to claim 1, wherein: The third-layer language model includes: M decoding layers, a language head model and a first weight fine-tuning LoRa layer, where M is a positive integer; The processing of the second feature vector by the third-layer language model to obtain a processing result includes: Performing weighted processing on the second feature vector through the M decoding layers and the language head model to obtain a fifth feature vector; Performing weighted processing on the second eigenvector by fine-tuning the LoRa layer with the first weight to obtain a sixth eigenvector; The processing result is obtained based on the fifth eigenvector and the sixth eigenvector.

5. The method according to claim 1, wherein: The third-layer language model includes: the M decoding layers, the language head model, and a second weight fine-tuning adapter layer; The processing of the second feature vector by the third-layer language model to obtain a processing result includes: The second feature vector is weightedly processed by the M decoding layers, the language head model and the second weight fine-tuning adapter layer to obtain the processing result.

6. The method according to claim 1, wherein: Before inputting the first data into the first language model, the method includes: Inputting the first data into a second language model, wherein the second language model includes a three-layer language model, wherein the three-layer language model includes a fourth-layer language model located in the electronic device, a fifth-layer language model located in the server, and a sixth-layer language model located in the electronic device; Adjust at least one of the following in the target layer language model through backpropagation: The first weight fine-tunes the weight coefficient in the LoRa layer, and the second weight fine-tunes the weight coefficient in the adapter layer; Based on the adjusted second language model, obtaining the first language model; The target layer language model includes at least one of the following: the fourth layer language model and the sixth layer language model.

7. An information processing device, executed by an electronic device, comprising: Input module, processing module and receiving module; The input module is used to input the first data into a first language model, wherein the first language model includes a three-layer language model, wherein the three-layer language model includes a first-layer language model located in the electronic device, a second-layer language model located in the server, and a third-layer language model located in the electronic device; The processing module is used to process the first data through the first-layer language model to obtain a first feature vector; and send the first feature vector to the second-layer language model; The receiving module is used to receive a second feature vector sent by the second-layer language model, where the second feature vector is obtained by processing the first feature vector by the second-layer language model; The processing module is further used to process the second feature vector through the third-layer language model to obtain a processing result.

8. The device according to claim 7, wherein: The first-layer language model includes: a word embedding layer, N decoding layers and a first weight fine-tuning LoRa layer, where N is a positive integer; The processing module is specifically used to perform weighted processing on the first data through the word embedding layer and the N decoding layers to obtain a third eigenvector; perform weighted processing on the first data through the first weight fine-tuning LoRa layer to obtain a fourth eigenvector; and obtain the first eigenvector based on the third eigenvector and the fourth eigenvector.

9. The device according to claim 7, wherein: The first language model layer includes: the word embedding layer, the N decoding layers, and a second weight fine-tuning adapter layer; The processing module is specifically used to perform weighted processing on the first data through the word embedding layer, the N decoding layers and the second weight fine-tuning adapter layer to obtain the first feature vector.

10. The device according to claim 7, wherein: The third-layer language model includes: M decoding layers, a language head model and a first weight fine-tuning LoRa layer, where M is a positive integer; The processing module is specifically used to perform weighted processing on the second feature vector through the M decoding layers and the language head model to obtain a fifth feature vector; perform weighted processing on the second feature vector through the first weight fine-tuning LoRa layer to obtain a sixth feature vector; and obtain the processing result based on the fifth feature vector and the sixth feature vector.

11. The device according to claim 7, wherein: The third-layer language model includes: the M decoding layers, the language head model, and a second weight fine-tuning adapter layer; The processing module is specifically configured to perform weighted processing on the second feature vector through the M decoding layers, the language head model and the second weight fine-tuning adapter layer to obtain the processing result.

12. The device according to claim 7, wherein: The information processing device also includes a training module; The input module is further configured to input the first data into a second language model before inputting the first data into the first language model, wherein the second language model includes a three-layer language model, wherein the three-layer language model includes a fourth-layer language model located in the electronic device, a fifth-layer language model located in the server, and a sixth-layer language model located in the electronic device; The training module is used to adjust at least one of the following in the target layer language model through back propagation: The first weight fine-tunes the weight coefficient in the LoRa layer, and the second weight fine-tunes the weight coefficient in the adapter layer; The processing module is configured to obtain the first language model based on the adjusted second language model; The target layer language model includes at least one of the following: the fourth layer language model and the sixth layer language model.

13. An electronic device comprising a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the information processing method as claimed in any one of claims 1 to 6.

14. A readable storage medium storing a program or an instruction, wherein the program or the instruction, when executed by a processor, implements the steps of the information processing method according to any one of claims 1 to 6.

15. A chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the steps of the information processing method according to any one of claims 1 to 6. 16 . A computer program product, wherein the program product is stored in a storage medium and is executed by at least one processor to implement the steps of the information processing method according to claim 1 .

Citation Information

Patent Citations

  • Model training method and device, storage medium, server, terminal and system

    CN114943274A

  • Deep learning model security deployment method, system and device, and storage medium

    CN116560670A

  • Fine adjustment method and device for point cloud classification

    CN116778133A

  • Information processing method and device, electronic equipment and medium

    CN117592103A

  • Language model and electronic device including the same

    US20220319500A1