The invention discloses an ontology-based large
language model self-evolution method and device, and the method comprises the steps: generating an ontology concept related to a professional field from a large
language model through a question and answer
interaction mode based on a first prompt template for ontology
knowledge extraction, and enabling the professional field to comprise the medical, legal or financial field; the ontology concepts generated by the large
language model step by step are organized into a
concept tree corresponding to the domain ontology, each edge on the
concept tree is marked as a knowledge path, the
confusion degree and the certainty degree of the large language model on each knowledge path on the
concept tree are calculated, and a reliable path and a to-be-reinforced path in the concept tree are marked based on the certainty degree; on the basis of the to-be-enhanced path, more natural and smoother new knowledge is generated through interaction with the large language model, fine adjustment is conducted on the large language model in combination with the new knowledge, in this way, deficient professional knowledge can be accurately supplemented, model self-evolution independent of external resources is achieved through the characteristics of the ontology, and the professional ability of the model is improved.