Sft data generation method and system based on knowledge graph guidance and model understanding evaluation

By transforming unstructured documents into knowledge graphs and introducing multidimensional adversarial probes and weighted expected calibration errors, combined with multi-hop sampling and differential generation strategies, the problem of insufficient accuracy and coverage of generated training data in existing technologies is solved, thereby improving the model's knowledge coverage and generalization ability.

CN122433831APending Publication Date: 2026-07-21EVALUATION & DEMONSTRATION RES CENT OF THE CHINESE PEOPLES LIBERATION ARMY ACAD OF MILITARY SCI
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
EVALUATION & DEMONSTRATION RES CENT OF THE CHINESE PEOPLES LIBERATION ARMY ACAD OF MILITARY SCI
Filing Date
2026-04-28
Publication Date
2026-07-21

AI Technical Summary

Technical Problem

Existing technologies suffer from problems such as low factual accuracy, insufficient knowledge coverage, lack of data diversity, and insufficient generalization ability when generating domain-specific training data. In particular, in knowledge-intensive application scenarios, obtaining high-quality training data is costly and it is difficult to effectively identify the knowledge that the model has mastered and has not mastered.

Method used

By transforming unstructured documents into knowledge graphs, constructing closed-book judgment questions using multidimensional adversarial probes and weighted expected calibration errors, and combining multi-hop domain sampling and differentiated generation strategies, SFT data is generated to improve the depth and breadth of the model's knowledge coverage and ensure that the generated content is consistent with the facts of the source documents.

Benefits of technology

It achieves a high degree of consistency between the generated content and the source document, can keenly identify blind spots in the model's knowledge, improves the depth and breadth of the model's knowledge coverage in specific fields, and the generated data has rich context and logical coherence, thus improving the model's generalization ability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122433831A_ABST
    Figure CN122433831A_ABST
Patent Text Reader

Abstract

The application relates to the technical field of artificial intelligence, and provides an SFT data generation method and system based on knowledge graph guidance and model understanding evaluation. The application converts unstructured documents into a knowledge graph, thereby avoiding the illusion problem in a traditional direct generation method and ensuring high consistency between generated content and source document facts; a multi-dimensional adversarial probe containing logical negation, entity confusion and cause-and-effect inversion is introduced, and a weighted expected calibration error is combined to form a high-strength model cognitive stress test, which can quantitatively identify knowledge blind spots in the knowledge system of a to-be-trained model, thereby greatly improving the depth and breadth of knowledge coverage; through a multi-hop domain sampling strategy and a differentiated generation strategy, SFT data generated based on a subgraph has rich context, logical coherence and various forms, avoids the problem of template-based homogeneity, and improves the generalization ability of the model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence technology, and in particular to a method and system for generating SFT data based on knowledge graph guidance and model understanding evaluation. Background Technology

[0002] With the widespread application of Large Language Models (LLMs) in various tasks, improving their performance in specific domains through supervised fine-tuning (SFT) has become a key technical approach. However, the effectiveness of SFT is highly dependent on a large amount of high-quality, domain-specific training data. In knowledge-intensive application scenarios (such as expert question answering, fact retrieval, and knowledge reasoning), obtaining such data is costly and extremely challenging, which severely restricts further improvements in model performance.

[0003] Existing technologies primarily employ synthetic data generation methods, typically relying on the generative capabilities of large language models to directly generate training data from raw unstructured documents. Existing methods include direct generation, template-based filling, and retrieval-enhanced generation. However, existing technologies for generating synthetic data generally face the following problems: low factual accuracy, with generated content inconsistent with source facts, introducing erroneous knowledge; insufficient knowledge coverage, failing to systematically cover long-tail knowledge and complex entity relationships, with generated data often concentrated on common knowledge; lack of data diversity, with generated questions and answers in a single format, leading to insufficient generalization ability of the trained model; and lack of specificity, failing to effectively identify knowledge already mastered and not mastered by the model, resulting in inefficient data supplementation. Summary of the Invention

[0004] Therefore, it is necessary to provide a method and system for generating SFT data based on knowledge graph guidance and model understanding evaluation to address the above-mentioned technical problems.

[0005] A method for generating SFT data based on knowledge graph guidance and model understanding evaluation, the method comprising the following steps: Acquire unstructured documents related to the target domain and transform them into knowledge graphs; Multidimensional adversarial semantic variants for each relation in the knowledge graph are generated by a synthesizer model. The multidimensional adversarial semantic variants include affirmative statements and at least one type of adversarial probes. The adversarial probes include logic negation probes, entity confusion probes, and causal inversion probes. The generated multidimensional adversarial semantic variants are constructed as closed-book judgment questions and input into the model to be trained to obtain the predicted probability distribution output by the model to be trained. Based on the predicted probability distribution and the true label distribution, the weighted expected calibration error of the model to be trained for each relation is calculated. Based on the weighted expected calibration error, seed units are selected in the knowledge graph according to the preset edge selection strategy. Starting from the seed units, a multi-hop domain sampling strategy is used to extract subgraphs containing context. Using the extracted subgraphs as context, a differential generation strategy is employed to generate SFT data through a synthesizer model.

[0006] In one embodiment, unstructured documents related to the target domain are obtained, and the unstructured documents are converted into a knowledge graph, including: Obtain unstructured documents related to the target domain; A dynamic chunking strategy is used to segment unstructured documents into multiple semantically coherent text blocks; The structured information of each text block is extracted using a synthesizer large language model, and the structured information includes entity information and relational information. A knowledge graph is constructed by globally aggregating structured information and merging entities and relationships during the aggregation process.

[0007] In one embodiment, a preset-sized overlapping area is provided between adjacent text blocks.

[0008] In one embodiment, the weighted expected calibration error is calculated according to the following formula:

[0009] in, For relationship The weighted expected calibration error; For relationship The The first type of adversarial probe One semantic variant; for The true label; The probability predicted by the model to be trained; The number of multidimensional adversarial semantic variants; To determine the number of dimensions of the adversarial probe; For the first Penalty weight coefficients for adversarial probes; For the first The number of multidimensional adversarial semantic variants of the adversarial probe.

[0010] In one embodiment, the multi-hop neighborhood sampling strategy includes breadth-first search.

[0011] In one embodiment, during the breadth-first search process, the neighbor edge selection strategy includes the max_loss strategy, the min_loss strategy, and the random strategy.

[0012] In one embodiment, the differentiation generation strategy includes atomic QA, aggregated QA, and multi-hop QA.

[0013] In one embodiment, using the extracted subgraph as context, a differential generation strategy is employed to generate SFT data through a synthesizer model, including: Using the extracted subgraph as context, a dynamic mapping dictionary is established from the node entities in the current subgraph to the underlying vocabulary of the synthesizer model; During the decoding phase of the synthesizer model, the current subgraph is used as a symbolic hard constraint. When the synthesizer model is in the... t When predicting the probability distribution of the next entity, the knowledge graph state evaluation function is used to check whether the entity corresponding to the generated entity conforms to the topological facts of the current subgraph and adaptively adjusts the probability distribution. If the predicted entity is on a reasonable reasoning path of the sampled subgraph, a positive incentive is applied; if the predicted entity belongs to a conflicting entity in the knowledge graph that is mutually exclusive with the current subgraph, a strong negative penalty is applied to the Logits corresponding to the current predicted entity. Based on the predicted probability distribution, a differentiated generation strategy is used to generate SFT data.

[0014] In one embodiment, The probability distribution is adaptively adjusted according to the following formula:

[0015] in, To predict the next entity The probability distribution; To predict the Logits corresponding to the entity; This is the state evaluation function for the knowledge graph. For subgraphs; For structured guiding coefficients.

[0016] A knowledge graph-guided and model understanding evaluation-based SFT data generation system, the system comprising: The knowledge graph construction module is used to acquire unstructured documents related to the target domain and transform them into knowledge graphs. The evaluation module is used to generate multidimensional adversarial semantic variants for each relation in the knowledge graph through a synthesizer model. These multidimensional adversarial semantic variants include affirmative statements and at least one type of adversarial probe, including logical negation probes, entity confusion probes, and causal inversion probes. The generated multidimensional adversarial semantic variants are constructed as closed-book judgment questions and input into the model to be trained to obtain the predicted probability distribution output by the model. Based on the predicted probability distribution and the true label distribution, the weighted expected calibration error of the model to be trained for each relation is calculated. The graph organization and sampling module is used to select seed units in the knowledge graph based on the weighted expected calibration error and a preset edge selection strategy. Starting from the seed units, a multi-hop domain sampling strategy is used to extract subgraphs containing context. The data generation module is used to generate SFT data through a synthesizer model, using the extracted subgraph as context and employing a differentiated generation strategy.

[0017] The aforementioned SFT data generation method and system based on knowledge graph guidance and model understanding evaluation avoids the illusion problem in traditional direct generation methods by converting unstructured documents into knowledge graphs, ensuring a high degree of consistency between the generated content and the facts of the source documents. By introducing multi-dimensional adversarial probes including logical negation, entity confusion, and causal inversion, and combining them with weighted expected calibration errors to form a high-intensity model cognitive stress test, it can quantitatively identify knowledge blind spots in the knowledge system of the model to be trained, and more keenly uncover deep logical loopholes and long-tail blind spots in the model to be trained in specific domains, thereby significantly improving the depth and breadth of knowledge coverage. Through multi-hop domain sampling strategies and differentiated generation strategies, the SFT data generated based on subgraphs has rich context, logical coherence, and diverse forms, avoiding the homogenization problem of templates and improving the generalization ability of the model. Attached Figure Description

[0018] Figure 1 This is a flowchart illustrating an SFT data generation method based on knowledge graph guidance and model understanding evaluation in one embodiment. Figure 2 This is a schematic diagram of the subgraph sampling process in one embodiment; Figure 3 This is a schematic diagram of the architecture of an SFT data generation system based on knowledge graph guidance and model understanding evaluation in one embodiment. Detailed Implementation

[0019] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0020] In one embodiment, such as Figure 1 As shown, a method for generating SFT data based on knowledge graph guidance and model understanding evaluation is provided. The method includes the following steps: Step 201: Obtain unstructured documents related to the target domain and convert them into a knowledge graph.

[0021] Step 202: Generate multidimensional adversarial semantic variants for each relation in the knowledge graph using a synthesizer model. The multidimensional adversarial semantic variants include affirmative statements and at least one type of adversarial probes. The adversarial probes include logic negation probes, entity confusion probes, and causal inversion probes. Construct the generated multidimensional adversarial semantic variants into closed-book judgment questions and input them into the model to be trained to obtain the predicted probability distribution output by the model to be trained.

[0022] Step 203: Based on the predicted probability distribution and the true label distribution, calculate the weighted expected calibration error of the model to be trained for each relation.

[0023] Step 204: Based on the weighted expected calibration error, select seed units in the knowledge graph according to the preset edge selection strategy, and extract subgraphs containing context using a multi-hop domain sampling strategy starting from the seed units.

[0024] Step 205: Using the extracted subgraph as context, a differential generation strategy is adopted to generate SFT data through a synthesizer model.

[0025] The aforementioned SFT data generation method based on knowledge graph guidance and model understanding evaluation avoids the illusion problem in traditional direct generation methods by converting unstructured documents into knowledge graphs, ensuring a high degree of consistency between the generated content and the facts of the source documents. By introducing multi-dimensional adversarial probes including logical negation, entity confusion, and causal inversion, and combining them with weighted expected calibration errors to form a high-intensity model cognitive stress test, it can quantitatively identify knowledge blind spots in the knowledge system of the model to be trained, and more keenly uncover deep logical loopholes and long-tail blind spots in the subdivided domains of the model to be trained, thereby significantly improving the depth and breadth of knowledge coverage. Through multi-hop domain sampling strategies and differentiated generation strategies, the SFT data generated based on subgraphs has rich context, logical coherence, and diverse forms, avoiding the homogenization problem of templates and improving the generalization ability of the model.

[0026] In one embodiment, unstructured documents related to the target domain are obtained, and the unstructured documents are converted into a knowledge graph, including: Obtain unstructured documents related to the target domain; A dynamic chunking strategy is used to segment unstructured documents into multiple semantically coherent text blocks; Through synthesizer large language model ( Extract the structured information of each text block, the structured information including entity information and relational information; A knowledge graph is constructed by globally aggregating structured information and merging entities and relationships during the aggregation process.

[0027] A dynamic chunking strategy is adopted to segment unstructured documents into multiple semantically coherent text blocks. Specifically, the size of the text blocks is adaptively adjusted according to the total text length and language complexity (such as average sentence length and symbol density) of the document, and advanced segmentation methods such as recursive character segmentation and Markdown structured segmentation are used to segment the text blocks to preserve semantic boundaries to the greatest extent.

[0028] It should be noted that before extracting the structured information of each text block, the synthesizer's large language model performs language detection (e.g., Chinese or English) on the text block, and then constructs prompts containing clear task descriptions, output format requirements, and examples. This improves the accuracy and efficiency of structured information extraction. The entity information includes entity ID, entity type (e.g., person, organization, location, technology, etc.), and detailed description; the relationship information defines the connections between entities, including source entity, target entity, relationship type (e.g., "proposed," "affected," "located in," etc.), and relationship description.

[0029] During the aggregation process, entities and relationships are merged. Specifically, different descriptions pointing to the same entity are merged by entity ID; for multiple relationship descriptions between the same entity pairs, their descriptions are merged and all source information is recorded, thus forming an information-rich and non-redundant global knowledge view.

[0030] In one embodiment, a preset-sized overlapping area is provided between adjacent text blocks.

[0031] In this embodiment, by setting an overlapping area of ​​a preset size between adjacent text blocks, it is ensured that entities and relationships across blocks can be fully captured.

[0032] In one embodiment, the weighted expected calibration error is calculated according to the following formula:

[0033] in, For relationship The weighted expected calibration error; For relationship The The first type of adversarial probe One semantic variant; for The true label; For the model to be trained ( The probability of prediction; For the number of multidimensional adversarial semantic variants, ; To determine the number of dimensions of the adversarial probe; For the first Penalty weight coefficients for adversarial probes; For the first The number of multidimensional adversarial semantic variants of the adversarial probe.

[0034] It should be noted that, for the weighted expected calibration error of the model to be trained, the generated multidimensional adversarial semantic variant is constructed as a closed-book judgment question (such as the prompt: "Is the following statement factually correct? [probe statement]") and input into the model to be trained to obtain the prediction probability distribution of the model to be trained for "yes" and "no".

[0035] Understandably, the weighted expected calibration error can assign different penalty weight coefficients to different types of adversarial semantic variants based on the varying abilities of adversarial probes to detect deep "illusion" vulnerabilities in the model across different dimensions. This allows for the quantitative identification of weak links in the model's knowledge system. By prioritizing data generation for these high-loss knowledge points, a systematic and targeted coverage of long-tail knowledge and complex relationships is achieved, significantly improving the depth and breadth of knowledge coverage.

[0036] In one embodiment, using the extracted subgraph as context, a differentiated generation strategy is employed to generate SFT data through a synthesizer model, including: Using the extracted subgraph as context, a dynamic mapping dictionary is established from the node entities in the current subgraph to the underlying vocabulary of the synthesizer model; During the decoding phase of the synthesizer model, the current subgraph is used as a symbolic hard constraint. When the synthesizer model is in the... t When predicting the probability distribution of the next entity, the knowledge graph state evaluation function is used to check whether the entity corresponding to the generated entity conforms to the topological facts of the current subgraph and adaptively adjusts the probability distribution. If the predicted entity is on a reasonable reasoning path of the sampled subgraph, a positive incentive is applied; if the predicted entity belongs to a conflicting entity in the knowledge graph that is mutually exclusive with the current subgraph (an entity that is very likely to cause hallucination), a strong negative penalty is applied to the Logits corresponding to the current predicted entity. Based on the predicted probability distribution, a differentiated generation strategy is used to generate SFT data.

[0037] It should be noted that the generated SFT data is formatted into a standard training format before being output. The output SFT data includes source subgraphs and policy metadata, and all SFT data form the final dataset.

[0038] In this embodiment, by using subgraphs as symbolic hard constraints (neural symbols), the topological structure of the knowledge graph is transformed into a hard constraint of the vocabulary generation probability distribution. This effectively blocks the spontaneous illusion diffusion of neural networks when generating SFT data, and the accuracy of data facts far exceeds that of conventional retrieval enhancement generation methods.

[0039] In one embodiment, the probability distribution is adaptively adjusted according to the following formula:

[0040] in, To predict the next entity The probability distribution; To predict the Logits corresponding to the entity; This is the state evaluation function for the knowledge graph. For subgraphs; For structured guiding coefficients.

[0041] In one embodiment, the multi-hop neighborhood sampling strategy includes breadth-first search.

[0042] Specifically, starting with a seed unit, breadth-first search (BFS) is used to iteratively expand the knowledge graph, extracting subgraphs containing rich context. S During the breadth-first search process, strict constraints are followed, including the maximum number of hops. k (like k = 2) The maximum number of units (nodes + edges) contained in the subgraph and the total number of tokens for all descriptive text in the subgraph. Constraints ensure that the sampled subgraph can capture depth-related information without becoming too large to handle.

[0043] The subgraph sampling process is as follows Figure 2 As shown, the left side displays the complete knowledge graph. G It contains multiple nodes ( AH ) and edges, nodes C The nodes marked in red are seed nodes with high weighted expected calibration errors. The middle section is the BFS expansion process, with hop 0 starting from the seed node. C Initialize the subgraph starting from the given point. S ={ C The first jump extends to neighboring nodes, prioritizing edges with higher loss. A , B , D , E Add a subgraph; the second hop continues to expand and check constraints (maximum number of hops). k =2, maximum number of tokens), will F Add a subgraph. The right side shows the final output subgraph.S It contains 6 nodes and 6 edges, forming a context-coherent knowledge substructure.

[0044] In one embodiment, during the breadth-first search process, the neighbor edge selection strategy includes the max_loss strategy, the min_loss strategy, and the random strategy.

[0045] Specifically, the max_loss strategy prioritizes expanding to edges with higher understanding loss to focus on knowledge gaps; the min_loss strategy prioritizes expanding to edges with low loss to consolidate existing knowledge in the model; and the random strategy randomly selects edges to increase the diversity of generated data.

[0046] In this embodiment, different neighbor edge selection strategies are adopted to achieve different objectives, thereby improving applicability.

[0047] In one embodiment, the differentiation generation strategy includes atomic QA, aggregated QA, and multi-hop QA.

[0048] Specifically, atomic QA is suitable for simple subgraphs containing only a single node or edge, generating simple question-answer pairs that represent basic facts; aggregate QA is suitable for subgraphs containing multiple nodes and edges, generating questions that require integrating information from multiple sources within the subgraph to answer; and multi-hop QA is suitable for subgraphs containing complex relational paths, generating complex question-answer pairs that require multi-step reasoning to arrive at an answer.

[0049] In this embodiment, under the hard constraint of symbolization, the most suitable generation strategy is adaptively selected based on the predicted probability distribution and the topological complexity of the subgraph to maximize the diversity and value of the generated data.

[0050] In one embodiment, SFT data for training a historical knowledge question-answering model is generated from a set of unstructured text documents about the history of artificial intelligence.

[0051] The synthesizer model uses a large-scale language model; the model to be trained uses a smaller-scale language model; the knowledge graph storage uses the NetworkX library to build and manage the graph structure in memory.

[0052] Provides 100 Markdown documents on the history of artificial intelligence development; splits all documents into multiple text blocks according to character / sentence / paragraph splitting methods, with a text block size of 1024 tokens and a block overlap of 100 tokens. Processes all text blocks in parallel. For each text block, the synthesizer model uses the following prompt: "Please extract key entities (people, organizations, events, technologies) and their relationships (e.g., 'proposed,' 'invented,' 'influenced') from the following text and output them in JSON format." All extracted entities and relationships are loaded into a NetworkX graph. If multiple text blocks mention "person A," this information is merged into the same node, enriching its description and relationships.

[0053] Select a relation from the graph, for example "Character B proposed the Turing Test." The synthesizer model is then invoked. Generate multidimensional adversarial semantic variants: Affirmative statement: "The Turing Test was conceived by Person B.", weights ; Logical negation probe: "The Turing test has nothing to do with person B.", weight Entity Confusion Probe: "Character C proposed the Turing Test." This involves introducing strongly interfering entities from the same period, with weights... Causal inversion probe: "The Turing Test directly guided the enlightenment of Person B's computational theory." Temporal and causal relationships are disordered, weights... The above variant is constructed as a closed-book true / false question and input into the model to be trained. The model may, when faced with the strong distractor "Person C," give a relatively high "yes" probability of 0.6. The weighted expected calibration error of this relationship is calculated using the weighted expected calibration error formula. The error will increase significantly due to the high penalty weight of the entity confusion probe, accurately exposing the model's easily confused blind spots in the early stages of artificial intelligence's historical relationships. This process is repeated for all relationships in the graph, and the calculated weighted expected calibration error value is stored as an edge attribute.

[0054] Using the max_loss strategy, k =2 hops, maximum token count is 4096. Among all relationships, find the relationship. The edge with the highest weighted expected calibration error ("Person B proposed the Turing Test") is selected as the seed edge. A breadth-first search is performed starting from the nodes "Person B" and "Turing Test". The first hop may extend to other nodes related to Turing, such as "Computational Theory", "Cryptography", or "World War II"; the second hop may further extend to "Enigma Machine" or "Von Neumann Architecture". During the extension process, neighboring relationships with similarly high understanding losses are prioritized. Expansion stops when the subgraph size reaches the constraint, and a subgraph containing information about Turing, the Turing Test, computational theory, cryptography, and their interrelationships is output.

[0055] Since the sampled subgraph contains multiple entities and inference paths, a multi-hop QA generation strategy is chosen to generate the subgraph. S The entity and relationship information is filled into the multi-hop question-answering prompt template. Simultaneously, a custom Graph Logits Processor is registered in the local inference engine (such as vLLM) to process the subgraph. S Extract the Token IDs corresponding to entities (such as "cryptography" and "person C") and build a dynamic mapping dictionary. This is then used in the synthesizer large language model. The autoregressive decoding process begins. When the synthesizer's large language model attempts to output a technology or person's name token, the Graph Logits Processor intervenes to evaluate: if the predicted token belongs to a subgraph... S For allowed sets of entities (such as "computation theory"), an incentive value λ (e.g., +2.0) is added to their original Logits. If the synthesizer large language model experiences hallucinations and attempts to output high-frequency mutually exclusive entities outside the subgraph (such as "deep learning"), a severe penalty (e.g., -10.0) is imposed on its Logits. Under these hard constraints, the synthesizer large language model generates QA pairs without any chronological misalignment: "Question: What contributions has Person B made to computation theory, and what is the Turing test he proposed used for? Answer: Person B is one of the founders of modern computation theory. The Turing test he proposed is a test used to determine whether a machine can exhibit intelligent behavior indistinguishable from that of a human." This is then formatted as Alpaca JSON and stored in the final dataset file.

[0056] Repeat the above steps to continuously mine the knowledge blind spots of the model from the knowledge graph and generate high-quality, diverse training data with complex logic, thereby effectively improving the knowledge level and reasoning ability of the model to be trained in the field of artificial intelligence history.

[0057] It should be understood that, although Figure 1The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order in which these steps are executed, and they can be performed in other orders. Figure 1 At least some of the steps in the process may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.

[0058] In one embodiment, such as Figure 3 As shown, an SFT data generation system based on knowledge graph guidance and model understanding evaluation is provided. The system includes: The knowledge graph construction module is used to acquire unstructured documents related to the target domain and transform them into knowledge graphs. The evaluation module is used to generate multidimensional adversarial semantic variants for each relation in the knowledge graph through a synthesizer model. These multidimensional adversarial semantic variants include affirmative statements and at least one type of adversarial probe, including logical negation probes, entity confusion probes, and causal inversion probes. The generated multidimensional adversarial semantic variants are constructed as closed-book judgment questions and input into the model to be trained to obtain the predicted probability distribution output by the model. Based on the predicted probability distribution and the true label distribution, the weighted expected calibration error of the model to be trained for each relation is calculated. The graph organization and sampling module is used to select seed units in the knowledge graph based on the weighted expected calibration error and a preset edge selection strategy. Starting from the seed units, a multi-hop domain sampling strategy is used to extract subgraphs containing context. The data generation module is used to generate SFT data through a synthesizer model, using the extracted subgraph as context and employing a differentiated generation strategy.

[0059] The SFT data generation system based on knowledge graph guidance and model understanding evaluation adopts a layered architecture, consisting of four layers from top to bottom. The top layer is the application layer, responsible for GraphGen workflow orchestration. The second layer is the operation layer, containing four core operation modules: knowledge construction, multi-dimensional probe evaluation (Quiz / Judge), graph organization, and neural symbol QA generation (i.e., SFT data generation). The third layer is the model layer, where the generator integrates a dynamic Logits mapping and intervention module (LogitsProcessor) based on subgraph topology, forming a dual constraint of neural symbols. The bottom layer is the infrastructure layer, including the storage system, a local inference engine (such as vLLM) supporting low-level decoding intervention, and a tokenizer.

[0060] The framework design of the SFT data generation system based on knowledge graph guidance and model understanding evaluation described in this application is modular, allowing users to flexibly configure different components according to specific needs, thus adapting to different application scenarios. Furthermore, this application introduces engineering optimization techniques such as batch request processing and knowledge extraction result caching, effectively reducing unnecessary calls to expensive large language model APIs. While maintaining or even improving data quality, it significantly shortens the data generation cycle and substantially reduces computational resource costs, making large-scale, high-quality synthetic data generation more economically and temporally feasible.

[0061] Specific limitations regarding the SFT data generation system based on knowledge graph guidance and model understanding evaluation can be found in the limitations of the SFT data generation method based on knowledge graph guidance and model understanding evaluation mentioned above, and will not be repeated here. Each module in the aforementioned SFT data generation system based on knowledge graph guidance and model understanding evaluation can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the corresponding operations of each module.

[0062] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0063] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of the invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A method for generating SFT data based on knowledge graph guidance and model understanding evaluation, characterized in that, The method includes the following steps: Acquire unstructured documents related to the target domain and transform them into knowledge graphs; Multidimensional adversarial semantic variants for each relation in the knowledge graph are generated by a synthesizer model. The multidimensional adversarial semantic variants include affirmative statements and at least one type of adversarial probes. The adversarial probes include logic negation probes, entity confusion probes, and causal inversion probes. The generated multidimensional adversarial semantic variants are constructed as closed-book judgment questions and input into the model to be trained to obtain the predicted probability distribution output by the model to be trained. Based on the predicted probability distribution and the true label distribution, the weighted expected calibration error of the model to be trained for each relation is calculated. Based on the weighted expected calibration error, seed units are selected in the knowledge graph according to the preset edge selection strategy. Starting from the seed units, a multi-hop domain sampling strategy is used to extract subgraphs containing context. Using the extracted subgraphs as context, a differential generation strategy is employed to generate SFT data through a synthesizer model.

2. The SFT data generation method based on knowledge graph guidance and model understanding evaluation according to claim 1, characterized in that, Acquire unstructured documents relevant to the target domain and transform them into a knowledge graph, including: Obtain unstructured documents related to the target domain; A dynamic chunking strategy is used to segment unstructured documents into multiple semantically coherent text blocks; The structured information of each text block is extracted using a synthesizer large language model, and the structured information includes entity information and relational information. A knowledge graph is constructed by globally aggregating structured information and merging entities and relationships during the aggregation process.

3. The SFT data generation method based on knowledge graph guidance and model understanding evaluation according to claim 2, characterized in that, There is a preset size overlap area between adjacent text blocks.

4. The SFT data generation method based on knowledge graph guidance and model understanding evaluation according to claim 1, characterized in that, The weighted expected calibration error is calculated according to the following formula: in, For relationship The weighted expected calibration error; For relationship The The first type of adversarial probe One semantic variant; for The true label; The probability predicted by the model to be trained; The number of multidimensional adversarial semantic variants; To determine the number of dimensions of the adversarial probe; For the first Penalty weight coefficients for adversarial probes; For the first The number of multidimensional adversarial semantic variants of the adversarial probe.

5. The SFT data generation method based on knowledge graph guidance and model understanding evaluation according to claim 1, characterized in that, The multi-hop neighborhood sampling strategy includes breadth-first search.

6. The SFT data generation method based on knowledge graph guidance and model understanding evaluation according to claim 5, characterized in that, In the breadth-first search process, the selection strategies for neighbor edges include the max_loss strategy, the min_loss strategy, and the random strategy.

7. The SFT data generation method based on knowledge graph guidance and model understanding evaluation according to claim 1, characterized in that, The differentiated generation strategies include atomic QA, aggregated QA, and multi-hop QA.

8. The SFT data generation method based on knowledge graph guidance and model understanding evaluation according to claim 7, characterized in that, Using the extracted subgraphs as context, a differential generation strategy is employed to generate SFT data through a synthesizer model, including: Using the extracted subgraph as context, a dynamic mapping dictionary is established from the node entities in the current subgraph to the underlying vocabulary of the synthesizer model; During the decoding phase of the synthesizer model, the current subgraph is used as a symbolic hard constraint. When the synthesizer model is in the... t When predicting the probability distribution of the next entity, the knowledge graph state evaluation function is used to check whether the entity corresponding to the generated entity conforms to the topological facts of the current subgraph and adaptively adjusts the probability distribution. If the predicted entity is on a reasonable reasoning path of the sampled subgraph, a positive incentive is applied; if the predicted entity belongs to a conflicting entity in the knowledge graph that is mutually exclusive with the current subgraph, a strong negative penalty is applied to the Logits corresponding to the current predicted entity. Based on the predicted probability distribution, a differentiated generation strategy is used to generate SFT data.

9. The SFT data generation method based on knowledge graph guidance and model understanding evaluation according to claim 8, characterized in that, The probability distribution is adaptively adjusted according to the following formula: in, To predict the next entity The probability distribution; To predict the Logits corresponding to the entity; This is the state evaluation function for the knowledge graph. For subgraphs; For structured guiding coefficients.

10. An SFT data generation system based on knowledge graph guidance and model understanding evaluation, characterized in that, The system includes: The knowledge graph construction module is used to acquire unstructured documents related to the target domain and transform them into knowledge graphs. The evaluation module is used to generate multidimensional adversarial semantic variants for each relation in the knowledge graph through a synthesizer model. These multidimensional adversarial semantic variants include affirmative statements and at least one type of adversarial probe, including logical negation probes, entity confusion probes, and causal inversion probes. The generated multidimensional adversarial semantic variants are constructed as closed-book judgment questions and input into the model to be trained to obtain the predicted probability distribution output by the model. Based on the predicted probability distribution and the true label distribution, the weighted expected calibration error of the model to be trained for each relation is calculated. The graph organization and sampling module is used to select seed units in the knowledge graph based on the weighted expected calibration error and a preset edge selection strategy. Starting from the seed units, a multi-hop domain sampling strategy is used to extract subgraphs containing context. The data generation module is used to generate SFT data through a synthesizer model, using the extracted subgraph as context and employing a differentiated generation strategy.