Application method, device, equipment, medium and product of large language model
By using a method that combines scoring and parameter fusion, the parameters of a large language model are dynamically adjusted, which solves the problems of low data efficiency, high cost, limited generalization ability, and catastrophic forgetting in existing technologies. This enables low-cost, high-precision adaptive optimization of the model and multi-task recognition.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHINA UNICOM (SHANGHAI) IND INTERNET CO LTD
- Filing Date
- 2026-02-06
- Publication Date
- 2026-05-29
AI Technical Summary
Existing large language models suffer from problems such as low data efficiency, high cost, excessive redundant information, limited generalization ability, and risk of catastrophic forgetting during post-training and fine-tuning training, making it difficult to achieve efficient and low-cost adaptive optimization in specific tasks.
By obtaining the scoring results of real-time input tasks, if the preset threshold conditions are met, the target adjustment parameters are determined from the adjustment parameter set based on the task type, and then fused with the original parameters of the preset large language model to generate target model parameters to process real-time input tasks while keeping the original model parameters unchanged.
It achieves high-precision model capability enhancement and adaptive optimization at low cost, improving recognition efficiency in multi-task scenarios and avoiding the risk of catastrophic forgetting.
Smart Images

Figure CN122114010A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of large language model technology, and in particular to a method, apparatus, device, medium and product for applying a large language model. Background Technology
[0002] In the wave of rapid development of artificial intelligence technology, Large Language Models (LLMs) have become a core driving force for industrial transformation. Although the capabilities of LLMs are constantly expanding, there is still a significant gap between the generality of pre-trained models and the specificity of practical applications.
[0003] To adapt to the task requirements of different real-world application scenarios, LLM significantly improves its performance in diverse tasks by injecting explicit knowledge, reasoning capabilities, and tool invocation capabilities into the model during the post-training phase. Specifically, this method typically involves large-scale input-output sample pairs... Train to approximate the mapping ,in Indicates the input data space. This represents the corresponding target output space. This training paradigm implicitly relies on the premise that the training dataset used is sufficient in terms of quality, diversity, and scale to cover the knowledge scope and generalization ability required in the target application scenario. To further improve the model's applicability in specific domains or tasks, model fine-tuning is typically employed. This method uses domain-specific data to enhance the model's capabilities, allowing it to understand and learn domain-specific knowledge to improve its performance in specific domains and tasks. This process mainly involves targeted optimization of the model, improving its performance and contextual relevance in the professional domain. The standard LLM fine-tuning paradigm involves collecting a large-scale training dataset (usually manually labeled or synthesized by LLM) and then performing supervised fine-tuning (SFT) on this dataset. The effectiveness of this method depends on the breadth and representativeness of the training data. If the dataset contains sufficiently diverse and high-quality samples, the model can inductively derive generalizable decision rules, thereby achieving stable and reliable performance on unseen test instances. For example, in tool invocation tasks, existing solutions construct a dataset containing tens of thousands of "user question-tool invocation" sample pairs. By learning from these samples, the model learns how to determine the required tools based on user intent, parse parameter requirements, and generate structured tool invocation instructions, thereby achieving automated and accurate tool collaboration.
[0004] Both current post-training and fine-tuning methods train on a large amount of existing data and then test the model's performance with new, unseen data. The training data consists of many "input-correct answer" examples, and the model's goal is to learn a rule (mapping function). ), continuously optimize and adjust parameters The goal is to minimize the loss to fit the training samples. This approach assumes that when the sample size is large and diverse enough, the learned model will effectively generalize to new tasks in the test distribution. However, this method has several fundamental problems: 1) Inefficient and costly data: Building a large-scale, high-quality training dataset requires a significant amount of human and computational resources, resulting in extremely high costs; 2) Redundant information: The training dataset contains a large number of samples that the model has already mastered or repeated, which does not contribute to improving model performance but wastes computational resources; 3) Limited generalization ability: The model performs well on the training set, but its performance will significantly decrease when test instances come from different distributions (i.e., distribution shift). Standard fine-tuning cannot dynamically adjust for specific test instances that the model is unfamiliar with; 4) Risk of catastrophic forgetting: Fine-tuning for new tasks may impair the abilities the model has learned on previous tasks. Summary of the Invention
[0005] This disclosure provides a method, apparatus, device, medium, and product for applying a large language model, which achieves low-cost, high-precision targeted enhancement and adaptive optimization of model capabilities while maintaining the general capabilities of the original large language model.
[0006] Firstly, it provides an application method for a large language model, including: Acquire real-time input tasks and preset large language models; The scoring result of the real-time input task is determined based on the candidate action set of the real-time input task; If the scoring result meets the preset threshold condition, the target adjustment parameter corresponding to the real-time input task is determined from the adjustment parameter set based on the task type of the real-time input task. The target model parameters are determined based on the target adjustment parameters and the original parameters of the preset large language model; The target model parameters are used as model parameters of a preset large language model to process real-time input tasks and determine the processing results of the real-time input tasks.
[0007] Secondly, an application device for a large language model is provided, including: The acquisition module is used to acquire real-time input tasks and preset large language models; The scoring result determination module is used to determine the scoring result of the real-time input task based on the candidate action set of the real-time input task; The target adjustment parameter determination module is used to determine the target adjustment parameter corresponding to the real-time input task from the adjustment parameter set based on the task type of the real-time input task if the scoring result meets the preset threshold condition. The target model parameter determination module is used to determine the target model parameters based on the target adjustment parameters and the original parameters of the preset large language model. The recognition result determination module is used to use the target model parameters as model parameters of a preset large language model, so as to process the real-time input task using the preset large language model, and to determine the recognition result of the real-time input task.
[0008] Thirdly, an electronic device is provided, comprising: At least one processor; and, A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the application method of the large language model as described in the first aspect above.
[0009] Fourthly, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the application method of the large language model as described in the first aspect above.
[0010] Fifthly, a computer program product is provided, the computer program product comprising a computer program that, when executed by a processor, implements the application method of the large language model as described in the first aspect above.
[0011] This disclosure presents an application method, apparatus, device, medium, and product of a large language model. The method includes: acquiring a real-time input task and a preset large language model; determining a scoring result for the real-time input task based on a set of candidate actions; if the scoring result meets a preset threshold condition, determining a target adjustment parameter corresponding to the real-time input task from an adjustment parameter set based on the task type of the real-time input task; determining target model parameters based on the target adjustment parameters and the original parameters of the preset large language model; and using the target model parameters as model parameters of the preset large language model to process the real-time input task and determine the processing result of the real-time input task. This technical solution performs quality assessment on real-time input tasks. When the score meets the standard, the corresponding target adjustment parameter is dynamically selected from a pre-stored adjustment parameter set according to the task type, and fused with the original parameters of the preset large language model to generate target model parameters. These target model parameters are then configured to the preset large language model to execute the task and obtain the processing result. This achieves low-cost, high-precision targeted enhancement and adaptive optimization of model capabilities while maintaining the original parameters of the preset large language model, enabling efficient recognition of multi-task scenarios.
[0012] It should be understood that the content described in this section is not intended to identify key or important features of the embodiments of this disclosure, nor is it intended to limit the scope of the embodiments of this disclosure. Other features of the embodiments of this disclosure will become readily apparent from the following description. Attached Figure Description
[0013] To more clearly illustrate the technical solutions in the embodiments of this disclosure, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0014] Figure 1 This is a flowchart of an application method for a large language model provided in Embodiment 1 of this disclosure; Figure 2 This is a schematic diagram illustrating the execution process of an application method for a large language model provided in Embodiment 1 of this disclosure; Figure 3 This is a schematic diagram of the structure of an application device for a large language model provided in Embodiment 2 of this disclosure; Figure 4 This is a schematic diagram of the structure of an electronic device provided in Embodiment 3 of this disclosure. Detailed Implementation
[0015] To enable those skilled in the art to better understand the solutions of the embodiments of this disclosure, the technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the embodiments of this disclosure, and not all embodiments. Based on the embodiments of this disclosure, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the protection scope of the embodiments of this disclosure.
[0016] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this disclosure described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0017] Example 1 Figure 1 This is a flowchart illustrating an application method for a large language model according to Embodiment 1 of this disclosure. This embodiment is applicable to the application process of a large language model. The method can be executed by an application device for the large language model, which can be implemented in hardware and / or software. This application device can be configured in an electronic device, including but not limited to computers, PCs, electronic devices, and servers, which are devices with data processing capabilities. Figure 1 As shown, the method includes: S110, Obtain real-time input tasks and preset large language models.
[0018] In this embodiment, a real-time input task and a preset large language model can be obtained. The preset large language model can be a pre-defined and pre-trained large language model. The preset large language model may include the original parameters of the already trained model.
[0019] S120. Determine the scoring result of the real-time input task based on the candidate action set of the real-time input task.
[0020] It is known that after obtaining the real-time input task, the candidate action set corresponding to the real-time input task can be determined. The candidate action set can include at least one candidate action. The candidate action can be a predefined tool or execution path that can be selected in the model's generated processing results. For example, the candidate action set can include actions such as querying the database, calling the calculator, and searching for documents.
[0021] As described above, the scoring result corresponding to the real-time input task can be determined based on the real-time input task set and its corresponding candidate action set.
[0022] S130. If the scoring result meets the preset threshold condition, determine the target adjustment parameter corresponding to the real-time input task from the adjustment parameter set based on the task type of the real-time input task.
[0023] It is known that after obtaining the scoring results corresponding to the real-time input task, it can be determined whether the scoring results meet the preset threshold conditions. The scoring results can be confidence scores, which represent the probability quantification of the model's output correctness. The confidence score typically ranges from 0 to 1, with higher values indicating a stronger degree of confidence in the result. The preset threshold conditions can be pre-set threshold conditions. For example, preset threshold conditions may include scoring results that are lower than a preset threshold.
[0024] Following the above description, if the scoring result meets the preset threshold condition, it can be considered that the uncertainty of the real-time input task is relatively high. At this point, the task type of the real-time input task can be determined, and the target adjustment parameters corresponding to the real-time input task can be determined from the adjustment parameter set based on the task type. The adjustment parameter set can be a set of parameters trained and optimized for a specific task type while keeping the original parameters of the preset large language model unchanged or partially adjusted. For example, the adjustment parameter set may include newly added trainable modules (such as low-rank adaptation matrices, adapter layers, and cue embedding vectors) or selectively unfrozen original parameters. The adjustment parameter set may include adjustment parameters corresponding to each task type.
[0025] It should be noted that, for a given real-time input task The model can be calculated. Candidate actions that can be performed in its environment (e.g., available API calls) The confidence score is calculated, and a confidence threshold is set. determination Certainty. This evaluation process does not rely on real labels. This ensures the fairness and applicability of the reasoning process. By filtering out high-confidence (i.e., certainty) samples, samples with higher uncertainty are obtained, ensuring that subsequent self-reinforcement and self-optimization work is carried out on difficult instances. This uncertainty assessment step can concentrate computational and learning resources on the most informative and challenging problems, thereby improving efficiency and quality.
[0026] S140. Determine the target model parameters based on the target adjustment parameters and the original parameters of the preset large language model.
[0027] In this embodiment, after obtaining the target adjustment parameters, the target adjustment parameters and the original parameters of the preset large language model can be used as the target model parameters. For example, the selected target adjustment parameters and the original parameters of the preset large language model can be combined and operated according to specific fusion rules (such as matrix addition, inter-layer insertion, or parameter superposition) to generate a set of target model parameters that integrate task specialization capabilities and model general capabilities.
[0028] S150. Use the target model parameters as the model parameters of the preset large language model to process the real-time input task and determine the processing result of the real-time input task.
[0029] As described above, after obtaining the target model parameters, the target model parameters can be configured in real time as the current model parameters of the preset large language model. This allows the model to run the preset large language model with the current model parameters optimized for the real-time input task without changing the original parameters. Then, the processing process is performed on the real-time input task based on the target model parameters, and the processing result corresponding to the real-time input task can be output.
[0030] This embodiment provides a method for applying a large language model, including: acquiring a real-time input task and a preset large language model; determining a scoring result for the real-time input task based on a set of candidate actions; if the scoring result meets a preset threshold condition, determining a target adjustment parameter corresponding to the real-time input task from an adjustment parameter set based on the task type of the real-time input task; determining target model parameters based on the target adjustment parameters and the original parameters of the preset large language model; using the target model parameters as model parameters of the preset large language model to process the real-time input task and determine the processing result of the real-time input task. This technical solution achieves low-cost, high-precision targeted enhancement and adaptive optimization of model capabilities while maintaining the original parameters of the preset large language model, enabling efficient recognition of multi-task scenarios.
[0031] As an optional implementation method of this embodiment, the application method of the large language model provided in this embodiment further includes: If the scoring result does not meet the preset threshold condition, the preset large language model is used to process the real-time input task to determine the recognition result of the real-time input task.
[0032] It is known that if the scoring result of the real-time input task does not meet the preset threshold condition, that is, the determinism of the real-time input task is relatively high, the preset large language model can be used to process the real-time input task directly, and then the processing result of the real-time input task can be determined.
[0033] As an optional implementation of this embodiment, the process of determining the set of adjustment parameters includes: 1) Obtain at least one training task set corresponding to the preset large language model. Each training task set corresponds to a different task type. Each training task set includes at least one training task.
[0034] In this embodiment, at least one training task set corresponding to a preset large language model can be obtained. Each training task set can correspond to a different task type. A training task set can include at least one training task, and all training tasks in a training task set have the same task type. The task type can be used to represent the functional category or semantic category of the training tasks in the training task set. For example, the task type can include the operation to be performed (such as translation, summarization, question answering, reasoning, generation, etc.) and the domain classification (medical field, customer service field, financial field, etc.).
[0035] 2) For each training task set, determine the training task set to be optimized from the training task set according to the scoring results corresponding to each training task in the training task set; the training task set to be optimized includes at least one training task to be optimized.
[0036] It is known that after obtaining each training task set, for each training task set, the score result corresponding to each training task in that training task set can be determined based on the candidate action set corresponding to that training task. The training tasks are then filtered according to their respective score results to determine the training tasks to be optimized, and these training tasks are then aggregated to obtain the training task set to be optimized.
[0037] 3) Obtain the extended task set corresponding to each training task to be optimized, and determine the target extended task set corresponding to the training task set to be optimized based on each extended task set.
[0038] It is known that after obtaining the set of training tasks to be optimized, for each training task in the set, data augmentation can be performed on that training task to determine the corresponding extended task set. The data augmentation process can involve using the training task to be optimized as a seed sample, introducing subtle differences while maintaining semantic similarity to the original training task, and determining the extended tasks while preserving the features of the original training task. For example, a large language model can be used to perform data augmentation on the training task to be optimized.
[0039] As described above, after obtaining the extended task set corresponding to each training task to be optimized, the extended task sets corresponding to each training task to be optimized can be summarized, and then the target extended task set corresponding to the training task set to be optimized can be determined.
[0040] 4) Based on the target extended task set, the training adjustment parameters of the preset large language model are trained using a preset loss function to determine the adjustment parameters corresponding to the task types of the training task set.
[0041] In this embodiment, after obtaining the target extended task set, the target extended task set can be used as the training dataset. The target extended task set can be trained and optimized by minimizing the preset loss function. During this process, the original parameters of the preset large language model can be kept unchanged, and new trainable parameters can be introduced into the preset large language model. The trainable parameters can be saved to the LORA adapter.
[0042] Specifically, parameter-efficient fine-tuning techniques (such as LoRA) can be used to update only a small number of additional training parameters (i.e., auxiliary parameters such as low-rank matrices stored in the adapter weights) without changing the weights of the preset large language model, thereby determining the adjustment parameters for the task type of the training task set corresponding to the target extended task set.
[0043] 5) Determine the set of adjustment parameters for the preset large language model based on the adjustment parameters corresponding to each task type.
[0044] It is known that the tuning parameters (such as multiple independent LoRA adapter weights) trained by different task types can be aggregated and integrated to form a set of tuning parameters that covers multi-task adaptation capabilities. This allows the pre-set large language model to quickly switch and enhance multi-task capabilities without changing the original base weights by flexibly loading the tuning parameters corresponding to different tasks in this set.
[0045] As an optional implementation of this embodiment, obtaining the extended task set corresponding to each training task to be optimized further includes: For any training task to be optimized, based on a preset number of expansions, the training task to be optimized is expanded using the preset large language model to determine the set of expanded tasks corresponding to the training task to be optimized; the set of expanded tasks includes at least one set of expanded tasks.
[0046] Specifically, the preset number of extensions can be a pre-defined number of extension task sets. For any training task to be optimized, the data synthesis capabilities of the preset large language model can be used to perform self-enhancement processing on the task based on the preset number of extensions. Specifically, the training task to be optimized can be used as a seed, and the preset large language model can be guided to generate K sets (the preset number of extensions) of new input-output pairs through pre-designed prompts. These generated extension tasks, while maintaining the semantic relevance, core intent, and task type of the original task, introduce subtle differences by changing the specific name, wording, or context, thus constructing an extension task set around the local uncertainty region of the training task to be optimized, which can then be used for subsequent optimization of the model's adjustment parameters.
[0047] For example, for uncertain samples (training task to be optimized) LLM itself can be used for data synthesis as a self-enhancing mechanism. As a seed sample (without corresponding labels) ), guided by the prompts of the extended rules to generate K Create new input-output pairs. These synthetic samples ( While maintaining the original uncertain sample While maintaining semantic similarity, subtle differences are introduced, thus preserving the original input features while expanding the training data. Among these, These are custom hyperparameters used to control the behavior based on the current uncertain sample. The amount of data in the synthesized samples. Each generated sample pair ( They all strive to become samples of uncertainty. A reasonable instance in the relevant underlying data distribution (especially in the region of uncertainty surrounding the model's input). K The generated sample pairs will form a specific subset of the dataset for subsequent self-optimization. For each sample deemed uncertain, task expansion capture is performed, ultimately generating an expanded task set for model parameter optimization. .
[0048] Following the above description, the expansion rules during task expansion can be described as follows: A training task to be optimized is used as a seed sample. During data expansion, the following principles must be followed: Different variants of the seed are created by changing the specific name, wording, or context, but no variant can be a duplicate of the original version; all generated samples (expanded tasks) must maintain the core intent and task type of the original sample; each generated sample must contain three fields: complete task instruction, input, and output; the response format must be standard JSON, with each sample being an object, and the entire set being a JSON array containing multiple objects.
[0049] As an optional implementation of this embodiment, the step of determining the training task set to be optimized from the training task set based on the scoring results corresponding to each training task in the training task set further includes: 1) For any training task, determine the set of candidate actions corresponding to the training task.
[0050] It is known that for each training task in the training task set, a set of candidate actions corresponding to each training task can be determined.
[0051] 2) Determine the scoring results corresponding to the training task based on the training task and the candidate action set.
[0052] It is known that for any training task, the score result corresponding to the training task can be determined based on the training task and its corresponding set of candidate actions. The score result can be the confidence score of the training task.
[0053] 3) Based on the preset threshold conditions and the scoring results corresponding to each training task, determine the set of training tasks to be optimized from the training task set.
[0054] It is known that after obtaining each training task, it is possible to determine whether the score results of each training task meet the preset threshold conditions. If they do, the training tasks that meet the preset threshold conditions can be used as training tasks to be optimized, and the training tasks to be optimized can be summarized to obtain the set of training tasks to be optimized.
[0055] As an optional implementation of this embodiment, determining the scoring results corresponding to the training task based on the training task and the candidate action set includes: 1) Based on the training task and the candidate action set, use the preset large language model to calculate the negative log-likelihood of each candidate action in the candidate action set.
[0056] In this embodiment, after obtaining the candidate action set corresponding to the training task, the negative log-likelihood of each candidate action in the candidate action set can be calculated using a preset large language model. The negative log-likelihood can represent the degree of surprise or uncertainty of the large language model in selecting a certain action.
[0057] For example, the training task can be represented as The set of executable candidate actions can be represented as: The presupposed large language model can be represented as The negative log-likelihood can be expressed as Then we have: ; in, It can represent the number of candidate actions. It can represent the number of training tasks.
[0058] 2) Use a preset scoring mechanism to transform each negative log-likelihood to determine the scoring result corresponding to each candidate action.
[0059] In this embodiment, the preset scoring mechanism can be a pre-defined scoring mechanism. Since the original negative log-likelihood score has an unbounded characteristic, its result is difficult to interpret directly, which limits its application value in accurately quantifying uncertainty. To solve this problem, the preset scoring memory can be used to transform each negative log-likelihood, thereby determining the scoring result corresponding to each candidate action.
[0060] For example, the rating result can be a confidence score, and the preset rating mechanism can be a relative score. The Relative Softmax Scoring (RSS) mechanism can be used to transform negative log-likelihood into a standardized and interpretable confidence distribution. The confidence score can be expressed as: ; in, Can represent candidate actions RSS confidence score, Then the corresponding action The negative log-likelihood score. The term represents the maximum negative log-likelihood score among all candidate actions, serving as a numerical stabilizer.
[0061] 3) Determine the first and second scoring results based on the scoring results corresponding to each candidate action.
[0062] It can be seen that after obtaining the scoring results corresponding to each candidate action decomposition, the maximum value of the scoring results and the scoring results that are only lower than the maximum value can be determined from the scoring results corresponding to each candidate action. The maximum value is determined as the first scoring result, and the scoring results that are only lower than the maximum value are determined as the second scoring result.
[0063] 4) Determine the score result corresponding to the training task based on the first score result and the second score result.
[0064] It is known that after determining the first and second scoring results, the difference between the first and second scoring results can be calculated, and the difference can be determined as the scoring result corresponding to the training task.
[0065] For example, to quantify prediction uncertainty, we calculate the difference between the highest and second-highest RSS scores (i.e., Quantified by difference. Specifically, input Uncertainty is defined as: ; in, It can represent the maximum value of the score result. This can represent a score result that is only below the maximum value.
[0066] Figure 2 This is a schematic diagram illustrating the execution process of a large-scale language model application method provided in this embodiment, as shown below. Figure 2 As shown, after acquiring the real-time input task and the preset large language model, the uncertainty (scoring result) of the real-time input task can be determined. If the uncertainty meets the preset threshold condition, the task type of the real-time input task can be determined, and the target adjustment parameter can be determined from the adjustment parameter set according to the task type. Based on the target adjustment parameter and the original parameters of the preset large language model, the target model parameter is determined. Based on the target model parameter, the preset large language model is used to process the real-time input task, and the processing result is determined. If the uncertainty does not meet the preset threshold condition, the preset large language model is directly used to process and obtain the processing result. The technical effects that the above technical solution can achieve include: 1) Significant performance improvement: After fine-tuning this solution relative to the preset large language model on multiple tasks, the accuracy was significantly improved, with the relative performance improvement being more significant for models with smaller parameter counts.
[0067] 2) High data utilization: This solution can achieve or even surpass the performance of fine-tuning training using a complete fine-tuning dataset by using only a very small amount of self-generated data based on uncertain samples for fine-tuning.
[0068] 3) Low computational cost: Since this scheme only performs lightweight fine-tuning on a portion of uncertain samples, the overall computational cost is much lower than that of fine-tuning the entire sample set.
[0069] 4) Effectively address distribution shift: This scheme can better handle test samples with different distributions than the training set by dynamically adapting to the inference samples, thereby enhancing the model's generalization ability.
[0070] 5) No risk of catastrophic forgetting: The temporary parameter update mechanism ensures the integrity of the original model knowledge.
[0071] Example 2 Figure 3 This is a schematic diagram of the structure of an application device for a large language model provided in Embodiment 3 of this disclosure; as shown below. Figure 3 As shown, the device includes: an acquisition module 210, a scoring result determination module 220, a target adjustment parameter determination module 230, a target model parameter determination module 240, and a recognition result determination module 250.
[0072] Among them, the acquisition module 210 is used to acquire real-time input tasks and preset large language models; The scoring result determination module 220 is used to determine the scoring result of the real-time input task based on the candidate action set of the real-time input task; The target adjustment parameter determination module 230 is used to determine the target adjustment parameter corresponding to the real-time input task from the adjustment parameter set based on the task type of the real-time input task if the scoring result meets the preset threshold condition. The target model parameter determination module 240 is used to determine the target model parameters based on the target adjustment parameters and the original parameters of the preset large language model; The recognition result determination module 250 is used to use the target model parameters as model parameters of a preset large language model, so as to process the real-time input task using the preset large language model, and to determine the recognition result of the real-time input task.
[0073] Embodiment 2 of this disclosure provides an application device for a large language model. Under the premise of keeping the original parameters of the preset large language model unchanged, it realizes low-cost, high-precision targeted enhancement and adaptive optimization of model capabilities, and achieves efficient recognition of multi-task scenarios.
[0074] Furthermore, the device also includes: The training task set acquisition module is used to acquire at least one training task set corresponding to the preset large language model. Each training task set corresponds to a different task type. Each training task set includes at least one training task. The module for determining the training task set to be optimized is used to determine the training task set to be optimized from the training task set based on the scoring results corresponding to each training task in the training task set; the training task set to be optimized includes at least one training task to be optimized. The target extended task set determination module is used to obtain the extended task set corresponding to each training task to be optimized, and determine the target extended task set corresponding to the training task set to be optimized based on each extended task set. The parameter adjustment determination module is used to train the training adjustment parameters of the preset large language model based on the target expanded task set and using a preset loss function, so as to determine the adjustment parameters corresponding to the task type of the training task set. The parameter set determination module is used to determine the corresponding set of adjustment parameters for the preset large language model based on the adjustment parameters corresponding to each task type.
[0075] Furthermore, the module for determining the training task set to be optimized is also used for: The candidate action set determination unit is used to determine the candidate action set corresponding to any training task for any training task. The scoring result determination unit is used to determine the scoring result corresponding to the training task based on the training task and the candidate action set; The unit for determining the training task set to be optimized is used to determine the training task set to be optimized from the training task set based on preset threshold conditions and the scoring results corresponding to each training task.
[0076] Furthermore, the scoring result determination unit is also used for: Based on the training task and the candidate action set, the negative log-likelihood of each candidate action in the candidate action set is calculated using the preset large language model. A pre-defined scoring mechanism is used to transform each negative log-likelihood in order to determine the scoring result corresponding to each candidate action. The first and second scores are determined based on the scores corresponding to each candidate action. The scoring result corresponding to the training task is determined based on the first scoring result and the second scoring result.
[0077] Furthermore, the target expansion task set determination module is also used for: For any training task to be optimized, based on a preset number of expansions, the training task to be optimized is expanded using the preset large language model to determine the set of expanded tasks corresponding to the training task to be optimized; the set of expanded tasks includes at least one set of expanded tasks.
[0078] Furthermore, the device also includes: The model recognition module is used to process the real-time input task using the preset large language model if the scoring result does not meet the preset threshold condition, in order to determine the recognition result of the real-time input task. The application apparatus for the large language model provided in this disclosure can execute the application method of the large language model provided in any embodiment of this disclosure, and has the corresponding functional modules and beneficial effects of the execution method.
[0079] Example 3 Figure 4 A schematic diagram of the structure of an electronic device 10 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the embodiments of the present disclosure described and / or claimed herein.
[0080] like Figure 4 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 can also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0081] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0082] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microprocessor, etc. Processor 11 performs the various methods and processes described above, such as the application methods of large language models.
[0083] In some embodiments, the application method of the large language model can be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the application method of the large language model described above can be performed. Alternatively, in other embodiments, processor 11 can be configured to execute the application method of the large language model by any other suitable means (e.g., by means of firmware).
[0084] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0085] Computer programs for implementing the methods of embodiments of this disclosure may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0086] In the context of embodiments of this disclosure, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0087] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0088] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0089] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.
[0090] It should be understood that the various forms of processes shown above can be used to reorder, add, or delete steps. For example, the steps described in the embodiments of this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of the embodiments of this disclosure can be achieved, and this document does not impose any limitations.
[0091] The specific embodiments described above do not constitute a limitation on the scope of protection of the embodiments disclosed herein. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the embodiments disclosed herein should be included within the scope of protection of the embodiments disclosed herein.
[0092] This disclosure also provides a computer program product, including a computer program and / or instructions, which, when executed by a processor, implements the application method of the large language model as provided in any embodiment of this application.
[0093] In implementing a computer program product, computer program code for performing the operations of the embodiments of this disclosure can be written in one or more programming languages or a combination thereof. Programming languages include object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as C or similar languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0094] Note that the above are merely preferred embodiments and the technical principles applied in this disclosure. Those skilled in the art will understand that this disclosure is not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions can be made without departing from the protection scope of this disclosure. Therefore, although the embodiments of this disclosure have been described in detail above, this disclosure is not limited to the above embodiments. More other equivalent embodiments may be included without departing from the concept of this disclosure, and the scope of this disclosure is determined by the scope of the appended claims.
Claims
1. A method for applying a large language model, characterized in that, include: Acquire real-time input tasks and preset large language models; The scoring result of the real-time input task is determined based on the candidate action set of the real-time input task; If the scoring result meets the preset threshold condition, the target adjustment parameter corresponding to the real-time input task is determined from the adjustment parameter set based on the task type of the real-time input task. The target model parameters are determined based on the target adjustment parameters and the original parameters of the preset large language model; The target model parameters are used as model parameters of a preset large language model to process real-time input tasks and determine the processing results of the real-time input tasks.
2. The method according to claim 1, characterized in that, The process of determining the set of adjustment parameters includes: Obtain at least one training task set corresponding to the preset large language model, and each training task set corresponds to a different task type; each training task set includes at least one training task. For each training task set, a training task set to be optimized is determined from the training task set based on the scoring results corresponding to each training task in the training task set; the training task set to be optimized includes at least one training task to be optimized. Obtain the extended task set corresponding to each training task to be optimized, and determine the target extended task set corresponding to the training task set to be optimized based on each extended task set; Based on the target extended task set, the training adjustment parameters of the preset large language model are trained using a preset loss function to determine the adjustment parameters corresponding to the task type of the training task set; The set of adjustment parameters for the preset large language model is determined based on the adjustment parameters corresponding to each task type.
3. The method according to claim 2, characterized in that, The step of determining the set of training tasks to be optimized from the training task set based on the scoring results corresponding to each training task in the training task set includes: For any training task, determine the set of candidate actions corresponding to the training task; Determine the scoring results corresponding to the training task based on the training task and the candidate action set; Based on preset threshold conditions and the scoring results corresponding to each training task, the set of training tasks to be optimized is determined from the training task set.
4. The method according to claim 3, characterized in that, The step of determining the scoring results corresponding to the training task based on the training task and the candidate action set includes: Based on the training task and the candidate action set, the negative log-likelihood of each candidate action in the candidate action set is calculated using the preset large language model. A pre-defined scoring mechanism is used to transform each negative log-likelihood in order to determine the scoring result corresponding to each candidate action. The first and second scores are determined based on the scores corresponding to each candidate action. The scoring result corresponding to the training task is determined based on the first scoring result and the second scoring result.
5. The method according to claim 2, characterized in that, The step of obtaining the extended task set corresponding to each training task to be optimized includes: For any training task to be optimized, based on a preset number of expansions, the training task to be optimized is expanded using the preset large language model to determine the set of expanded tasks corresponding to the training task to be optimized; the set of expanded tasks includes at least one set of expanded tasks.
6. The method according to claim 1, characterized in that, The method further includes: If the scoring result does not meet the preset threshold condition, the preset large language model is used to process the real-time input task to determine the recognition result of the real-time input task.
7. An application device for a large language model, characterized in that, include: The acquisition module is used to acquire real-time input tasks and preset large language models; The scoring result determination module is used to determine the scoring result of the real-time input task based on the candidate action set of the real-time input task; The target adjustment parameter determination module is used to determine the target adjustment parameter corresponding to the real-time input task from the adjustment parameter set based on the task type of the real-time input task if the scoring result meets the preset threshold condition. The target model parameter determination module is used to determine the target model parameters based on the target adjustment parameters and the original parameters of the preset large language model. The recognition result determination module is used to use the target model parameters as model parameters of a preset large language model, so as to process the real-time input task using the preset large language model, and to determine the recognition result of the real-time input task.
8. An electronic device, characterized in that, include: At least one processor; as well as, A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the application method of the large language model as described in any one of claims 1-6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the application method of the large language model as described in any one of claims 1-6.
10. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the application method of the large language model as described in any one of claims 1-6.