A method, device, and medium for generating thought chain data
By constructing a semantic topology network for a specific domain and employing knowledge distillation techniques, high-quality thought chain data is generated, solving the problem of insufficient knowledge fusion in specific domains and improving the model's reasoning ability and data generation efficiency in professional fields.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ZHEJIANG LAB
- Filing Date
- 2026-01-27
- Publication Date
- 2026-04-21
AI Technical Summary
Existing thought chain data mainly focuses on general common sense or open-domain problems, lacking deep integration with specific domain knowledge systems, making it difficult to support accurate understanding and high-level reasoning in professional contexts.
By constructing a semantic topology network for a specified domain, question-answer pairs are generated and knowledge distillation technology is used to generate high-quality thought chain data. This includes network construction with target text as nodes and relationships as edges, design of first and second prompt word engineering, and knowledge distillation and verification processes for the large model.
It achieves efficient integration of knowledge systems in a specified domain, generates high-quality thought chain data, and improves the model's reasoning and generalization abilities in the professional field.
Smart Images

Figure CN121581248B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of natural language processing technology, and in particular to a method, apparatus, device, and medium for generating thought chain data. Background Technology
[0002] With the widespread application of Large Language Models (LLMs) in professional fields such as healthcare, finance, law, and engineering, the demand for training customized models for specific domains is becoming increasingly urgent. Compared to general-purpose models, domain-specific models not only require high-quality question-answer pairs, but also urgently need inference-oriented training samples containing Chain-of-Thought (CoT) to effectively improve the model's step-by-step reasoning, logical analysis, and causal inference capabilities in complex tasks.
[0003] However, currently available thought chain data mainly focuses on general common sense or open-domain problems, and generally lacks a structured reasoning process that is deeply integrated with the knowledge system of a specific domain, making it difficult to support the model's accurate understanding and high-order reasoning in professional contexts.
[0004] Therefore, there is an urgent need for a data construction mechanism that can integrate domain knowledge and has good generalization ability to support efficient and low-cost training of large professional domain models. Summary of the Invention
[0005] In view of this, one aspect of this application provides a method for generating thought chain data, the method comprising:
[0006] Acquire multiple target texts in a specified field; the target texts are used to summarize and describe the core content of the corresponding documents.
[0007] Using each target text as a node and the relationship between the target texts as an edge, a semantic topology network for the specified domain is constructed.
[0008] Based on the semantic topology network, a first prompt word project is constructed; and based on the first prompt word project, question-answer pairs for the specified domain are generated by specifying a large model.
[0009] Using knowledge distillation technology, based on a pre-constructed second prompt word project, intermediate reasoning representations for each question-answer pair are generated through the specified large model to obtain initial thought chain data;
[0010] The initial thought chain data is verified to obtain the target thought chain data.
[0011] Optionally, constructing a semantic topology network for the specified domain, using each target text as a node and the relationships between the target texts as edges, includes:
[0012] Extract the domain entities of the target text; the domain entities are the core terms of the target text.
[0013] Determine the overlap of domain entity pairs between different target texts; the overlap is used to characterize the degree of similarity of the domain entity pairs; the overlap is positively correlated with the degree of similarity.
[0014] Determine the similarity between different target texts; the similarity is used to characterize the degree of semantic similarity between different target texts, and the similarity is positively correlated with the degree of semantic similarity;
[0015] Using the target text as nodes, and constructing edges between the nodes based on the overlap and similarity, the semantic topology network is obtained.
[0016] Optionally, constructing the edges between the nodes based on the overlap and the similarity includes:
[0017] Extract the target overlap that is greater than the overlap threshold; and use the edges between the node pairs corresponding to the target overlap as specific edges;
[0018] Extract the target similarity values that are greater than the similarity threshold; and use the edges between the node pairs corresponding to the target similarity values as abstract edges;
[0019] The edges between the nodes are constructed using the concrete edges and the abstract edges;
[0020] Determine if there exists a target node pair that includes both concrete and abstract edges;
[0021] If an abstract edge exists, remove the target node pair.
[0022] Optionally, the construction of the first prompt word project based on the semantic topology network includes:
[0023] Obtain a pre-built initial prompt word project, as well as preset domain expert roles, question types, and question lengths for the specified domain;
[0024] From the semantic topology network, a first path consisting of two concrete edges and a second path consisting of two abstract edges are selected.
[0025] Based on the first path and the second path, construct the problem focus for guiding model reasoning;
[0026] The question type, question length, domain expert role, and question focus constitute the question-and-answer scenario that guides the model's reasoning.
[0027] The target text corresponding to the question-and-answer scenario and the question focus is injected into the initial prompt word project to obtain the first prompt word project.
[0028] Optionally, constructing the problem focus point to guide model reasoning based on the semantic information in the first path and the second path includes:
[0029] Take any domain entity corresponding to the target overlap in the first path as the first problem focus point;
[0030] The target texts containing edges in the second path are merged to obtain merged text; and the merged text is used as the focus of the second problem.
[0031] The problem focus is formed by the first problem focus and the second problem focus.
[0032] Optionally, the construction of the second prompt word project includes:
[0033] Obtain a pre-built initial prompt word project;
[0034] Extract the questions from the question-and-answer pairs; and use the target text used to generate the question-and-answer pairs as reference text;
[0035] The question and the reference text are injected into the initial prompt word project as input data for the initial prompt word project;
[0036] Based on the reference text, a reasoning answer corresponding to the question, including the initial thought chain data, is generated, which serves as the data generation rule for the initial prompt word project, thus obtaining the second prompt word project.
[0037] Optionally, the step of validating the initial thought chain data to obtain the target thought chain data includes:
[0038] Obtain a pre-built third-party prompt word project;
[0039] Based on the aforementioned third prompt word project, the first major model is used to perform specified verification on the question-answer pair and the reasoned answer; the specified verification includes answer consistency verification, thought chain verification, and answer integrity verification;
[0040] The answer consistency check includes checking the semantic consistency between the first answer in the question-answer pair and the second answer in the corresponding reasoned answer;
[0041] The thought chain verification includes at least verifying the logic and coherence of the initial thought chain data;
[0042] The answer integrity verification includes verifying whether the first answer, the second answer, and the initial thought chain data completely solve the problem.
[0043] Optionally, after verifying the initial thought chain data to obtain the target thought chain data, the method further includes:
[0044] The target thought chain data and the corresponding question-and-answer pairs are used to form a target array;
[0045] Obtain human ratings for the target array; and perform a quality assessment on the target array using a second major model to obtain an evaluation score;
[0046] Remove the arrays containing the manual scores and / or the evaluation scores that are less than the score threshold from the target array;
[0047] The specified large model is fine-tuned and trained using the target array to obtain the target large model; and the specified downstream task is executed using the target large model to evaluate the quality of the target array.
[0048] Optionally, obtaining multiple target texts in a specified domain includes:
[0049] Obtain multiple documents in the specified field;
[0050] Extract target metadata information from the document; the target metadata information includes at least one of the following: title, author, keywords, abstract, publication date, and publication.
[0051] Based on the target metadata information, determine whether the document belongs to the specified field;
[0052] If it does not belong to the category, the aforementioned literature will be removed;
[0053] If so, proceed with the following steps:
[0054] Extract initial text from each of the aforementioned documents to describe the core content;
[0055] The initial text is preprocessed to obtain the target text; the preprocessing includes converting the format to a specified format, removing specified content and text with a byte length less than a preset length; the specified content includes at least one of the following: header, footer, acknowledgments, citations, special characters, garbled characters, and tags for non-specified content.
[0056] Another aspect of this application provides a mind chain data generation apparatus, the apparatus comprising:
[0057] The target text acquisition module is used to acquire multiple target texts in a specified field; the target texts are used to summarize and describe the core content of the corresponding documents.
[0058] The network construction module is used to construct a semantic topology network for the specified domain, with each of the target texts as nodes and the relationships between the target texts as edges.
[0059] The question-answer pair generation module is used to construct a first prompt word project based on the semantic topology network; and based on the first prompt word project, generate question-answer pairs for the specified domain by specifying a large model;
[0060] The thought chain generation module is used to generate intermediate reasoning representations for each question-answer pair by employing knowledge distillation technology, based on a pre-built second prompt word project, through the specified large model, to obtain initial thought chain data;
[0061] The thought chain verification module is used to verify the initial thought chain data to obtain the target thought chain data.
[0062] Another aspect of this application provides an electronic device including a memory and a processor, wherein the memory stores a computer program executable on the processor, and the processor executes the computer program to implement the steps of the method for generating the thought chain data.
[0063] Another aspect of this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method for generating the thought chain data.
[0064] The method, apparatus, device, and medium for generating thought chain data provided in this application have the following beneficial effects: by constructing a semantic topology network with target text as nodes, a knowledge system of a specified domain is integrated, and the structural advantages of the semantic topology network and the generative capabilities of large models are combined to efficiently and accurately generate high-quality target thought chain data that meets the needs of a specified domain, thereby improving the generation efficiency of professional domain data, enhancing the reasoning and generalization capabilities of the model, and having broad application prospects. Attached Figure Description
[0065] Figure 1 A flowchart illustrating a method for generating thought chain data provided in an embodiment of this application;
[0066] Figure 2 This is a schematic diagram of the structure of a semantic topology network provided in an embodiment of this application;
[0067] Figure 3 A schematic diagram illustrating the principle of mind chain data evaluation provided in an embodiment of this application;
[0068] Figure 4A schematic diagram illustrating the results of a specified large model performing different downstream tasks, provided in an embodiment of this application.
[0069] Figure 5 This is a schematic diagram illustrating the extraction result of target metadata information provided in an embodiment of this application;
[0070] Figure 6 A schematic diagram of a mind chain data generation device provided in an embodiment of this application;
[0071] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.
[0072] The attached diagram is labeled as follows: 60 is the target text acquisition module, 61 is the network construction module, 62 is the question-answer pair generation module, 63 is the thought chain generation module, 64 is the thought chain verification module, 70 is the memory, 71 is the processor, 72 is the display screen, 73 is the input / output interface, 74 is the communication interface, 75 is the power supply, 76 is the communication bus, 701 is the computer program, 702 is the operating system, and 703 is the data. Detailed Implementation
[0073] The terminology used in this application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. The singular forms “a,” “the,” and “the” used in this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any or all possible combinations of one or more of the associated listed items.
[0074] It should be understood that although the terms first, second, third, etc., may be used in this application to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, without departing from the scope of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to determination."
[0075] Figure 1 This is a flowchart illustrating a method for generating thought chain data provided in an embodiment of this application, as shown below. Figure 1 As shown, the method includes:
[0076] S10: Obtain multiple target texts in a specified field; the target texts are used to summarize and describe the core content of the corresponding documents.
[0077] In a specific embodiment, obtaining high-quality thought chain data in a certain field inevitably requires acquiring a large amount of relevant knowledge about that technical field. This typically involves collecting a large amount of text related to that technical field, manually annotating keywords in the text to construct a knowledge graph, and then using the semantic information in the knowledge graph to generate thought chain data.
[0078] However, this method involves time-consuming and labor-intensive manual annotation, resulting in lower accuracy. Furthermore, missing keywords may prevent the complete presentation of the document's core content, leading to lower completeness and accuracy of the thought process.
[0079] To address the aforementioned technical problems, this application provides a method for generating thought chain data, specifically, acquiring multiple target texts within a specified domain. To ensure the quality of the thought chain data, the specified domain cannot be too broad; therefore, the specified domain belongs to a sub-domain of a specific domain, i.e., it is a domain within a preset range. For example, Earth Science includes eight sub-domains (geology, physical geography, geophysics, geochemistry, oceanography, atmospheric science, environmental earth science, and applied geoscience). Therefore, for the specific domain of Earth Science, any one of these eight sub-disciplines can be used as the specified domain.
[0080] Furthermore, regarding the target text, to ensure the completeness and accuracy of the thought chain data, the target text refers to the text used to describe the core content of the corresponding document. For example, the target text could be an abstract, and the corresponding document could be a research paper. Understandably, the target text highly summarizes the core content of the document, thereby ensuring that the key content of the document is used for the generation of the thought chain data.
[0081] It should be noted that the documents in this application's embodiments include, but are not limited to, any form of text or graphic carrier such as books, academic papers, journal articles, research reports, technical manuals, and patent specifications; this application does not impose any limitations on this. The target text is, but is not limited to, an abstract, summary, synopsis, or core content description; this application also does not impose any limitations on this, as long as it can describe the core content of the corresponding document.
[0082] S11: Construct a semantic topology network for a specified domain, using each target text as a node and the relationships between target texts as edges;
[0083] Figure 2 This is a schematic diagram of a semantic topology network provided in an embodiment of this application. After obtaining the target text, the target text is further used as nodes and the relationships between the target texts are used as edges to construct a structured semantic topology network for the specified domain.
[0084] In an alternative embodiment, circles are used to represent target text (i.e., nodes), and two nodes with a relationship are connected by undirected line segments, resulting in... Figure 2 The semantic topology network shown is as follows. It should be noted that the semantic topology network in this application uses the entire target text as nodes, and the relationship between nodes can be that the semantic similarity between target texts reaches a threshold, or that the number of identical words between target texts reaches a specified number. This application does not limit the way to determine the relationship between two nodes, as long as two related target texts (i.e., nodes) are connected and identified in the form of line segments.
[0085] S12: Construct a first prompt word project based on a semantic topology network; and based on the first prompt word project, generate question-answer pairs for a specified domain by specifying a large model;
[0086] S13: Using knowledge distillation technology, based on a pre-built second prompt word project, and through a specified large model, intermediate reasoning representations of each question-answer pair are generated to obtain initial thought chain data;
[0087] S14: Verify the initial thought chain data to obtain the target thought chain data.
[0088] Understandably, semantic topology network fusion describes the relevant knowledge of the entire specified domain. At this point, a first prompt word project can be constructed based on the semantic topology network, and this first prompt word project can be used to guide the specified large model in reasoning, generating question-answer pairs about the specified domain.
[0089] Furthermore, a large-scale model knowledge distillation technique is employed. Based on a pre-constructed second prompt word project, the intermediate reasoning process of question-answer pairs is generated through this designated large-scale model, thereby obtaining initial thought chain data. To ensure the quality of the thought chain data, the initially generated thought chain data is validated to remove low-quality data and obtain the target thought chain data.
[0090] Knowledge distillation is a model compression technique that uses a "teacher-student" architecture to transfer knowledge from a large model to a smaller model. The core idea of knowledge distillation is to allow the smaller model (student) to learn the soft targets output by the larger model (teacher), rather than simply learning the hard labels of the original data. In specific implementations, by continuously distilling the answers in question-answer pairs, further reflection is achieved, resulting in high-quality thought chain data.
[0091] It should be noted that the designated large model can include, but is not limited to, Qwen, Kimi Chat, the GPT series, and Deepseek; this application does not impose any restrictions on the designated large model. Furthermore, it should be noted that when validating the initial thought chain data, the large model can also be used for validation to verify whether the logic, coherence, and accuracy of the initial thought chain data meet the requirements.
[0092] Therefore, the method for generating thought chain data provided in this application uses target text as nodes to construct a semantic topology network, realizes the integration of knowledge systems in a specified domain, and combines the structural advantages of semantic topology networks with the generative capabilities of large models to efficiently and accurately generate high-quality target thought chain data that meets the needs of a specified domain. This improves the generation efficiency of professional domain data, enhances the reasoning and generalization capabilities of the model, and has broad application prospects.
[0093] In one optional embodiment, a semantic topology network for a specified domain is constructed, using each target text as a node and the relationships between target texts as edges, including:
[0094] Extract the domain entities from the target text; domain entities are the core terms of the target text.
[0095] Determine the overlap of domain entity pairs between different target texts; overlap is used to characterize the degree of similarity between domain entity pairs; overlap is positively correlated with the degree of similarity.
[0096] Determine the similarity between different target texts; similarity is used to characterize the degree of semantic similarity between different target texts, and similarity is positively correlated with the degree of semantic similarity;
[0097] Using the target text as nodes, and constructing edges between nodes based on overlap and similarity, a semantic topology network is obtained.
[0098] like Figure 2 As shown, each node is injected with the target text, meaning a semantic topology network is constructed using the target text as the unit. In this semantic topology network, the existence of relationships between nodes is crucial. For the target text, the entire passage already summarizes the core content of the corresponding document; therefore, there is almost no redundant content in the target text, meaning the entire target text is important. Furthermore, the keywords in the target text are highly relevant to the specified field.
[0099] Based on the above analysis, to ensure the accuracy of node relationships in the semantic topology network and the precision of the thought chain data, in one optional embodiment, domain entities are extracted from the target text. Domain entities refer to keywords that can describe a specified domain; that is, domain entities are the core terms of the target text. In another optional embodiment, the domain entities are injected as node attributes into the corresponding target text nodes.
[0100] Table 1 shows a correspondence between target text and domain entities provided in the embodiments of this application. For ease of understanding, the following explanation will be based on Table 1. Specifically, taking geology as the specified domain and the target text as the abstract of the corresponding document as an example, the explanation will be provided below.
[0101] Table 1. A mapping table between target text and domain entities.
[0102]
[0103] Referring to Table 1, for each summary, words highly relevant to a specified domain can be extracted as domain entities. These domain entities can be words, phrases, short sentences, or even English words, etc., and this application does not impose any limitations on this. It should be noted that, to ensure the semantic richness and completeness of the semantic topology network, in one optional embodiment, the number of domain entities extracted from each target text is no less than a preset number, for example, no less than 5. Furthermore, for different target texts, the same number of domain entities can be extracted, or different numbers of domain entities can be extracted, and this application does not impose any limitations on this either.
[0104] Furthermore, in order to construct edges between target texts, the overlap of domain entity pairs between different target texts is determined, that is, the degree of similarity between different domain entity pairs is determined. For example, for the two summaries numbered 1 and 3 in Table 1, the corresponding domain entities have the exact same "mineralization", so obviously the overlap of these two domain entities reaches 1, that is, they are exactly the same.
[0105] It should be noted that when determining the overlap, the domain entities of different target texts are combined pairwise to calculate multiple overlaps. For example, the overlap of the 5 domain entities corresponding to number 1 and the 5 domain entities corresponding to number 3 in Table 1 is calculated pairwise. In an optional embodiment, the overlap can also be determined using a large model. This application does not specifically limit the method for determining the overlap.
[0106] Meanwhile, for different target texts, the core content of the corresponding documents is summarized. Edges between nodes can be constructed by determining the semantic similarity between two target texts. Specifically, the similarity between target texts of different nodes can be determined using a Sentence-Transformers model or an all-MiniLM-L6-v2 model. This involves encoding the target text of each node to obtain a semantic vector space, and then calculating the cosine similarity of the semantic vector space as the similarity measure representing the semantic similarity between different target texts.
[0107] It is understandable that by determining the overlap of domain entities and the similarity of target text between two nodes, it is possible to determine whether a relationship exists between the nodes that meets certain conditions. It is possible that at least one of the overlap and similarity reaches a corresponding preset value to determine the existence of a relationship between the nodes and to construct an edge; this application does not limit this.
[0108] Based on the above embodiments, as an optional embodiment, edges between nodes are constructed according to overlap and similarity, including:
[0109] Extract the target overlap that is greater than the overlap threshold; and use the edges between the node pairs corresponding to the target overlap as the specific edges;
[0110] Extract the target similarity with a similarity greater than a similarity threshold; and use the edges between the node pairs corresponding to the target similarity as abstract edges;
[0111] Edges between nodes are constructed using concrete edges and abstract edges;
[0112] Determine if there exists a target node pair that includes both concrete and abstract edges;
[0113] If they exist, remove the abstract edges between the target node pairs.
[0114] In a specific embodiment, overlap reflects the degree of similarity between pairs of domain entities, and there is a positive correlation between overlap and similarity; that is, the greater the overlap, the higher the degree of similarity. In an optional embodiment, when the overlap is equal to 1, it indicates that the two domain entities are completely identical.
[0115] Understandably, in a structured semantic topology network, edges between nodes are used to represent the relationship between two nodes; that is, edges between nodes can accurately express the knowledge system included in the structure. Therefore, in order to ensure that the semantic topology network accurately expresses the knowledge context and relationships between specified domains, in one optional embodiment, a target overlap greater than an overlap threshold is extracted. For example, a target overlap greater than 0.7 is extracted, and the edges between node pairs corresponding to the target overlap are taken as specific edges.
[0116] Specifically, the edges represent strong associations between corresponding node pairs of domain entities. For example, for Figure 2 The semantic topology network shown, and for nodes numbered 3 and 6 in Table 1, contain the exact same domain entity "deposition phase," therefore, there is a concrete edge between node 1 and node 6. In an optional embodiment, as... Figure 2 As shown, solid lines are used to represent specific edges. Of course, line segments of a specified color can also be used, and this application does not limit this.
[0117] Furthermore, it's understandable that similarity reflects the degree of semantic similarity between two target texts, and there's a positive correlation between similarity and semantic similarity. Therefore, a higher similarity indicates greater similarity between the two target texts, meaning there's a high correlation between the knowledge in the corresponding documents.
[0118] Therefore, to further express the knowledge architecture between semantic topological networks, knowledge from the entire specified domain is integrated. As an optional implementation, target similarities with similarity greater than a similarity threshold are extracted, for example, target similarities greater than 0.5 are extracted, and the edges between node pairs corresponding to the target similarities are used as abstract edges.
[0119] Abstract edges are used to represent strong semantic relationships between corresponding nodes, for example, for Figure 2 The semantic topology network shown, and summaries numbered 3 and 4 in Table 1, indicate a high degree of semantic correlation between the two summaries; therefore, an abstract edge is constructed between nodes 3 and 4. In an alternative embodiment, as... Figure 2 As shown, abstract edges are represented using dashed lines. Of course, line segments of a different color than concrete edges can also be used, and this application does not limit this.
[0120] Table 2 is a schematic table illustrating the determination results of specific edges and abstract edges provided in the embodiments of this application. For ease of understanding, the following will be combined with... Figure 2 The following explanations are provided in Tables 1 and 2.
[0121] Table 2 is a schematic diagram of the determination results for concrete edges and abstract edges.
[0122]
[0123] As shown in Table 1, in the above Table 1 and Figure 2In the example shown, the overlap between domain entity pairs of different nodes and the semantic similarity between different target texts are calculated, resulting in the results shown in Table 1. Different variant types can be determined based on overlap and similarity. When two nodes form both a concrete edge and an abstract edge, only the concrete edge is retained. At the same time, the edge attribute value (i.e., overlap or similarity) is injected into the node as attribute information.
[0124] Furthermore, based on Table 2, we can construct as follows: Figure 2 The structured semantic topology network is shown. It should be noted that some nodes may have both concrete and abstract edges. Concrete edges, constructed with the same degree of dependence on domain entities, have a stronger semantic strength representing the association between two nodes than abstract edges. Therefore, abstract edges can be removed, retaining only concrete edges. Alternatively, both types of edges can be retained, ensuring that only one is chosen for retention; this application does not impose any restrictions on this.
[0125] In one optional embodiment, a first prompt word project is constructed based on a semantic topology network, including:
[0126] Obtain a pre-built initial prompt word project, as well as preset domain expert roles, question types, and question lengths for a specified field;
[0127] From the semantic topology network, select the first path consisting of two concrete edges and the second path consisting of two abstract edges;
[0128] Based on the first and second paths, construct the problem focus to guide the model's reasoning;
[0129] The question-and-answer scenario that guides the model's reasoning is constructed by considering the question type, question length, domain expert roles, and question focus.
[0130] The target text corresponding to the question-and-answer scenario and the focus of the question is injected into the initial prompt word project to obtain the first prompt word project.
[0131] In a specific embodiment, a structured semantic topology network is combined with a large model to automatically generate question-and-answer pairs, thereby automatically generating high-quality question-and-answer pairs. That is, based on the semantic topology network, high-quality professional question-and-answer pairs are generated through a multi-expert collaborative question-and-answer scenario.
[0132] Specifically, firstly, based on the characteristics of the specified field, domain expert roles with role descriptions are pre-constructed. For example, for the specified field of geology, the domain expert role that can be constructed is "geologist". It can also be understood that expert roles are assigned according to "professional fields". For example, for the Earth Science discipline, which includes 8 second-level sub-disciplines, there will be 8 corresponding expert roles in the question-and-answer generation scenario, with each expert role responsible for one second-level sub-discipline of Earth Science.
[0133] Furthermore, for question-and-answer scenarios in different designated domains, question types and lengths can be preset. Question types include, but are not limited to, factual, inference, application, evaluation, explanation, comparison, and prediction. Question lengths include, but are not limited to, long, medium-long, and short questions.
[0134] Furthermore, question focal points are constructed for the pre-built initial prompt word project. The main goal of constructing these question focal points is to ensure that the generated question-answer pairs focus on a specified range. To generate high-precision question focal points for a specific domain, a semantic topology network is used for construction.
[0135] Specifically, multi-hop concrete problems and multi-hop abstract problems are selected from the semantic topology network. Multi-hop concrete problems refer to the first path in the semantic topology network consisting of two concrete edges, i.e., multi-hop node pairs. Multi-hop abstract problems refer to the second path in the semantic topology network consisting of two abstract edges, i.e., multi-hop node clusters (with a maximum depth of 3) connected by abstract edges. For example, ... Figure 2 As shown, the first path can be composed of nodes 1, 3 and 6, and the second path can be composed of nodes 3, 4 and 5.
[0136] It should be noted that the first path can be a path composed of multiple concrete edges, while the second path is a path composed of multiple abstract edges. However, it is understandable that the longer the path, the more difficult it is to locate the focus of the question, which is detrimental to the accuracy of subsequent question-and-answer pairs. Therefore, in this embodiment, the depth of both the first and second paths is set to 2.
[0137] Additionally, it should be noted that, in order to ensure the fairness and accuracy of the question-and-answer pairs, the ratio of the number of questions extracted from the first path and the second path is a specified ratio, that is, the ratio of multi-hop specific questions to multi-hop abstract questions is a specified ratio, for example, a one-to-one ratio, to ensure that the two types of questions are evenly distributed.
[0138] Furthermore, based on the first and second paths, a problem focus point is constructed to guide the model's reasoning. In an optional embodiment, the problem focus point can be determined based on the semantic information included in the first and second paths, wherein the semantic information may include, but is not limited to, the core content of the entire text, a phrase, a sentence, or a domain entity, and this application does not limit this. For example, for the first path consisting of nodes 1, 3, and 6, "mineralization" can be used as the problem focus point.
[0139] Furthermore, by defining the question type, question length, domain expert roles, and question focus, a question-and-answer scenario is constructed to guide the model's reasoning. The target text corresponding to the question-and-answer scenario and the question focus is then injected into the initial prompt word project, resulting in the first prompt word project. Based on this first prompt word project, the model can be instructed to perform reasoning to generate high-quality question-and-answer pairs for a specified domain.
[0140] Based on the above embodiments, as an optional embodiment, a problem focus point for guiding model reasoning is constructed according to the semantic information in the first path and the second path, including:
[0141] Take any domain entity corresponding to the target overlap in the first path as the first problem focus point;
[0142] The target texts containing edges in the second path are merged to obtain the merged text; and the merged text is used as the focus of the second problem.
[0143] The first and second problem focal points together constitute the problem focal point.
[0144] In specific embodiments, it can be understood that a problem focus point refers to a core and critical specific problem identified through decomposition, evaluation, and screening when analyzing a complex and broad problem domain. Therefore, determining the problem focus point is crucial for generating high-quality question-answer pairs.
[0145] Therefore, in one optional embodiment, after determining the first path composed of specific edges, the problem focus is set as any one of the domain entities in the target overlap. For example, for the first path composed of nodes 1, 3, and 6, "mineralization" can be used as the first problem focus. That is, for multi-hop specific problems, the problem focus is the list of overlapping domain entities.
[0146] For the second path, a large model can be used to fuse the two target texts, resulting in a fused text. This fused text then serves as the focus of the second problem. In other words, for multi-hop abstract problems, the focus is on the paper abstract, which is then summarized and generalized using a large model, resulting in a fused text. To facilitate understanding, an example of the first prompt word project will be provided below.
[0147] For example, for Figure 2 The first prompt word project constructed using nodes 1 and 3 shown is as follows:
[0148] Generate a multi-hop question and answer based on specified criteria (expert role, question focus, question type, question length) and provided target text. The question focus is a sentence or phrase extracted or generated from the context that highlights the suitability of the selected target text for creating a multi-hop question.
[0149] Instructions:
[0150] 1. Generate a multi-hop question: Use the provided target text and question focus to construct a question that requires combining information from multiple target texts. Ensure the question clearly reflects the relevance of the question focus to the target text. The question should be phrased in a way that naturally aligns with the perspective of an expert without explicitly mentioning their role or identity.
[0151] 2. Generate Answer: Create a detailed and faithful answer using only the provided target text. Avoid adding information that is not directly present in the given target text or cannot be inferred from it.
[0152] Questions and answers are generated based on the following conditions:
[0153] Expert Role: {"Expert Title": "Geologist", "Role Responsibilities": "Studies the Earth's material composition, internal structure, surface features, and geological processes. Uses geological exploration and analysis tools to investigate rock strata, earthquakes, volcanic activity, and tectonic movements. Their work aims to understand the Earth's history, the physical and chemical processes within the Earth, and the interactions between the Earth's different spheres."}
[0154] The focus of the issue: "Metallogenesis"
[0155] Question type: Reasoning
[0156] Question Length: "Long Question"
[0157] Context: {"Target Text 1": "This study explores the mineralization mechanism controlled by sedimentary facies through geochemical analysis and sedimentological methods. It focuses on analyzing the migration and settling patterns of ore-forming fluids during diagenesis, as well as the influence of alteration on mineral enrichment. The results show that sedimentary facies zones determine the initial distribution of ore-forming fluids, while diagenetic evolution promotes the activation and enrichment of useful elements. Through case studies, we establish a coupled model of sedimentary diagenesis and mineralization processes, providing a new theoretical framework for the exploration and evaluation of sedimentary deposits."} "Target Text 2": "This thesis systematically studies the genetic mechanisms of different types of sedimentary basins and their controlling effect on mineral resource enrichment. Based on basin infilling sequences and sedimentary facies analysis, we establish a coupled model of sedimentary environment evolution and mineralization. The study shows that basin basement properties, subsidence rates, and provenance supply jointly determine reservoir quality and distribution patterns. Through analysis of diagenesis and mineralization time series, a theoretical framework for multi-stage mineralization within sedimentary basins is proposed, providing new guidance for resource exploration."}
[0158] Please follow the instructions above to generate questions and answers.
[0159] Therefore, the method for generating thought chain data provided in this application proposes a multi-expert collaborative question-and-answer generation mode driven by semantic topology network. By automatically constructing a semantic topology network for papers and an expert role matching mechanism, it solves the problem of balancing the accuracy of professional terminology expression with the diversity of generation.
[0160] In one alternative embodiment, constructing a second prompt word project includes:
[0161] Obtain a pre-built initial prompt word project;
[0162] Extract the questions from the question-and-answer pairs; and use the target text used to generate the question-and-answer pairs as the reference text;
[0163] Inject the question and reference text into the initial prompt word project as input data for the initial prompt word project;
[0164] Based on the reference text, the reasoning answer corresponding to the question, including the initial thought chain data, will be generated as the data generation rule for the initial prompt word project, thus obtaining the second prompt word project.
[0165] Building upon the high-quality question-and-answer pairs generated in the above embodiments, a model-based knowledge distillation technique is employed to automatically synthesize reasoning data containing logical thought processes using a specified large model—that is, to generate thought chain data. Simultaneously, it is necessary to ensure the consistency of the final answers. In a specific embodiment, based on a pre-constructed second prompt word project, intermediate reasoning identifiers for question-and-answer pairs are generated using a specified large model, thereby obtaining the initial thought chain data.
[0166] In a specific embodiment, the second prompt word engineering is crucial to the quality of the generated thought chain data. In one alternative embodiment of constructing the second prompt word engineering, thought distillation generation includes determining input data, prompt word engineering design, and setting data generation rules.
[0167] In this process, questions are extracted from the question-and-answer pairs generated in the above embodiments, and the target text corresponding to the generation of the question-and-answer pair is used as the reference text, that is, the corresponding paper abstract is used as the reference text. Thus, the questions and reference text are used as input data for the prompt word project and injected into the pre-constructed initial prompt word project.
[0168] Additionally, the data generation rules in the prompt word project are set to generate inference answers corresponding to the question, including the initial thought chain data, based on the reference text. In other words, the model output data must contain a complete inference chain.
[0169] When designing a prompt word project, it's important to note that the initial prompt word project still needs to be configured with the domain expert role, and a detailed step-by-step reasoning process must be generated. For ease of understanding, the second prompt word project will be illustrated below with an example.
[0170] For example, for Figure 2 The second prompt word project constructed using nodes 1 and 3 shown is as follows:
[0171] You are a reasoning expert in your field. Analyze the given reference text and question, and then provide:
[0172] 1. A step-by-step reasoning process based on scientific principles.
[0173] 2. A final answer with explicit evidence from the reference text.
[0174] The data generation rules are as follows:
[0175] 1. Extract key evidence from the reference text to support each step of the reasoning.
[0176] 2. The reasoning process must be logically clear and avoid jumps.
[0177] 3. Finally, provide an answer based on reasoning.
[0178] The input data is:
[0179] [Reference Text 1]
[0180] This study explored the mineralization mechanism controlled by sedimentary facies using geochemical analysis and sedimentological methods. The focus was on analyzing the migration and precipitation patterns of ore-forming fluids during diagenesis, as well as the impact of alteration on mineral enrichment. The results show that sedimentary facies zones determine the initial distribution of ore-forming fluids, while diagenetic evolution promotes the activation and enrichment of useful elements. Through a case study, we established a coupled model of sedimentary, diagenetic, and mineralization processes, providing a new theoretical framework for the exploration and evaluation of sedimentary deposits.
[0181] [Reference Text 2]
[0182] This dissertation systematically studies the genetic mechanisms of different types of sedimentary basins and their controlling effect on mineral resource enrichment. Based on basin infilling sequences and sedimentary facies analysis, we established a coupled model of sedimentary environment evolution and mineralization. The study shows that the properties of the basin basement, subsidence rate, and provenance supply jointly determine the quality and distribution patterns of the layers. Through diagenesis and mineralization time-series analysis, we propose a theoretical framework for multi-stage mineralization within sedimentary basins, providing new guiding principles for resource exploration.
[0183] [question]
[0184] "Based on the evolution of sedimentary basins and sedimentary facies analysis, how can the migration and precipitation patterns of ore-forming fluids during diagenesis explain the mechanisms of multi-stage mineralization within sedimentary basins? Furthermore, how do the control of sedimentary facies zones on the initial distribution of ore-forming fluids, together with basin basement properties, subsidence rates, and sediment supply, influence mineral resource enrichment?"
[0185] Therefore, the method for generating thought chain data provided in this application embodiment designs an automatic synthesis technology for thought chain data based on knowledge distillation, and generates detailed reasoning processes in professional fields through large models, thus breaking through the bottleneck of the scarcity of thought chain data in professional fields.
[0186] In one optional embodiment, the initial thought chain data is validated to obtain the target thought chain data, including:
[0187] Obtain a pre-built third-party prompt word project;
[0188] Based on the third prompt word engineering, the first major model is used to perform specified verification on question-answer pairs and inference answers; the specified verification includes answer consistency verification, thought chain verification, and answer integrity verification;
[0189] Among them, the answer consistency check includes checking the semantic consistency between the first answer in the question-answer pair and the second answer in the corresponding reasoning answer;
[0190] The validation of the thought chain includes at least validating the logic and coherence of the initial thought chain data;
[0191] Answer integrity verification includes verifying whether the first answer, the second answer, and the initial thought chain data completely solve the problem.
[0192] In a specific embodiment, in order to ensure the quality of the generated thought chain data, it is necessary to verify the generated initial thought chain data to ensure that the answers generated in the question-answer pair are consistent with the answers generated by reasoning from the thought chain data.
[0193] Specifically, in one optional verification embodiment, the constructed third prompt word project, through the first major model, performs answer consistency verification, thought chain verification, and answer integrity verification on the question-answer pair and the inference answer. The first major model can be the same major language model as the specified major model in the above embodiments, or it can be a different major language model; this application does not limit this.
[0194] It should be noted that, in the specified verification, answer consistency verification refers to verifying the semantic consistency between the first answer in the question-answer pair and the second answer in the corresponding inference answer. That is, comparing the original answer generated based on the semantic topology network with the answer generated by the inference model distillation to see if they are semantically consistent.
[0195] The validation of the thought chain includes at least verifying the logic and coherence of the initial thought chain data. That is, it involves verifying the correctness of the reasoning logic between each step of the generated thought chain data using the first major model, thereby checking whether the reasoning chain is interconnected, without contradictions or breaks. Furthermore, it also verifies the smoothness of the connection between adjacent steps, thus ensuring that the reasoning covers all aspects of the problem without significant omissions.
[0196] Answer integrity verification refers to verifying whether the first answer, the second answer, and the initial thought chain data completely solve the problem. In other words, it uses the first major model to verify whether the first answer, the second answer, and the initial thought chain data can successfully solve the problem in the corresponding question-answer pair.
[0197] In a specific embodiment, if any step in the specified verification fails, the final target thought chain data cannot be obtained; that is, the corresponding initial thought chain data is of low quality and should be discarded. For ease of understanding, the following example of the constructed third prompt word project will illustrate the specified verification of the initial thought chain data.
[0198] For example, for Figure 2 The third prompt word project constructed from nodes 1 and 3 shown is as follows:
[0199] You are an expert evaluator responsible for judging whether a response meets the quality and correctness criteria of a general reasoning task. Your evaluation must consider both the quality of the reasoning process (thought chain) and the correctness or appropriateness of the final answer.
[0200] Evaluation criteria:
[0201] 1. Correctness of the final answer (answer consistency check): Is the semantic consistency between the first answer in the question-answer pair and the second answer in the corresponding reasoning answer, or is it consistent with the expected result?
[0202] 2. Quality of the thought process (thinking chain verification): Is the reasoning logically clear, coherent, and free of major errors? Does the reasoning support the final answer in a clear and step-by-step manner?
[0203] 3. Completeness (Answer Completeness Check): Does the response adequately address all aspects of the problem?
[0204] Task: Analyze the provided response and determine whether it is "yes" or "no" based on the following criteria:
[0205] "Yes": The response meets the required criteria in terms of correctness, reasoning, and completeness.
[0206] "No": The response failed to meet one or more criteria.
[0207] Provide your evaluation in JSON format, with the following structure:
[0208] {"Answer Evaluation": "Correctness and consistency are discussed here"}
[0209] "Thought Chain Assessment": "Logic and coherence are discussed here."
[0210] "Completeness": "Evaluate here whether the response fully resolved the instruction."
[0211] "Judgment": "Yes / No"
[0212] }
[0213] Current input:
[0214] Question: "Based on the evolution process and sedimentary facies analysis of sedimentary basins, how can the migration and precipitation patterns of ore-forming fluids during diagenesis explain the mechanisms of multi-stage mineralization within sedimentary basins? Furthermore, how do the control of sedimentary facies zones on the initial distribution of ore-forming fluids, together with basin basement properties, subsidence rates, and sediment supply, influence mineral resource enrichment?"
[0215] The first answer states: "According to the target text, sedimentary facies zones determine the initial distribution of ore-forming fluids, while diagenesis promotes the activation and enrichment of useful elements, establishing a coupled model of sedimentary diagenesis and mineralization processes (target text 1). Simultaneously, a coupled model exists between sedimentary environment evolution and mineralization; basin basement properties, subsidence rate, and source supply jointly determine reservoir quality and distribution patterns. Furthermore, a theoretical framework for multi-stage mineralization within sedimentary basins is proposed through the analysis of diagenesis and mineralization timelines (target text 2). Therefore, the biogenic mechanism of multi-stage mineralization within sedimentary basins involves sedimentary facies zones controlling the distribution of ore-forming fluids, diagenesis driving element activation and enrichment, and basin evolution factors (such as basement properties, subsidence rate, and source supply) jointly regulating mineralization timelines and resource enrichment patterns."
[0216] Thought Chain Response: "As a professional reasoning expert specializing in deduction, I will analyze the problem based on the provided target text. The reasoning process is strictly based on the scientific evidence in the target text, ensuring logical coherence and clear steps. The following is the step-by-step reasoning:"
[0217] Step 1: Identifying the core and key elements of the problem: The problem focuses on the multi-stage mineralization mechanism within a sedimentary basin, involving the combined influence of sedimentary facies zones, basin basement properties, subsidence rates, and provenance supply on resource enrichment. Core concepts include sedimentary facies zones controlling fluid distribution, diagenesis driving nutrient activation, and basin evolution factors affecting reservoir quality.
[0218] Step 2: Analyze the control of sedimentary facies zones on the initial distribution of ore-forming fluids: Evidence shows that "sedimentary facies zones determine the initial distribution of ore-forming fluids" (target text 1). Inference: Characteristics of sedimentary facies zones (such as permeability differences) directly control the spatial distribution of fluids. For example, fluids aggregate in high-permeability facies zones, providing initial conditions for mineralization and leading to localized mineralization.
[0219] Step 3: Explain the driving force of fluid migration and precipitation patterns in diagenesis on mineralization: Evidence includes "the migration and precipitation patterns of ore-forming fluids during diagenesis" and "diagenetic evolution promotes the activation and enrichment of useful elements" (Target Text 1). Inference: Diagenetic physicochemical changes (such as compaction and dissolution) drive fluid migration and mineral precipitation, forming multiple phases of mineralization through multi-stage element activation.
[0220] Step 4: Correlation between sedimentary environment evolution and mineralization: Evidence suggests that "a coupled model of sedimentary environment evolution and mineralization was established based on basin infilling sequences and sedimentary facies analysis" (target text 2). Inference: Basin evolution (such as sea-level changes) leads to the interconnection of sedimentary facies zones and the redistribution of fluids, supporting the correspondence between multiple sedimentary events and different mineralization stages.
[0221] Step 5: Integrating the impact of basin basement properties, subsidence rate, and sediment supply on resource enrichment: Evidence indicates that "basin basement properties, subsidence rate, and sediment supply jointly determine reservoir quality and distribution patterns, and a multi-stage mineralization framework is proposed through analysis of diagenesis and mineralization time series" (Target Text 2). Reasoning: Basement properties control deep fluid migration paths, subsidence rate modulates the diagenetic timescale (prolonged rapid subsidence process), and sediment supply provides ore-forming materials. These three factors collectively promote phased mineralization, such as early mineralization followed by later reactivation.
[0222] Step 6: Comprehensive analysis of multi-stage mineralization mechanisms: The reasoning concludes that sedimentary facies zones control fluid distribution, diagenesis enables elemental activation and enrichment, and basin evolution factors (basement properties, subsidence rate, and sediment supply) modulate the spatiotemporal pattern, forming a coupled sedimentary-diagenetic-mineralization system, leading to multi-stage mineralization.
[0223] The second answer states: "The eigenmechanism of multi-stage mineralization within sedimentary basins is due to the initial distribution of ore-forming fluids controlled by sedimentary facies zones (target text 1), while the migration and precipitation patterns of fluids during diagenesis promote the activation and enrichment of valuable minerals (target text 1). Simultaneously, the evolution of the sedimentary environment couples with mineralization (target text 2), and the basin basement properties, subsidence rate, and sediment supply jointly determine reservoir quality and distribution patterns (reference text 2). Through the analysis of diagenesis and mineralization timelines, a multi-stage mineralization framework is formed. Therefore, the control of fluid distribution by sedimentary facies zones and the interaction of basin evolution factors (basement properties, subsidence rate, and sediment supply) modulate the temporal and spatial distribution of mineralization, leading to multi-stage enrichment of mineral resources. The final answer is based on the reasoning that multi-stage mineralization is the result of the combined effects of the sedimentary-diagenetic-mineralization coupling process and the dynamic evolution of the basin."
[0224] Therefore, the method for generating thought chain data provided in this application establishes a strict specified verification mechanism, and ensures that the generated thought chain data has high accuracy and reliability through answer semantic consistency verification and reasoning process quality assessment.
[0225] Figure 3 This is a schematic diagram illustrating the principle of a thought chain data evaluation method provided in an embodiment of this application. In an optional embodiment, after verifying the initial thought chain data to obtain the target thought chain data, the method further includes:
[0226] The target thought chain data and the corresponding question-and-answer pairs are used to form a target array;
[0227] Obtain human ratings for the target array; and use the second major model to perform quality assessment on the target array, obtaining the assessment score;
[0228] Remove arrays from the target array that contain human-rated and / or evaluation scores that are below the score threshold;
[0229] The target large model is obtained by fine-tuning the specified large model using the target array; and the specified downstream task is performed using the target large model to evaluate the quality of the target array.
[0230] In one optional embodiment, the quality of the thought chain data is evaluated through a combination of manual assessment and downstream tasks of the model. Specifically, the target thought chain data obtained after verification in the above embodiment and the corresponding question-answer pairs constitute a target array.
[0231] like Figure 3As shown in the embodiments of this application, evaluation criteria and indicators are defined. Specifically, the evaluation of thought chain data should first clarify the evaluation criteria and indicators, which is the basis for ensuring the scientific nature and objectivity of the evaluation. In one optional embodiment, the evaluation criteria are mainly used to define the characteristics that high-quality thought chain data should possess, which may include, but are not limited to, logical rationality, reasoning accuracy, step completeness, language clarity, and consistency with domain knowledge.
[0232] The corresponding evaluation indicators can be divided into two categories: qualitative and quantitative. Qualitative indicators focus on the logical consistency, coherence, and interpretability of the reasoning process. Quantitative indicators measure data quality through parameters such as accuracy, consistency score, coverage, diversity, and conciseness. By establishing a systematic set of standards and indicators, a unified judgment basis can be provided for subsequent automated evaluation and manual review, thereby ensuring the validity and usability of the thought chain data.
[0233] Based on the evaluation criteria and indicators defined above, expert scores for the target array are obtained. It should be noted that the focus of these human scores is on qualitative indicators. Quantitative indicators can be scored efficiently and accurately using a second major model. Similarly, in specific embodiments, the second major model can be the same as or a different model from the designated major model in the above embodiments; this application does not impose specific limitations on this.
[0234] Therefore, as Figure 3 As shown, in a specific embodiment for obtaining human scores, the target array is simultaneously evaluated using a second major model to obtain an evaluation score. Therefore, the target array is filtered based on the human scores and the evaluation score, resulting in a higher-quality array.
[0235] After screening, the synthesized thought chain data is added to the supervised fine-tuning process of the model for post-training. The thought chain data is evaluated by observing the model's performance on different downstream tasks. Specifically, a large model is fine-tuned and trained using a high-quality target array. After training, a specified downstream task is selected and executed using the specified large model, thereby evaluating the quality of the target array.
[0236] In one optional embodiment, downstream tasks of the model for detecting the quality of thought chain data include question-answering tasks, reasoning tasks, and translation or summarizing tasks. Question-answering tasks refer to evaluating the effectiveness of thought chains in solving complex problems by having the model answer questions and generate thought chains. Reasoning tasks refer to evaluating the model's ability to perform reasoning by generating thought chains for problems requiring multi-step reasoning. Translation or summarizing tasks refer to the use of thought chain data as background knowledge to support reasoning in multilingual or text summarizing tasks, used to evaluate its accuracy and clarity during the translation or summarizing process.
[0237] Understandably, model-based tasks alone cannot fully comprehend complex reasoning processes, especially when dealing with highly specialized or multi-step thought processes. They may overlook subtle errors or inconsistencies in the reasoning. Human evaluation, on the other hand, provides more detailed analysis, particularly in ensuring the accuracy, logic, and domain relevance of the reasoning process. Experts, with their deep professional background, can make more comprehensive quality judgments. Therefore, human evaluation can compensate for the shortcomings of automated evaluation, ensuring that the thought processes generated by the model perform better in complex tasks than are actually required.
[0238] Human evaluation employs two methods: expert review and comparative analysis. Expert review involves a step-by-step examination of the thought process, assessing its professionalism, accuracy, and consistency. Comparative analysis compares the generated thought process with manually annotated data, analyzing differences in reasoning processes, logical consistency, and other aspects.
[0239] Figure 4 This is a schematic diagram illustrating the results of a specified large model performing different downstream tasks, provided in an embodiment of this application. In an optional embodiment, the specified large model is the Llama3.1-4B model, and three sets of tasks of different models are executed.
[0240] Specifically, this includes a base model, a question-answer pair-based fine-tuned model, and a thought chain-based fine-tuned model. The base model directly uses the pre-trained base model (i.e., the Llama 3.1-4B model) without any fine-tuning, aiming to serve as a performance benchmark to measure the capabilities of the original model. The question-answer pair-based fine-tuned model refers to a model fine-tuned using 50,000 publicly available high-quality question-answer pairs, aiming to evaluate the impact of ordinary question-answer pairs on model performance. The thought chain-based fine-tuned model refers to a model fine-tuned using 50,000 high-quality thought chain data synthesized in this application, aiming to evaluate the advantages of thought chain data in improving the model's inference and general capabilities.
[0241] like Figure 4As shown, the mind chain data fine-tuning experimental group consistently performed best on reasoning tasks, indicating that introducing high-quality mind chain data during fine-tuning can significantly improve the model's logical reasoning ability. Furthermore, the mind chain fine-tuning experimental group also showed improvement in question answering and translation / summarizing tasks, demonstrating that the rich information contained in the mind chain data enhanced the model's language understanding and consistency generation capabilities.
[0242] In one optional embodiment, the problems that arise in the generation of thought chain data can be analyzed based on the evaluation results to identify the main error types or areas for improvement, such as insufficient reasoning or unclear steps. Based on the error analysis results, the model's generation strategy or training data can be adjusted to optimize the quality of the generated thought chain data.
[0243] Therefore, the method for generating thought chain data provided in this application constructs a thought chain data evaluation process, integrates manual evaluation and downstream tasks of the model, and achieves continuous optimization and improvement of data quality.
[0244] In one optional embodiment, acquiring multiple target texts in a specified domain includes:
[0245] Retrieve multiple documents in a specified field;
[0246] Extract target metadata information from the literature; the target metadata information includes at least one of the following: title, author, keywords, abstract, publication date, and publication.
[0247] Based on the target metadata information, determine whether the document belongs to the specified field;
[0248] If it does not belong to the category, the literature will be removed;
[0249] If so, proceed with the following steps:
[0250] Extract initial text from various documents to describe the core content;
[0251] The initial text is preprocessed to obtain the target text. The preprocessing includes converting the format to a specified format, removing specified content and text with a byte length less than a preset length. The specified content includes at least one of the following: header, footer, acknowledgments, citations, special characters, garbled characters, and tags that are not specified content.
[0252] In practice, to ensure data reliability and the accuracy of subsequent thought chain data, a large number of documents in a specified field are acquired as raw data. These documents may include, but are not limited to, books, academic papers, journal articles, research reports, technical manuals, and patent specifications. For example, publicly available papers in geology are selected as raw data.
[0253] In specific embodiments, the scope of the designated field needs to be limited. For example, it can be a sub-discipline under a certain discipline (such as Earth Science - Geology), or a specific professional knowledge point (such as mineral prediction). This application does not limit the designated field. In addition, the selection of literature datasets in the instruction field should be credible and professional, and have a certain scale, for example, ranging from dozens to thousands of papers.
[0254] Figure 5 This diagram illustrates the extraction result of target metadata information provided in an embodiment of this application. Further, in an optional embodiment, to ensure the reliability of the documents, professional annotation is required to obtain high-quality documents. Specifically, such as... Figure 5 As shown, target metadata information is extracted from the literature, including at least one of the following: title, author, keywords, abstract, publication date, and publication.
[0255] It should be noted that the purpose of annotation is to further extract data strongly relevant to the specified domain, ensuring the quality of subsequent synthesized thought chain data. For each document, after extracting the target metadata information, it can be evaluated using a large language model to determine whether the document is consistent with the specified domain, retaining documents consistent with the specified domain.
[0256] For literature within a specified field, initial text describing the core content is extracted. For example, for papers, the abstract can be extracted as the initial text. Further, the initial text is preprocessed. This preprocessing includes converting the format to a specified format; for example, papers in different formats (such as PDF, LaTeX, HTML, etc.) are uniformly converted to the Markdown standard text format.
[0257] Preprocessing also includes removing specified content, that is, removing meaningless noise data. Specified content includes, but is not limited to, headers, footers, acknowledgments, citations, special characters, garbled text, and markers not specified. This ensures accurate identification of the subsequent target text, avoids introducing errors or unnecessary information, and prevents a reduction in the quality of the thought chain data.
[0258] In addition, preprocessing also includes texts with a byte length less than a preset length. For example, documents with a byte length of less than 500 are removed to avoid documents that are too short to provide enough knowledge and affect the quality of the thought chain data.
[0259] In the above embodiments, the method for generating thought chain data has been described in detail. This application also provides an embodiment of a thought chain data generation device.
[0260] Figure 6This is a schematic diagram of the structure of a mind chain data generation device provided in an embodiment of this application, as shown below. Figure 6 As shown, the device includes:
[0261] The target text acquisition module 60 is used to acquire multiple target texts in a specified field; the target texts are used to summarize and describe the core content of the corresponding documents.
[0262] Network construction module 61 is used to construct a semantic topology network for a specified domain, with each target text as a node and the relationship between the target texts as an edge.
[0263] The question-answer pair generation module 62 is used to construct a first prompt word project based on a semantic topology network; and based on the first prompt word project, generate question-answer pairs for a specified domain by specifying a large model;
[0264] The thought chain generation module 63 is used to generate intermediate reasoning representations for each question-answer pair by using knowledge distillation technology, based on a pre-built second prompt word project, and by specifying a large model, to obtain initial thought chain data;
[0265] The thought chain verification module 64 is used to verify the initial thought chain data to obtain the target thought chain data.
[0266] Furthermore, the mind chain data generation apparatus provided in this application embodiment also includes:
[0267] The domain entity extraction module is used to extract domain entities from the target text; domain entities are the core terms of the target text.
[0268] The overlap determination module is used to determine the overlap of domain entity pairs between different target texts; overlap is used to characterize the degree of similarity between domain entity pairs; overlap is positively correlated with the degree of similarity.
[0269] The similarity determination module is used to determine the similarity between different target texts; similarity is used to characterize the degree of semantic similarity between different target texts, and similarity is positively correlated with the degree of semantic similarity;
[0270] The target construction module is used to construct edges between target text nodes based on overlap and similarity, thereby obtaining a semantic topology network.
[0271] The target overlap extraction module is used to extract the overlap of targets with an overlap greater than the overlap threshold; and to take the edges between the node pairs corresponding to the target overlap as the specific edges.
[0272] The target similarity extraction module is used to extract the similarity of targets with a similarity greater than a similarity threshold; and to treat the edges between the node pairs corresponding to the target similarity as abstract edges;
[0273] The node edge construction module is used to construct edges between nodes using concrete edges and abstract edges; determine whether there exists a target node pair that includes both concrete and abstract edges; if so, remove the abstract edges between the target node pairs.
[0274] The first acquisition module is used to acquire the pre-built initial prompt word project, as well as the preset domain expert roles, question types and question lengths for the specified fields;
[0275] The path filtering module is used to filter the first path consisting of two concrete edges and the second path consisting of two abstract edges from the semantic topology network.
[0276] The problem focus point construction module is used to construct problem focus points to guide model reasoning based on the first path and the second path.
[0277] The question-answering scenario construction module is used to construct question-answering scenarios that guide model reasoning by combining question type, question length, domain expert roles, and question focus.
[0278] The first prompt word project construction module is used to inject the target text corresponding to the question-and-answer scenario and the focus of the question into the initial prompt word project to obtain the first prompt word project.
[0279] The first problem focus point determination module is used to take any domain entity corresponding to the target overlap in the first path as the first problem focus point;
[0280] The second problem focus point determination module is used to merge the target texts with edges in the second path to obtain merged text; and use the merged text as the second problem focus point.
[0281] The problem focus generation module is used to form a problem focus by combining the first problem focus and the second problem focus.
[0282] The text processing module is used to extract the questions from the question-answer pairs and uses the target text for generating the question-answer pairs as the reference text.
[0283] The data injection module is used to inject questions and reference text into the initial prompt word project as input data for the initial prompt word project;
[0284] The data generation rule determination module is used to generate the reasoning answer corresponding to the question, including the initial thought chain data, based on the reference text, as the data generation rule for the initial prompt word project, and to obtain the second prompt word project.
[0285] The second acquisition module is used to acquire the pre-built third prompt word project;
[0286] The specified verification module is used to perform specified verification on question-answer pairs and inference answers based on the third prompt word engineering and through the first major model. The specified verification includes answer consistency verification, thought chain verification, and answer integrity verification. Among them, answer consistency verification includes verifying the semantic consistency between the first answer in the question-answer pair and the second answer in the corresponding inference answer; thought chain verification includes at least verifying the logic and coherence of the initial thought chain data; answer integrity verification includes verifying whether the first answer, the second answer, and the initial thought chain data completely solve the problem.
[0287] The target array construction module is used to construct a target array from the target thought chain data and the corresponding question-answer pairs;
[0288] The quality assessment module is used to obtain human ratings for the target array; and to perform quality assessment on the target array using the second major model to obtain the assessment score.
[0289] The array elimination module is used to remove arrays from the target array that have human-rated and / or evaluation scores that are lower than the score threshold;
[0290] The fine-tuning training module is used to fine-tune the training of a specified large model using a target array to obtain a target large model; and to execute a specified downstream task using the target large model to evaluate the quality of the target array.
[0291] The document retrieval module is used to retrieve multiple documents in a specified field.
[0292] The metadata extraction module is used to extract target metadata information from documents; the target metadata information includes at least one of the following: title, author, keywords, abstract, publication date, and publication.
[0293] The metadata processing module is used to determine whether a document belongs to a specified field based on the target metadata information; if it does not belong, the document removal module is called; if it does belong, the target execution module is called; the target execution module includes an initial text extraction module and a preprocessing module.
[0294] The document removal module is used to remove documents.
[0295] The initial text extraction module is used to extract initial text from various documents to describe the core content;
[0296] The preprocessing module is used to preprocess the initial text to obtain the target text. The preprocessing includes converting the format to a specified format, removing specified content and text with a byte length less than a preset length. The specified content includes at least one of the following: header, footer, acknowledgments, citations, special characters, garbled characters, and tags that are not specified content.
[0297] Figure 7This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application, such as... Figure 7 As shown, the electronic device includes: a memory 70 for storing computer programs;
[0298] The processor 71 is used to execute a computer program to implement the steps of the method for generating thought chain data as described in the above embodiments.
[0299] The electronic devices provided in this embodiment may include, but are not limited to, tablet computers, laptop computers, or desktop computers.
[0300] The processor 71 may include one or more processing cores, such as a quad-core processor or an octa-core processor. The processor 71 may be implemented using at least one of the following hardware forms: Digital Signal Processor (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA). The processor 71 may also include a main processor and a coprocessor. The main processor, also known as the Central Processing Unit (CPU), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, the processor 71 may integrate a Graphics Processing Unit (GPU), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, the processor 71 may also include an Artificial Intelligence (AI) processor, which is used to handle computational operations related to machine learning.
[0301] The memory 70 may include one or more computer-readable storage media, which may be non-transitory. The memory 70 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In this embodiment, the memory 70 is used to store at least the following computer program 701, which, after being loaded and executed by the processor 71, is capable of implementing the relevant steps of the thought chain data generation method disclosed in any of the foregoing embodiments. In addition, the resources stored in the memory 70 may also include an operating system 702 and data 703, and the storage method may be temporary or permanent storage. The operating system 702 may include Windows, Unix, Linux, etc. The data 703 may include, but is not limited to, the relevant data involved in the thought chain data generation method.
[0302] In some embodiments, the electronic device may further include a display screen 72, an input / output interface 73, a communication interface 74, a power supply 75, and a communication bus 76.
[0303] Those skilled in the art will understand that Figure 7 The structures shown do not constitute a limitation on electronic devices and may include more or fewer components than those shown.
[0304] The electronic device provided in this application includes a memory and a processor. When the processor executes the program stored in the memory, it can implement the method for generating thought chain data in the above embodiments.
[0305] It should be noted that although the operations are depicted in a specific order in the accompanying drawings, this should not be construed as requiring these operations to be performed in the specific order shown or sequentially, or requiring all illustrated operations to be performed to achieve the desired result. In some cases, multitasking and parallel processing may be advantageous. Furthermore, the separation of various system modules and components in the above embodiments should not be construed as requiring such separation in all embodiments, and it should be understood that the described program components and systems can generally be integrated together in a single software product or packaged into multiple software products.
Claims
1. A method of generating thought chain data, characterized by, The method comprises: acquiring a plurality of target texts of a specified field; the target texts are used to summarize the core content of the corresponding literature; constructing a semantic topology network of the specified field with each target text as a node and the relationship between the target texts as an edge; the semantic topology network comprises concrete edges and abstract edges; the concrete edges are edges with an overlap degree greater than an overlap degree threshold, and the abstract edges are edges with a similarity degree greater than a similarity degree threshold; the overlap degree is used to represent the degree of similarity between different pairs of domain entities in different target texts; the similarity degree is used to represent the semantic similarity between different target texts; the domain entity is a core term of the target text; based on the semantic topology network, constructing a first prompt word engineering; and based on the first prompt word engineering, generating question and answer pairs of the specified field through a specified large model; using a knowledge distillation technology, generating intermediate reasoning representations of each question and answer pair through the specified large model based on a pre-constructed second prompt word engineering, to obtain initial thinking chain data; verifying the initial thinking chain data to obtain target thinking chain data; the method comprises: acquiring a pre-constructed initial prompt word engineering, and a pre-set domain expert role, question type and question length of the specified field; selecting a first path composed of two concrete edges and a second path composed of two abstract edges from the semantic topology network; constructing a question focus point for model reasoning according to the first path and the second path; constructing a question and answer scene for model reasoning by combining the question type, the question length, the domain expert role and the question focus point; injecting the target text corresponding to the question and answer scene and the question focus point into the initial prompt word engineering to obtain the first prompt word engineering.
2. The method of claim 1, wherein the thought chain data is generated by: The method comprises: extracting domain entities of the target texts; determining the overlap degree of pairs of domain entities between different target texts; the overlap degree is positively correlated with the degree of similarity; determining the similarity between different target texts; the similarity is positively correlated with the degree of semantic similarity; constructing edges between the nodes according to the overlap degree and the similarity to obtain the semantic topology network.
3. The method of claim 2, wherein the thought chain data is generated by: The method comprises: extracting a target overlap degree with an overlap degree greater than the overlap degree threshold; and constructing concrete edges between the node pairs corresponding to the target overlap degree; extracting a target similarity with a similarity greater than the similarity threshold; and constructing abstract edges between the node pairs corresponding to the target similarity; constructing edges between the nodes through the concrete edges and the abstract edges; determining whether there are target node pairs comprising concrete edges and abstract edges; if there are, removing the abstract edges between the target node pairs.
4. The method of claim 1, wherein the thought chain data is generated by: The problem focus point is constructed according to semantic information in the first path and the second path, and the problem focus point comprises: Any domain entity corresponding to target overlap degree in the first path is taken as a first problem focus point; Target text with an edge in the second path is fused to obtain fused text, and the fused text is taken as a second problem focus point; The first problem focus point and the second problem focus point constitute the problem focus point.
5. The method of claim 1, wherein the thought chain data is generated by: The second prompt word engineering is constructed, and the method comprises: An initial prompt word engineering is obtained; A question in the question and answer pair is extracted, and target text used for generating the question and answer pair is taken as reference text; The question and the reference text are injected into the initial prompt word engineering as input data of the initial prompt word engineering; A reasoning answer including initial thinking chain data corresponding to the question is generated according to the reference text, and the reasoning answer is taken as a data generation rule of the initial prompt word engineering to obtain the second prompt word engineering.
6. The method of claim 5, wherein the thought chain data is generated by: The initial thinking chain data is verified to obtain target thinking chain data, and the method comprises: A third prompt word engineering is obtained; The question and answer pair and the reasoning answer are specified verified by a first large model based on the third prompt word engineering; the specified verification comprises answer consistency verification, thinking chain verification and answer integrity verification; The answer consistency verification comprises verifying semantic consistency between a first answer in the question and answer pair and a second answer in the corresponding reasoning answer; The thinking chain verification at least comprises verifying logic and coherence of the initial thinking chain data; The answer integrity verification comprises verifying whether the first answer, the second answer and the initial thinking chain data completely solve the question.
7. The method of claim 5, wherein the thought chain data is generated by: After the initial thinking chain data is verified to obtain the target thinking chain data, the method further comprises: The target thinking chain data and the corresponding question and answer pair constitute a target array; An artificial score of the target array is obtained, and a second large model is used to perform quality evaluation on the target array to obtain an evaluation score; Arrays with the artificial score and / or the evaluation score less than a score threshold are removed from the target array; The target large model is obtained by fine-tuning the specified large model through the target array, and a specified downstream task is performed by using the target large model to evaluate the quality of the target array.
8. The method of claim 1, wherein the thought chain data is generated by: The method for obtaining a plurality of target texts in a specified domain comprises: A plurality of literatures in the specified domain are obtained; Target metadata information is extracted from the literatures; the target metadata information comprises at least one of a title, an author, a keyword, an abstract, a publication date and a publication; It is determined whether the literatures belong to the specified domain according to the target metadata information; If not, the literatures are removed; If yes, the following steps are performed: Initial texts used for describing core content are extracted from the literatures; The initial text is preprocessed to obtain the target text; the preprocessing includes converting the format to a specified format, removing specified content, and text with a byte length less than a preset length; the specified content includes at least one of a header, a footer, a thank you, a reference, a special character, a garbled code, and a label of non-specified content.
9. A thought chain data generating apparatus characterized by comprising: The device comprises: A target text acquisition module is configured to acquire a plurality of target texts of a specified field; the target texts are used to summarize the core content of the corresponding literature; A network construction module is configured to construct a semantic topology network of the specified field by taking each target text as a node and the relationship between the target texts as an edge; the semantic topology network comprises concrete edges and abstract edges; the concrete edges are edges with an overlap degree greater than an overlap degree threshold, and the abstract edges are edges with a similarity degree greater than a similarity degree threshold; the overlap degree is used to represent the degree of similarity of domain entities between different target texts; the similarity degree is used to represent the semantic similarity between different target texts; the domain entity is a core term of the target text; A question and answer pair generation module is configured to construct a first prompt word engineering based on the semantic topology network, and generate a question and answer pair of the specified field by a specified large model based on the first prompt word engineering; A thought chain generation module is configured to generate an intermediate reasoning representation of each question and answer pair by the specified large model based on a pre-constructed second prompt word engineering by using a knowledge distillation technology, and obtain initial thought chain data; A thought chain verification module is configured to verify the initial thought chain data to obtain target thought chain data; A first acquisition module is configured to acquire a pre-constructed initial prompt word engineering, and a preset domain expert role, question type, and question length of the specified field; A path screening module is configured to screen a first path composed of two concrete edges and a second path composed of two abstract edges from the semantic topology network; A question focus point construction module is configured to construct a question focus point for model reasoning according to the first path and the second path; A question and answer scenario construction module is configured to construct a question and answer scenario for model reasoning by the question type, the question length, the domain expert role, and the question focus point; A first prompt word engineering construction module is configured to inject the question and answer scenario and the target text corresponding to the question focus point into the initial prompt word engineering to obtain the first prompt word engineering.
10. An electronic device comprising a memory and a processor, said memory having stored thereon a computer program operable to run on said processor, characterized in that, The processor executes the computer program to realize the steps of the thought chain data generation method of any one of claims 1 to 8.
11. A computer readable storage medium having stored thereon a computer program, characterized in that, The program is executed by the processor to realize the steps of the thought chain data generation method of any one of claims 1 to 8.
Citation Information
Patent Citations
Knowledge distillation method, device, equipment, storage medium and computer program product
CN119005176A
Data processing method, device and equipment and readable storage medium
CN120317365A
Technology development situation awareness system and method
CN120429414A