Model configuration parameter adaptive method and device, storage medium and electronic equipment

By dynamically matching the hyperparameters of a large language model using the HBPOP architecture, the problem of unstable generation results caused by fixed hyperparameters is solved, achieving high-quality, low-latency generation effects that can adapt to different business scenarios.

CN122065983APending Publication Date: 2026-05-19SHANGHAI XULU INFORMATION TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHANGHAI XULU INFORMATION TECHNOLOGY CO LTD
Filing Date
2026-04-10
Publication Date
2026-05-19

AI Technical Summary

Technical Problem

In practical applications, existing large language models use globally fixed hyperparameter values, ignoring the diversity of different business scenarios. This results in insufficient quality and stability of the generated results. Furthermore, the existing self-reflection mechanism has high computational overhead and cannot meet the needs of low-latency applications.

Method used

The heterogeneous branched parallel output prediction (HBPOP) architecture is adopted. Initial hyperparameters are quickly generated by configuring the parameter model and then modified to customized hyperparameters based on the confidence level, which dynamically matches the task requirements and avoids redundant calculations and delays.

Benefits of technology

Without altering the target model structure, the quality and stability of the generated results are significantly improved, latency is reduced, real-time interaction requirements are met, and the configuration parameter model is optimized through online feedback.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122065983A_ABST
    Figure CN122065983A_ABST
Patent Text Reader

Abstract

The invention provides a model configuration parameter self-adaption method and device, a storage medium and electronic equipment, and relates to the field of large language models. The electronic equipment firstly obtains a prompt word to be processed by a target model; performing single processing on the prompt word through a configuration parameter model, and quickly outputting an initial hyper-parameter matched with the semantic feature of the prompt word; generating a more stable and more adaptive customized hyper-parameter according to the initial hyper-parameter; and finally, enabling the target model to complete response generation under the constraint of the customized hyper-parameter. Therefore, on the premise that the structure of the target model is not changed, task requirements can be dynamically matched, and the quality and stability of the generated result are remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of large models, and more specifically, to a method, apparatus, storage medium, and electronic device for adaptive model configuration parameters. Background Technology

[0002] In the field of artificial intelligence, especially in the practical deployment of Large Language Models (LLMs), LLMs are generally equipped with several key hyperparameters, including temperature coefficient, frequency penalty, presence penalty, and sampling parameters (Top-P and Top-K). The temperature coefficient controls the randomness of the output; a lower value results in a more deterministic output, while a higher value leads to a more divergent output. The frequency penalty suppresses the repetition of already occurring words, ensuring the coherence of long texts. The presence penalty limits the overall frequency of a certain type of word, improving expressive diversity. Among the sampling parameters, Top-P dynamically defines the candidate word set based on a cumulative probability threshold, while Top-K selects the K words with the highest probabilities. Both constrain the model's decoding range, achieving a balance between generation quality and computational efficiency.

[0003] Because the output behavior of large language models is highly dependent on the specific values ​​of these hyperparameters, and different business problems have fundamentally different requirements for output behavior. For example, code generation tasks require deterministic and reproducible output, necessitating a lower temperature coefficient (e.g., 0.2–0.5) and moderate frequency penalty; while creative tasks such as novel writing require stimulating diversity, favoring a higher temperature coefficient (e.g., 0.8–1.2) and lower existence penalty. Fact-based question answering tends to use a smaller Top-P (e.g., 0.7) to ensure accurate answers, while open-ended dialogues utilize a larger Top-P (e.g., 0.95) to enhance expressive richness.

[0004] However, in traditional LLM, hyperparameters often use globally fixed values, ignoring the diversity of problems faced in real-world application scenarios. Summary of the Invention

[0005] In order to overcome at least one of the shortcomings of the prior art, one of the objectives of this application is to provide a model configuration parameter adaptive method, apparatus, storage medium and electronic device, which can dynamically match task requirements without changing the target model structure, and significantly improve the quality and stability of the generated results.

[0006] Firstly, this application provides a method for adaptive model configuration parameters, the method comprising: Obtain the prompt words to be processed by the target model; The prompt words are processed by a configuration parameter model to obtain the initial hyperparameters recommended by the configuration parameter model for the target model; Based on the initial hyperparameters, customized hyperparameters are obtained to facilitate the target model's processing of the prompt words; The target model processes the prompt words under the constraints of customized hyperparameters to obtain the response results of the prompt words.

[0007] Secondly, embodiments of this application also provide a model configuration parameter adaptive device, the device comprising: The human-computer interaction module is used to obtain prompt words to be processed by the target model; The parameter recommendation module is used to process the prompt words through a configuration parameter model to obtain the initial hyperparameters recommended by the configuration parameter model for the target model; The parameter correction module is used to obtain customized hyperparameters that facilitate the target model in processing the prompt words based on the initial hyperparameters; The interactive response module is used to process the prompt words through the target model under the constraints of customized hyperparameters to obtain the response results of the prompt words.

[0008] Optionally, the configuration parameter model also outputs the confidence level of the initial hyperparameters; The parameter correction module is used to obtain customized hyperparameters that facilitate the target model's processing of the prompt words based on the initial hyperparameters, including: The initial hyperparameters are modified based on their confidence level to obtain customized hyperparameters that facilitate the target model's processing of the prompt words.

[0009] Thirdly, embodiments of this application also provide a storage medium storing a computer program that, when executed by a processor, implements the model configuration parameter adaptive method.

[0010] Fourthly, embodiments of this application also provide an electronic device, the electronic device including a processor and a memory, the memory storing a computer program, the computer program implementing the model configuration parameter adaptive method when executed by the processor.

[0011] Compared with the prior art, this application has the following beneficial effects: In the model configuration parameter adaptive method, apparatus, storage medium, and electronic device provided in this application, the server first obtains the prompt word to be processed by the target model; then, it processes the prompt word once through the configuration parameter model, quickly outputting initial hyperparameters that adapt to the semantic features of the prompt word; subsequently, it generates more stable and suitable customized hyperparameters based on the initial hyperparameters; finally, the target model completes response generation under the constraints of the customized hyperparameters. In this way, the server can dynamically match task requirements without changing the target model structure, significantly improving the quality and stability of the generated results. Attached Figure Description

[0012] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0013] Figure 1 One of the flowcharts illustrating the adaptive method for model configuration parameters provided in this application embodiment; Figure 2 A schematic diagram of the model structure of the configuration parameter model provided in the embodiments of this application; Figure 3 A second flowchart illustrating the adaptive method for model configuration parameters provided in this application embodiment; Figure 4 A comparison chart of experimental results for output latency and throughput provided for embodiments of this application; Figure 5 A comparative chart of experimental results for the overall adaptability provided in the embodiments of this application; Figure 6 A comparative chart of statistical results of lasting satisfaction provided for embodiments of this application; Figure 7 This is a schematic diagram of the structure of the model configuration parameter adaptive device provided in the embodiments of this application; Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.

[0014] icon: 11-Human-computer interaction module; 12-Parameter recommendation module; 13-Parameter correction module; 14-Interaction response module; 21-Memory; 22-Processor; 23-Communication unit; 24-System bus. Detailed Implementation

[0015] To make the objectives, technical solutions, and advantages of the embodiments of this application (hereinafter referred to as "the embodiments") clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. The components of the embodiments of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.

[0016] Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.

[0017] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.

[0018] In the description of this application, it should be noted that the terms "first," "second," "third," etc., are used only for distinguishing descriptions and should not be construed as indicating or implying relative importance. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0019] Based on the above statement, as introduced in the background technology, in traditional LLM, hyperparameters often adopt globally fixed values, ignoring the diversity of problems faced in actual application scenarios.

[0020] In related technologies, hyperparameters can be configured for different business scenarios through offline testing and hard coding. However, in practical applications, it has been found that this method leads to a sharp increase in maintenance costs with the number of scenarios. For example, for services with more than 100 business scenarios, manual debugging of the corresponding hyperparameters often takes several weeks. In addition, this method can only cover scenarios with clear intentions and cannot respond to complex user intentions, such as mixed-modal input or novel prompts that have not been seen before.

[0021] Therefore, to alleviate the limitations of fixed configurations, some related technologies have proposed allowing large language models to analyze and generate suggested sampling hyperparameters through prompt engineering, a so-called self-reflection mechanism. However, this approach requires first generating an analytical text about parameter selection, and then performing the actual generation based on that analysis. This results in an additional 20%–50% increase in token consumption and a significant increase in response latency, reaching 1–3 seconds in high-concurrency scenarios. Research revealed that the high latency is due to the large number of parameters in the large language model itself (e.g., over 70 bytes), making each reflection equivalent to a complete forward computation, resulting in enormous computational overhead and failing to meet the low-latency requirements of real-time chat, voice interaction, or text-to-image processing applications.

[0022] It should be noted that the defects in the solutions in the above-mentioned related technologies are the result of practice and careful research. Therefore, the discovery process of the above problems and the solutions proposed by the embodiments of this application in the following text should be regarded as contributions made to this application in the process of invention and creation, and should not be understood as technical content known to those skilled in the art.

[0023] Based on the discovery of the above-mentioned technical problems, this embodiment provides a model configuration parameter adaptive method, named the Heterogeneous Branched Parallel Output Prediction (HBPOP) architecture, also known as the BPOP architecture. Figure 1 As shown, the method includes: S1, obtain the prompt words to be processed by the target model.

[0024] S2, by processing the prompt words through the configuration parameter model, obtains the initial hyperparameters recommended by the configuration parameter model for the target model.

[0025] S3. Based on the initial hyperparameters, obtain customized hyperparameters that facilitate the target model's processing of prompt words.

[0026] S4, the target model processes the prompt words under the constraints of the customized hyperparameters to obtain the response results of the prompt words.

[0027] This can be understood as follows: the server first obtains the prompt word to be processed by the target model; then, it processes the prompt word once through a configured parameter model, quickly outputting initial hyperparameters that adapt to the semantic features of the prompt word; subsequently, it generates more robust and suitable customized hyperparameters based on these initial hyperparameters; finally, the target model completes response generation under the constraints of these customized hyperparameters. In this way, the server can dynamically match task requirements without changing the target model structure, significantly improving the quality and stability of the generated results.

[0028] For the adaptive model configuration parameter method provided in this embodiment, the electronic device implementing the method can be, but is not limited to, a mobile terminal, tablet computer, laptop computer, desktop computer, and server. When it is a server, the server can be a single server or a group of servers. The server group can be centralized or distributed (for example, the server can be a distributed system). In some embodiments, the server can be local or remote relative to the user terminal. In some embodiments, the server can be implemented on a cloud platform; by way of example only, the cloud platform can include private cloud, public cloud, hybrid cloud, community cloud, distributed cloud, inter-cloud, multi-cloud, etc., or any combination thereof. In some embodiments, the server can be implemented on an electronic device having one or more components.

[0029] To make the solution provided in this embodiment clearer, a server is used as the electronic device for implementing the method below, and in conjunction with... Figure 1 Each step of the method is described in detail. However, it should be understood that the operations in the flowchart may not be implemented in sequence, and steps without logical contextual relationships may be reversed in order or performed simultaneously. Furthermore, those skilled in the art, guided by the content of this application, may add one or more other operations to the flowchart, or remove one or more operations from the flowchart. See also... Figure 1 The method includes: S1, obtain the prompt words to be processed by the target model.

[0030] In practical applications, the server can receive input in natural language form from the user terminal and identify it as prompts to be processed by the target model. Therefore, prompts here refer to the text sequence input to the large language model to guide it in generating response content, and their forms include, but are not limited to, questions, instructions, and mixed-modal text.

[0031] Furthermore, in this embodiment, the target model refers to the Large Language Model (LLM) that is invoked by the server and actually performs the text generation task. It is used to process prompt words and output response results. In practical applications, this target model can be a model with a large number of parameters and strong generation capabilities, such as open-source large language models like Llama-3.1-70B-Instruct or Qwen-2.5-72B-Instruct. These models do not participate in hyperparameter prediction but only act as the controlled generation entity.

[0032] Based on the prompts received in the above embodiments, the following will continue to... Figure 1 Step S2 will be explained below: S2, by processing the prompt words through the configuration parameter model, obtains the initial hyperparameters recommended by the configuration parameter model for the target model.

[0033] In related technologies, multiple independent small models or a serial calling method can be used to predict different hyperparameters. For example, one model is run first to determine the task type, then another model is run to output the temperature value, and finally the configuration table is queried to obtain the penalty coefficient. In practice, it has been found that this method not only increases memory usage and computational latency, but also easily reduces predictive synergy due to inconsistencies in the feature spaces between models. In addition, the server needs to perform multiple forward propagations on the same prompt word, but only outputs a single-dimensional result each time, making it impossible to obtain semantic classification and multiple hyperparameters simultaneously in a single operation. In view of this, the configuration parameter model provided in this embodiment includes a shared encoding layer, a gating layer, and multiple parameter branches, and provides the following optional implementation methods for step S2: S2-1, the prompt words are processed through a shared coding layer to obtain the semantic features of the prompt words.

[0034] S2-2, the semantic features are processed through a gating layer to obtain activation information for multiple parameter branches.

[0035] S2-3, Based on the activation information, determine the active branch from multiple parameter branches.

[0036] S2-4 uses activation branches to process semantic features and obtains the initial hyperparameters recommended by the target model.

[0037] like Figure 2 As shown, this embodiment deploys a configuration parameter model in the server that includes a shared coding layer, a gating layer, and multiple parameter branches. This enables the server to intelligently determine which parameter branches to use for calculation based on the semantic content of the prompt words when processing user input prompt words. This ensures inference efficiency while accurately generating initial hyperparameters that are suitable for the current task requirements.

[0038] In practical applications, the server can first process the prompt words through a shared encoding layer to obtain their semantic features; this shared encoding layer is a shared encoder backbone based on the Transformer architecture, which receives the input prompt words. Then, a unified high-dimensional hidden layer representation is output. This representation carries the overall semantic information of the prompt word and serves as the common input for all subsequent branch paths.

[0039] In this process, the server further processes the semantic features through a gating layer to obtain activation information for multiple parameter branches; the gating layer is specifically implemented as an adaptive gating unit, which determines the activation information based on the semantic features. Calculate a gating vector consisting of 0s and 1s. , of which element The value of is determined by the following expression:

[0040] In the formula, For indicator functions, For the Sigmoid function, This is a preset gating threshold; the gating vector is used to characterize whether each parameter branch is activated, i.e., when... At that time, corresponding to the first A parameter branch is enabled, and conversely, it is suppressed.

[0041] See also Figure 2 Based on this activation information, the server determines the activation branch from multiple parameter branches. These multiple parameter branches are physically separate but logically share the semantic features of the same prompt word, including the main branch path (PrimaryBranch) and at least two auxiliary branch paths (AuxiliaryBranchI and AuxiliaryBranchII). The main branch path is used to output the discrete intent tags of the business scenario. For example, one of the intentions, such as "code generation" or "creative writing," is specifically calculated using the Softmax function; the auxiliary branch path I is used to predict the temperature coefficient in parallel, outputting continuous numerical values. Auxiliary branch path II is used for parallel prediction frequency penalty, outputting continuous numerical values. Therefore, by using a gating layer to process semantic features, the server ultimately obtains branches that require targeted hyperparameter customization.

[0042] For example, when the server receives the prompt "Python bubble sort code", the gating unit recognizes that the prompt belongs to a deterministic task and automatically sets the gating value corresponding to the frequency penalty branch to 0, activating only the main branch path and the temperature prediction branch. This skips the entire forward calculation process of the frequency penalty branch, reducing the computational power consumption of inference while still accurately outputting the low temperature value and intent category suitable for the code generation task.

[0043] In this way, we can achieve parallel prediction of multidimensional hyperparameters while avoiding redundant calculations caused by irrelevant branches, ensuring that the initial hyperparameters are generated efficiently, lightweightly and with good task suitability in a single forward propagation.

[0044] Based on the initial hyperparameters obtained from the above embodiments, the following steps will continue to be performed on... Figure 1 Step S3 will be explained below: S3. Based on the initial hyperparameters, obtain customized hyperparameters that facilitate the target model's processing of prompt words.

[0045] It should be noted that if the server indiscriminately adopts the initial hyperparameters as customized hyperparameters without evaluating their reliability, it may directly inject obviously unreasonable parameters (e.g., assigning excessively high temperature values ​​to factual query errors) into the target model, leading to risks such as degraded output quality, content duplication, or even logical errors. Therefore, the configuration parameter model also outputs the confidence level of the initial hyperparameters. The server then modifies the initial hyperparameters based on this confidence level to obtain customized hyperparameters that facilitate the target model's processing of prompt words. As an optional implementation: S3-1, If ​​the confidence level of the initial hyperparameters is greater than the confidence level threshold, then the fusion coefficient of the initial hyperparameters is obtained based on the confidence level of the initial hyperparameters.

[0046] Among them, the fusion coefficient of the initial hyperparameters is positively correlated with the confidence level of the initial hyperparameters.

[0047] In this embodiment, when the server determines that the confidence level of the initial hyperparameter is greater than the confidence level threshold, it will further calculate a fusion coefficient based on the confidence level of the initial hyperparameter. The fusion coefficient is positively correlated with the confidence level of the initial hyperparameter, thereby providing an adjustable weight basis for subsequent parameter fusion.

[0048] For example, the output initial temperature coefficient is Confidence level The set confidence threshold ,because Then, the fusion coefficients are constructed based on the confidence level of the initial hyperparameters.

[0049] In practical applications, while the server outputs each initial hyperparameter through the configuration parameter model, it also simultaneously outputs the confidence score corresponding to that initial hyperparameter. This confidence score is generated by the Sigmoid activation function, specifically expressed as follows:

[0050] In the formula, The semantic features obtained by processing the prompt words through a shared coding layer. For the first The confidence level is mapped to the weights for each parameter branch. This represents the Sigmoid function; the confidence score ranges from 0 to 1, with higher values ​​indicating greater reliability of the server's prediction results for the initial hyperparameters.

[0051] Based on this, the server determines the fusion coefficients according to the confidence scores of the initial hyperparameters. Specifically, it is derived from the Sigmoid function through a linear transformation and mapping, and the expression is:

[0052] In the formula, For the Sigmoid function, This is the steepness coefficient. This is the safety threshold.

[0053] Therefore, the fusion coefficient is positively correlated with the confidence level of the initial hyperparameters. When the confidence score increases, the fusion coefficient increases accordingly, and vice versa.

[0054] S3-2, based on the fusion coefficients of the initial hyperparameters, the initial hyperparameters are fused with the corresponding default hyperparameters to obtain the customized parameters corresponding to the initial hyperparameters.

[0055] In this embodiment, the server generates a smoothly transitioning intermediate value as the final customized parameter by combining the initial hyperparameters with the corresponding default hyperparameters in a proportionally weighted manner. This retains the model's dynamic adjustment capability while avoiding the risk of instability caused by predictive mutations.

[0056] In practical applications, the server has already obtained the fusion coefficients of the initial hyperparameters based on the aforementioned steps. Initial hyperparameters And the default hyperparameters corresponding to the initial hyperparameters. The custom parameters corresponding to the initial hyperparameters are calculated using the following expression. :

[0057] In the formula, the fusion coefficient The closer the value is to 1, the closer the customized parameters are to the initial hyperparameters; conversely, the closer they are to the default hyperparameters.

[0058] Furthermore, if the confidence level of the initial hyperparameters is less than or equal to the confidence threshold, step S3 includes: S3-4 If the confidence level of the initial hyperparameter is less than or equal to the confidence threshold, then the default hyperparameter corresponding to the initial hyperparameter will be used as the custom parameter corresponding to the initial hyperparameter.

[0059] In this embodiment, when the server determines that the confidence level of the initial hyperparameter is less than or equal to the confidence threshold, it directly abandons the use of the initial hyperparameter and instead uses a pre-set, long-term verified, stable and reliable default hyperparameter as the final output, thereby ensuring that the target model always runs under safe and controllable parameter constraints.

[0060] For example, if the input is garbled text, the confidence level of the output initial temperature coefficient is: Because it is less than the confidence threshold The server will ignore the predicted values ​​and force the use of the default hyperparameters. .

[0061] In practical applications, the server continuously monitors each initial hyperparameter output by the configuration parameter model and its corresponding confidence score. When the confidence score does not exceed the preset safety boundary, i.e., meets the condition of being less than or equal to the confidence threshold, the server abandons further weighted fusion or correction operations on the initial hyperparameter and no longer executes any calculation process based on the initial hyperparameter. At this time, the server directly assigns the default hyperparameter, which has the same type and function as the initial hyperparameter, as the custom parameter corresponding to the initial hyperparameter. For example, the default hyperparameter for temperature coefficient, the default hyperparameter for frequency penalty, etc.

[0062] Based on the customized hyperparameters obtained from the above embodiments, we will continue to... Figure 1 Step S4 will be explained below: S4, the target model processes the prompt words under the constraints of the customized hyperparameters to obtain the response results of the prompt words.

[0063] In practical applications, after generating the customized hyperparameters, the server injects them into the target model's inference engine in real time via a standard interface. This inference engine specifically includes a sampling decoder, which is responsible for performing probability distribution sampling operations in each round of autoregressive generation, in conjunction with the injected sampling parameters.

[0064] Thus, without modifying the structure and weights of the large language model itself, by simply dynamically adjusting its sampling behavior during the inference phase, the consistency between the response results and the user's intent can be significantly improved, enabling the large language model to stably output high-quality and highly adaptable response content in different business scenarios.

[0065] Research has found that while current servers can obtain user feedback on prompt responses when executing adaptive model configuration parameters, they cannot update the configuration parameter model based on this feedback. This means that the configuration parameter model the server relies on is statically fixed from deployment, and its prediction strategy cannot be adjusted according to user preferences accumulated during actual use. For example, when the user base gradually prefers a more concise code interpretation style, the model still uses the parameter mapping relationship obtained during initial training and cannot autonomously optimize the recommendation logic for temperature or penalty coefficients. Therefore, if... Figure 3 As shown, the adaptive model configuration parameter method provided in this embodiment further includes: S5, obtain feedback information on the user's response to the prompt words.

[0066] S6 updates the configuration parameter model based on feedback information.

[0067] In this embodiment, the server can continuously collect user feedback on the response results of prompt words during operation, and use this feedback information to update the configuration parameter model, so that its prediction strategy can be dynamically optimized as the distribution of real business data changes.

[0068] In practical applications, the server can collect feedback information from users' responses to prompts in real time. This feedback information includes explicit feedback (e.g., likes or dislikes) and implicit feedback (e.g., quantifiable signals such as dwell time, number of retries, and skipping behavior), and model them uniformly as feedback signals. .

[0069] The server further transmits this feedback signal The initial set of hyperparameters currently output by the configuration parameter model These are input into the feedback reward model to construct a loss function aimed at improving user satisfaction. ;Calculate the gradient based on this loss function The low-rank adaptation (LoRA) technique is used to adjust the weights of the configuration parameter model. Perform incremental updates.

[0070] It should also be understood that while configuration parameter models are obtained through supervised learning using positive and negative samples, current training methods for these models rely on manually set fixed hyperparameters or simple rules to generate sample labels. However, they cannot automatically obtain the target model's response under different hyperparameter constraints for each prompt word sample, and thus reverse-engineer the optimal hyperparameter combination. For example, for complex prompt words like "implement quicksort using Python with time complexity analysis," it is difficult for humans to exhaustively enumerate all parameter combinations and evaluate their generation effects, resulting in the model training data lacking positive sample labels for this type of task.

[0071] Therefore, this embodiment obtains the positive and negative samples required for training by distilling the target model. That is, for each prompt word sample, the server can obtain the sample response result of the target model to the prompt word sample under the constraint of the current hyperparameters; generate new hyperparameters based on the sample response result; return to obtaining the sample response result of the target model to the prompt word sample under the constraint of the current hyperparameters based on the new hyperparameters, until the sample response effect to the prompt word sample meets the preset conditions, and then use the corresponding hyperparameters as the positive sample label of the prompt word sample; construct the negative sample label of the prompt word sample based on the positive sample label of the prompt word sample, wherein the negative sample label is a hyperparameter that is different from the positive sample label.

[0072] In this embodiment, the server can perform backdistillation during the offline training phase, enabling the configuration parameter model to not only learn to map prompt words to hyperparameter values, but also to gain a deeper understanding of the differences in the impact of different hyperparameter combinations on the output quality of the target model, thereby truly mastering the inherent laws and trade-offs of parameter configuration.

[0073] In practical applications, the server can call the target model for each prompt word sample and generate a corresponding sample response result constrained by its current hyperparameters. Then, it quantitatively evaluates the sample response result according to a preset output quality scoring strategy, and uses this score as the optimization objective, iteratively iterating within the feasible range of hyperparameters using a binary search algorithm: Each time new hyperparameters are generated, the target model is redriven to generate responses and scores are recalculated until the obtained sample response performance meets preset conditions. For example, the unit test pass rate for code suggestions meets the standard, and the diversity score for creative suggestions exceeds the threshold. At this point, the server will finally converge the obtained hyperparameter combination. This serves as a positive sample label for the prompt word sample.

[0074] Based on this, the server can construct semantically matching but poorly performing negative sample labels from the positive sample labels. Specifically, the server can randomly sample several groups of labels for the same prompt word. Significantly different combinations of hyperparameters form a set of negative samples, which are then mapped to a unified feature space to obtain the corresponding negative sample embedding representation. Simultaneously, positive sample hyperparameters are also mapped to embedded representations. .

[0075] Based on the positive and negative samples obtained through the above implementation, the server optimizes the training of the configuration parameter model using a composite loss function that includes a contrastive learning term, expressed as:

[0076] In the formula, The cross-entropy loss represents the predicted intention classification. The mean square error (MSE) represents the number of predicted hyperparameters. This indicates the loss due to parameter comparison.

[0077] For the contrastive loss, the features of the prompt word samples are represented here as follows: The embedding representation of the positive sample label of the prompt word sample is as follows: The embedding of negative sample labels is represented as Then the expression for calculating the contrastive loss is:

[0078] In the formula, Cosine similarity is used to measure the feature representation of prompt word samples. The directional consistency between the embedding representations of positive and negative sample labels forces the model to narrow down in the latent space. and The distance, push away With each The distance.

[0079] To verify the actual performance of the configuration parameter model obtained from the aforementioned training, after deploying the model, the server conducted a comparative experiment on a mixed test set (10,000 real prompt words) containing ten typical tasks such as code generation, creative writing, and logical reasoning. The model configuration parameter adaptive method (Ours: BPOP Architecture) provided in this embodiment was compared with three representative related technical paths.

[0080] The three representative related technical paths are: Baseline A (Static Config) uses a globally fixed temperature value of 0.7, which represents the general configuration method adopted by most large language model APIs that provide services to the outside world; Baseline B (LLM Self-Reflect) requires the target model to perform an inference round first, that is, guide it to actively analyze the task type and suggest parameters through specific prompt words; Baseline C (BERT Serial) represents a lightweight approach that is more common in engineering practice, that is, first use a small classification model (e.g., BERT) to identify the intent category, and then match the hyperparameters according to the preset rules, which is a typical two-stage serial architecture.

[0081] The experiment statistically analyzed the first-word delay (TTFT, i.e., the time from when the user sends a request to when the first output character is received) and normalized throughput (Throughput, with baseline A's measured QPS on a single NVIDIA A100 GPU as 1.00x). The final experimental results are as follows: Figure 4 As shown in the figure. Therefore, the experimental results indicate that baseline B, due to its reliance on large model self-reflection, has a TTFT as high as 420ms and a throughput of only 0.60x, which cannot meet the requirements of real-time interaction; baseline C, limited by the serial process, has a TTFT of 250ms. In contrast, the TTFT of this solution is only 195ms, an increase of only 8% compared to the static configuration (180ms), and the throughput reaches 0.98x.

[0082] Furthermore, to comprehensively evaluate its overall adaptability across diverse business scenarios, the server was further evaluated from the following perspectives: Code Pass@1 (measuring the correctness of code generation tasks), Creative Diversity (reflecting the richness of textual expression), Safety (the ability to detect and avoid harmful or illegal content), Instruction Following (assessing the accuracy of user instruction execution), and Latency Efficiency (characterizing the balance between response speed and computing resource consumption). All metrics were normalized to a score range of 0–100 for easy comparison across different scenarios.

[0083] The final experimental results are as follows Figure 5As shown, the experimental results indicate that Baseline A (Static Config) is severely unbalanced in coding tasks (60 points) and creative tasks (50 points) due to its fixed hyperparameters; Baseline B (LLM Self-Reflect) is relatively outstanding in the quality dimension, but its latency efficiency reaches 40 points, which means that it has the defect of trading computing power for quality; while the model configuration parameter adaptive method (Ours: BPOP Architecture) provided in this embodiment maintains high scores and relatively balanced performance in all five aspects, with a code pass rate of 90.0, creative diversity of 92.0, security of 95.0, instruction compliance of 91.0, and latency efficiency of 90.0, and a comprehensive weighted score of 92.3, which is significantly better than Baseline A (68.5) and Baseline B (81.5).

[0084] Furthermore, to test long-term adaptability, the server was run online for 30 days, collecting explicit user feedback on the generated results in real time (e.g., likes / dislikes), and using low-rank adaptation (LoRA) technology to perform lightweight, asynchronous weight updates on the configuration parameter model.

[0085] The final test results are as follows Figure 6 As shown, the test results indicate that the satisfaction score of the static configuration scheme gradually decreased from 3.80 on day 1 to 3.75 on day 30; while the model configuration parameter adaptive method (BPOP+Online Feedback Loop) provided in this embodiment steadily increased the satisfaction score from 3.90 to 4.70, an improvement of 25.3% within 30 days. Therefore, the model configuration parameter adaptive method provided by this instance can autonomously learn the user's real preferences (e.g., a preference for concise code explanations), achieving the effect of getting better with use.

[0086] Based on the same inventive concept as the model configuration parameter adaptive method provided in this embodiment, this embodiment also provides a model configuration parameter adaptive device. This device includes at least one software functional module that can be stored in a memory or embedded in an electronic device. The processor in the electronic device executes the executable module stored in the memory. For example, the software functional module and computer program included in this device. Please refer to... Figure 7 Functionally, the device may include: Human-computer interaction module 11 is used to obtain prompt words to be processed by the target model; The parameter recommendation module 12 is used to process the prompt words through the configuration parameter model to obtain the initial hyperparameters recommended by the configuration parameter model for the target model; The parameter correction module 13 is used to obtain customized hyperparameters that facilitate the target model's processing of prompt words based on the initial hyperparameters; The interactive response module 14 is used to process the prompt words through the target model under the constraints of the customized hyperparameters to obtain the response results of the prompt words.

[0087] In this embodiment, the human-computer interaction module 11 is used to implement Figure 1 In step S1, the parameter recommendation module 12 is used to implement... Figure 1 In step S2, the parameter correction module 13 is used to implement... Figure 1 In step S3, the interactive response module 14 is used to implement Figure 1 The CCP's step S4, therefore, for a detailed description of each of the above modules, please refer to the specific implementation method of the corresponding step.

[0088] Optionally, the configuration parameter model also outputs the confidence level of the initial hyperparameters; The parameter correction module 13 is used to obtain customized hyperparameters that facilitate the target model's processing of prompt words based on the initial hyperparameters, including: The initial hyperparameters are modified based on their confidence level to obtain customized hyperparameters that facilitate the target model's processing of prompt words.

[0089] Optionally, the parameter correction module 13 is used to correct the initial hyperparameters based on the confidence level of the initial hyperparameters, to obtain customized hyperparameters that facilitate the target model's processing of prompt words, including: If the confidence level of the initial hyperparameters is greater than the confidence level threshold, then the fusion coefficient of the initial hyperparameters is obtained based on the confidence level of the initial hyperparameters. The fusion coefficient of the initial hyperparameters is positively correlated with the confidence level of the initial hyperparameters. Based on the fusion coefficients of the initial hyperparameters, the initial hyperparameters are fused with the corresponding default hyperparameters to obtain the custom parameters corresponding to the initial hyperparameters.

[0090] Optionally, the parameter correction module 13 is used to correct the initial hyperparameters based on the confidence level of the initial hyperparameters, to obtain customized hyperparameters that facilitate the target model's processing of prompt words, including: If the confidence level of the initial hyperparameter is less than or equal to the confidence threshold, then the default hyperparameter corresponding to the initial hyperparameter will be used as the custom parameter corresponding to the initial hyperparameter.

[0091] Optionally, the configuration parameter model includes a shared encoding layer, a gating layer, and multiple parameter branches. The parameter recommendation module 12 is used to process the prompt words through the configuration parameter model to obtain the initial hyperparameters recommended by the configuration parameter model for the target model, including: The semantic features of the prompt words are obtained by processing them through a shared coding layer; The semantic features are processed by a gating layer to obtain activation information for multiple parameter branches; Based on the activation information, the active branch is determined from multiple parameter branches; The semantic features are processed using activation branches to obtain the initial hyperparameters recommended by the target model.

[0092] Optionally, the configuration parameter model is obtained through supervised learning with positive and negative samples. The device also includes a model training module for obtaining the sample response results of the target model to the prompt word sample under the constraints of the current hyperparameters for each prompt word sample. Based on the sample response results, new hyperparameters are generated; Based on the new hyperparameters, return to obtaining the sample response results of the target model to the prompt word samples under the constraints of the current hyperparameters, until the sample response effect to the prompt word samples meets the preset conditions, and then use the corresponding hyperparameters as the positive sample labels of the prompt word samples. Based on the positive sample labels of the prompt word samples, construct the negative sample labels of the prompt word samples, where the negative sample labels are hyperparameters that are different from the positive sample labels.

[0093] Optionally, the device also includes an online update module for obtaining feedback information on the user's response to the prompt words; Update the configuration parameter model based on the feedback information.

[0094] In addition, the functional modules in the various embodiments of this application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.

[0095] It should also be understood that if the above embodiments are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the related technology, or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application.

[0096] Therefore, this embodiment also provides a storage medium, which is a computer-readable storage medium. This storage medium stores a computer program, which, when executed by a processor, implements the model configuration parameter adaptive method provided in this embodiment. The storage medium can be any medium capable of storing program code, such as a USB flash drive, external hard drive, read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.

[0097] like Figure 8 As shown, this embodiment provides an electronic device that may include a processor 22 and a memory 21. The memory 21 stores a computer program, and the processor reads and executes the computer program in the memory 21 corresponding to the above-described embodiments to implement the model configuration parameter adaptive method provided in this embodiment.

[0098] See also Figure 8 The electronic device also includes a communication unit 23. The memory 21, processor 22 and communication unit 23 are electrically connected to each other directly or indirectly through system bus 24 to realize data transmission or interaction.

[0099] The memory 21 can be an information recording device based on any electronic, magnetic, optical, or other physical principles, used to record execution instructions, data, etc. In some embodiments, the memory 21 can be, but is not limited to, volatile memory, non-volatile memory, memory drive, etc.

[0100] In some embodiments, the volatile memory may be random access memory (RAM); in some embodiments, the non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), flash memory, etc.; in some embodiments, the storage drive may be a disk drive, solid-state drive, any type of storage disk (such as optical disc, DVD, etc.), or similar storage media, or a combination thereof.

[0101] The communication unit 23 is used to send and receive data over a network. In some embodiments, the network may include a wired network, a wireless network, a fiber optic network, a telecommunications network, an intranet, the Internet, a local area network (LAN), a wide area network (WAN), a wireless local area network (WLAN), a metropolitan area network (MAN), a public switched telephone network (PSTN), a Bluetooth network, a ZigBee network, or a near field communication (NFC) network, or any combination thereof. In some embodiments, the network may include one or more network access points. For example, the network may include wired or wireless network access points, such as base stations and / or network switching nodes, through which one or more components of the service request processing system can connect to the network to exchange data and / or information.

[0102] The processor 22 may be an integrated circuit chip with signal processing capabilities, and may include one or more processing cores (e.g., a single-core processor or a multi-core processor). By way of example only, the processor described above may include a Central Processing Unit (CPU), an Application Specific Integrated Circuit (ASIC), an Application Specific Instruction-set Processor (ASIP), a Graphics Processing Unit (GPU), a Physics Processing Unit (PPU), a Digital Signal Processor (DSP), a Field Programmable Gate Array (FPGA), a Programmable Logic Device (PLD), a controller, a microcontroller unit, a Reduced Instruction Set Computing (RISC) computer, or a microprocessor, or any combination thereof.

[0103] Understandable. Figure 8The structure shown is for illustrative purposes only. Electronic devices may also have more advanced features. Figure 8 Showing more or fewer components, or having with Figure 8 The different configurations shown. Figure 8 The components shown can be implemented using hardware, software, or a combination thereof.

[0104] It should be understood that the apparatus and methods disclosed in the above embodiments can also be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings show the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.

[0105] The above descriptions are merely various embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A method for adaptive model configuration parameters, characterized in that, The method includes: Obtain the prompt words to be processed by the target model; The prompt words are processed by a configuration parameter model to obtain the initial hyperparameters recommended by the configuration parameter model for the target model; Based on the initial hyperparameters, customized hyperparameters are obtained to facilitate the target model's processing of the prompt words; The target model processes the prompt words under the constraints of customized hyperparameters to obtain the response results of the prompt words.

2. The model configuration parameter adaptive method according to claim 1, characterized in that, The configuration parameter model also outputs the confidence level of the initial hyperparameters; Based on the initial hyperparameters, customized hyperparameters are obtained to facilitate the target model's processing of the prompt words, including: The initial hyperparameters are modified based on their confidence level to obtain customized hyperparameters that facilitate the target model's processing of the prompt words.

3. The model configuration parameter adaptive method according to claim 2, characterized in that, The initial hyperparameters are modified based on their confidence level to obtain customized hyperparameters that facilitate the target model's processing of the prompt words, including: If the confidence level of the initial hyperparameter is greater than the confidence level threshold, then the fusion coefficient of the initial hyperparameter is obtained based on the confidence level of the initial hyperparameter, wherein the fusion coefficient of the initial hyperparameter is positively correlated with the confidence level of the initial hyperparameter. Based on the fusion coefficient of the initial hyperparameters, the initial hyperparameters are fused with the corresponding default hyperparameters to obtain customized parameters corresponding to the initial hyperparameters.

4. The model configuration parameter adaptive method according to claim 2, characterized in that, The initial hyperparameters are modified based on their confidence level to obtain customized hyperparameters that facilitate the target model's processing of the prompt words, including: If the confidence level of the initial hyperparameter is less than or equal to the confidence threshold, then the default hyperparameter corresponding to the initial hyperparameter will be used as the custom parameter corresponding to the initial hyperparameter.

5. The model configuration parameter adaptive method according to claim 1, characterized in that, The configuration parameter model includes a shared encoding layer, a gating layer, and multiple parameter branches. The prompt words are processed through the configuration parameter model to obtain initial hyperparameters recommended by the configuration parameter model for the target model, including: The prompt words are processed through the shared coding layer to obtain their semantic features; The semantic features are processed by the gating layer to obtain the activation information of the multiple parameter branches; Based on the activation information, the active branch is determined from the plurality of parameter branches; The semantic features are processed using the activation branch to obtain the initial hyperparameters recommended by the target model.

6. The model configuration parameter adaptive method according to claim 1, characterized in that, The configuration parameter model is obtained through supervised learning using positive and negative samples, and the method further includes: For each prompt word sample, obtain the sample response result of the target model to the prompt word sample under the constraints of the current hyperparameters; Based on the sample response results, new hyperparameters are generated; Based on the new hyperparameters, return to obtaining the sample response results of the target model to the prompt word sample under the constraints of the current hyperparameters, until the sample response effect to the prompt word sample meets the preset conditions, and then use the corresponding hyperparameters as the positive sample label of the prompt word sample. Based on the positive sample labels of the prompt word samples, negative sample labels are constructed for the prompt word samples, wherein the negative sample labels are hyperparameters that are different from the positive sample labels.

7. The adaptive model configuration parameter method according to claim 1, characterized in that, The method further includes: Obtain feedback information on the user's response to the prompt words; The configuration parameter model is updated based on the feedback information.

8. A model configuration parameter adaptive device, characterized in that, The device includes: The human-computer interaction module is used to obtain prompt words to be processed by the target model; The parameter recommendation module is used to process the prompt words through a configuration parameter model to obtain the initial hyperparameters recommended by the configuration parameter model for the target model; The parameter correction module is used to obtain customized hyperparameters that facilitate the target model in processing the prompt words based on the initial hyperparameters; The interactive response module is used to process the prompt words through the target model under the constraints of customized hyperparameters to obtain the response results of the prompt words.

9. A storage medium, characterized in that, The storage medium stores a computer program that, when executed by a processor, implements the adaptive model configuration parameter method according to any one of claims 1-7.

10. An electronic device, characterized in that, The electronic device includes a processor and a memory, the memory storing a computer program that, when executed by the processor, implements the model configuration parameter adaptive method according to any one of claims 1-7.