A financial field training data construction method based on a double feedback mechanism

By employing a training data construction method with a dual feedback mechanism, and combining retrieval-enhanced generation and thought chain prompts with multi-dimensional scoring from an AI teacher model, the problems of training data quality and real-time performance in the financial field are solved, achieving efficient and low-cost data construction and model performance improvement.

CN120123471BActive Publication Date: 2025-11-04UNIV OF SCI & TECH OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510175395.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-02-18
Publication Date
2025-11-04
Estimated Expiration
2045-02-18

AI Technical Summary

Technical Problem

Existing technologies for constructing training data in the financial field suffer from problems such as unstable data quality, insufficient logical reasoning ability, high cost, and poor real-time performance, making it difficult to meet the needs of large-scale language models.

Method used

We employ a dual-feedback mechanism approach, utilizing retrieval enhancement generation technology and thought chain prompts to form comprehensive information. We then construct a high-quality training dataset by performing multi-dimensional scoring and screening through a pre-trained evaluation model and an AI teacher model.

Benefits of technology

It enables the efficient and low-cost construction of high-quality training data, improves the performance and real-time performance of the model in financial tasks, and reduces the reliance on manual annotation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120123471B_ABST
    Figure CN120123471B_ABST
Patent Text Reader

Abstract

The application discloses a financial field training data construction method based on a double feedback mechanism, and relates to the technical field of natural language processing, and comprises the following steps: based on the initial information obtained in advance, external knowledge is retrieved by using retrieval enhancement generation technology, comprehensive information is formed by combining thought chain prompt words, and the comprehensive information is screened; the screened comprehensive information is taken as the input of a dialogue base model, logical information is generated, and the logical information is converted into concise information through thought distillation; the concise information is scored in multiple dimensions by using an AI teacher model, the concise information is screened according to the scoring result, and a training data set is constructed. Through the RAG technology and the thought chain prompt words of the input end, the model can obtain rich financial field knowledge; at the output end, the AI teacher model is used to automatically score the generated answers in multiple dimensions, so that the high quality of the training data set is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of natural language processing technology, and more specifically, to a method for constructing training data in the financial field based on a dual feedback mechanism. Background Technology

[0002] With the significant progress made by large language models (LLMs) such as GPT-3, BERT, and T5 in natural language processing tasks, demonstrating powerful language understanding and generation capabilities, their application potential in the financial field has attracted increasing attention. The success of these models largely depends on massive amounts of high-quality training data. When these models are applied to the financial field, the specialization and complexity of the financial sector place extremely high demands on the model's understanding ability, logical reasoning ability, and accuracy of facts. The model's performance depends not only on its architecture and training methods but also on the quality, specialization, and diversity of the training data. Therefore, constructing high-quality training data is crucial for improving the model's performance in financial tasks.

[0003] Traditionally, building high-quality training datasets has relied primarily on manual annotation. Manually annotated datasets are typically highly accurate and specialized, especially when dealing with complex tasks or specialized domains. However, manual annotation methods suffer from drawbacks such as high cost, limited scalability, and insufficient real-time performance. The need for professional personnel, particularly in the financial sector where specialized financial expertise is required, leads to high costs and long processing times. Furthermore, limitations in manpower and time typically result in smaller datasets for manually annotated models, making it difficult to meet the massive data demands of large language models. Additionally, the rapid pace of information updates in the financial sector makes timely data updates difficult, impacting the model's real-time performance and effectiveness.

[0004] To address the cost and scalability issues of manual annotation, researchers have proposed automated data generation methods, such as Self-Instruct. These methods expand training data by allowing models to generate their own instructions and corresponding responses, enabling the rapid generation of large-scale datasets and reducing manual costs. However, automated generation methods still face challenges in practical applications. While using Self-Instruct to generate instruction datasets can expand the data scale to some extent, it still falls short in ensuring data quality, logical consistency, and domain specialization. First, data quality is unstable; the instructions and responses generated by the model may contain logical errors, factual errors, or fail to meet the professionalism and compliance requirements of the financial field. Second, risk control is insufficient; automatically generated data lacks human review and may contain sensitive information or inappropriate content, failing to meet the stringent compliance requirements of the financial sector. Finally, generalization ability is limited; the model may tend to generate content related to its existing knowledge, resulting in insufficient data diversity and coverage.

[0005] To enhance the knowledge base and reasoning ability of models, researchers introduced Retrieval-Augmented Generation (RAG) technology. This is an excellent non-parametric solution that assists model generation by retrieving relevant information, enabling the model to utilize the latest information from external knowledge bases. However, RAG also has some limitations in application. First, the knowledge retrieved by RAG needs to be integrated with the model's internal knowledge, which may lead to information conflicts or inconsistencies. Second, the model's dependence on external knowledge bases increases; if the knowledge base is not updated in a timely manner or its quality is low, it may affect the model's output quality. Furthermore, the retrieval process increases inference time, affecting the model's real-time performance. Therefore, although RAG can... While it can alleviate the lack of model knowledge reserves to some extent, it cannot completely replace the importance of high-quality training data. Chain-of-Thought (CoT) technology, as another method to enhance model reasoning capabilities, has achieved significant results in solving complex reasoning tasks, mathematical calculations, and logical reasoning by guiding the model to explicitly generate reasoning steps. However, CoT also faces some problems in practical applications. Explicit thought chains increase the length of generated content, which may increase the reading burden on users. Generating intermediate reasoning steps requires additional computing resources, increasing reasoning time and cost, and reducing the model's real-time performance. In addition, in the financial field, intermediate reasoning steps may involve sensitive information, and explicit display may pose information security risks.

[0006] In summary, existing technologies, particularly in the financial field, still have shortcomings in data construction and optimization, including data quality, logical reasoning ability, evaluation efficiency, and professionalism. Manual annotation is costly, automated methods suffer from unstable quality, RAG methods increase reliance on external knowledge bases and have limited real-time performance, CoT technology increases inference costs, knowledge distillation has limited effectiveness, and ordinary models lack sufficient professionalism. Therefore, there is an urgent need for a new method that can efficiently construct high-quality training data, improve the model's logical reasoning ability and professionalism, while reducing inference costs, and meeting the performance and real-time requirements of the financial sector.

[0007] No effective solutions have yet been proposed to address the problems in the relevant technologies. Summary of the Invention

[0008] In response to the problems in related technologies, this invention proposes a method for constructing training data in the financial field based on a dual feedback mechanism to overcome the aforementioned technical problems existing in the existing related technologies.

[0009] Therefore, the specific technical solution adopted by the present invention is as follows:

[0010] A method for constructing training data in the financial field based on a dual feedback mechanism, the method comprising the following steps:

[0011] S1. Based on pre-acquired initial information, external knowledge is retrieved using retrieval enhancement generation technology, combined with thought chain prompts to form comprehensive information, and then the comprehensive information is filtered, specifically including:

[0012] Based on the pre-acquired initial information, knowledge fragments are retrieved from external knowledge bases using retrieval enhancement generation technology to obtain external knowledge;

[0013] Using the thought chain method, thought chain prompts are designed to guide the thinking of the dialogue base model, and initial information, external knowledge and thought chain prompts are spliced ​​together to obtain comprehensive information;

[0014] The comprehensive information is scored using a pre-trained evaluation model, and the comprehensive information is filtered based on the comparison between the score results and the preset score threshold.

[0015] S2. Using the dialogue base model, the filtered comprehensive information is used as the input to the dialogue base model to generate logical information, and the logical information is then distilled into concise information through thought distillation.

[0016] S3. Using an AI teacher model, perform multi-dimensional scoring on concise information, and filter concise information based on the scoring results to construct a training dataset.

[0017] Furthermore, the comprehensive information is scored using a pre-trained evaluation model, and the comprehensive information is then filtered based on a comparison between the scoring results and a preset scoring threshold, including the following steps:

[0018] Construct and train a rerank model, and use the trained rerank model to score the concatenated comprehensive information in turn to obtain several score results.

[0019] Set a scoring threshold and determine whether the scoring result of the comprehensive information is greater than or equal to the scoring threshold. If so, retain the comprehensive information corresponding to the scoring result. If not, trigger the feedback mechanism to adjust the external knowledge retrieval and mind chain prompts.

[0020] Furthermore, based on the pre-acquired initial information, knowledge fragments are retrieved from external knowledge bases using retrieval enhancement generation techniques. Obtaining external knowledge includes the following steps:

[0021] An external knowledge base is built based on pre-acquired financial knowledge.

[0022] Based on the pre-acquired initial information, knowledge fragments are retrieved from external knowledge bases using text matching and semantic similarity calculation methods.

[0023] Select the knowledge fragments with the highest similarity to form external knowledge.

[0024] Furthermore, the formula for calculating semantic similarity is:

[0025]

[0026] In the formula, sim(x,k) represents semantic cosine similarity; k represents candidate documents in the database; and x represents the initial information obtained in advance.

[0027] Furthermore, the calculation formula for combining initial information, external knowledge, and thought chain prompts is as follows:

[0028]

[0029] In the formula, Indicates a splicing operation; D represents comprehensive information; P represents retrieved external knowledge; D represents comprehensive information. CoT These are thought chain prompts.

[0030] Furthermore, using the dialogue base model, the filtered comprehensive information is used as input to generate logical information, and the logical information is then distilled through thought processes to generate concise information, including the following steps:

[0031] S21. Based on the pre-trained dialogue base model with a converter architecture, the filtered comprehensive information is converted into a word sequence. The correlation of the word sequence at different positions is obtained through the self-attention mechanism, and layer normalization and residual connection are used for training.

[0032] S22. Using a fully connected feedforward neural network, the correlation of the word sequence at different positions is transformed nonlinearly, and then trained again using layer normalization and residual connections. Logical information is generated through output transformation.

[0033] S23. Through thought distillation, extract the answer from the logical information and remove the reasoning process from the logical information to obtain concise information.

[0034] Furthermore, the calculation formula for the self-attention mechanism is as follows:

[0035]

[0036] In the formula, Q represents the query vector; K represents the key vector; V represents the value vector; d k The vector dimension is represented by T; the matrix transpose is represented by T; and Attention(Q,K,V) represents the attention score of a word sequence at any position relative to other positions.

[0037] Furthermore, using an AI teacher model, concise information is scored from multiple dimensions, and concise information is filtered based on the scoring results to construct a training dataset, including the following steps:

[0038] S31. Based on the pre-acquired initial information, external knowledge, and concise information, a scoring information is formed;

[0039] S32. Utilize an AI teacher model to evaluate the scoring information from multiple dimensions and generate scoring results for each dimension.

[0040] S33. Based on the scoring results of each dimension, calculate the comprehensive score, and set the filtering threshold according to the comprehensive score to filter concise information and construct the training dataset.

[0041] Furthermore, the formula for calculating the overall score is as follows:

[0042]

[0043] In the formula, S represents the overall score; w i represents the weight coefficient of each rating dimension; x represents the initial information obtained beforehand; y represents the concise information; i represents each rating dimension; s i (x,y) represents the rating result for the i-th dimension.

[0044] Furthermore, a comprehensive score is calculated, and a screening threshold is set based on the comprehensive score. The screening rules for concise information include: when the comprehensive score is greater than or equal to the set threshold, the corresponding concise information is used as training data.

[0045] The beneficial effects of this invention are as follows:

[0046] This invention achieves efficient and high-quality construction of training data in the financial field by introducing a dual feedback mechanism at both the input and output ends. At the input end, Retrieval Enhanced Generation (RAG) technology combined with CoT prompts guides the dialogue base model to acquire rich financial knowledge and generate logically rigorous answers. At the output end, an AI teacher model automatically scores the generated results across multiple dimensions, including contextual consistency, answer completeness, factual accuracy, logical coherence, conciseness, financial professionalism, financial compliance, and user-demand matching, thereby selecting high-quality training data. This method not only reduces the cost and time of manual annotation but also significantly improves the performance of downstream models in tasks such as financial question answering, demonstrating high application value and promising prospects for wider adoption. Attached Figure Description

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

[0048] Figure 1 This is a flowchart of a method for constructing training data in the financial field based on a dual feedback mechanism according to an embodiment of the present invention;

[0049] Figure 2 This is a flowchart illustrating the framework of a method for constructing training data in the financial field based on a dual feedback mechanism, according to an embodiment of the present invention.

[0050] Figure 3 This is a Transformer model architecture diagram in a financial field training data construction method based on a dual feedback mechanism according to an embodiment of the present invention. Detailed Implementation

[0051] To further illustrate the various embodiments, the present invention provides accompanying drawings, which are part of the disclosure of the present invention. These drawings are mainly used to illustrate the embodiments and can be used in conjunction with the relevant descriptions in the specification to explain the operating principles of the embodiments. With reference to these drawings, those skilled in the art should be able to understand other possible implementation methods and the advantages of the present invention.

[0052] According to an embodiment of the present invention, a method for constructing training data in the financial field based on a dual feedback mechanism is provided.

[0053] The present invention will now be further described in conjunction with the accompanying drawings and specific embodiments, such as... Figures 1-2 As shown, the financial field training data construction method based on a dual feedback mechanism according to an embodiment of the present invention includes the following steps:

[0054] S1. Based on the pre-acquired initial information, external knowledge is retrieved using retrieval enhancement generation technology, combined with thought chain prompts to form comprehensive information, and then the comprehensive information is filtered.

[0055] Specifically, the user provides initial input, which is pre-acquired initial information. The user provides initial input and retrieves relevant external knowledge through RAG (Retrieval Enhancement Generation) technology. The user inputs an initial question, which is the pre-acquired initial information x. The system uses RAG technology to retrieve knowledge fragments related to x from an external knowledge base to enhance the background information of the input.

[0056] Specifically, new input is formed by combining thought chain prompts. This new input is comprehensive information and is used to guide the dialogue base model (Reply model). The initial input x, the retrieved external knowledge D, and the thought chain prompt P are combined. CoT Combined, new inputs are formed. Used to guide the Reply model to generate output with logical reasoning capabilities.

[0057] Specifically, based on pre-acquired initial information, external knowledge is retrieved using retrieval enhancement generation technology, combined with thought chain prompts to form comprehensive information, and the comprehensive information is then filtered, including the following steps:

[0058] S11. Based on the pre-acquired initial information, retrieve knowledge fragments from the external knowledge base using retrieval enhancement generation technology to obtain external knowledge.

[0059] Specifically, based on pre-acquired initial information, knowledge fragments are retrieved from external knowledge bases using retrieval enhancement generation techniques to acquire external knowledge, including the following steps:

[0060] S111. Construct an external knowledge base based on pre-acquired financial domain knowledge.

[0061] Specifically, this involves building an external knowledge base, namely, establishing an external knowledge base U that covers knowledge in the financial field, including financial knowledge, financial news, market data, etc.

[0062] S112. Based on the pre-acquired initial information, retrieve knowledge fragments from the external knowledge base using text matching and semantic similarity calculation methods.

[0063] Specifically, the formula for calculating semantic similarity is:

[0064]

[0065] In the formula, sim(x,k) represents semantic cosine similarity; k represents candidate documents in the database; and x represents the initial information obtained in advance.

[0066] S113. Select several knowledge fragments with the highest similarity to form external knowledge.

[0067] Specifically, retrieving knowledge fragments means retrieving relevant knowledge. This includes retrieving knowledge fragments related to x from an external knowledge base U using methods such as text matching and semantic similarity calculation, and selecting the N knowledge fragments with the highest similarity to form the retrieved external knowledge D.

[0068] Specifically, combining the retrieved external knowledge D with the initial input x, and introducing external expertise into the Reply model, can enhance the model's generative capabilities.

[0069] S12. Using the thinking chain method, design thinking chain prompts that can guide the thinking of the dialogue base model, and combine the initial information, external knowledge and thinking chain prompts to obtain comprehensive information.

[0070] Specifically, designing CoT (Mind Chain) cue words P CoT The aim is to guide the Reply model to engage in deep thinking during the generation process, reflect the logical reasoning process, and generalize to a variety of financial tasks.

[0071] Example as follows:

[0072] "*In accordance with the requirements of the XXX financial task, carefully read and make full use of the list of relevant financial documents retrieved."

[0073] Please analyze the specific connections between the task and these documents in detail, and deduce the solution step by step.

[0074] In your answer, demonstrate your reasoning process in detail, ensuring that each step has clear logic and supporting evidence.

[0075] *The content should be specific and clear, avoiding vague or general descriptions. It should demonstrate a deep understanding and comprehensive analysis of the XXX task.

[0076] Specifically, the calculation formula for combining initial information, external knowledge, and thought chain prompts is as follows:

[0077]

[0078] In the formula, Indicates a splicing operation; D represents comprehensive information; P represents retrieved external knowledge; D represents comprehensive information. CoT These are thought chain prompts.

[0079] Specifically, comprehensive information This new input guides the model to include detailed thought processes and demonstrate logical reasoning ability when generating answers.

[0080] S13. Use the pre-trained evaluation model to score the comprehensive information, and filter the comprehensive information based on the comparison between the score results and the preset score threshold.

[0081] Specifically, a pre-trained evaluation model is used to automatically score the concatenated composite information, and a predetermined threshold is set. Only when the score of the composite information reaches or exceeds the threshold is it fed into the dialogue base model for further processing; otherwise, a feedback mechanism is triggered to adjust the external knowledge retrieval and thought chain prompts.

[0082] Specifically, a rerank model is introduced to filter the initial question and the retrieved external knowledge D, which consists of the N knowledge fragments with the highest similarity, thereby ensuring higher quality of the comprehensive information input to the downstream dialogue model. This rerank model is based on a pre-trained cross encoder. Its basic idea is to jointly encode the question and candidate comprehensive information, use a classification head to output a matching score, and select the top-n candidates according to the score.

[0083] Assume the retrieved external knowledge is: D = {d1, d2, d3, ..., d...} N};

[0084] For each candidate comprehensive information d i , will (x,d i The concatenation is used as the input to the cross encoder, where x represents the pre-acquired initial information;

[0085] The cross encoder for input (x,d) i Perform joint encoding to calculate the hidden state h of the [CLS] token. i Wherein, [CLS]token represents the overall semantic information of the input sequence, used for each d i The pairing with x generates a global representation, and then a matching score is calculated using a linear classification head:

[0086] s i =W·h i +b

[0087] Among them, hi This represents the vector representation of the [CLS] token in the final layer of the cross-encoder, where W and b represent the two linear classification head parameters of the model, and s i Represents candidate comprehensive information d i Match score with x;

[0088] Sorting and selecting Top-n candidates: Based on the matching scores {s1,s2,s3,...,s} of all candidates obtained from the comprehensive information. N} and sort in descending order;

[0089] Finally, the n candidates with the highest scores are selected as the final output, and these candidates serve as high-quality integrated information input into the subsequent dialogue base model. The cross-encoder is also based on the Transformer architecture, and its self-attention mechanism and other principles will not be elaborated here.

[0090] S2. Using the dialogue base model, the filtered comprehensive information is used as the input to the dialogue base model to generate logical information, and the logical information is then distilled into concise information through thought distillation.

[0091] Specifically, the Reply (dialogue base) model generates output that includes thought processes; the Reply model receives new input. Utilizing internal knowledge and logical reasoning abilities, generate output y that includes thought processes. CoT y CoT It represents logical information, which includes the answer to the question and the reasoning process.

[0092] Specifically, the Reply model, in accepting Then, an output y containing the thought process is generated. CoT The output includes both direct answers to the question and detailed reasoning steps, outputting logical information y. CoT The calculation formula is:

[0093]

[0094] In this process, the Reply model combines its own pre-trained knowledge, externally retrieved knowledge, and the guidance of thought chain prompts to produce logically rigorous answers and reasoning processes, using clear formats and keywords to distinguish between intermediate reasoning steps and the final answer.

[0095] For example, the reasoning process is as follows: First, analyze the client's investment needs and risk preferences; second, evaluate the available financial documents in conjunction with the current market conditions; third, consider long-term returns and risk diversification; the final answer: "I recommend XXXX to the client."

[0096] Specifically, the dialogue base model (Reply model) is the core component of this invention, responsible for receiving input. And generate an output y that includes the thought process. CoT The Reply model uses a pre-trained large language model based on the Transformer architecture, such as the GPT series and QWEN series models, which have extremely strong semantic understanding and generation capabilities. The Transformer architecture, with its powerful self-attention mechanism, can capture long-term dependencies in the input sequence and is suitable for natural language processing tasks.

[0097] Specifically, using the dialogue base model, the filtered comprehensive information is used as input to generate logical information, and the logical information is then distilled through thought processes to generate concise information, including the following steps:

[0098] S21. Based on the pre-trained dialogue base model with a converter architecture, the filtered comprehensive information is converted into a word sequence. The correlation of the word sequence at different positions is obtained through the self-attention mechanism, and layer normalization and residual connection are used for training.

[0099] S22. Using a fully connected feedforward neural network, the correlation of the word sequence at different positions is transformed nonlinearly, and then trained again using layer normalization and residual connections. Logical information is generated through output transformation.

[0100] Specifically, the Transformer architecture mainly consists of multiple layers of encoders and decoders. In this invention, the decoder portion is the primary focus, and its architecture diagram is shown below. Figure 3 As shown, firstly, the input information is embedded, then converted into a token sequence through positional encoding and sequence embedding, and each token is mapped to a high-dimensional vector with positional encoding added to preserve order information. Next, the encoder captures the correlation between different positions in the input sequence using a masked multi-head self-attention mechanism, and applies residual connections and layer normalization after each layer to stabilize the training process. The encoder output is passed to the decoder, which generates an initial output through a masked multi-head self-attention mechanism and utilizes the encoder's output through an encoder-decoder attention mechanism. Subsequently, the decoder performs a nonlinear transformation through a fully connected feedforward neural network, and applies residual connections and layer normalization again after each layer. The decoder generates responses step by step, each step based on the previous output and the encoder's output. Finally, the decoder output is further processed through a linear layer and converted into a probability distribution using a softmax function to select the next token until the termination condition is met. This entire process ensures that the model can effectively generate coherent and relevant dialogue responses from the input text.

[0101] Specifically, the self-attention layer, through the self-attention mechanism, enables the model to focus on the correlation between different positions in the input sequence. The calculation process is as follows:

[0102]

[0103] In the formula, Attention(Q,K,V) represents the attention score of a token at a certain position relative to other positions, that is, the mutual influence weight between tokens in the input sequence.

[0104] Specifically, a feedforward neural network, which is a fully connected feedforward neural network after the self-attention layer, performs nonlinear transformations on the data.

[0105] Specifically, layer normalization and residual connections are used after each sub-layer to stabilize the training process and accelerate convergence.

[0106] Specifically, the general-purpose large language base model has been pre-trained on a large amount of text data and has a certain ability to understand and generate language, but its professionalism and accuracy in the financial field may be insufficient, so further optimization is needed.

[0107] S23. Through thought distillation, extract the answer from the logical information and remove the reasoning process from the logical information to obtain concise information.

[0108] Specifically, logical information is processed to obtain concise information for y. CoT The process involves removing intermediate reasoning steps, extracting the final answer, and obtaining a concise output y. This process is equivalent to distilling the thought process, allowing the model to retain logical reasoning ability even without explicitly presenting the reasoning steps.

[0109] Specifically, through thought distillation, the answer is extracted from the logical information, and the reasoning process is removed to obtain concise information. To balance the model's reasoning ability and response speed, the distillation strategy adopted is to extract the answer from y. CoT The final answer is extracted, and intermediate reasoning processes are removed to obtain a concise output as training data to be selected. Distillation includes locating markers, i.e., searching for the position of a specific marker (such as "Final Answer:") in the text; then content extraction, i.e., extracting the subsequent text starting from the marker position as the final answer y; then impurity removal, i.e., using regular expression matching to remove possible redundant symbols, blank lines, or non-answer content; by omitting intermediate reasoning processes in the training data to be selected, the model internalizes these logical reasoning abilities during fine-tuning; in the fine-tuned model generation, even without explicitly presenting the reasoning steps, the model can produce logically strong answers.

[0110] Specifically, the calculation formula for the self-attention mechanism is as follows:

[0111]

[0112] In the formula, Q represents the query vector; K represents the key vector; V represents the value vector; d k The vector dimension is represented by T; the matrix transpose is represented by T; and Attention(Q,K,V) represents the attention score of a word sequence at any position relative to other positions.

[0113] S3. Using an AI teacher model, perform multi-dimensional scoring on concise information, and filter concise information based on the scoring results to construct a training dataset.

[0114] Specifically, an AI teacher model is introduced to score concise information y from multiple dimensions, and high-quality data is selected based on the scoring results to construct a training dataset. Another high-performance AI teacher model is then used to automatically score y from multiple dimensions, covering aspects such as logic, accuracy, and professionalism. Based on the scoring results, high-quality concise information is selected to construct a training dataset D. train .

[0115] Specifically, an AI teacher model is introduced at the output end to automatically score the concise information (y) generated by the Reply model from multiple dimensions. Based on the scoring results, high-quality data is selected to build a training dataset. The teacher model needs to have strong knowledge reserves and semantic understanding capabilities, such as the GPT-4 model serving as the teacher model.

[0116] Specifically, using an AI teacher model to score concise information from multiple dimensions, and then filtering concise information based on the scoring results to construct a training dataset includes the following steps:

[0117] S31. Based on the pre-acquired initial information, external knowledge, and concise information, a scoring information is formed.

[0118] The scoring process includes the following steps: First, prepare the scoring input, which is the scoring information, that is, combine the user input x, the retrieved external knowledge D, and the Reply model output y to form the scoring input; this can be done by concatenating prompt words.

[0119] For example, the user asks a question: {x}; the retrieved external knowledge is: {D}; and the model answers: {y}.

[0120] As a professional financial reviewer, please score the model's response based on the following dimensions: XXX.

[0121] S32. Using an AI teacher model, evaluate the scoring information from multiple dimensions and generate scoring results for each dimension.

[0122] Specifically, in order to comprehensively evaluate the generated answer y, the Teacher model designed the following eight dimensions of scoring criteria: contextual consistency, answer completeness, factual accuracy, logical coherence, conciseness, financial expertise, financial compliance, and user needs matching; the scoring range for each dimension is from 0 to 1, with higher scores indicating better performance in that dimension.

[0123] Specifically, contextual consistency refers to the relevance of the answer to the question and whether the answer correctly understands the question's intent; completeness of the answer refers to whether the answer comprehensively covers all aspects of the question without omitting important information; factual accuracy refers to whether the information in the answer is true and accurate, without containing errors or misleading content; logical coherence refers to whether the answer's structure is reasonable, its logic is self-consistent, and its reasoning process is rigorous; conciseness refers to whether the answer is succinct and to the point, without redundancy or elaboration; financial professionalism refers to whether the answer reflects professional terminology and knowledge in the financial field and conforms to professional expression standards; financial compliance refers to whether the answer complies with financial regulations and ethical standards, without any illegal or inappropriate content; and user needs matching refers to whether the answer meets the user's specific needs and solves the user's concerns.

[0124] S33. Based on the scoring results of each dimension, calculate the comprehensive score, and set the filtering threshold according to the comprehensive score to filter concise information and construct the training dataset.

[0125] Specifically, the formula for calculating the overall score is as follows:

[0126]

[0127] In the formula, S represents the overall score; w i represents the weight coefficient of each rating dimension; x represents the initial information obtained beforehand; y represents the concise information; i represents each rating dimension; s i (x,y) represents the rating result for the i-th dimension.

[0128] Specifically, w i The weighting coefficients for each scoring dimension can be adjusted according to specific task requirements to meet the following needs.

[0129] Specifically, x represents user input, i.e., the initial information obtained in advance; y represents the Reply model response, i.e., concise information.

[0130] Specifically, in terms of factual accuracy, the Teacher model may compare the retrieved external knowledge D to verify whether the facts in the answer are correct.

[0131] Specifically, a comprehensive score is calculated, and a screening threshold is set based on the comprehensive score. The screening rules for concise information include: when the comprehensive score is greater than or equal to the set threshold, the corresponding concise information is used as training data.

[0132] Specifically, based on the comprehensive score S, a threshold T is set. Only when S≥T is y considered a high-quality answer. The (x,y) pairs that meet the condition are added to the training dataset to obtain the final training dataset D. train .

[0133] In summary, through the above steps, this invention establishes a complete process from input to output and then to data filtering, realizing bidirectional optimization of training data and improving the efficiency and quality of data construction.

[0134] The input optimization primarily involves guiding and optimizing the Reply model, including an introduction to the Reply model, the application of RAG retrieval technology, the introduction of thought chains, and distillation strategies. The Retrieval Augmentation (RAG) technology aims to enhance the Reply model's professionalism in the financial field. Notably, to improve real-time performance and efficiency, the introduction of thought chains does not involve multi-step inference chains; instead, it guides thought processes through CoT cues during the input phase. During training, the intermediate inference steps of the CoT part are omitted from the fine-tuning data, and this capability is internalized into the model through distillation, thus maintaining the model's inference ability while reducing inference costs.

[0135] On the output side, an AI teacher model is introduced to automatically score the generated answers. Considering the complexity and professionalism of financial tasks, a scoring standard is designed with eight dimensions: contextual consistency, answer completeness, factual accuracy, logical coherence, conciseness, financial professionalism, financial compliance, and user need matching. A high-performance large-scale language model (such as GPT-4) is used as the teacher model, and each generated result is comprehensively evaluated through Prompt Engineering without human intervention. Based on the scoring results, high-quality answers are selected for further fine-tuning or as a preferred dataset. By adjusting the weights of each scoring dimension, training datasets that meet different standards can be flexibly generated, enabling iterative optimization of the model. The application of a dual feedback mechanism at both the input and output ends not only improves the quality of training data but also reduces reliance on manual annotation and evaluation, improving the efficiency and scalability of data construction.

[0136] In summary, by employing the technical solutions described above, this invention achieves efficient and high-quality construction of training data in the financial field through the introduction of a dual feedback mechanism at both the input and output ends. At the input end, Retrieval Enhancement Generation (RAG) technology combined with CoT prompts guides the dialogue base model to acquire rich financial knowledge and generate logically rigorous answers. At the output end, an AI teacher model automatically scores the generated results across multiple dimensions, including contextual consistency, answer completeness, factual accuracy, logical coherence, conciseness, financial professionalism, financial compliance, and user demand matching, thereby selecting high-quality training data. This method not only reduces the cost and time of manual annotation but also significantly improves the performance of downstream models in tasks such as financial question answering, demonstrating high application value and promising prospects for wider adoption.

[0137] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for constructing training data in the financial field based on a dual feedback mechanism, characterized in that, The method includes the following steps: S1. Based on pre-acquired initial information, external knowledge is retrieved using retrieval enhancement generation technology, combined with thought chain prompts to form comprehensive information, and then the comprehensive information is filtered, specifically including: Based on the pre-acquired initial information, knowledge fragments are retrieved from external knowledge bases using retrieval enhancement generation technology to obtain external knowledge; Using the thought chain method, thought chain prompts are designed to guide the thinking of the dialogue base model, and initial information, external knowledge and thought chain prompts are spliced ​​together to obtain comprehensive information; The comprehensive information is scored using a pre-trained evaluation model, and the comprehensive information is filtered based on the comparison between the score results and the preset score threshold. S2. Using the dialogue base model, the filtered comprehensive information is used as the input to the dialogue base model to generate logical information, and the logical information is then distilled into concise information through thought distillation. S2 includes: S21. Based on the pre-trained dialogue base model with a converter architecture, the filtered comprehensive information is converted into a word sequence. The correlation of the word sequence at different positions is obtained through the self-attention mechanism, and layer normalization and residual connection are used for training. S22. Using a fully connected feedforward neural network, the correlation of the word sequence at different positions is transformed nonlinearly, and then trained again using layer normalization and residual connections. Logical information is generated through output transformation. S23. Through thought distillation, extract the answer from the logical information and remove the reasoning process from the logical information to obtain concise information; S3. Using an AI teacher model, perform multi-dimensional scoring on concise information, and filter concise information based on the scoring results to construct a training dataset; S3 includes: S31. Based on the pre-acquired initial information, external knowledge, and concise information, a scoring information is formed; S32. Utilize an AI teacher model to evaluate the scoring information from multiple dimensions and generate scoring results for each dimension. S33. Based on the scoring results of each dimension, calculate the comprehensive score, and set the filtering threshold according to the comprehensive score to filter concise information and construct the training dataset; The formula for calculating the comprehensive score is as follows: ; In the formula, S This indicates the overall score; w i This represents the weighting coefficient for each rating dimension; x This indicates the initial information obtained in advance; y To convey concise information; i This represents each rating dimension; s i ( x , y ) indicates the first i The scoring results for each dimension.

2. The method for constructing training data in the financial field based on a dual feedback mechanism according to claim 1, characterized in that, The process of scoring the comprehensive information using a pre-trained evaluation model and filtering the comprehensive information based on the comparison between the scoring results and a preset scoring threshold includes the following steps: Construct and train a rerank model, and use the trained rerank model to score the concatenated comprehensive information in turn to obtain several score results. Set a scoring threshold and determine whether the scoring result of the comprehensive information is greater than or equal to the scoring threshold. If so, retain the comprehensive information corresponding to the scoring result. If not, trigger the feedback mechanism to adjust the external knowledge retrieval and mind chain prompts.

3. The method for constructing training data in the financial field based on a dual feedback mechanism according to claim 1, characterized in that, The process of retrieving knowledge fragments from an external knowledge base based on pre-acquired initial information and using retrieval enhancement generation technology to obtain external knowledge includes the following steps: An external knowledge base is built based on pre-acquired financial knowledge. Based on the pre-acquired initial information, knowledge fragments are retrieved from external knowledge bases using text matching and semantic similarity calculation methods. Select the knowledge fragments with the highest similarity to form external knowledge.

4. The method for constructing training data in the financial field based on a dual feedback mechanism according to claim 3, characterized in that, The formula for calculating semantic similarity is: ; In the formula, sim( x , k () represents semantic cosine similarity; k This represents the candidate documents in the database; x This indicates the initial information obtained in advance.

5. The method for constructing training data in the financial field based on a dual feedback mechanism according to claim 4, characterized in that, The calculation formula for concatenating initial information, external knowledge, and thought chain prompts is as follows: ; In the formula, ⊕ represents the splicing operation; Indicates comprehensive information; D Represents retrieved external knowledge; P CoT These are thought chain prompts.

6. The method for constructing training data in the financial field based on a dual feedback mechanism according to claim 1, characterized in that, The calculation formula for the self-attention mechanism is as follows: ; In the formula, Q Represents the query vector; K Represents the key vector; V Represents a value vector; d k Represents the vector dimension; T represents the transpose of the matrix; Attention( Q , K , V ) represents the attention score of a word sequence at any position relative to other positions.

7. The method for constructing training data in the financial field based on a dual feedback mechanism according to claim 1, characterized in that, The calculation of the comprehensive score and the setting of the filtering threshold based on the comprehensive score include the following filtering rules for concise information: when the comprehensive score is greater than or equal to the set threshold, the corresponding concise information is used as training data.

Citation Information

Patent Citations

  • Pretraining language model-based common sense question and answer method and system

    CN116842157A

  • Financial field large model training method and system based on multi-dimensional data evaluation

    CN117952185A