Fine-adjustment-free large model industry adaptation method and system based on feedback driving sample library

By using a feedback-driven example library approach, the final prompts are generated and dynamic templates are optimized using an industry example library. This solves the adaptation problem of large pre-trained language models in professional industries, achieving fast and low-cost industry adaptation and maintenance of general capabilities.

CN121743371APending Publication Date: 2026-03-27CHINA NAT ENVIRONMENTAL MONITORING CENT
View PDF 4 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-16
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

Existing large-scale pre-trained language models suffer from problems such as misunderstanding of industry terminology, confusion of professional logic, and irregular output format when applied to highly specialized industries. Furthermore, full parameter fine-tuning requires high computing power, has high data acquisition and cleaning costs, and may cause the model to lose its general capabilities.

Method used

We employ a feedback-driven, sample library-based, fine-tuning-free approach. We generate final prompts using an industry sample library and optimize the sample library and dynamic prompt templates with multi-dimensional feedback scoring. This maintains the general applicability of the large model and enables the rapid and low-cost integration of industry expertise.

Benefits of technology

It enables rapid and low-cost adaptation of large models to professional industries, avoiding storage and management burdens while maintaining the model's versatility.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121743371A_ABST
    Figure CN121743371A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of artificial intelligence large models, in particular to a fine-tuning-free large model industry adaptation method and system based on a feedback-driven sample library, and the method comprises the steps: generating a final prompt for inputting a fixed parameter large model through an industry sample library for user query; inputting the final prompt into the fixed parameter large model, outputting a corresponding answer, and obtaining a multi-dimensional feedback score according to the output answer; and optimizing the industry sample library according to the multi-dimensional feedback score and iterating a dynamic prompt template used for generating a final prompt. According to the method, the universal capability of the large model can be kept, industry professional knowledge can be quickly and flexibly integrated at low cost, and the storage and management burden of the large model is prevented from being aggravated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence large model technology, and in particular to an industry adaptation method and system for large models without fine-tuning based on a feedback-driven example library. Background Technology

[0002] Currently, large pre-trained language models, such as GPT (Generative Pre-trained Transformer) and LLaMA (Large Language Model), have demonstrated powerful capabilities in general tasks. However, when applied to highly specialized industries such as medicine, law, and finance, directly calling these models often leads to problems such as misunderstandings of industry terminology, confusion in professional logic, and irregular output formats.

[0003] Traditional solutions mainly rely on full parameter fine-tuning or efficient parameter fine-tuning of these models. However, this requires updating hundreds of billions or even trillions of parameters, which places extremely high demands on computing resources. It also requires a large amount of high-quality, strictly labeled industry data, resulting in high costs for data acquisition and cleaning. Furthermore, parameter fine-tuning may cause the model to lose its original general knowledge and capabilities. In addition, an independent copy of the model needs to be saved for each industry or task, which places a heavy burden on storage and management.

[0004] Therefore, how to maintain the versatility of large models, integrate industry expertise quickly, cost-effectively, and flexibly, and avoid increasing the storage and management burden of large models, is a technical problem that urgently needs to be solved by those skilled in the art. Summary of the Invention

[0005] This application provides a method and system for industry adaptation of large models without fine-tuning based on a feedback-driven sample library. This method can maintain the generality of large models, quickly, cost-effectively, and flexibly integrate industry expertise, and avoid increasing the storage and management burden on large models.

[0006] To solve the above-mentioned technical problems, this application provides the following technical solution: A method for adapting a large model to an industry without fine-tuning based on a feedback-driven sample library includes the following steps: Step S110: Generate a final prompt for a large model with fixed parameters based on an industry sample library for user queries; Step S120: Input the final prompt into the large model with fixed parameters, output the corresponding answer, and obtain a multi-dimensional feedback score based on the output answer; Step S130: Optimize the industry sample library and iterate the dynamic prompt template used to generate the final prompt based on the multi-dimensional feedback score.

[0007] The industry-specific adaptation method for large models without fine-tuning based on a feedback-driven example library, as described above, preferably includes the following sub-steps for generating the final prompt: using user queries... Retrieve results from the corresponding industry sample library that match the user's query. The closest correlation Each context fragment and its corresponding A sample, and through the retrieved... Context fragments form a context; in the retrieved Context fragments and Each sample is inserted into the corresponding slot in the dynamic tooltip template to assemble the final tooltip.

[0008] The industry adaptation method for large models without fine-tuning based on a feedback-driven example library, as described above, preferably includes the following sub-steps for retrieving context fragments and examples, and forming the context: Step S210, taking the user query... Encoded as query vector Step S220: In the vector database A, perform an approximate nearest neighbor search to find the vector that matches the query vector. The highest cosine similarity A context fragment; Step S230, for the found Each context fragment is filtered and rearranged to make... Each context segment forms a context; step S240: in the vector database B, retrieve the context related to the user query. Most similar A sample, and from Select from the samples Example.

[0009] The above-described industry-specific adaptation method for large models without fine-tuning based on a feedback-driven example library preferably involves... Select from the samples One example includes the following sub-steps: Calculate user queries Similarity between the question and each retrieved sample If the highest similarity Exceeding the top threshold Then only the highest similarity score will be selected. Corresponding examples; if the highest similarity Below the bottom threshold If the highest similarity is not selected, then no sample will be chosen; if the highest similarity is not selected, then no sample will be chosen. exist Within the range, select One example, Not greater than Any positive integer.

[0010] The industry adaptation method for large models without fine-tuning based on feedback-driven sample libraries, as described above, preferably includes the following sub-steps for creating dynamic prompt templates: Step S310, defining the static text and dynamic slots of the dynamic prompt template; Step S320, designing the generation strategy for dynamic slot content; Step S330, establishing a version management and feedback iteration mechanism for the dynamic prompt template.

[0011] A feedback-driven example library-based industry-adaptive system for large, non-fine-tuning models includes: a prompt generation unit, a calculation and scoring unit, and an optimization and iteration unit. The prompt generation unit generates final prompts for user queries using an industry example library, which are then input into a large model with fixed parameters. The calculation and scoring unit inputs the final prompts into the large model with fixed parameters, outputs the corresponding answers, and obtains multi-dimensional feedback scores based on the output answers. The optimization and iteration unit optimizes the industry example library and iterates on the dynamic prompt template used to generate the final prompts based on the multi-dimensional feedback scores.

[0012] In the industry-adaptive system for large, non-fine-tuning models based on a feedback-driven example library as described above, preferably, the prompt generation unit includes: a retrieval subunit and an insertion subunit; the retrieval subunit uses user queries. Retrieve results from the corresponding industry sample library that match the user's query. The closest correlation Each context fragment and its corresponding A sample, and through the retrieved... Context fragments form a context; insert sub-units when retrieved Context fragments and Each sample is inserted into the corresponding slot in the dynamic tooltip template to assemble the final tooltip.

[0013] As described above, in the industry-adaptive system for large, non-fine-tuning models based on a feedback-driven example library, preferably, the retrieval subunit will retrieve user queries. Encoded as query vector In vector database A, perform an approximate nearest neighbor search to find the vector that matches the query vector. The highest cosine similarity A context fragment, for the found Each context fragment is filtered and rearranged to make... Each context segment forms a context; the retrieval sub-unit retrieves data from the vector database B that matches the user's query. Most similar A sample, and from Select from the samples Example.

[0014] As described above, in the industry-adaptive system for large, non-fine-tuning models based on a feedback-driven example library, preferably, the retrieval subunit calculates user queries. Similarity between the question and each retrieved sample If the highest similarity Exceeding the top threshold Then only the highest similarity score will be selected. Corresponding examples; if the highest similarity Below the bottom threshold If the highest similarity is not selected, then no sample will be chosen; if the highest similarity is not selected, then no sample will be chosen. exist Within the range, select One example, Not greater than Any positive integer.

[0015] The industry adaptation system for large, non-fine-tuning models based on a feedback-driven sample library, as described above, preferably further includes: a template creation unit; the template creation unit defines the static text and dynamic slots of the dynamic prompt template; the template creation unit designs the generation strategy for the dynamic slot content; and the template creation unit establishes a version management and feedback iteration mechanism for the dynamic prompt template.

[0016] Beneficial effects: This application enables industry sample libraries and dynamic prompt templates to continuously absorb feedback and improve themselves during application. By integrating high-quality industry sample libraries and dynamic prompt templates into the large model, the parameters of the large model can be modified without changing them. This allows the fixed-parameter large model to be adapted to vertical industries quickly, cost-effectively, and flexibly, while maintaining its general capabilities and avoiding increasing the storage and management burden on the large model. Attached Figure Description

[0017] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For those skilled in the art, other drawings can be obtained based on these drawings.

[0018] Figure 1 This is a flowchart of an industry-specific method for large models that do not require fine-tuning, based on a feedback-driven example library. Figure 2 It is a flowchart of the retrieval of context fragments and examples, as well as the formation of context; Figure 3 This is a flowchart of the creation process for a dynamic prompt template; Figure 4 This is a schematic diagram of an industry-adaptive system for large models that requires no fine-tuning, based on a feedback-driven sample library. Detailed Implementation

[0019] Embodiments of the present invention are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.

[0020] Example 1 like Figure 1 As shown, this application provides a method for industry adaptation of large models without fine-tuning based on a feedback-driven example library, including the following steps: Step S110: Generate the final prompt for the large model with fixed parameters by using the industry sample library to respond to user queries; Received user query (i.e., user question) After that, use user query. Search within its corresponding industry sample database to retrieve results matching the user's query. The closest correlation Each context fragment and its corresponding A sample (question-answer pair), and retrieved... Context fragments form a context. Here, "most relevant" refers to... / "One" refers to selecting the most relevant individuals in descending order of relevance. / When performing a search, if the industry sample library has not been optimized, the initial industry sample library will be used for the search; if the industry sample library has been optimized, the optimized industry sample library will be used for the search.

[0021] Prior to this, it is necessary to collect publicly available documents, business manuals, historical interaction data, and other materials for the target industry (e.g., finance, healthcare, law, etc.). Industry experts will then screen and construct an initial industry sample library to ensure its professionalism and accuracy. The industry sample library includes two vector databases: Vector Database A and Vector Database B. Vector Database A stores context fragments, which are smaller, semantically complete pieces (e.g., a definition, a rule, a set of data) extracted from the context of the sample. Vector Database B stores samples with a "question-context-answer" structure.

[0022] Furthermore, each example also has multiple tags, including industry scenario tags, feedback rating tags, confidence level tags, retrieval frequency tags, quality weight tags, and entry time tags, for precise sample filtering and retrieval. Each industry scenario tag contains multiple scenarios, and all scenarios within each tag are progressively refined from broad to narrow (e.g., finance-credit, healthcare-chronic disease treatment) to facilitate hierarchical filtering during subsequent retrieval. Feedback rating tags reflect the example's evaluation metrics; confidence level tags measure the example's reliability; retrieval frequency tags indicate the number of times the example was retrieved; quality weight tags (e.g., 0-10 points) indicate the example's quality level, with initial values ​​assigned by experts and updated based on feedback; and entry time tags indicate the time the example was collected into the industry example database.

[0023] Among them, such as Figure 2 As shown, the retrieval of context fragments and examples, as well as the formation of context, include the following sub-steps: Step S210: Query the user query Encoded as query vector ; User queries Encoded as query vector It maps unstructured text queries to a low- or high-dimensional vector space so that they can be matched with candidate documents / sample vectors using vector similarity (e.g., cosine similarity).

[0024] Step S220: In the vector database A, perform an approximate nearest neighbor search to find the vector that matches the query vector. The highest cosine similarity A context fragment; Approximate Nearest Neighbor (ANN) algorithms, in high-dimensional vector spaces, significantly improve the efficiency of finding the most similar vector to a target vector at the cost of a small amount of precision. They find the most similar vector to the query vector through nearest neighbor search. The highest cosine similarity Context fragments ,in This is the first context fragment. This is the second context fragment. For the first A context fragment, The term "highest cosine similarity" here refers to... "One" refers to selecting the items with the highest cosine similarity in descending order. indivual.

[0025] Step S230: For the found Each context fragment is filtered and rearranged to make... Each contextual segment forms a context; In found After a context fragment, from Filter out context fragments that do not meet the criteria from the first set of context fragments, and then gradually select those that match the user's query from the remaining context fragments. Highly relevant and low similarity to the selected context fragment. A context fragment, The context fragments are reordered in logical order to form a context, thereby ensuring that the context is consistent with the user query. Under the premise of relevance, reduce the concentrated occurrence of similar context fragments in the context.

[0026] Step S240: In vector database B, retrieve the results that match the user's query. Most similar A sample, and from Select from the samples One example; In vector database B, retrieve the results that match the user's query. Most similar Sample Questions (Correct Answer) ,in, For the first example problem, This is the answer for the first sample. For the second example problem, This is the answer for the second sample. For the first A sample problem For the first The answer to the sample. Here, "most similar" "One" refers to selecting the items with the highest similarity scores in descending order. indivual.

[0027] Furthermore, user queries Compared with the examples in vector database B Similarity score The calculation formula is as follows: ; in, For user queries Compared with the example Sparse retrieval score, measuring user query Compared with the example Keyword matching degree; For user queries Compared with the example Dense search score; To integrate the weight parameters, they can be optimized using feedback data.

[0028] Furthermore, user queries Compared with the example The formula for calculating the dense retrieval score is as follows: ; in, This refers to an encoder function that maps text to vectors, and an encoder function used for dense retrieval to improve the accuracy of sample retrieval. Lightweight fine-tuning can be performed using the feedback scores of the samples by minimizing the loss function. This can enable encoder functions By bringing queries closer to high-quality samples in the vector space and pushing them further away from low-quality samples, the search quality can be self-evolved.

[0029] Furthermore, the loss function for: ; in, For user queries Positive examples that generate high feedback scores; For user queries Negative examples retrieved but not adopted or that generated low feedback scores; The set of negative examples; This is the loss coefficient; It is a natural exponential function.

[0030] Then, calculate the user query. Similarity between the question and each retrieved sample ,in, For the first A sample problem This is a similarity calculation function; if the highest similarity... Exceeding the top threshold Then only the highest similarity score will be selected. Corresponding examples are used to avoid redundancy; if the highest similarity Below the bottom threshold If the highest similarity is not selected, then no sample will be chosen; if the highest similarity is not selected, then no sample will be chosen. exist Within the range, select One example, Not greater than Any positive integer.

[0031] After searching Context fragments and After a sample (question-answer correct), it will be... The context formed by the context fragments and Each sample (question-answer pair) is inserted into the corresponding slot in the dynamic hint template to assemble the final hint, which is then provided to the large model with fixed parameters. The dynamic hint template is pre-designed and continuously updated during use, resulting in different versions. The context and sample insertions use the latest version of the dynamic hint template.

[0032] Among them, such as Figure 3 As shown, creating a dynamic suggestion template includes the following sub-steps: Step S310: Define the static text and dynamic slots of the dynamic prompt template; Dynamic prompt template It can be formalized as a static text and dynamic slots Composed of sequences ;in, This is the first static text. For the first dynamic slot, This is the second static text. For the second dynamic slot, For the first A static text, For the first One dynamic slot.

[0033] Among them, static text The corresponding dynamic slots were identified. Rules (e.g., use cases), dynamic slots The input must follow the corresponding static text. Clear rules, and dynamic slots The corresponding static text needs to be embedded. The preset position is used to avoid problems such as formatting errors and logical inconsistencies, and dynamic slots are used to achieve this. It can achieve flexible adaptation.

[0034] Step S320: Design a strategy for generating dynamic slot content; Dynamic slots It includes: retrieval slots, instruction slots, and sample slots; the generation strategy for dynamic slot content is as follows: retrieval slots are used to insert context consisting of context fragments retrieved from vector database A, instruction slots are used to insert industry-specific task requirements, and sample slots are used to insert one or more samples (question-answer pairs) retrieved from vector database B.

[0035] Step S330: Establish a version management and feedback iteration mechanism for dynamic prompt templates; Dynamic prompt template Version management is as follows: Each time the dynamic prompt template is updated... Modifications to the generation strategy for static text and / or dynamic slots will save a new version of the dynamic tooltip template. .

[0036] Dynamic prompt template The feedback and iteration mechanism is as follows: record the use of the new version of the dynamic prompt template. Feedback ratings for sample examples, and based on the use of the new version of the dynamic prompt template. The feedback score of the sample is calculated using the new version of the dynamic prompt template. The average feedback score of the sample when using the new version of the dynamic prompt template. Average feedback score of the samples It is statistically significantly superior to using the old version of the dynamic prompt template. Average feedback score of the samples At that time, the old version of the dynamic prompt template will be used. Upgrade to the new version of the dynamic prompt template The new version of the dynamic prompt template will be used subsequently. Otherwise, the old version of the dynamic prompt template will be used subsequently. .

[0037] Among them, dynamic prompt templates are used. Average feedback score of the samples The calculation formula is as follows: ; in, In dynamic prompt template The following is a collection of examples that are frequently used or make a major contribution to the scoring; In dynamic prompt template Under the dynamic slot content generation strategy, the example The degree to which it is selected and utilized; For example Expected dynamic score; Dynamic prompt template The strategy efficiency factor.

[0038] ; in, It is a dynamic prompt template Number of times it was used To use dynamic tooltip templates Example Feedback score; when At that time, it was believed Significantly superior in a statistical sense , This is the difference threshold.

[0039] Step S120: Input the final prompt into the fixed-parameter large model, output the corresponding answer, and obtain multi-dimensional feedback scores based on the output answer; The generated final prompts are input into large-scale models such as GPT and LLaMA. These large-scale models have fixed, unadjusted parameters. After processing by the fixed-parameter large-scale models, the corresponding answers are output, thus fulfilling the user's query. and getting the answer As a new example, the output answers will be evaluated using a combination of automated and manual methods, and multi-dimensional feedback scores will be collected from the evaluation.

[0040] The multi-dimensional feedback scoring comes from rule-based feedback and human feedback. Rule-based feedback uses a calibrated lightweight evaluation model or a large model to self-evaluate and score the professionalism, accuracy, and safety of the output answers. Human feedback is scored by domain experts on answers that are critical or high-risk.

[0041] Step S130: Optimize the industry sample library based on multi-dimensional feedback scores and iterate on the dynamic prompt template used to generate the final prompt; User queries and the output answer The sample is stored as a new instance, along with its corresponding multi-dimensional feedback score. The retrieval frequency and entry time of this instance are also recorded. Then, the sample's feedback score is calculated based on the associated stored instance, multi-dimensional feedback score, retrieval frequency, and entry time. If the sample's feedback score is not lower than the optimization threshold, it is added to the industry sample library as a positive example to optimize the library. If the sample's feedback score is lower than the optimization threshold, and the problem is widespread, the sample is corrected, and the corrected sample is added to the industry sample library as a new positive example to optimize the library. Furthermore, the dynamic suggestion template is iterated based on the sample's feedback score, according to the dynamic suggestion template's feedback iteration mechanism.

[0042] Furthermore, use dynamic prompt templates. Example Feedback rating The calculation formula is as follows: ; in, To use dynamic tooltip templates Example Feedback rating; Is it using dynamic tooltip templates? Example confidence level The weight value for the confidence level; Is it using dynamic tooltip templates? Example retrieval frequency It is a weight value for retrieval frequency; Is it using dynamic tooltip templates? Example quality weight, It is the weight value of the quality weight; Is it using dynamic tooltip templates? Example The time of entry into the warehouse It is the weight value of the time of entry into the warehouse; and .

[0043] In the above formula, the example Feedback rating The calculation uses the new retrieval frequency. New confidence level New quality weights and new warehousing time As shown below: ; ; ; in, Is it using dynamic tooltip templates? Example The new retrieval frequency; Is it using dynamic tooltip templates? Example The old retrieval frequency; Is it using dynamic tooltip templates? Example The new confidence level; Is it using dynamic tooltip templates? Example The old confidence level; It is a forgetting factor that controls the rate at which historical confidence decays; This is an example. Multidimensional feedback scores received after being retrieved and used to generate answers (normalized to [0,1]); Is it using dynamic tooltip templates? Example New quality weights; Is it using dynamic tooltip templates? Example The new inbound time; It is the time-related decay coefficient.

[0044] In addition, the feedback score label, confidence label, retrieval frequency label, quality weight label, and entry time label of the sample are updated based on the feedback score, confidence score, retrieval frequency, quality weight, and entry time of the sample obtained above.

[0045] Example 2 like Figure 4 As shown, this application provides a large model industry adaptation system 400 based on a feedback-driven sample library without fine-tuning, including: a prompt generation unit 410, a calculation and scoring unit 420, and an optimization and iteration unit 430.

[0046] The prompt generation unit 410 generates a final prompt for a large model with fixed input parameters based on the industry sample library for user queries.

[0047] The prompt generation unit 410 includes a retrieval subunit 411 and an insertion subunit 412; the retrieval subunit 411 receives the user query. (i.e., user question) After that, use user query. Search within its corresponding industry sample database to retrieve results matching the user's query. The closest correlation Each context fragment and its corresponding A sample (question-answer pair), and retrieved... Context fragments form a context. Here, "most relevant" refers to... / "One" refers to selecting the most relevant individuals in descending order of relevance. / When performing a search, if the industry sample library has not been optimized, the initial industry sample library will be used for the search; if the industry sample library has been optimized, the optimized industry sample library will be used for the search.

[0048] Prior to this, it is necessary to collect publicly available documents, business manuals, historical interaction data, and other materials for the target industry (e.g., finance, healthcare, law, etc.). Industry experts will then screen and construct an initial industry sample library to ensure its professionalism and accuracy. The industry sample library includes two vector databases: Vector Database A and Vector Database B. Vector Database A stores context fragments, which are smaller, semantically complete pieces (e.g., a definition, a rule, a set of data) extracted from the context of the sample. Vector Database B stores samples with a "question-context-answer" structure.

[0049] Furthermore, each example also has multiple tags, including industry scenario tags, feedback rating tags, confidence level tags, retrieval frequency tags, quality weight tags, and entry time tags, for precise sample filtering and retrieval. Each industry scenario tag contains multiple scenarios, and all scenarios within each tag are progressively refined from broad to narrow (e.g., finance-credit, healthcare-chronic disease treatment) to facilitate hierarchical filtering during subsequent retrieval. Feedback rating tags reflect the example's evaluation metrics; confidence level tags measure the example's reliability; retrieval frequency tags indicate the number of times the example was retrieved; quality weight tags (e.g., 0-10 points) indicate the example's quality level, with initial values ​​assigned by experts and updated based on feedback; and entry time tags indicate the time the example was collected into the industry example database.

[0050] The retrieval subunit 411 performs the retrieval of context fragments and examples, as well as the formation of the context, as detailed below: Retrieval subunit 411 will retrieve user queries Encoded as query vector .

[0051] User queries Encoded as query vector It maps unstructured text queries to a low- or high-dimensional vector space so that they can be matched with candidate documents / sample vectors using vector similarity (e.g., cosine similarity).

[0052] Retrieval subunit 411 performs an approximate nearest neighbor search in vector database A to find a match between the query vector and the nearest neighbor. The highest cosine similarity A context fragment.

[0053] Approximate Nearest Neighbor (ANN) algorithms, in high-dimensional vector spaces, significantly improve the efficiency of finding the most similar vector to a target vector at the cost of a small amount of precision. They find the most similar vector to the query vector through nearest neighbor search. The highest cosine similarity Context fragments ,in This is the first context fragment. This is the second context fragment. For the first A context fragment, The term "highest cosine similarity" here refers to... "One" refers to selecting the items with the highest cosine similarity in descending order. indivual.

[0054] Retrieval subunit 411 for the found Each context fragment is filtered and rearranged to make... Each contextual segment forms a context.

[0055] In found After a context fragment, from Filter out context fragments that do not meet the criteria from the first set of context fragments, and then gradually select those that match the user's query from the remaining context fragments. Highly relevant and low similarity to the selected context fragment. A context fragment, The context fragments are reordered in logical order to form a context, thereby ensuring that the context is consistent with the user query. Under the premise of relevance, reduce the concentrated occurrence of similar context fragments in the context.

[0056] Retrieval subunit 411 retrieves data from vector database B that matches the user's query. Most similar A sample, and from Select from the samples Example.

[0057] In vector database B, retrieve the results that match the user's query. Most similar Sample Questions (Correct Answer) ,in, For the first example problem, This is the answer for the first sample. For the second example problem, This is the answer for the second sample. For the first A sample problem For the first The answer to the sample. Here, "most similar" "One" refers to selecting the items with the highest similarity scores in descending order. indivual.

[0058] Furthermore, user queries Compared with the examples in vector database B Similarity score The calculation formula is as follows: ; in, For user queries Compared with the example Sparse retrieval score, measuring user query Compared with the example Keyword matching degree; For user queries Compared with the example Dense search score; To integrate the weight parameters, they can be optimized using feedback data.

[0059] Furthermore, user queries Compared with the example The formula for calculating the dense retrieval score is as follows: ; in, This refers to an encoder function that maps text to vectors, and an encoder function used for dense retrieval to improve the accuracy of sample retrieval. Lightweight fine-tuning can be performed using the feedback scores of the samples by minimizing the loss function. This can enable encoder functions By bringing queries closer to high-quality samples in the vector space and pushing them further away from low-quality samples, the search quality can be self-evolved.

[0060] Furthermore, the loss function for: ; in, For user queries Positive examples that generate high feedback scores; For user queries Negative examples retrieved but not adopted or that generated low feedback scores; The set of negative examples; This is the loss coefficient; It is a natural exponential function.

[0061] Then, calculate the user query. Similarity between the question and each retrieved sample ,in, For the first A sample problem This is a similarity calculation function; if the highest similarity... Exceeding the top threshold Then only the highest similarity score will be selected. Corresponding examples are used to avoid redundancy; if the highest similarity Below the bottom threshold If the highest similarity is not selected, then no sample will be chosen; if the highest similarity is not selected, then no sample will be chosen. exist Within the range, select One example, Not greater than Any positive integer.

[0062] After searching Context fragments and After a sample (question-answer correct), insert subunit 412 will be... The context formed by the context fragments and Each sample (question-answer pair) is inserted into the corresponding slot in the dynamic hint template to assemble the final hint, which is then provided to the large model with fixed parameters. The dynamic hint template is pre-designed and continuously updated during use, resulting in different versions. The context and sample insertions use the latest version of the dynamic hint template.

[0063] The industry adaptation system 400 for large, non-fine-tuning models based on a feedback-driven sample library also includes a template creation unit 440, which creates dynamic prompt templates as follows: Template creation unit 440 defines the static text and dynamic slots of the dynamic prompt template.

[0064] Dynamic prompt template It can be formalized as a static text and dynamic slots Composed of sequences ;in, This is the first static text. For the first dynamic slot, This is the second static text. For the second dynamic slot, For the first A static text, For the first One dynamic slot.

[0065] Among them, static text The corresponding dynamic slots were identified. Rules (e.g., use cases), dynamic slots The input must follow the corresponding static text. Clear rules, and dynamic slots The corresponding static text needs to be embedded. The preset position is used to avoid problems such as formatting errors and logical inconsistencies, and dynamic slots are used to achieve this. It can achieve flexible adaptation.

[0066] Template creation unit 440 designs a strategy for generating dynamic slot content.

[0067] Dynamic slots It includes: retrieval slots, instruction slots, and sample slots; the generation strategy for dynamic slot content is as follows: retrieval slots are used to insert context consisting of context fragments retrieved from vector database A, instruction slots are used to insert industry-specific task requirements, and sample slots are used to insert one or more samples (question-answer pairs) retrieved from vector database B.

[0068] Template creation unit 440 establishes a version management and feedback iteration mechanism for dynamic prompt templates.

[0069] Dynamic prompt template Version management is as follows: Each time the dynamic prompt template is updated... Modifications to the generation strategy for static text and / or dynamic slots will save a new version of the dynamic tooltip template. .

[0070] Dynamic prompt template The feedback and iteration mechanism is as follows: record the use of the new version of the dynamic prompt template. Feedback ratings for sample examples, and based on the use of the new version of the dynamic prompt template. The feedback score of the sample is calculated using the new version of the dynamic prompt template. The average feedback score of the sample when using the new version of the dynamic prompt template. Average feedback score of the samples It is statistically significantly superior to using the old version of the dynamic prompt template. Average feedback score of the samples At that time, the old version of the dynamic prompt template will be used. Upgrade to the new version of the dynamic prompt template The new version of the dynamic prompt template will be used subsequently. Otherwise, the old version of the dynamic prompt template will be used subsequently. .

[0071] Among them, dynamic prompt templates are used. Average feedback score of the samples The calculation formula is as follows: ; in, In dynamic prompt template The following is a collection of examples that are frequently used or make a major contribution to the scoring; In dynamic prompt template Under the dynamic slot content generation strategy, the example The degree to which it is selected and utilized; For example Expected dynamic score; Dynamic prompt template The strategy efficiency factor.

[0072] ; in, It is a dynamic prompt template Number of times it was used To use dynamic tooltip templates Example Feedback score; when At that time, it was believed Significantly superior in a statistical sense , This is the difference threshold.

[0073] The calculation and scoring unit 420 will ultimately prompt the input of the fixed-parameter large model, output the corresponding answer, and obtain multi-dimensional feedback scores based on the output answer.

[0074] The generated final prompts are input into large-scale models such as GPT and LLaMA. These large-scale models have fixed, unadjusted parameters. After processing by the fixed-parameter large-scale models, the corresponding answers are output, thus fulfilling the user's query. and getting the answer As a new example, the output answers will be evaluated using a combination of automated and manual methods, and multi-dimensional feedback scores will be collected from the evaluation.

[0075] The multi-dimensional feedback scoring comes from rule-based feedback and human feedback. Rule-based feedback uses a calibrated lightweight evaluation model or a large model to self-evaluate and score the professionalism, accuracy, and safety of the output answers. Human feedback is scored by domain experts on answers that are critical or high-risk.

[0076] The optimization and iteration unit 430 optimizes the industry sample library and iterates the dynamic prompt template used to generate the final prompt based on multi-dimensional feedback scores.

[0077] User queries and the output answer The sample is stored as a new instance, along with its corresponding multi-dimensional feedback score. The retrieval frequency and entry time of this instance are also recorded. Then, the sample's feedback score is calculated based on the associated stored instance, multi-dimensional feedback score, retrieval frequency, and entry time. If the sample's feedback score is not lower than the optimization threshold, it is added to the industry sample library as a positive example to optimize the library. If the sample's feedback score is lower than the optimization threshold, and the problem is widespread, the sample is corrected, and the corrected sample is added to the industry sample library as a new positive example to optimize the library. Furthermore, the dynamic suggestion template is iterated based on the sample's feedback score, according to the dynamic suggestion template's feedback iteration mechanism.

[0078] Furthermore, use dynamic prompt templates. Example Feedback rating The calculation formula is as follows: ; in, To use dynamic tooltip templates Example Feedback rating; Is it using dynamic tooltip templates? Example confidence level The weight value for the confidence level; Is it using dynamic tooltip templates? Example retrieval frequency It is a weight value for retrieval frequency; Is it using dynamic tooltip templates? Example quality weight, It is the weight value of the quality weight; Is it using dynamic tooltip templates? Example The time of entry into the warehouse It is the weight value of the time of entry into the warehouse; and .

[0079] In the above formula, the example Feedback rating The calculation uses the new retrieval frequency. New confidence level New quality weights and new warehousing time As shown below: ; ; ; in, Is it using dynamic tooltip templates? Example The new retrieval frequency; Is it using dynamic tooltip templates? Example The old retrieval frequency; Is it using dynamic tooltip templates? Example The new confidence level; Is it using dynamic tooltip templates? Example The old confidence level; It is a forgetting factor that controls the rate at which historical confidence decays; This is an example. Multidimensional feedback scores received after being retrieved and used to generate answers (normalized to [0,1]); Is it using dynamic tooltip templates? Example New quality weights; Is it using dynamic tooltip templates? Example The new inbound time; It is the time-related decay coefficient.

[0080] In addition, the feedback score label, confidence label, retrieval frequency label, quality weight label, and entry time label of the sample are updated based on the feedback score, confidence score, retrieval frequency, quality weight, and entry time of the sample obtained above.

[0081] This application enables industry sample libraries and dynamic prompt templates to continuously absorb feedback and improve themselves during application. By integrating high-quality industry sample libraries and dynamic prompt templates into the large model, the parameters of the large model can be modified without changing them. This allows the fixed-parameter large model to be adapted to vertical industries quickly, cost-effectively, and flexibly, while maintaining its general capabilities and avoiding increasing the storage and management burden on the large model.

[0082] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the invention can be implemented in other specific forms without departing from its spirit or essential characteristics. Therefore, the embodiments should be considered in all respects as exemplary and non-limiting, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be included within the present invention. No reference numerals in the claims should be construed as limiting the scope of the claims.

[0083] Furthermore, it should be understood that although this specification describes embodiments, not every embodiment contains only one independent technical solution. This narrative style is merely for clarity. Those skilled in the art should consider the specification as a whole, and the technical solutions in each embodiment can also be appropriately combined to form other embodiments that can be understood by those skilled in the art.

Claims

1. A method for industry adaptation of large models without fine-tuning based on a feedback-driven example library, characterized in that, Includes the following steps: Step S110: Generate the final prompt for the large model with fixed parameters by using the industry sample library to respond to user queries; Step S120: Input the final prompt into the fixed-parameter large model, output the corresponding answer, and obtain multi-dimensional feedback scores based on the output answer; Step S130: Optimize the industry sample library based on multi-dimensional feedback scores and iterate on the dynamic prompt template used to generate the final prompt.

2. The industry adaptation method for large models without fine-tuning based on a feedback-driven example library according to claim 1, characterized in that, The generation of the final prompt includes the following sub-steps: Use user query Retrieve results from the corresponding industry sample library that match the user's query. The closest correlation Each context fragment and its corresponding A sample, and through the retrieved... A context fragment forms a context; After searching Context fragments and Each sample is inserted into the corresponding slot in the dynamic tooltip template to assemble the final tooltip.

3. The industry adaptation method for large models without fine-tuning based on a feedback-driven example library according to claim 2, characterized in that, The retrieval of context fragments and examples, as well as the formation of context, include the following sub-steps: Step S210: Query the user query Encoded as query vector ; Step S220: In the vector database A, perform an approximate nearest neighbor search to find the vector that matches the query vector. The highest cosine similarity A context fragment; Step S230: For the found Each context fragment is filtered and rearranged to make... Each contextual segment forms a context; Step S240: In vector database B, retrieve the results that match the user's query. Most similar A sample, and from Select from the samples Example.

4. The industry adaptation method for large models without fine-tuning based on a feedback-driven example library according to claim 3, characterized in that, from Select from the samples One example includes the following sub-steps: Calculate user queries Similarity between the question and each retrieved sample ; If the highest similarity Exceeding the top threshold Then only the highest similarity score will be selected. Corresponding examples; If the highest similarity Below the bottom threshold If so, then no sample will be selected; If the highest similarity exist Within the range, select One example, Not greater than Any positive integer.

5. The industry adaptation method for large models without fine-tuning based on a feedback-driven example library according to claim 2, characterized in that, Creating a dynamic suggestion template includes the following sub-steps: Step S310: Define the static text and dynamic slots of the dynamic prompt template; Step S320: Design a strategy for generating dynamic slot content; Step S330: Establish a version management and feedback iteration mechanism for dynamic prompt templates.

6. An industry-adaptive system for large, fine-tuning-free models based on a feedback-driven example library, characterized in that: include: Prompt generation unit, calculation and scoring unit, and optimization and iteration unit; Among them, the prompt generation unit generates the final prompt for a large model with fixed input parameters based on the industry sample library for user queries; The calculation and scoring unit will ultimately prompt the input into a large model with fixed parameters, output the corresponding answer, and obtain multi-dimensional feedback scores based on the output answer; The optimization and iteration unit optimizes the industry sample library and iterates the dynamic prompt template used to generate the final prompt based on multi-dimensional feedback scores.

7. The industry-adaptive system for large, fine-tuning-free models based on a feedback-driven example library as described in claim 6, characterized in that, The prompt generation unit includes: a retrieval subunit and an insertion subunit; The retrieval sub-unit uses user queries Retrieve results from the corresponding industry sample library that match the user's query. The closest correlation Each context fragment and its corresponding A sample, and through the retrieved... A context fragment forms a context; Insert subunit when retrieved Context fragments and Each sample is inserted into the corresponding slot in the dynamic tooltip template to assemble the final tooltip.

8. The industry-adaptive system for large, fine-tuning-free models based on a feedback-driven example library as described in claim 7, characterized in that, The retrieval subunit will retrieve user queries Encoded as query vector In vector database A, perform an approximate nearest neighbor search to find the vector that matches the query vector. The highest cosine similarity A context fragment, for the found Each context fragment is filtered and rearranged to make... Each contextual segment forms a context; The retrieval sub-unit retrieves data from vector database B that matches the user's query. Most similar A sample, and from Select from the samples Example.

9. The industry-adaptive system for large, fine-tuning-free models based on a feedback-driven example library as described in claim 8, characterized in that, Retrieval subunit calculates user queries Similarity between the question and each retrieved sample ; If the highest similarity Exceeding the top threshold Then only the highest similarity score will be selected. Corresponding examples; if the highest similarity Below the bottom threshold If the highest similarity is not selected, then no sample will be chosen; if the highest similarity is not selected, then no sample will be chosen. exist Within the range, select One example, Not greater than Any positive integer.

10. The industry-adaptive system for large, fine-tuning-free models based on a feedback-driven example library as described in claim 7, characterized in that, Also includes: Template creation unit; The template creation unit defines the static text and dynamic slots for dynamic tooltip templates; Template creation unit design dynamic slot content generation strategy; The template creation unit establishes a version management and feedback iteration mechanism for dynamically prompted templates.

Citation Information

Patent Citations

  • Dynamic question and answer matching method and system based on context awareness

    CN119691133A

  • Self-adaptive template reconstruction method and system based on few samples

    CN119807421A

  • Large model named entity recognition method and system based on representative sample selection and context enhancement

    CN120579545A

  • Providing a suitability prompt to evaluate and improve the output of a generative model without fine tuning

    WO2025155426A1