A method and apparatus for training a vertical domain large model

CN122927423APending Publication Date: 2026-10-16ALIBABA (CHINA) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610779836.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-01
Publication Date
2026-10-16

AI Technical Summary

Technical Problem

[0002]随着大语言模型(Large Language Model,LLM)的发展,上述LLM面向全场景设计,知识面广、理解能力和生成能力均衡,擅长日常对话、通用写作、常识推理、基础问答,无行业偏向,泛用性强,但存在专业深度不足、领域知识老旧、行业规则不熟等问题,进而发展出了垂直领域LLM,上述垂直领域LLM聚焦单一专业场景,相比于上述LLM专业知识扎实,能解决较为复杂的专业问题

Benefits of technology

[0024] In this embodiment of the invention, multiple natural language statements, vertical domain knowledge corpora, and open domain corpora input by the user are acquired; at least one corresponding target structured knowledge is obtained from the vertical domain knowledge base based on each natural language statement; structured knowledge mounting samples are generated based on the natural language statements and the at least one target structured knowledge; a basic vertical domain large model is pre-trained based on the multiple structured knowledge mounting samples, the vertical domain knowledge corpora, and the open domain corpora to generate a pre-trained vertical domain large model; a post-training sample set is constructed, wherein the post-training sample set includes multiple training samples with multiple tasks, multiple roles, and multiple granularities; the pre-trained vertical domain large model is fine-tuned based on the post-training sample set to generate a target vertical domain large model. Through the above method, the performance of vertical domain LLMs can be improved. For example, in the field of content security, the risk identification and reasoning capabilities of the aforementioned vertical domain LLMs can be improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122927423A_ABST
    Figure CN122927423A_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose a method and device for vertical domain large model training. In the embodiments of the present application, a plurality of natural language sentences input by a user, vertical domain knowledge corpus and open domain corpus are obtained; at least one piece of target structured knowledge corresponding to each natural language sentence is obtained in a vertical domain knowledge base; a structured knowledge mounting sample is generated according to the natural language sentence and the at least one piece of target structured knowledge; a basic vertical domain large model is pre-trained according to a plurality of generated structured knowledge mounting samples, the vertical domain knowledge corpus and the open domain corpus, to generate a pre-trained vertical domain large model; a post-training sample set is constructed, and the post-training sample set includes a plurality of training samples of multiple tasks, multiple roles and multiple granularities; the pre-trained vertical domain large model is fine-tuned according to the post-training sample set, to generate a target vertical domain large model. Through the above method, the performance of the vertical domain LLM can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of artificial intelligence technology, and more specifically, to a method and apparatus for training large models in a vertical domain. Background Technology

[0002] With the development of Large Language Models (LLMs), the aforementioned LLMs are designed for all scenarios, with broad knowledge, balanced comprehension and generation capabilities, and are good at everyday conversations, general writing, common sense reasoning, and basic question answering. They are not industry-biased and have strong versatility, but they have problems such as insufficient professional depth, outdated domain knowledge, and unfamiliarity with industry rules. As a result, vertical domain LLMs have been developed. The aforementioned vertical domain LLMs focus on a single professional scenario. Compared with the aforementioned LLMs, they have solid professional knowledge and can solve more complex professional problems.

[0003] In existing technologies, the aforementioned LLMs are trained using massive domain-specific corpora to generate the aforementioned vertical domain LLMs. However, due to the lack of effective modeling of structured knowledge such as review standards, standard basis, and risk logic, the aforementioned vertical domain LLMs only learn surface-level language patterns, making it difficult to carry out deep-level reasoning that conforms to business specifications. Furthermore, traditional fine-tuning methods are prone to significant degradation of general language capabilities when injecting professional knowledge, which seriously restricts the practicality and robustness of the aforementioned vertical domain LLMs in real-world complex scenarios.

[0004] In conclusion, improving the performance of vertical domain LLM is a problem that needs to be solved. Summary of the Invention

[0005] In view of this, embodiments of the present invention provide a method and apparatus for training large models in a vertical domain, which can improve the performance of vertical domain LLM.

[0006] In a first aspect, embodiments of the present invention provide a method for training a large-scale vertical domain model. The method includes: acquiring multiple natural language statements, vertical domain knowledge corpora, and open-domain corpora input by a user; acquiring at least one corresponding target structured knowledge from a vertical domain knowledge base based on each natural language statement; generating structured knowledge-attached samples based on the natural language statements and the at least one target structured knowledge; pre-training a basic large-scale vertical domain model based on the multiple structured knowledge-attached samples, the vertical domain knowledge corpora, and the open-domain corpora to generate a pre-trained large-scale vertical domain model; constructing a post-training sample set, wherein the post-training sample set includes multiple training samples with multiple tasks, multiple roles, and multiple granularities; and fine-tuning the pre-trained large-scale vertical domain model based on the post-training sample set to generate a target large-scale vertical domain model.

[0007] Optionally, obtaining at least one target structured knowledge in the vertical domain knowledge base for each natural language statement specifically includes: determining the word-level semantics, phrase-level semantics, and sentence-level semantics of each natural language statement; and obtaining the at least one target structured knowledge in the vertical domain knowledge base based on the word-level semantics, phrase-level semantics, and sentence-level semantics, respectively.

[0008] Optionally, determining the word-level semantics, phrase-level semantics, and sentence-level semantics of each natural language statement specifically includes: inputting each natural language statement into a first open-source large language model to generate the word-level semantics, phrase-level semantics, and sentence-level semantics.

[0009] Optionally, obtaining the at least one target structured knowledge from the vertical domain knowledge base based on the word-level semantics, phrase-level semantics, and sentence-level semantics respectively includes: inputting the word-level semantics, phrase-level semantics, and sentence-level semantics into the first open-source large language model, and obtaining the at least one target structured knowledge from the vertical domain knowledge base through the first open-source large language model.

[0010] Optionally, obtaining the at least one target structured knowledge from the vertical domain knowledge base based on the word-level semantics, phrase-level semantics, and sentence-level semantics respectively includes: obtaining the at least one target structured knowledge from the vertical domain knowledge base based on the word-level semantics, the phrase-level semantics, the sentence-level semantics, and pre-defined rules.

[0011] Optionally, generating a structured knowledge mounting sample based on the natural language statement and the at least one target structured knowledge specifically includes: semantically associating and aligning the natural language statement and the at least one target structured knowledge to generate the structured knowledge mounting sample, wherein the structured knowledge mounting sample is text described in natural language.

[0012] Optionally, the construction of the post-training sample set specifically includes: inputting historical raw data into the second open-source large language model to construct multiple post-training samples; the multiple post-training samples constitute the post-training sample set.

[0013] Optionally, the multitasking includes risk understanding and identification, instruction compliance, knowledge-based question answering, risk attribution, knowledge-based reasoning, and business standard differences.

[0014] Secondly, embodiments of the present invention provide an apparatus for training a large vertical domain model. The apparatus includes: an acquisition unit, configured to acquire multiple natural language statements, vertical domain knowledge corpora, and open domain corpora input by a user; the acquisition unit is further configured to acquire at least one corresponding target structured knowledge in a structured knowledge base based on each natural language statement; a generation unit, configured to generate structured knowledge mounting samples based on the natural language statements and the at least one target structured knowledge; a training unit, configured to pre-train a basic large vertical domain model based on the multiple structured knowledge mounting samples, the vertical domain knowledge corpora, and the open domain corpora, generating a pre-trained large vertical domain model; and a construction unit, configured to construct a post-training sample set, wherein the post-training sample set includes multiple training samples with multiple tasks, multiple roles, and multiple granularities; the training unit is further configured to fine-tune the pre-trained large vertical domain model based on the post-training sample set, generating a target large vertical domain model.

[0015] Optionally, the acquisition unit is specifically used to: determine the word-level semantics, phrase-level semantics, and sentence-level semantics of each of the natural language statements; and acquire at least one target structured knowledge from the vertical domain knowledge base based on the word-level semantics, phrase-level semantics, and sentence-level semantics, respectively.

[0016] Optionally, the acquisition unit is further configured to: input each of the natural language statements into the first open-source large language model to generate the word-level semantics, the phrase-level semantics, and the sentence-level semantics.

[0017] Optionally, the acquisition unit is further configured to: input the word-level semantics, phrase-level semantics, and sentence-level semantics into the first open-source large language model, and acquire the at least one target structured knowledge from the vertical domain knowledge base through the first open-source large language model.

[0018] Optionally, the acquisition unit is further configured to: acquire the at least one target structured knowledge from the vertical domain knowledge base based on the word-level semantics, the phrase-level semantics, the sentence-level semantics, and pre-defined rules.

[0019] Optionally, the generation unit is specifically used to: semantically associate and align the natural language statement and the at least one target structured knowledge to generate the structured knowledge mounting sample, wherein the structured knowledge mounting sample is text described in natural language.

[0020] Optionally, the construction unit is specifically used to: input historical raw data into the second open-source large language model to construct multiple post-training samples; the multiple post-training samples constitute the post-training sample set.

[0021] Optionally, the multitasking includes risk understanding and identification, instruction compliance, knowledge-based question answering, risk attribution, knowledge-based reasoning, and business standard differences.

[0022] Thirdly, embodiments of the present invention provide an electronic device, including a memory and a processor, wherein the memory is used to store one or more computer program instructions, wherein the one or more computer program instructions are executed by the processor to implement the method as described in the first aspect or any one of the possible methods of the first aspect.

[0023] Fourthly, embodiments of the present invention provide a computer-readable storage medium having stored thereon computer program instructions that, when executed by a processor, implement the method as described in the first aspect or any one of the possibilities of the first aspect.

[0024] In this embodiment of the invention, multiple natural language statements, vertical domain knowledge corpora, and open domain corpora input by the user are acquired; at least one corresponding target structured knowledge is obtained from the vertical domain knowledge base based on each natural language statement; structured knowledge mounting samples are generated based on the natural language statements and the at least one target structured knowledge; a basic vertical domain large model is pre-trained based on the multiple structured knowledge mounting samples, the vertical domain knowledge corpora, and the open domain corpora to generate a pre-trained vertical domain large model; a post-training sample set is constructed, wherein the post-training sample set includes multiple training samples with multiple tasks, multiple roles, and multiple granularities; the pre-trained vertical domain large model is fine-tuned based on the post-training sample set to generate a target vertical domain large model. Through the above method, the performance of vertical domain LLMs can be improved. For example, in the field of content security, the risk identification and reasoning capabilities of the aforementioned vertical domain LLMs can be improved. Attached Figure Description

[0025] The above and other objects, features and advantages of the present invention will become clearer from the following description of embodiments of the invention with reference to the accompanying drawings, in which: Figure 1 This is a flowchart of a method for training a large model in a vertical domain according to an embodiment of the present invention; Figure 2 This is a flowchart of another method for training large models in a vertical domain according to an embodiment of the present invention; Figure 3 This is a schematic diagram of a device for training a large model in a vertical domain according to an embodiment of the present invention; Figure 4 This is a schematic diagram of an electronic device according to an embodiment of the present invention. Detailed Implementation

[0026] The present application is described below based on embodiments, but it is not limited to these embodiments. In the detailed description of the present application below, certain specific details are described in detail. Those skilled in the art can fully understand the present application without these details. To avoid obscuring the substance of the present application, well-known methods, processes, flows, elements, and circuits are not described in detail.

[0027] Furthermore, those skilled in the art should understand that the accompanying drawings provided herein are for illustrative purposes only and are not necessarily drawn to scale.

[0028] Unless the context explicitly requires it, words such as "including" or "contains" throughout the application should be interpreted as including rather than exclusive or exhaustive; that is, meaning "including but not limited to".

[0029] In the description of this application, it should be understood that the terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance. Furthermore, in the description of this application, unless otherwise stated, "a plurality of" means two or more.

[0030] In existing technologies, open-source LLMs are trained using massive domain-specific corpora to generate the aforementioned vertical domain LLMs. However, due to the lack of effective modeling of structured knowledge such as review standards, standard bases, and risk logic, these vertical domain LLMs only learn surface-level language patterns, making it difficult to conduct deep reasoning that conforms to business specifications. Furthermore, traditional fine-tuning methods are prone to significant degradation of general language capabilities when injecting professional knowledge, severely restricting the practicality and robustness of these vertical domain LLMs in real-world complex scenarios. The vertical domains of these vertical domain LLMs include content security, financial regulation, and medical review.

[0031] Taking content security as an example, in order to improve the risk identification and reasoning capabilities of LLM in security scenarios with high compliance requirements such as security content, domain-specific corpora and general corpora are mixed in the pre-training or fine-tuning stages, or external knowledge bases are dynamically introduced during reasoning through retrieval-augmented generation. However, the above methods suffer from the problem of "shallow coupling" between knowledge and LLM, causing the LLM to only memorize surface co-occurrence patterns and failing to establish an interpretable and generalizable reasoning path from input expression to structured judgment logic. To alleviate the above problems, existing technologies have adopted more refined knowledge injection mechanisms. For example, knowledge distillation is used to use the judgment results of the rule engine or small model as soft labels to supervise the output of the large model. Question-answer pairs with knowledge references are introduced in instruction fine-tuning to try to guide the model to learn the mapping relationship between knowledge and conclusion. The above methods have achieved certain results on specific tasks, but still have significant defects, as follows: First, knowledge injection is separated from the LLM training process, whether it is retrieval-augmented generation (Retrieval-Augmented Generation) or LLM training. Whether it's generation (RAG) or posterior rule validation, the knowledge is not internalized into the inherent reasoning ability of LLM, leading to a sharp drop in generalization ability in new scenarios without retrieval support or rule coverage. Secondly, using entire standard texts or rule labels as additional input makes them susceptible to interference from irrelevant context. Finally, it's difficult to coordinate the optimization of general capabilities and domain knowledge. Most solutions use "full domain corpus fine-tuning" or "freezing some parameters and injecting knowledge," which easily leads to catastrophic forgetting. The aforementioned LLMs show slight improvement in risk identification tasks, but significantly degrade in general capabilities. Therefore, how to improve the performance of vertical domain LLMs is a problem that needs to be solved.

[0032] In this embodiment of the invention, the LLM mentioned above refers to a deep learning model with a large number of parameters that is pre-trained on massive amounts of text and has powerful natural language understanding, generation and reasoning capabilities. It is widely used in tasks such as question answering, content creation and code generation. The LLM can also be called a large model, model, etc.

[0033] In this embodiment of the invention, to address the aforementioned problems, a method for training large-scale models in vertical domains is proposed, specifically as follows: Figure 1 As shown, the method includes: Step S101: Obtain multiple natural language statements, vertical domain knowledge corpora, and open domain corpora input by the user.

[0034] Specifically, taking the field of content security as an example, the natural language statement input by the user can be "selling homemade anesthetics", the vertical domain knowledge corpus can be knowledge corpus of the content security field, the open domain corpus can be corpus of other or general domains, and the corpus can be web page content, document content, database content, etc., which are determined according to the actual situation.

[0035] Step S102: Based on each of the natural language statements, at least one target structured knowledge is used.

[0036] Specifically, the word-level semantics, phrase-level semantics, and sentence-level semantics of each of the natural language statements are determined; and the at least one target structured knowledge is obtained from the vertical domain knowledge base based on the word-level semantics, phrase-level semantics, and sentence-level semantics, respectively.

[0037] In one possible implementation, determining the word-level semantics, phrase-level semantics, and sentence-level semantics of each natural language statement specifically includes: inputting each natural language statement obtained from the vertical domain knowledge base into a first open-source large language model to generate the word-level semantics, the phrase-level semantics, and the sentence-level semantics.

[0038] In one possible implementation, obtaining the at least one target structured knowledge from the vertical domain knowledge base based on the word-level semantics, phrase-level semantics, and sentence-level semantics respectively includes: inputting the word-level semantics, phrase-level semantics, and sentence-level semantics into the first open-source large language model, and obtaining the at least one target structured knowledge from the vertical domain knowledge base through the first open-source large language model; or, obtaining the at least one target structured knowledge from the vertical domain knowledge base based on the word-level semantics, the phrase-level semantics, the sentence-level semantics, and pre-defined rules; that is, establishing semantic mapping at the word-level, phrase-level, and sentence-level granularities.

[0039] For example, the vertical domain knowledge base includes structured knowledge defined by attributes, such as <entity: narcotic drugs>, <relationship: prohibited from sale>, <basis: Article 42 of the Drug Administration Law>, <limiting condition: not for teaching / research purposes>; this is only an illustrative example.

[0040] In this embodiment of the invention, the vertical domain knowledge base includes structured knowledge defined by attributes, which can also be referred to as the knowledge graph of the vertical domain.

[0041] Assuming that the aforementioned "selling homemade anesthetics" obtains structured knowledge such as "anesthetic drugs" and "prohibited from sale" from the vertical domain knowledge base, it can also obtain structured knowledge such as domain knowledge, review standards, risk definitions, and judgment logic from the vertical domain knowledge base.

[0042] Step S103: Generate a structured knowledge mounting sample based on the natural language statement and at least one target structured knowledge.

[0043] Specifically, the natural language statement and the at least one target structured knowledge are semantically associated and aligned to generate the structured knowledge mounting sample, wherein the structured knowledge mounting sample is text described in natural language.

[0044] In this embodiment of the invention, the structured knowledge mounting sample displays the semantic association between the modeling input statement and structured knowledge. The knowledge mounting method used in the structured knowledge mounting sample belongs to knowledge-augmented training, which refers to the explicit integration of external knowledge during the LLM training stage. Through joint training, knowledge injection, retrieval enhancement and other technologies, the factual accuracy, domain professionalism and logical reasoning ability of LLM are improved, effectively alleviating the illusion problem.

[0045] Step S104: Pre-train the basic vertical domain large model based on multiple structured knowledge mounting samples, the vertical domain knowledge corpus, and the open domain corpus to generate a pre-trained vertical domain large model.

[0046] In this embodiment of the invention, in order to retain the general capabilities of the vertical domain large model while training its specialized capabilities, and to balance knowledge adaptation and general capability retention, structured knowledge-mounted samples, the vertical domain knowledge corpus, and the open domain corpus are introduced to perform further pre-training for domain adaptation, thereby generating a pre-trained vertical domain large model; the above pre-training process can also be referred to as continued pre-training.

[0047] Step S105: Construct a post-training sample set, wherein the post-training sample set includes multiple training samples with multiple tasks, multiple roles, and multiple granularities.

[0048] Specifically, historical raw data is input into the second open-source large language model to construct multiple post-training samples; the multiple post-training samples constitute the post-training sample set; wherein, the multi-task includes risk understanding and identification, instruction compliance, knowledge question answering, risk attribution, knowledge reasoning, and business standard differences.

[0049] In one possible implementation, different training samples include content with different tasks, roles, granularities, and prompts. The risk understanding and identification, instruction compliance, knowledge-based question answering, risk attribution, knowledge reasoning, and business standard differences in these multi-tasks can also be referred to as capability dimensions. Specifically, risk understanding and identification refers to understanding and identifying content security risks, extracting risk elements from the text, such as keywords or risk fragments, as well as some implicit references, and associating them with corresponding risk points for training. This helps the model learn the risk distribution of various risks and the reasons why samples are judged as violations. Instruction compliance refers to the expectation that the model can well understand and activate its inherent knowledge for instructions in different tasks, while facilitating subsequent customized risk prevention and control needs. Therefore, diverse instruction data is used for model training, and the risk standards of the instructions are flipped and replaced to avoid the model directly judging the riskiness of the text using risk knowledge. Knowledge-based question answering refers to using knowledge descriptions for enhancement in the post-training stage to ask questions about entity content. To enhance the correlation between knowledge and risk, risk point information was incorporated into the training data. Explicit guidance enabled the model to connect learned knowledge with real-world risk scenarios, rather than processing information in isolation. Risk attribution refers to the model actively generating specific evidence for risk judgment, forcing it to shift from simple "risk label matching" to deeper semantic analysis. By generating attribution reasons, the model can learn specific risk triggers, such as specific vocabulary. Simultaneously, similar to contrastive learning, the model distinguishes between correct and incorrect attributions, gaining a deeper understanding of the characteristics of different risk types. Knowledge reasoning refers to the model learning step-by-step decision-making and causal chain reasoning capabilities for risk judgment through a clear "risk mention - semantic analysis - aggression identification - result output" process. This is suitable for content security scenarios requiring strict adherence to review rules. The step-by-step decision-making capability includes first verifying entity relevance and then assessing aggression. Business standard differences refer to the varying definitions of risk standards across different businesses; therefore, the model considers differentiated risk identification capabilities tailored to different business scenarios. During training, risk data from various business scenarios were injected to enhance the model's sensitivity to different prevention and control scenarios.

[0050] Step S106: Fine-tune the pre-trained vertical domain large model based on the post-training sample set to generate the target vertical domain large model.

[0051] In this embodiment of the invention, by continuing the knowledge mounting mechanism in the pre-training stage, structured knowledge and real text samples are semantically aligned with fine-grained semantics at the word, phrase, and sentence levels. During training, LLM learns the mapping relationship between expression and knowledge. While introducing structured knowledge mounting samples and content security professional corpora, large-scale open-domain corpora are continuously mixed in. Sample sets covering multiple dimensions such as knowledge retrieval, logical reasoning, risk classification, and attribution explanation are designed. Through fine-grained mounting of structured knowledge, multi-task-driven knowledge understanding training, and synergistic optimization of general-domain capabilities, the systemic defects of existing technologies in terms of knowledge internalization depth and general capability degradation are overcome.

[0052] In one possible implementation, after step S106, the method further includes other steps, specifically as follows: Figure 2 As shown, it includes the following: Step S107: Input the user statement to be processed into the target vertical domain large model to generate the target result.

[0053] Through the above embodiments, by designing a structured knowledge mounting mechanism, fine-grained knowledge such as review standards and knowledge descriptions are aligned with real text at multiple levels, including words, phrases, and sentences, enabling controllable reasoning. This allows for accurate activation of relevant risk judgment logic without external retrieval. Furthermore, a "knowledge-task" joint training framework is constructed. Through multi-task instruction fine-tuning and explicit knowledge reference constraints, risk identification performance is significantly improved while effectively mitigating catastrophic forgetting. This approach combines high accuracy, strong interpretability, and good generalization. The resulting target vertical domain large-scale model not only effectively mitigates catastrophic forgetting but also improves performance in risk task methods.

[0054] In this embodiment of the invention, an apparatus for training large models in a vertical domain is provided, such as... Figure 3 As shown, the device includes: an acquisition unit 301, a generation unit 302, a training unit 303, and a construction unit 304; The acquisition unit 301 is used to acquire multiple natural language statements, vertical domain knowledge corpora, and open domain corpora input by the user; the acquisition unit 301 is also used to acquire at least one corresponding target structured knowledge in a structured knowledge base based on each natural language statement; the generation unit 302 is used to generate structured knowledge mounting samples based on the natural language statements and the at least one target structured knowledge; the training unit 303 is used to pre-train the basic vertical domain large model based on the multiple structured knowledge mounting samples, the vertical domain knowledge corpora, and the open domain corpora, generating a pre-trained vertical domain large model; the construction unit 304 is used to construct a post-training sample set, wherein the post-training sample set includes multiple training samples with multiple tasks, multiple roles, and multiple granularities; the training unit 303 is also used to fine-tune the pre-trained vertical domain large model based on the post-training sample set, generating a target vertical domain large model.

[0055] Furthermore, the acquisition unit is specifically used to: determine the word-level semantics, phrase-level semantics, and sentence-level semantics of each of the natural language statements; and acquire the at least one target structured knowledge from the vertical domain knowledge base based on the word-level semantics, phrase-level semantics, and sentence-level semantics, respectively.

[0056] Furthermore, the acquisition unit is specifically used to: input each of the natural language statements into the first open-source large language model to generate the word-level semantics, the phrase-level semantics, and the sentence-level semantics.

[0057] Furthermore, the acquisition unit is specifically used to: input the word-level semantics, phrase-level semantics, and sentence-level semantics into the first open-source large language model, and acquire the at least one target structured knowledge from the vertical domain knowledge base through the first open-source large language model.

[0058] Furthermore, the acquisition unit is specifically used to: acquire the at least one target structured knowledge from the vertical domain knowledge base based on the word-level semantics, the phrase-level semantics, the sentence-level semantics, and the pre-set rules.

[0059] Furthermore, the generation unit is specifically used to: semantically associate and align the natural language statement and the at least one target structured knowledge to generate the structured knowledge mounting sample, wherein the structured knowledge mounting sample is text described in natural language.

[0060] Furthermore, the construction unit is specifically used to: input historical raw data into the second open-source large language model to construct multiple post-training samples; the multiple post-training samples constitute the post-training sample set.

[0061] Furthermore, the multitasking includes risk understanding and identification, instruction compliance, knowledge-based question answering, risk attribution, knowledge-based reasoning, and business standard differences.

[0062] Figure 4 This is a schematic diagram of the structure of the electronic device described in an embodiment of the present invention. Figure 4 As shown, it includes a general computer hardware architecture, which includes at least a processor 401 and a memory 402. The processor 401 and the memory 402 are connected via a bus 403. The memory 402 is adapted to store instructions or programs executable by the processor 401. The processor 401 can be a standalone microprocessor or a collection of one or more microprocessors. Thus, the processor 401 executes the instructions stored in the memory 402 to perform the method flow of the embodiments of the present invention as described above, thereby realizing data processing and control of other devices. The bus 403 connects the above-mentioned components together, and also connects the above-mentioned components to the display controller 404, the display device, and the input / output (I / O) device 405. The input / output (I / O) device 405 can be a mouse, keyboard, modem, network interface, touch input device, motion-sensing input device, printer, and other devices known in the art. Typically, the input / output device 405 is connected to the system via an input / output (I / O) controller 406.

[0063] The instructions stored in memory 402 are executed by at least one processor 401 to: acquire multiple natural language statements, vertical domain knowledge corpora, and open domain corpora input by the user; acquire at least one corresponding target structured knowledge from the vertical domain knowledge base based on each natural language statement; generate structured knowledge mounting samples based on the natural language statements and the at least one target structured knowledge; pre-train a basic vertical domain large model based on the multiple structured knowledge mounting samples, the vertical domain knowledge corpora, and the open domain corpora to generate a pre-trained vertical domain large model; construct a post-training sample set; and fine-tune the pre-trained vertical domain large model based on the post-training sample set to generate a target vertical domain large model.

[0064] Specifically, the electronic device includes: one or more processors 401 and a memory 402. Figure 4 Take a processor 401 as an example. The processor 401 and the memory 402 can be connected via a bus or other means. Figure 4Taking a bus connection as an example, memory 402, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules. Processor 401 executes various functional applications and data processing of the device by running the non-volatile software programs, instructions, and modules stored in memory 402, thereby realizing the aforementioned method for determining the training of large-scale models in a vertical domain.

[0065] Memory 402 may include a program storage area and a data storage area, wherein the program storage area may store the operating system and applications required for at least one function; the data storage area may store an option list, etc. Furthermore, memory 402 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some embodiments, memory 402 may optionally include memory remotely located relative to processor 401, and these remote memories may be connected to external devices via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0066] One or more modules are stored in memory 402, and when executed by one or more processors 401, they perform the method for training a large model in a vertical domain in any of the above method embodiments.

[0067] As those skilled in the art will recognize, various aspects of the embodiments of the present invention can be implemented as a system, method, or computer program product. Therefore, various aspects of the embodiments of the present invention can take the form of a completely hardware implementation, a completely software implementation (including firmware, resident software, microcode, etc.), or an implementation combining software and hardware aspects, which may generally be referred to herein as a "circuit," "module," or "system." Furthermore, various aspects of the embodiments of the present invention can take the form of a computer program product implemented in one or more computer-readable media having computer-readable program code implemented thereon.

[0068] Any combination of one or more computer-readable media can be used. A computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium can be, for example, (but not limited to) an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or apparatus, or any suitable combination thereof. More specific examples (not an exhaustive list) of computer-readable storage media will include: an electrical connection having one or more wires, a portable computer floppy disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable optical disc read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In the context of embodiments of the present invention, a computer-readable storage medium can be any tangible medium capable of containing or storing a program used by or in conjunction with an instruction execution system, device, or apparatus.

[0069] Computer-readable signal media may include propagated digital signals having computer-readable program code implemented therein, such as in baseband or as part of a carrier wave. Such propagated signals may take any of a variety of forms, including, but not limited to, electromagnetic, optical, or any suitable combination thereof. A computer-readable signal medium may be any computer-readable medium that is not a computer-readable storage medium and can communicate, propagate, or transmit a program used by or in conjunction with an instruction execution system, device, or apparatus.

[0070] Program code implemented on a computer-readable medium may be transmitted using any suitable medium, including but not limited to wireless, wired, fiber optic cable, RF, or any suitable combination thereof.

[0071] Computer program code for performing operations relating to various aspects of embodiments of the present invention can be written in any combination of one or more programming languages, including: object-oriented programming languages ​​such as Java, Smalltalk, C++, etc.; and conventional procedural programming languages ​​such as the "C" programming language or similar programming languages. The program code can be executed as a standalone software package entirely on the user's computer, partially on the user's computer, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the latter case, the remote computer can be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (e.g., via the Internet provided by an Internet service provider).

[0072] The flowchart illustrations and / or block diagrams of the methods, apparatus (systems), and computer program products according to embodiments of the present invention describe various aspects of the embodiments of the present invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus to produce a machine such that the instructions (executed via the processor of the computer or other programmable data processing apparatus) create means for implementing the functions / actions specified in the flowchart and / or block diagram blocks or blocks.

[0073] These computer program instructions may also be stored in a computer-readable medium that can direct a computer, other programmable data processing apparatus or other means to operate in a particular manner, such that the instructions stored in the computer-readable medium produce an article of writing that includes instructions that implement the functions / actions specified in flowchart and / or block diagram blocks or blocks.

[0074] Computer program instructions may also be loaded onto a computer, other programmable data processing apparatus or other device to cause a series of operable steps to be performed on the computer, other programmable apparatus or other device to produce a computer-implemented process, such that the instructions, which execute on the computer or other programmable apparatus, provide for implementing the functions / actions specified in flowchart and / or block diagram blocks or blocks.

[0075] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.

[0076] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, and displayed data) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use, and processing of such data must comply with the relevant laws, regulations, and standards of the relevant countries and regions, and corresponding access points are provided for users to choose to authorize or refuse processing. A user's refusal to process personal information beyond what is necessary for basic functions will not affect the user's use of basic functions.

Claims

1. A method for training large models in a vertical domain, characterized in that, The method includes: Acquire multiple natural language statements, vertical domain knowledge corpora, and open domain corpora input by users; Based on each of the natural language statements, at least one corresponding target structured knowledge is obtained from the vertical domain knowledge base; Generate a structured knowledge-mounted sample based on the natural language statement and at least one target structured knowledge; The basic vertical domain large model is pre-trained based on multiple structured knowledge mounting samples, the vertical domain knowledge corpus, and the open domain corpus to generate a pre-trained vertical domain large model. Construct a post-training sample set, wherein the post-training sample set includes multiple training samples with multiple tasks, multiple roles, and multiple granularities; The pre-trained vertical domain large model is fine-tuned based on the post-training sample set to generate the target vertical domain large model.

2. The method according to claim 1, characterized in that, The step of obtaining at least one corresponding target structured knowledge from the vertical domain knowledge base based on each of the natural language statements specifically includes: Determine the word-level semantics, phrase-level semantics, and sentence-level semantics of each of the natural language statements; At least one target structured knowledge is obtained from the vertical domain knowledge base based on the word-level semantics, phrase-level semantics, and sentence-level semantics, respectively.

3. The method according to claim 2, characterized in that, The determination of the word-level semantics, phrase-level semantics, and sentence-level semantics of each of the natural language statements specifically includes: Each of the natural language statements is input into the first open-source large language model to generate the word-level semantics, the phrase-level semantics, and the sentence-level semantics.

4. The method according to claim 3, characterized in that, The step of obtaining at least one target structured knowledge from the vertical domain knowledge base based on the word-level semantics, phrase-level semantics, and sentence-level semantics respectively specifically includes: The word-level semantics, phrase-level semantics, and sentence-level semantics are input into the first open-source large language model, and the first open-source large language model is used to obtain the at least one target structured knowledge from the vertical domain knowledge base.

5. The method according to claim 3, characterized in that, The step of obtaining at least one target structured knowledge from the vertical domain knowledge base based on the word-level semantics, phrase-level semantics, and sentence-level semantics respectively specifically includes: Based on the word-level semantics, the phrase-level semantics, the sentence-level semantics, and the pre-defined rules, at least one target structured knowledge is obtained from the vertical domain knowledge base.

6. The method according to claim 1, characterized in that, The step of generating structured knowledge-mounted samples based on the natural language statement and the at least one target structured knowledge specifically includes: The natural language statement and the at least one target structured knowledge are semantically associated and aligned to generate the structured knowledge mounting sample, wherein the structured knowledge mounting sample is text described in natural language.

7. The method according to claim 1, characterized in that, The constructed training sample set specifically includes: The historical raw data is input into the second open-source large language model to construct multiple post-training samples; The multiple post-training samples constitute the post-training sample set.

8. The method according to claim 1, characterized in that, The multitasking includes risk understanding and identification, instruction compliance, knowledge-based question answering, risk attribution, knowledge-based reasoning, and differences in business standards.

9. A device for training large models in a vertical domain, characterized in that, The device includes: The acquisition unit is used to acquire multiple natural language statements, vertical domain knowledge corpora, and open domain corpora input by the user. The acquisition unit is further configured to acquire at least one corresponding target structured knowledge from the structured knowledge base based on each natural language statement; The generation unit is used to generate a structured knowledge-mounted sample based on the natural language statement and the at least one target structured knowledge. The training unit is used to pre-train the basic vertical domain large model based on multiple structured knowledge mounting samples, the vertical domain knowledge corpus, and the open domain corpus, thereby generating a pre-trained vertical domain large model. A construction unit is used to construct a post-training sample set, wherein the post-training sample set includes multiple training samples with multiple tasks, multiple roles, and multiple granularities. The training unit is also used to fine-tune the pre-trained vertical domain large model based on the post-training sample set to generate the target vertical domain large model.

10. An electronic device comprising a memory and a processor, characterized in that, The memory is used to store one or more computer program instructions, wherein the one or more computer program instructions are executed by the processor to implement the method as described in any one of claims 1-8.

11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method as described in any one of claims 1-8.