Large and small model collaborative natural language processing method, system and equipment and medium
By preprocessing and task splitting text data, and dynamically allocating large and small models to handle sub-tasks, the problems of resource consumption of large models and insufficient performance of small models are solved, thus achieving high efficiency and accuracy in natural language processing tasks.
Patent Information
- Application Number
- CN202511319914.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-16
- Publication Date
- 2026-01-06
AI Technical Summary
Large models have limitations in resource consumption and inference speed, making them unsuitable for real-time or resource-constrained environments, while small models are insufficient in performance when handling complex tasks, leading to inaccurate results.
By preprocessing the text data to be processed, calculating the task complexity, breaking down the text processing task into sub-tasks, dynamically allocating them to the large and small models for processing, and then fusing the results.
It improves the efficiency and accuracy of natural language processing tasks, achieves optimized resource allocation and synergy between models, and enhances the dynamic adaptability of the system.
Smart Images

Figure CN121277677A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of language processing technology, and in particular to natural language processing methods, systems, devices and media that utilize a combination of large and small models. Background Technology
[0002] With the continuous development of natural language processing technology, large language models have made significant progress in text generation, question answering systems, machine translation, and other fields, demonstrating powerful performance. However, these large models typically require substantial computational resources and time for inference, which can lead to inefficiency in practical applications. Meanwhile, while small models have advantages in inference speed and resource consumption, their accuracy and performance may not meet the demanding business requirements when handling complex natural language tasks.
[0003] In existing technologies, the high resource consumption and slow inference speed of large models limit their application in real-time or resource-constrained environments, while small models, although able to process data quickly, have insufficient performance when handling complex tasks, which may lead to inaccurate results.
[0004] Therefore, how to effectively combine the advantages of large and small models to improve the efficiency and performance of natural language processing tasks while reducing resource consumption has become a technical problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0005] This invention provides a natural language processing method, system, device, and medium for coordinating large and small models to process natural language tasks.
[0006] To address the aforementioned technical problems, embodiments of the present invention provide a natural language processing method for collaboration between large and small models, comprising:
[0007] Preprocess the text data to be processed to obtain word embedding vector data;
[0008] Obtain the semantic complexity of the word embedding vector data and the length of the input text data to be processed, and calculate the task complexity based on the semantic complexity and the length of the input text;
[0009] The text processing task is divided into several sub-tasks based on the task complexity.
[0010] Based on a preset task complexity threshold, each subtask is dynamically assigned to the large model and the small model for processing, thereby obtaining the text reasoning results of each subtask.
[0011] The results of the various text reasoning are fused to obtain the text processing result.
[0012] Further, the step of preprocessing the text data to be processed to obtain word embedding vector data includes:
[0013] The text data to be processed is converted into word embedding vectors using a pre-trained word embedding model;
[0014] Based on the length of the word embedding vector, the word embedding vector is padded or truncated to make its length meet the input requirements of the language model, thus obtaining the processed word embedding vector data.
[0015] Further, the step of obtaining the semantic complexity of the word embedding vector data and the input text length of the text data to be processed, and calculating the task complexity based on the semantic complexity and the input text length, includes:
[0016] Calculate the length of the input text in the text data to be processed;
[0017] Perform semantic analysis on the word embedding vector data to obtain the semantic complexity of the word embedding vector data;
[0018] The task complexity is calculated based on the length of the input text and the semantic complexity using preset weight parameters.
[0019] Furthermore, the step of dividing the text processing task into several sub-tasks based on the task complexity includes:
[0020] Based on the task complexity, identify the semantic structure and logical relationships in the text processing task;
[0021] Based on the semantic structure and logical relationship, the text processing task is divided into several sub-tasks, and each sub-task corresponds to at least one processing step of the text processing task.
[0022] Determine the processing requirements for each subtask so that it can be dynamically allocated to the large or small model for processing based on the processing requirements.
[0023] Further, the step of dynamically assigning each subtask to the large model and small model for processing according to a preset task complexity threshold, and obtaining the text reasoning results of each subtask, includes:
[0024] The subtasks are divided according to a preset task complexity threshold to obtain a first complexity task, a second complexity task, and a third complexity task.
[0025] The first complexity task is processed using a small model to obtain the first text reasoning result;
[0026] The second complexity task is processed using a large model to obtain the second text reasoning result;
[0027] By using small and large models to collaboratively process the third complexity task, the third text reasoning result is obtained.
[0028] Furthermore, the fusion of the various text reasoning results to obtain the text processing result includes:
[0029] The fusion strategy is determined based on the complexity and processing requirements of each sub-task;
[0030] The first text reasoning result, the second text reasoning result, and the third text reasoning result are fused according to the fusion strategy to obtain the text processing result.
[0031] Another embodiment of the present invention provides a natural language processing system with large and small model collaboration, comprising:
[0032] The data processing module is used to preprocess the text data to be processed to obtain word embedding vector data;
[0033] The complexity calculation module is used to obtain the semantic complexity of the word embedding vector data and the input text length of the text data to be processed, and to calculate the task complexity based on the semantic complexity and the input text length.
[0034] The task splitting module is used to split the text processing task into several sub-tasks according to the task complexity.
[0035] The task processing module is used to dynamically allocate each of the sub-tasks to the large model and the small model for processing according to a preset task complexity threshold, so as to obtain the text reasoning results of each of the sub-tasks.
[0036] The text fusion module is used to fuse the various text reasoning results to obtain the text processing result.
[0037] Furthermore, the task processing module is used for:
[0038] The subtasks are divided according to a preset task complexity threshold to obtain a first complexity task, a second complexity task, and a third complexity task.
[0039] The first complexity task is processed using a small model to obtain the first text reasoning result;
[0040] The second complexity task is processed using a large model to obtain the second text reasoning result;
[0041] By using small and large models to collaboratively process the third complexity task, the third text reasoning result is obtained.
[0042] Another embodiment of the present invention provides a computer device including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor executes the computer program to implement the natural language processing method of size-model collaboration as described above.
[0043] In another embodiment of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing a computer program, wherein when the device containing the computer-readable storage medium executes the computer program, it implements the natural language processing method of large and small model collaboration as described above.
[0044] Compared with the prior art, the beneficial effects of the embodiments of the present invention are at least one of the following:
[0045] By employing a collaborative reasoning mechanism between large and small models, the efficiency and accuracy of natural language processing tasks are significantly improved. A task scheduling mechanism is introduced to flexibly allocate processing tasks between the large and small models based on task complexity, achieving optimized resource allocation. Through bidirectional data interaction, effective information transfer and verification between the large and small models are enabled, enhancing inter-model synergy and further improving overall reasoning performance. By transmitting key features from the large model to the small model and feeding back the reasoning results from the small model to the large model for secondary verification, the system can handle complex tasks more accurately. Adjusting the data processing flow and model invocation strategy based on real-time feedback allows the system to better adapt to the needs of different task scenarios, enhancing its dynamic adaptability. Attached Figure Description
[0046] Figure 1 This is a flowchart illustrating the steps of a natural language processing method for large and small model collaboration in one embodiment of the present invention.
[0047] Figure 2 This is a structural block diagram of a natural language processing system with large and small model collaboration in one embodiment of the present invention;
[0048] Figure 3 A structural diagram of a computer device provided in an embodiment of the present invention. Detailed Implementation
[0049] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The purpose of providing these embodiments is to make the disclosure of the present invention more thorough and comprehensive. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.
[0050] In the description of this application, the terms "first," "second," "third," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Therefore, a feature defined with "first," "second," "third," etc., may explicitly or implicitly include one or more of that feature. In the description of this application, unless otherwise stated, "a plurality of" means two or more.
[0051] In the description of this application, it should be noted that, unless otherwise expressly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to fixed connections, detachable connections, or integral connections; they can refer to mechanical connections or electrical connections; they can refer to direct connections or indirect connections through an intermediate medium; and they can refer to the internal communication between two components. The terms "vertical," "horizontal," "left," "right," "upper," "lower," and similar expressions used herein are for illustrative purposes only and do not indicate or imply that the device or component referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as limiting the invention. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items. Those skilled in the art can understand the specific meaning of the above terms in this application based on the specific circumstances.
[0052] In the description of this application, it should be noted that, unless otherwise defined, all technical and scientific terms used in this invention have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used in this specification is for the purpose of describing specific embodiments only and is not intended to limit the invention. Those skilled in the art can understand the specific meaning of the above terms in this application based on the specific circumstances.
[0053] One embodiment of the present invention provides a natural language processing method for collaboration between large and small models. For details, please refer to [link / reference]. Figure 1 , Figure 1 The flowchart shown is a step diagram of a natural language processing method for large and small model collaboration in one embodiment of the present invention, including steps S11-S15:
[0054] S11. Perform data preprocessing on the text data to be processed to obtain word embedding vector data.
[0055] In the field of natural language processing, text data preprocessing is a crucial step to ensure that models can process information efficiently and accurately. Specifically, data preprocessing of the text data to be processed first involves using a pre-trained word embedding model to convert the text data into word embedding vectors. Word embedding models can map words in text to vectors in a high-dimensional space. These vectors not only represent the semantic information of words but also capture the semantic relationships between words.
[0056] However, simply converting text data into word embedding vectors is insufficient, as different language models may have specific requirements regarding the length of the input data. To ensure that the word embedding vectors are compatible with a particular language model, they need to be padded or truncated according to their length. This operation aims to ensure that the length of the word embedding vectors meets the input requirements of subsequent large and small models, thus obtaining processed word embedding vector data. Padding typically involves adding specific padding symbols to the end of the vector to increase its length; truncating, on the other hand, removes redundant elements when the vector exceeds the required length.
[0057] S12. Obtain the semantic complexity of the word embedding vector data and the length of the input text of the text data to be processed, and calculate the task complexity based on the semantic complexity and the length of the input text.
[0058] First, the length of the input text data to be processed is calculated. Input text length refers to the number of characters or words in the text data; this metric directly reflects the size of the text. In practical applications, text length has a significant impact on the model's processing time and resource consumption. Longer texts typically require more computational resources and time to process.
[0059] Secondly, semantic analysis is performed on the word embedding vector data to obtain its semantic complexity. Semantic complexity refers to the richness and complexity of semantic information in text data. Through semantic analysis, the semantic relationships between words in the text, the complexity of contextual information, and the underlying semantic structure can be evaluated. The assessment of semantic complexity involves a multi-dimensional analysis of the word embedding vectors, including but not limited to word vector similarity, cluster analysis, and semantic field identification.
[0060] Finally, based on the input text length and semantic complexity, the task complexity is calculated using preset weight parameters. Task complexity is a comprehensive indicator that combines text length and semantic complexity to more fully assess the difficulty of the task. The preset weight parameters can be adjusted according to the specific needs of the task and the characteristics of the model to ensure that the calculation of task complexity accurately reflects the resources and time required to process the actual task.
[0061] S13. Divide the text processing task into several sub-tasks according to the task complexity.
[0062] In natural language processing tasks, rationally breaking down text processing tasks according to task complexity is a key step in improving processing efficiency and accuracy. Specifically, this process involves the following aspects:
[0063] First, based on task complexity, identify the semantic structure and logical relationships within the text processing task. In complex text processing tasks, text often contains multiple levels of semantic structure and logical relationships, which are crucial for understanding the meaning of the text. By analyzing task complexity, key semantic units and logical connections in the text can be identified more accurately. For example, in a complex question-answering task, it is necessary to identify the core semantics of the question, relevant contextual information, and the logical relationships between them.
[0064] Secondly, based on semantic structure and logical relationships, the text processing task is broken down into several subtasks, each corresponding to at least one processing step of the text processing task. After identifying the semantic structure and logical relationships of the text, the entire task can be decomposed into multiple subtasks according to these structures and relationships. Each subtask corresponds to one or more processing steps of the text processing task, such as question understanding, context matching, and answer generation. For example, a complex question-and-answer task can be broken down into the following subtasks: a question understanding subtask, responsible for understanding the user's question and extracting the core semantics; a context matching subtask, responsible for finding the relevant parts of the question in the context; and an answer generation subtask, responsible for generating an accurate answer based on the question and context.
[0065] Finally, the processing requirements for each subtask are determined so that they can be dynamically allocated to either the large or small model for processing. After breaking down the text processing task into multiple subtasks, the specific processing requirements for each subtask need to be further determined. These requirements include those for processing speed, resource consumption, accuracy, etc. For example, the problem understanding subtask may require the strong semantic understanding capabilities of a large model, while the context matching subtask may be more suitable for efficient processing by a small model.
[0066] S14. Based on the preset task complexity threshold, each sub-task is dynamically assigned to the large model and the small model for processing, and the text reasoning results of each sub-task are obtained.
[0067] First, the subtasks are divided into first-complexity tasks, second-complexity tasks, and third-complexity tasks based on preset task complexity thresholds. In practical applications, the task complexity thresholds are set based on an assessment of task difficulty. These thresholds help the system identify which tasks are relatively simple, which are relatively complex, and which are of intermediate complexity. In this way, the system can classify subtasks into low-complexity tasks, medium-complexity tasks, and high-complexity tasks, where low-complexity tasks are first-complexity tasks, high-complexity tasks are second-complexity tasks, and medium-complexity tasks are third-complexity tasks.
[0068] The first text reasoning result is obtained by processing the task of first complexity using a small model. Small models typically have faster processing speeds and lower resource consumption, making them well-suited for handling low-complexity tasks. In these tasks, the semantic structure and logical relationships of the text are relatively simple, and the powerful semantic understanding capabilities of large models are not required. By using small models, the system can reduce resource waste while ensuring processing efficiency.
[0069] Large models are used to process the second complexity task, yielding the second text reasoning result. Large models typically possess stronger semantic understanding capabilities and higher accuracy, making them well-suited for handling highly complex tasks. In these tasks, the semantic structure and logical relationships of the text are more intricate, requiring models with a deeper understanding.
[0070] Finally, the small and large models are used in a collaborative process to obtain the third text reasoning result. Medium-complexity tasks contain a certain level of complexity but do not require the powerful processing capabilities of high-complexity tasks. Through the collaborative processing of the small and large models, the system can fully utilize the advantages of both models, improving processing efficiency and accuracy. The small model can quickly process the simpler parts of the task, while the large model can handle the more complex parts, thus achieving optimal resource allocation.
[0071] S15. The results of each text reasoning are fused to obtain the text processing result.
[0072] In natural language processing tasks, fusing the text reasoning results of each subtask is a key step to ensure the accuracy and consistency of the final text processing result. It is necessary to comprehensively consider the complexity and processing requirements of each subtask to determine the most suitable fusion strategy.
[0073] First, the fusion strategy is determined based on the complexity and processing requirements of each subtask. In natural language processing tasks, different subtasks have varying complexities and processing requirements. Low-complexity tasks may produce inference results with high confidence but may lack deep semantic understanding; high-complexity tasks may produce more accurate inference results but are slower. Therefore, it is necessary to select an appropriate fusion strategy based on the specific circumstances of each subtask. For example, a voting method can be used for classification tasks; a weighted average method can be used for probability output tasks.
[0074] The first, second, and third text inference results are fused according to a fusion strategy to obtain the final text processing result. After determining the fusion strategy, the text inference results obtained from different models need to be comprehensively processed. The specific steps are as follows:
[0075] If the subtask is a classification task, a voting method is used, and the category that appears most frequently in each text reasoning result is taken as the final text processing result.
[0076] If the subtask is a probabilistic output task, the weighted average method is used to calculate the weighted average of the reasoning results of each text as the final text processing result.
[0077] For tasks requiring higher robustness, Bayesian fusion can be used to comprehensively consider the uncertainties of each model and obtain more reliable text processing results.
[0078] To further illustrate the present invention, another embodiment is provided to describe the solution in detail:
[0079] 1. In the data preprocessing stage, the input text is converted into an embedding vector using a word embedding model. Based on the input length requirements of the model, the embedding vector is padded or truncated to make its length meet the model input requirements, thus obtaining the input vector X.
[0080] 2. Dynamic weight adjustment mechanism:
[0081] 1) Use a pre-trained language model to segment and tag the input text, identifying different types of morphemes. For example, for an input vector X, identify morphemes such as noun N, verb V, and adjective A.
[0082] 2) Extract the contextual information for each morpheme, including the semantic features and grammatical structure of the preceding and following text. For example, for a noun N, extract the semantic features C of its preceding and following text. N .
[0083] 3) Calculate the weight of each morpheme dynamically based on its type and contextual information. The weight calculation formula is as follows:
[0084] ωi =σ(W·f i +b)
[0085] Among them, f i is the feature vector of morpheme i, W is the weight matrix, b is the bias, and σ is the activation function.
[0086] 4) During model inference, adjust the processing weights of morphemes based on dynamically calculated weights. For example, in text classification tasks, increase the weight of nouns to improve classification accuracy.
[0087] f i ′ =ω i ·f i
[0088] Among them, f i ′ It is the adjusted morpheme feature vector.
[0089] After performing the above processing on each input vector X, the resulting information is used as word embedding vector data for subsequent processing.
[0090] 3. Task complexity assessment:
[0091] 1) Define the task complexity index C by combining the text length L of the input vector X and the semantic complexity S of the word embedding vector data. The calculation formula is as follows:
[0092] C = α·L + β·S
[0093] Here, α and β are weight parameters that can be adjusted according to task requirements.
[0094] 2) The text length L is the number of characters corresponding to the input vector X;
[0095] 3) Semantic complexity S is the perplexity of word embedding vector data.
[0096] 4. Dynamic task decomposition process:
[0097] 1) Identify the key semantic structures and logical relationships in the task based on the complexity of the input task.
[0098] For example, for a complex question-answering task, the core semantics of the question and relevant contextual information are identified.
[0099] 2) Based on task complexity, break down the task into multiple sub-tasks. For example, a complex question-answering task can be broken down into three sub-tasks: question understanding, context matching, and answer generation.
[0100] 3) Dynamically allocate for processing by large models and small models according to the characteristics of subtasks. For example, allocate the problem understanding subtask to a large model, the context matching subtask to a small model, and the answer generation subtask to be jointly processed by a large model and a small model.
[0101] 4) Integrate the processing results of each subtask to generate the final inference result. For example, integrate the results of problem understanding, context matching, and answer generation to generate a complete Q&A result.
[0102] 5. Task dynamic scheduling mechanism:
[0103] 1) Set complexity thresholds T1 and T2 according to task requirements;
[0104] 2) If the task complexity C < T1, call a small model to process independently; if C > T2, call a large model to process independently; if T1 < C < T2, adopt the method of joint processing by large and small models.
[0105] 6. Joint processing by large and small models:
[0106] 1) Input the input vector X into a large model for feature extraction, and the extracted feature value is F large ;
[0107] 2) Use the attention mechanism to extract the key features F large in: key :
[0108] F key = A·F large
[0109] where A is the attention weight matrix.
[0110] 3) Pass the key features F key to the small model for inference, and the inference result is Y small , and the confidence level is P small ;
[0111] 4) The large model judges whether secondary verification is needed according to the confidence level P small . If the confidence level is lower than the threshold θ, the large model will perform secondary inference, and the result is Y large , otherwise directly use the result of the small model as the final inference result Y final ;
[0112] 5) Multi-strategy result fusion. Select a suitable fusion strategy according to task requirements and model performance. For example, for classification tasks, use the voting method:
[0113] Y final = mode({Y large , Ysmall})
[0114] For tasks involving probabilistic outputs, a weighted average method is used:
[0115] Y final =α·Y large +(1-α)·Y small
[0116] Here, α is a weight parameter that can be adjusted according to model performance or task requirements.
[0117] For tasks requiring higher robustness, the Bayesian fusion method is used:
[0118]
[0119] 6) Verify the accuracy and robustness of the fusion results through experiments, and calculate metrics such as accuracy (Acc) and F1 score:
[0120]
[0121] Optimize the parameters of the fusion strategy based on the evaluation results, such as weight allocation and voting rules, to further improve the fusion effect.
[0122] 7. Feedback-driven dynamic optimization:
[0123] 1) Real-time detection of the inference results and confidence levels of small models;
[0124] 2) Based on the detection results, dynamically adjust the data preprocessing method and model calling order. For example, if the confidence level is low, use the adjusted input vector to perform inference again by adding contextual information or adjusting the word embedding model;
[0125] 3) Based on the confidence feedback from the small model, dynamically adjust the model invocation strategy to optimize the inference results. If the confidence level is below the threshold θ, the task complexity C is in the medium range, and the confidence level is low, adjust the model to be handled independently by the large model.
[0126] The natural language processing method based on large and small model collaboration in this invention significantly improves the efficiency and accuracy of natural language processing tasks through a collaborative reasoning mechanism between large and small models. It introduces a task scheduling mechanism to flexibly allocate processing tasks between the large and small models based on task complexity, achieving optimized resource allocation. Through bidirectional data interaction, effective information transfer and verification between the large and small models are enabled, enhancing inter-model collaboration and further improving overall reasoning performance. By transmitting key features from the large model to the small model and feeding back the reasoning results from the small model to the large model for secondary verification, the system can handle complex tasks more accurately. Adjusting the data processing flow and model calling strategy based on real-time feedback allows the system to better adapt to the needs of different task scenarios, enhancing its dynamic adaptability.
[0127] This invention also provides a natural language processing system for big-small model collaboration, used to execute the big-small model collaboration natural language processing method described above. Figure 2 This is a structural block diagram of a natural language processing system for large and small model collaboration according to an embodiment of the present invention. The system includes:
[0128] The data processing module 21 is used to preprocess the text data to be processed to obtain word embedding vector data.
[0129] The complexity calculation module 22 is used to obtain the semantic complexity of the word embedding vector data and the input text length of the text data to be processed, and to calculate the task complexity based on the semantic complexity and the input text length.
[0130] The task splitting module 23 is used to split the text processing task into several sub-tasks according to the task complexity.
[0131] The task processing module 24 is used to dynamically allocate each of the sub-tasks to the large model and the small model for processing according to a preset task complexity threshold, so as to obtain the text reasoning results of each of the sub-tasks.
[0132] The text fusion module 25 is used to fuse the various text reasoning results to obtain the text processing result.
[0133] The task processing module is used for:
[0134] The subtasks are divided according to a preset task complexity threshold to obtain a first complexity task, a second complexity task, and a third complexity task.
[0135] The first complexity task was processed using a small model to obtain the first text reasoning result.
[0136] The second complexity task is processed using a large model to obtain the second text reasoning result.
[0137] By using small and large models to collaboratively process the third complexity task, the third text reasoning result is obtained.
[0138] The technical features and effects of the system proposed in the embodiments of the present invention are the same as those of the method proposed in the embodiments of the present invention, and will not be repeated here. Each module in the above system can be implemented entirely or partially through software, hardware, or a combination thereof. Each module can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0139] See Figure 3 This is a structural block diagram of a computer device provided in an embodiment of the present invention. The computer device includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements the steps described in the above-described embodiment of the natural language processing method for size-model collaboration, for example... Figure 1 Steps S11 to S15 as described above; or, when the processor executes the computer program, it implements the functions of each module in the above-described device embodiments, such as modules 21 to 25 of the natural language processing system with size model collaboration.
[0140] For example, the computer program may be divided into one or more modules, which are stored in the memory and executed by the processor to complete the present invention. The one or more modules may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program in the computer device.
[0141] The computer device may include, but is not limited to, a processor and memory. Those skilled in the art will understand that the schematic diagram is merely an example of a computer device and does not constitute a limitation on the computer device. It may include more or fewer components than illustrated, or combine certain components, or different components. For example, the computer device may also include input / output devices, network access devices, buses, etc.
[0142] The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor. The processor is the control center of the computer device, connecting various parts of the computer device via various interfaces and lines.
[0143] The memory can be used to store the computer programs and / or modules. The processor implements various functions of the computer device by running or executing the computer programs and / or modules stored in the memory and by calling data stored in the memory. The memory may mainly include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the mobile phone (such as audio data, phonebook, etc.). In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as hard disk, memory, plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, at least one disk storage device, flash memory device, or other volatile solid-state storage device.
[0144] If the modules integrated into the computer device are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium, etc.
[0145] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.
[0146] Accordingly, embodiments of the present invention provide a computer-readable storage medium comprising a stored computer program, wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to perform steps in the size-model collaborative natural language processing method of the above embodiments, for example... Figure 1 Steps S11 to S15 as described above.
[0147] In summary, compared with the prior art, the natural language processing method, system, computer device, and computer-readable storage medium for large and small model collaboration provided by the embodiments of the present invention have the following beneficial effects:
[0148] By employing a collaborative reasoning mechanism between large and small models, the efficiency and accuracy of natural language processing tasks are significantly improved. A task scheduling mechanism is introduced to flexibly allocate processing tasks between the large and small models based on task complexity, achieving optimized resource allocation. Through bidirectional data interaction, effective information transfer and verification between the large and small models are enabled, enhancing inter-model synergy and further improving overall reasoning performance. By transmitting key features from the large model to the small model and feeding back the reasoning results from the small model to the large model for secondary verification, the system can handle complex tasks more accurately. Adjusting the data processing flow and model invocation strategy based on real-time feedback allows the system to better adapt to the needs of different task scenarios, enhancing its dynamic adaptability.
[0149] The embodiments described above are merely illustrative of several implementations of the present invention, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these modifications and improvements all fall within the scope of protection of the present invention. Therefore, the scope of protection of this patent should be determined by the appended claims.
Claims
1. A size model collaborative natural language processing method, characterized in that, The method comprises the following steps: data preprocessing is performed on the to-be-processed text data to obtain word embedding vector data; a semantic complexity of the word embedding vector data and an input text length of the to-be-processed text data are obtained, and a task complexity is calculated according to the semantic complexity and the input text length; a text processing task is split into a plurality of subtasks according to the task complexity; each of the subtasks is dynamically assigned to a large model and a small model for processing according to a preset task complexity threshold, and a text reasoning result of each of the subtasks is obtained; the text reasoning results are fused to obtain a text processing result.
2. The size model coordinated natural language processing method of claim 1, wherein, The data preprocessing on the to-be-processed text data to obtain the word embedding vector data comprises the following steps: the to-be-processed text data is converted into word embedding vectors by using a pre-trained word embedding model; the word embedding vectors are padded or truncated according to their lengths to make the lengths meet the input requirements of a language model, and processed word embedding vector data is obtained.
3. The size model coordinated natural language processing method of claim 1, wherein, The obtaining of the semantic complexity of the word embedding vector data and the input text length of the to-be-processed text data and the calculation of the task complexity according to the semantic complexity and the input text length comprises the following steps: the input text length of the to-be-processed text data is calculated; the semantic complexity of the word embedding vector data is obtained by performing semantic analysis on the word embedding vector data; the task complexity is calculated according to the input text length and the semantic complexity through a preset weight parameter.
4. The size model coordinated natural language processing method of claim 1, wherein, The splitting of the text processing task into a plurality of subtasks according to the task complexity comprises the following steps: the semantic structure and the logical relationship in the text processing task are identified according to the task complexity; the text processing task is split into a plurality of subtasks based on the semantic structure and the logical relationship, and each of the subtasks corresponds to at least one processing link of the text processing task; the processing requirement of each subtask is determined so as to be dynamically assigned to a large model or a small model for processing according to the processing requirement subsequently.
5. The size model coordinated natural language processing method of claim 1, wherein, The dynamic assignment of each of the subtasks to the large model and the small model for processing according to the preset task complexity threshold to obtain the text reasoning result of each of the subtasks comprises the following steps: each of the subtasks is divided according to a preset task complexity threshold to obtain a first complexity task, a second complexity task and a third complexity task; the first complexity task is processed by using a small model to obtain a first text reasoning result; the second complexity task is processed by using a large model to obtain a second text reasoning result; the third complexity task is cooperatively processed by using the small model and the large model to obtain a third text reasoning result.
6. The size model coordinated natural language processing method of claim 5, wherein, The fusion of the text reasoning results to obtain the text processing result comprises the following steps: a fusion strategy is determined according to the complexity and the processing requirement of each of the subtasks; the first text reasoning result, the second text reasoning result and the third text reasoning result are fused according to the fusion strategy to obtain a text processing result.
7. A size model collaborative natural language processing system, characterized by, The method comprises the following steps: a data processing module is configured to perform data preprocessing on to-be-processed text data to obtain word embedding vector data; The complexity calculation module is configured to obtain semantic complexity of the word embedding vector data and input text length of the to-be-processed text data, and calculate task complexity according to the semantic complexity and the input text length; The task splitting module is configured to split the text processing task into a plurality of subtasks according to the task complexity; The task processing module is configured to dynamically assign each of the subtasks to a large model and a small model for processing according to a preset task complexity threshold, to obtain a text reasoning result of each of the subtasks; The text fusion module is configured to fuse each of the text reasoning results to obtain a text processing result.
8. The size model coordinated natural language processing system of claim 7, wherein, The task processing module is configured to: divide each of the subtasks according to a preset task complexity threshold to obtain a first complexity task, a second complexity task, and a third complexity task; process the first complexity task using a small model to obtain a first text reasoning result; process the second complexity task using a large model to obtain a second text reasoning result; perform collaborative processing on the third complexity task using the small model and the large model to obtain a third text reasoning result.
9. A computer device, comprising: A processor, a memory, and a computer program stored in the memory and configured to be executed by the processor are included, and the processor implements the natural language processing method of large and small model collaboration according to any one of claims 1-7 when executing the computer program.
10. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, wherein the device where the computer readable storage medium is located implements the natural language processing method of large and small model collaboration according to any one of claims 1-7 when executing the computer program.
Citation Information
Cited By
Semantic understanding method and engine based on multi-model collaborative reasoning and self-supervised learning
CN121659960A
