Ontology-based large language model self-evolution method and device
By generating and organizing ontology concept trees, calculating confusion and confidence, marking reliable and paths to be strengthened, and fine-tuning using Q&A interaction to generate new knowledge for fine-tuning, the problem of insufficient professional capabilities of large language models in the professional field is solved, and self-evolution and cost reduction are achieved.
Patent Information
- Application Number
- CN202510554833.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-29
- Publication Date
- 2025-08-12
AI Technical Summary
Existing large language models perform poorly in professional fields such as medicine, law and finance, lack professional depth and are prone to conceptual confusion or factual errors. The existing methods require a large amount of external professional data and resources, and the self-evolutionary methods cannot meet the requirements of knowledge-intensive professional fields.
Through ontology-based methods, the concept of the body is generated from the large language model, organized into a concept tree, calculate the confusion and confidence, mark the reliable and paths to be strengthened, and generate new knowledge through question-and-answer interaction and fine-tune it to achieve self-evolution.
Reliance on external resources is reduced, the cost of improving capabilities in professional fields is reduced, and the professional capabilities and consistency of the model in professional fields is improved.
Smart Images

Figure CN120471136A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of natural language processing, and in particular relates to a method and device for self-evolution of a large language model based on ontology. Background Art
[0002] Current large language models (LLMs) have demonstrated impressive capabilities in general domains, enabling fluent conversations, generating creative content, and answering common-sense questions. These models, pre-trained on massive amounts of data, have mastered a rich set of language patterns and world knowledge. However, their performance often falls short when applied to highly specialized fields such as medicine, law, and finance. While they can produce seemingly reasonable responses, they often lack technical depth and may even confuse concepts or make factual errors.
[0003] To address this issue, the current mainstream approach is to enhance the model's professional capabilities by injecting existing external domain expertise. Specifically, researchers mainly adopt two technical routes: one is to introduce professional corpus in the model pre-training stage. For example, in 2023, Professor Nie Zaiqing's team at Tsinghua University released the open source multimodal biomedical field basic model BioMedGPT. As the first open source, lightweight general biomedical AI model, it is based on the Transformer structure, supports multi-task processing, and can achieve good performance on a variety of biomedical tasks; the other is to inject domain knowledge through methods such as fine-tuning in the post-training stage. For example, med42-v2 is based on the llama model and is fine-tuned using a large amount of clinical data. Compared with the base model, it has shown better performance in various medical benchmark tests. However, these methods have obvious limitations, because in professional fields with high barriers to entry, obtaining high-quality domain-labeled data often requires a lot of manpower and resource costs.
[0004] Currently, a new paradigm known as "model self-evolution" is emerging in general domains. This paradigm enables models to autonomously generate training data based on driving tasks and continuously improve their performance through self-evaluation and iterative optimization. This approach eliminates reliance on external, manually annotated data and demonstrates strong scalability. For example, the paper "Principle-Driven Self-Alignment of Language Models from Scratch with Minimal Human Supervision" proposes a method that appends a prompt "Please follow ethical requirements" to questions to obtain more ethical responses. Questions without the prompt and high-quality responses are then combined into question-answer pairs for training the model itself. However, most of these self-evolution methods are based on relatively broad principles, such as requiring the model to maintain consistency in responses and improve the coherence of reasoning. These principles cannot meet the knowledge-intensive requirements of model evolution in knowledge-intensive professional domains.
[0005] In professional fields, there are already many well-established domain ontologies with rich concepts. Recently, the Ontotune method demonstrated that infusing large models with high-quality domain ontologies can help enhance their domain expertise. This provides a path for ontology-based self-evolution of models within professional domains. This is because domain ontologies, as standardized descriptions of the conceptual system of a specific domain, not only clearly define core concepts and accurately depict the relationships between concepts, but also possess rich professional connotations. Furthermore, this structured knowledge representation has built-in logical rules, such as (Concept A belongs to Concept B), (Concept B belongs to Concept C), then (Concept A belongs to Concept C). These logical rules can be used to automatically detect knowledge contradictions within the model. For example, if the model simultaneously contains the following three pieces of knowledge: (Concept A belongs to Concept B), (Concept B belongs to Concept C), and (Concept A does not belong to Concept C), then this indicates a knowledge contradiction within the model. Summary of the Invention
[0006] In view of the above, the purpose of the present invention is to provide a method and device for the self-evolution of a large language model based on ontology, which extracts professional ontology knowledge within the large language model, filters out ontology knowledge that does not conform to the rules, and then improves and supplements the large language model to achieve self-evolution of the model.
[0007] To achieve the above-mentioned object of the invention, an embodiment provides a method for self-evolution of a large language model based on ontology, comprising the following steps:
[0008] Based on the first prompt template for ontology knowledge extraction, ontology concepts in the fields of medicine, law, or finance are generated from a large language model through question-answering interaction;
[0009] Organize the ontology concepts generated by the large language model step by step into a concept tree corresponding to the domain ontology, mark each edge on the concept tree as a knowledge path, and calculate the confusion and confidence of the large language model for each knowledge path on the concept tree. Based on the confidence, mark the reliable paths and paths to be strengthened in the concept tree;
[0010] Based on the path to be strengthened, more natural and fluent new knowledge is generated by interacting with the large language model, and the large language model is fine-tuned based on the new knowledge to achieve self-evolution in professional ontology knowledge.
[0011] Preferably, the first prompt template for ontology knowledge extraction includes: a limited professional field, a given top-level professional concept, a requirement to generate subordinate concepts and synonym concepts based on the top-level professional concept, and a requirement to organize the generated concepts into JSON format for output as ontology concepts.
[0012] Preferably, the ontology concepts generated step by step by the large language model are organized into a concept tree corresponding to the domain ontology, and each edge on the concept tree is marked as a knowledge path, including:
[0013] The concept tree includes a top-level professional concept in a single professional field, several sub-concepts under the top-level professional concept, and synonym concepts of the sub-concepts. The concept tree reflects the cognition of the relationship between the top-level professional concept and the sub-concepts and synonym concepts under the lower level.
[0014] Each edge on the concept tree is marked as a knowledge path, and each knowledge path reflects the relationship between two concepts, including synonym relationships and hypernym-hyponym relationships.
[0015] Preferably, calculating the confidence of each knowledge path includes:
[0016] The confidence calculation formula is designed based on the perplexity, including:
[0017] The confidence degree BeliefConf(min) calculation formula based on the minimum value of forward perplexity and reverse perplexity is:
[0018]
[0019] The second calculation formula of the confidence degree BeliefConf(max) based on the maximum value of the forward perplexity and the reverse perplexity is:
[0020]
[0021] The third calculation formula for the confidence degree BeliefConf(min) based on the difference between the forward perplexity and the reverse perplexity is:
[0022] BeliefConf(minus)=false_ppl-tr_ppl
[0023] Among them, true_ppl and false_ppl represent the forward perplexity and reverse perplexity respectively.
[0024] During the specific calculation, one of the above three formulas is used to calculate the confidence of each knowledge path.
[0025] Preferably, marking reliable paths in the concept tree based on confidence includes:
[0026] For multiple knowledge paths with certain relationships between ontology concepts, such as (Concept A, belongs to, Concept B), (Concept A, is a synonym, Concept C), and (Concept C, belongs to, Concept B), if the large language model gives these multiple knowledge paths a high confidence level exceeding a given threshold, it means that during pre-training, a large amount of corpus simultaneously points to and supports the two knowledge paths of (Concept A, belongs to, Concept B) and (Concept C, belongs to, Concept B), and marks these two knowledge paths as reliable paths.
[0027] Preferably, the given threshold is determined by:
[0028] Calculate the confidence of each knowledge path in the concept tree, obtain the average confidence value and the confidence values corresponding to multiple quantiles, and mark the average confidence value and the confidence values corresponding to multiple quantiles as thresholds, where the confidence values corresponding to multiple quantiles include the confidence values corresponding to 50%, 60%, 70%, 80%, and 90%.
[0029] Preferably, marking the paths to be strengthened in the concept tree based on the confidence level includes:
[0030] For multiple reliable paths screened, such as (Concept A, belongs to, Concept B) and (Concept B, belongs to, Concept C), these two reliable paths should be able to infer (Concept A, belongs to, Concept C) according to the consistency rules of the ontology. However, if the results given by the large language model actually show a high degree of confidence in (Concept A, does not belong to, Concept C), then it is considered that there is a knowledge conflict within the large language model. At this time, the knowledge path (Concept A, belongs to, Concept C) is marked as a path to be strengthened.
[0031] Preferably, generating more natural and fluent new knowledge based on the path to be strengthened by interacting with the large language model includes:
[0032] Designing a second prompt template for interactive thinking, which includes asking questions about the relationship of the path to be strengthened and setting two corpus modes;
[0033] The first corpus mode is the reflective mode, which uses the second prompt template to only ask the large language model about the relationship, allowing the large language model to answer questions based on its existing knowledge. This attempts to stimulate the large language model's reflection and help it better understand the relationship between the two concepts in the reinforcement path.
[0034] The second corpus mode is the reference mode, which places the path to be strengthened after the relational query question in the second prompt template, and then gives the large language model a prompt to answer the question based on it.
[0035] Generate new knowledge based on the above two corpus patterns.
[0036] Preferably, fine-tune the large language model incorporating new knowledge, including:
[0037] Based on the new knowledge, the large language model is fine-tuned using Lora's fine-tuning method.
[0038] To achieve the above-mentioned purpose of the invention, an embodiment also provides a large language model self-evolution device based on ontology, including a memory and one or more processors, wherein the memory stores executable code, and when the one or more processors execute the executable code, they are used to implement the above-mentioned large language model self-evolution method based on ontology.
[0039] Compared with the prior art, the present invention has the following beneficial effects:
[0040] Based on a large language model embedded with medical, legal or financial fields, ontological concepts about the medical, legal or financial fields are generated from the large language model through question-answering interaction. On this basis, the ontological concepts generated step by step by the large language model are organized into a concept tree corresponding to the domain ontology, and each edge on the concept tree is marked as a knowledge path. The confusion and confidence of the large language model for each knowledge path on the concept tree are calculated. Based on the confidence, the reliable paths and paths to be strengthened in the concept tree are marked to filter out non-compliant ontological knowledge. Then, based on the paths to be strengthened, more natural and smooth new knowledge paths are generated through interaction with the large language model. The large language model is fine-tuned with the new knowledge to supplement and improve it, thereby achieving self-evolution in professional ontological knowledge. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0042] Figure 1 is a flow chart of a method for self-evolution of a large language model based on ontology provided by an embodiment;
[0043] Figure 2 An example diagram of the ontology-based large language model self-evolution method provided in the embodiment. DETAILED DESCRIPTION
[0044] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and do not limit the scope of protection of the present invention.
[0045] The inventive concept of this invention is that existing fine-tuning of large language models for specialized fields such as medicine, law, or finance often requires the use of large amounts of external professional corpora. This large amount of external professional corpora incurs significant human and resource costs. Therefore, embodiments of the present invention provide an ontology-based self-evolution method and apparatus for large language models, enabling the self-evolution of large language models in fields such as medicine, law, or finance, thereby reducing reliance on external resources and lowering the cost of improving the capabilities of large language models in specialized fields.
[0046] like Figure 1 As shown, the embodiment provides a method and device for self-evolution of a large language model based on ontology, including the following steps:
[0047] S1, based on the first prompt template for ontology knowledge extraction, generates ontology concepts in professional fields from a large language model through question-answering interaction.
[0048] Step S1 uses knowledge extraction technology to extract the parameterized expertise of the large language model into an explicit ontology structure. Specifically, a first prompt template for ontology knowledge extraction is defined. This prompt template includes: a defined professional domain, a given top-level professional concept, a requirement to generate subordinate concepts and their synonyms based on the top-level professional concept, and a requirement to organize the generated concepts into JSON format for output as ontology concepts. Specifically, through the first prompt template, the large language model is given a top-level professional concept and is instructed to generate its hyponyms and synonyms.
[0049] Taking the medical field as an example, Figure 2 As shown, the given first prompt template is "As a medical expert, you need to build an ontology in the medical field. Please generate strict subclasses under the top-level professional concept {layer concept (e.g., cell, antibiotic, vitamin)} and provide their synonyms. Please organize them into JSON format." Based on this first prompt template, the first-level concept of cell is neuron, the second-level concept is motor neuron, and the third-level concept is a synonym of the second-level concept, namely motor nerve cell. The ontology concepts generated by the large language model include drug names, biological tissues, physiological tissues, surgical names, disease names, body parts, doctor names, hospital names, etc.
[0050] S2, organizes the ontology concepts generated step by step by the large language model into a concept tree corresponding to the domain ontology, marks each edge on the concept tree as a knowledge path, and calculates the confusion and confidence of the large language model for each knowledge path on the concept tree, and marks the reliable paths and paths to be strengthened in the concept tree based on the confidence.
[0051] In the embodiment, the ontology concepts in JSON format with a hierarchical relationship generated according to step S1 form a concept tree corresponding to a domain ontology, wherein the concept tree includes a top-level professional concept in a single professional field, several layers of sub-concepts under the top-level professional concept, and synonym concepts of the sub-concepts. The concept tree reflects the cognition of the relationship between the top-level professional concept and the lower-level sub-concepts and synonym concepts in the large language model.
[0052] In the embodiment, each edge on the concept tree is also marked as a knowledge path, and each knowledge path reflects the relationship between two concepts, including synonym relationships and hypernym-hyponym relationships. Figure 2 As shown, such as the triples (neuron, belongs to, cell), (neuron, is a synonym of, nerve cell), (nerve cell, belongs to, cell), each triple is a knowledge path, among which, (neuron, belongs to, cell) reflects the subordinate relationship of the superordinate and hyponym, and (neuron, is a synonym of, nerve cell) reflects the synonym relationship.
[0053] In the embodiment, the perplexity of the large language model for each knowledge path on the concept tree is also calculated. The perplexity of each knowledge path is calculated using the perplexity calculation formula. Specifically, taking the synonym relationship as an example, for given synonyms 1 and synonyms 2, the following two paragraphs of text are designed, and the loss value of the token ("yes" or "no") output at the end of the two paragraphs of text is calculated as the perplexity.
[0054] The calculation text of forward perplexity is: Forward text = f'Please judge whether the following statement is true or false, and then answer with "yes" or "no": "{Synonym 1}" is a synonym of "{Synonym 2}". Answer: Yes';
[0055] The calculation text of reverse perplexity is: reverse text = f'Please judge whether the following statement is true or false, and then answer with "yes" or "no": "{Synonym 1}" is a synonym of "{Synonym 2}". Answer: No';
[0056] For hyponym and hyponym relationships, {Synonym 1}, "is a synonym of..." and {Synonym 2} in the text are replaced with the corresponding hyponym and hyponym relationships and concepts.
[0057] In the embodiment, a confidence calculation formula is also designed based on the perplexity, which reflects the confidence of the large language model for a certain knowledge path. The specific confidence calculation formula includes:
[0058] The confidence degree BeliefConf(min) calculation formula based on the minimum value of forward perplexity and reverse perplexity is:
[0059]
[0060] The second calculation formula of the confidence degree BeliefConf(max) based on the maximum value of the forward perplexity and the reverse perplexity is:
[0061]
[0062] The third calculation formula for the confidence degree BeliefConf(min) based on the difference between the forward perplexity and the reverse perplexity is:
[0063] BeliefConf(minus)=false_ppl-true_ppl
[0064] Among them, true_ppl and false_ppl represent the forward perplexity and reverse perplexity respectively.
[0065] During the specific calculation, one of the above three formulas is used to calculate the confidence of each knowledge path. In the embodiment, the confidence of each knowledge path in the concept tree is calculated to obtain the average confidence value and the confidence values corresponding to multiple quantiles. The average confidence value and the confidence values corresponding to multiple quantiles are marked as thresholds for subsequent confirmation of reliable paths. The confidence values corresponding to multiple quantiles include confidence values corresponding to 50%, 60%, 70%, 80%, and 90%.
[0066] In the embodiment, a pattern of reliable paths is defined, and the reliable paths in the above-mentioned concept tree are marked based on the degree of confidence. For multiple knowledge paths with a certain relationship between ontological concepts, such as (concept A, belongs to, concept B), (concept A, is a synonym, concept C), (concept C, belongs to, concept B), if the large language model gives these multiple knowledge paths a high degree of confidence exceeding a given threshold, it means that during pre-training, there are more corpora pointing to and supporting the two knowledge paths of (concept A, belongs to, concept B) and (concept C, belongs to, concept B), and marking these two knowledge paths as reliable paths. The purpose of finding a reliable path here first is that when two conflicting ontological knowledge are found, it is necessary to determine which one should be believed and discard the other.
[0067] like Figure 2 As shown, for (neuron, belongs to, cell), (neuron, is a synonym of nerve cell), (nerve cell, belongs to, cell), if there are more corpora pointing to and supporting the two knowledge paths of (neuron, belongs to, cell) and (nerve cell, belongs to, cell), then these two are reliable paths.
[0068] In the embodiment, a pattern for strengthening paths is also defined, and paths to be strengthened in the concept tree are marked. For example, if the large language model has a high degree of confidence in (Concept A, belongs to, Concept B) and (Concept B, belongs to, Concept C), both paths are reliable. According to the consistency rules of the ontology, these two reliable paths should be able to infer (Concept A, belongs to, Concept C). However, if the results given by the large language model actually indicate a high degree of confidence in (Concept A, does not belong to, Concept C), then it is considered that there is a knowledge conflict within the large language model, and the knowledge path (Concept A, belongs to, Concept C) is marked as a path to be strengthened.
[0069] like Figure 2 As shown, (motor neuron, belongs to, neuron), (neuron, belongs to, cell), should be able to infer (motor neuron, belongs to, cell), but this is in conflict with (motor neuron, does not belong to, cell) given by the large language model. At this time, (motor neuron, belongs to, cell) needs to be marked as the path to be strengthened.
[0070] Through the above method, the inconsistent parts of the large language model ontology knowledge are identified.
[0071] S3, based on the path to be strengthened, generates more natural and fluent new knowledge by interacting with the large language model, and fine-tunes the large language model based on the new knowledge to achieve self-evolution in professional ontology knowledge.
[0072] In one embodiment, when generating new knowledge paths as training corpus, a second prompt template is designed for interactive thinking. This second prompt template includes questions about the relationships between the paths to be strengthened. For example, for the knowledge path to be strengthened (Concept A, belongs to, Concept C), the second prompt template may be "Question: What is the relationship between Concept A and Concept C?" Two corpus modes are set: a reflective mode and a reference mode. New knowledge is generated based on the two corpus modes.
[0073] In the reflection mode, only the above questions are asked to the large language model, that is, only the relationship questions are asked to the large language model through the second prompt template, and the model is asked to answer the questions based on its own knowledge. The attempt is to stimulate the large language model to reflect so that the large language model can have a better understanding of the relationship between the two concepts in the reinforcement path.
[0074] In the reference mode, the path to be strengthened is placed after the relationship inquiry question in the second prompt template, that is, the knowledge (Concept A, belongs to, Concept C) is placed after the question, that is, "Question: What is the relationship between Concept A and Concept C? (Concept A, belongs to, Concept C)". By giving prompts to the large language model, the large language model can answer the question based on this.
[0075] After acquiring new knowledge, natural language data is generated based on the new knowledge path. Lora's fine-tuning approach is then used to fine-tune the large language model. This approach accurately supplements missing expertise and leverages the characteristics of ontology to enable self-evolution of the model independent of external resources, enhancing the model's expertise.
[0076] Based on the same inventive concept, an embodiment further provides an ontology-based large language model self-evolution device, comprising a memory and one or more processors. The memory stores executable code, and when the one or more processors execute the executable code, the device is used to implement the ontology-based large language model self-evolution method described above, specifically comprising the following steps:
[0077] S1, based on the first prompt template for ontology knowledge extraction, generates ontology concepts about professional fields from the large language model through question-answering interaction;
[0078] S2 organizes the ontology concepts generated by the large language model step by step into a concept tree corresponding to the domain ontology, marks each edge on the concept tree as a knowledge path, and calculates the confusion and confidence of the large language model for each knowledge path on the concept tree. Based on the confidence, it marks the reliable paths and paths to be strengthened in the concept tree.
[0079] S3, based on the path to be strengthened, generates more natural and fluent new knowledge by interacting with the large language model, and fine-tunes the large language model based on the new knowledge to achieve self-evolution in professional ontology knowledge.
[0080] The computing device provided in the embodiment, in addition to the processor and memory, also includes hardware required for other services such as internal bus, network interface, memory, etc. at the hardware level. The memory is a non-volatile memory, and the processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it to implement the ontology-based large language model self-evolution method described in S1-S3 above. Of course, in addition to software implementation, the present invention does not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc., that is, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0081] The specific implementation methods described above provide a detailed description of the technical solutions and beneficial effects of the present invention. It should be understood that the above is only the most preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, supplements and equivalent substitutions made within the scope of the principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A large language model self-evolution method based on ontology, characterized by: The following steps are involved: Based on the first prompt template for ontology knowledge extraction, ontology concepts about professional fields such as medicine, law or finance are generated from the large language model through question-answering interaction; Organize the ontology concepts generated by the large language model step by step into a concept tree corresponding to the domain ontology, mark each edge on the concept tree as a knowledge path, and calculate the confusion and confidence of the large language model for each knowledge path on the concept tree. Based on the confidence, mark the reliable paths and paths to be strengthened in the concept tree; Based on the path to be strengthened, more natural and fluent new knowledge is generated by interacting with the large language model, and the large language model is fine-tuned based on the new knowledge to achieve self-evolution in professional ontology knowledge.
2. The ontology-based large language model self-evolution method according to claim 1, characterized in that: The first prompt template for ontology knowledge extraction includes: a limited professional field, a given top-level professional concept, a requirement to generate subordinate concepts and synonym concepts based on the top-level professional concept, and a requirement to organize the generated concepts into JSON format for output as ontology concepts.
3. The ontology-based large language model self-evolution method according to claim 1, characterized in that: Organize the ontology concepts generated by the large language model step by step into a concept tree corresponding to the domain ontology, and mark each edge on the concept tree as a knowledge path, including: The concept tree includes a top-level professional concept in a single professional field, several sub-concepts under the top-level professional concept, and synonym concepts of the sub-concepts. The concept tree reflects the cognition of the relationship between the top-level professional concept and the sub-concepts and synonym concepts under the lower level. Each edge on the concept tree is marked as a knowledge path, and each knowledge path reflects the relationship between two concepts, including synonym relationships and hypernym-hyponym relationships.
4. The ontology-based large language model self-evolution method according to claim 1, characterized in that: Calculate the confidence of each knowledge path, including: The confidence calculation formula is designed based on the perplexity, including: The confidence degree BeliefConf(min) calculation formula based on the minimum value of forward perplexity and reverse perplexity is: The second calculation formula of the confidence degree BeliefConf(max) based on the maximum value of the forward perplexity and the reverse perplexity is: The third calculation formula for the confidence degree BeliefConf(min) based on the difference between the forward perplexity and the reverse perplexity is: BeliefConf(minus)=false_ppl-true_ppl Among them, true_ppl and false_ppl represent the forward perplexity and reverse perplexity respectively. During the specific calculation, one of the above three formulas is used to calculate the confidence of each knowledge path.
5. The ontology-based large language model self-evolution method according to claim 1, characterized in that: Reliable paths in the concept tree are marked based on confidence, including: For multiple knowledge paths with certain relationships between ontology concepts, such as (Concept A, belongs to, Concept B), (Concept A, is a synonym, Concept C), and (Concept C, belongs to, Concept B), if the large language model gives these multiple knowledge paths a high confidence level exceeding a given threshold, it means that during pre-training, a large amount of corpus simultaneously points to and supports the two knowledge paths of (Concept A, belongs to, Concept B) and (Concept C, belongs to, Concept B), and marks these two knowledge paths as reliable paths.
6. The ontology-based large language model self-evolution method according to claim 5, characterized in that: The given threshold is determined by: Calculate the confidence of each knowledge path in the concept tree, obtain the average confidence value and the confidence values corresponding to multiple quantiles, and mark the average confidence value and the confidence values corresponding to multiple quantiles as thresholds, where the confidence values corresponding to multiple quantiles include the confidence values corresponding to 50%, 60%, 70%, 80%, and 90%.
7. The ontology-based large language model self-evolution method according to claim 5, characterized in that: Based on the confidence level, the paths to be strengthened in the concept tree are marked, including: For multiple reliable paths screened, such as (Concept A, belongs to, Concept B) and (Concept B, belongs to, Concept C), these two reliable paths should be able to infer (Concept A, belongs to, Concept C) according to the consistency rules of the ontology. However, if the results given by the large language model actually show a high degree of confidence in (Concept A, does not belong to, Concept C), then it is considered that there is a knowledge conflict within the large language model. At this time, the knowledge path (Concept A, belongs to, Concept C) is marked as a path to be strengthened.
8. The ontology-based large language model self-evolution method according to claim 7, characterized in that: Generate more natural and fluent new knowledge based on the path to be strengthened by interacting with the large language model, including: Designing a second prompt template for interactive thinking, which includes asking questions about the relationship of the path to be strengthened and setting two corpus modes; The first corpus mode is the reflective mode, which uses the second prompt template to only ask the large language model about the relationship, allowing the large language model to answer questions based on its existing knowledge. This attempts to stimulate the large language model's reflection and help it better understand the relationship between the two concepts in the reinforcement path. The second corpus mode is the reference mode, which places the path to be strengthened after the relational query question in the second prompt template, and then gives the large language model a prompt to answer the question based on it. Generate new knowledge based on the above two corpus patterns.
9. The ontology-based large language model self-evolution method according to claim 1, characterized in that: Fine-tune the large language model by incorporating new knowledge, including: Based on the new knowledge, the large language model is fine-tuned using Lora's fine-tuning method.
10. A large language model self-evolution device based on ontology, comprising a memory and one or more processors, wherein the memory stores executable code, characterized in that: When the one or more processors execute the executable code, they are used to implement the ontology-based large language model self-evolution method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Knowledge discovery-oriented scientific experiment knowledge graph construction method and system
CN117725223A
Large language model method and system fusing pre-training and dynamic fine tuning technologies
CN119129719A
Dynamic ontology construction method based on large model
CN119691194A
Knowledge map creation method and apparatus for patent text, and storage medium and device
WO2024109097A1