Industrial safety risk management-oriented domain large language model construction method

CN122819484APending Publication Date: 2026-09-25SICHUAN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611037468.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-13
Publication Date
2026-09-25

AI Technical Summary

Technical Problem

本发明提出一种面向工业安全风险管理的领域大语言模型构建方法,目的在于解决通用大语言模型在工业安全场景中存在的专业知识不足、法规条款理解不准确、风险因素覆盖不完整、应急处置优先级不明确的问题

Benefits of technology

首先,在工业安全知识理解与风险推理能力上,本发明将工业安全领域语料构建、主题导向语义筛选、文档类型自适应指令生成与领域大语言模型训练过程进行有机结合,形成了从领域知识获取到场景化风险推理的连续处理能力。相比直接使用通用大语言模型,本发明能够使模型更加充分地学习安全工程术语、法规条文表达、事故调查报告结构、应急预案流程以及高风险作业场景中的危险源描述方式,从而提升模型在安全知识问答、事故原因分析、法规条款补充、风险因素识别和应急处置建议生成等任务中的专业性和准确性。特别是在矿山、危险化学品、金属冶炼、能源电力、受限空间作业等高风险工业场景中,模型能够根据输入场景识别人员行为、设备设施、环境条件和管理流程中的关键风险因素,并进一步给出主导危险源、处置优先级、禁止行为和复工条件,实现从一般文本生成到工业安全风险管理辅助决策的能力提升。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122819484A_ABST
    Figure CN122819484A_ABST
Patent Text Reader

Abstract

The application discloses a field large language model construction method for industrial safety risk management. The method comprises the following steps: collecting industrial safety professional documents and candidate public corpus, and performing optical character recognition analysis, format normalization, denoising, deduplication, quality filtering and structured segmentation; constructing an industrial safety capability theme set, and combining a theme-oriented semantic filtering method to construct a field adaptive pre-training corpus; identifying the document type of the candidate text segment, selecting an adaptive instruction generation template according to the document type, and calling a teacher model to generate a field instruction sample; training the large language model through a progressive field adaptation training process; constructing an industrial safety evaluation set for industrial safety risk management, performing multi-dimensional capability evaluation on the candidate model, and selecting a target model according to the evaluation result. The application can improve the industrial safety term understanding, accident report reasoning, risk factor identification and emergency disposal suggestion generation capability of the large language model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of artificial intelligence and natural language processing technology, and in particular to a method for constructing a domain-specific large language model for industrial safety risk management. This method can be used for safety knowledge Q&A, accident analysis, risk factor identification, and emergency decision support in high-risk industrial scenarios such as mining, hazardous chemicals, metal smelting, energy and power, confined space operations, and emergency response. Background Technology

[0002] With the widespread application of large language models in knowledge-based question answering, text generation, and complex reasoning tasks, their use in industrial safety risk management is of significant value. Industrial safety risk management involves high-risk industries such as mining, hazardous chemicals, metal smelting, and energy and power. Relevant knowledge sources include laws and regulations, technical standards, accident investigation reports, emergency plans, safety engineering textbooks, company operating procedures, and internal technical documents. These texts are characterized by specialized terminology, complex hierarchical clauses, long accident chains, and high coupling of risk factors. This requires models not only to understand safety production knowledge but also to perform context-based reasoning from regulations, identify primary hazard sources, determine response priorities, and generate emergency measures within specific scenarios.

[0003] While existing general-purpose language models possess strong natural language understanding and generation capabilities, they still have significant shortcomings when directly applied to industrial safety risk management. On one hand, these general-purpose models lack specialized terminology systems, regulatory expressions, and accident reporting knowledge specific to industries such as mining, chemicals, metallurgy, and power. This can easily lead to factual errors or logical biases in hazard identification, regulatory interpretation, risk level assessment, and emergency response recommendations. On the other hand, industrial safety scenarios exhibit asymmetric risk characteristics. Omitting hazardous factors can result in personal injury and significant property damage, while excessive conservatism typically only increases production costs. Therefore, model outputs should prioritize procedural prudence, regulatory fidelity, and complete coverage of risk factors.

[0004] Existing natural language processing methods in the security field mostly focus on single tasks such as incident classification, entity extraction, risk warning, report generation, and compliance testing, lacking a complete technical process encompassing domain-specific corpus construction, domain-adaptive pre-training, domain-supervised fine-tuning, preference alignment and adaptability testing, and security assessment screening. Furthermore, existing methods struggle to simultaneously meet the multi-dimensional requirements of professional knowledge mastery, incident analysis, regulatory supplementation, and coverage of scenario risk factors.

[0005] Therefore, this invention proposes a domain-specific large language model construction method for industrial safety risk management. This method involves constructing an industrial safety corpus, topic-oriented semantic filtering, document type adaptive instruction generation, and a progressive domain adaptation training process consisting of domain-adaptive pre-training, domain-supervised fine-tuning, and preference optimization. Combined with model evaluation and screening for industrial safety risk management, this enables the model to more accurately understand industrial safety knowledge and output risk management results that comply with regulatory requirements and on-site handling logic, which is of great significance for industrial safety risk management. Summary of the Invention

[0006] (a) Technical problems to be solved This invention proposes a domain-specific large language model construction method for industrial safety risk management. The aim is to address the problems of insufficient professional knowledge, inaccurate understanding of regulations and clauses, incomplete coverage of risk factors, and unclear emergency response priorities in general-purpose large language models within industrial safety scenarios. By constructing an industrial safety domain corpus, performing semantic filtering based on safety topics, adaptively generating instruction data according to document type, and employing a progressive domain-adaptive training process consisting of domain-adaptive pre-training, domain-supervised fine-tuning, and preference optimization, the model acquires the capabilities of understanding industrial safety terminology, inferring incident reports, identifying risk factors, and generating emergency response suggestions.

[0007] (II) Technical Solution Construction of candidate text fragments for industrial safety: Collect professional documents and candidate public corpora for industrial safety. The documents include safety engineering textbooks, laws and regulations, technical standards, accident investigation reports, emergency plans, internal technical documents of enterprises, and safety popular science materials. Perform optical character recognition and parsing, format normalization, noise removal, sensitive information deletion, duplicate text filtering, quality screening, and structured segmentation on the documents to obtain a set of candidate text fragments for industrial safety. Domain-adaptive pre-training data construction: Construct an industrial safety capability topic set, which includes at least personnel behavior risk identification, equipment and facility risk identification, environmental condition risk identification, mine safety, hazardous chemical safety, energy and power safety, risk classification assessment, emergency plans and disposal suggestions. A topic-oriented semantic screening method is adopted, and the semantic similarity between candidate text fragments and each industrial safety capability topic is calculated using a text embedding model. Candidate text fragments with similarity that meet the preset threshold are added to the domain-adaptive pre-training dataset. Domain-supervised fine-tuning data construction: Candidate text fragments are identified by document type and classified into regulations and standards, accident cases, textbooks and lecture notes, emergency plans, and general safety documents; a document type adaptive instruction data generation method is adopted, and corresponding instruction generation templates are selected according to different document types. The teacher model is called to generate instruction samples containing questions, background summaries, and answers. The generated results are subjected to format parsing, length filtering, rejection content filtering, answer integrity checking, and source text consistency checking to obtain the domain-supervised fine-tuning dataset; Progressive domain adaptation training consists of domain-adaptive pre-training, domain-supervised fine-tuning, and preference optimization. Domain-adaptive pre-training: Using a general large language model as the base model, the model is pre-trained using a domain-adaptive pre-training dataset to learn industrial safety terminology, legal provisions, accident report analysis, and emergency response text structure. Domain-supervised fine-tuning: Based on the model after domain-adaptive pre-training, domain-supervised fine-tuning data is used to perform domain-supervised fine-tuning, enabling the model to form instruction following capability and task reasoning capability for industrial safety risk management; Preference optimization: Based on the model fine-tuned by domain supervision, preference samples are used to optimize preferences, enabling the model to learn an expressive ability that is more suitable for the output style of specific domain scenarios; Model Evaluation and Screening: Construct an industrial safety assessment set for industrial safety risk management, evaluate candidate models based on professional knowledge accuracy, open-ended accident analysis quality, accuracy of supplementing regulatory provisions, and risk factor coverage, and select the target model for industrial safety risk management applications based on the comprehensive evaluation results; Preferably, the topic-oriented semantic filtering method is used to filter domain-specific corpus data from a large-scale text corpus, specifically including: Let the industrial security capability theme set be , The number of topics, a positive integer, for any candidate text segment. , , The candidate text fragments are a positive integer representing the total number of candidate text segments. The candidate texts are derived from industrial safety professional documents and public candidate corpora, and are generated using a text embedding model. Calculate candidate text fragments Vector representation of: For the first Themes , Calculate the vector representation of the topic : Then, the cosine similarity score between the candidate text fragments and each topic is calculated. : (1); in, Indicates candidate text fragments vector representation With the topic vector representation The vector similarity scores between the text segments are used to select the text segment with the highest topic similarity. Security relevance score : If candidate text fragments Security relevance score satisfy: , Then the text fragment reserve, The threshold representing the relevance score. Indicates candidate text fragments The number of characters, This represents the minimum number of characters. The maximum number of characters is represented by the following formula, which is used to obtain the domain-adaptive pre-training dataset. : (2); This is the dataset for domain-adaptive pre-training.

[0008] Preferably, the document type adaptive instruction data generation method is used to construct a domain-supervised fine-tuning dataset suitable for multiple tasks from a domain-specific corpus. Specifically, it includes: For domain-adaptive pre-trained datasets text fragments First, the document type is identified through rule matching or classification models. : According to document type Select the corresponding task template : Call the teacher model Generate instruction samples: (3); in, To indicate a problem, This represents a background summary. Indicates the reference answer, teacher model Employing a large language model, contextual summarization is used to retain the core facts needed to answer questions, avoiding the model merely learning to memorize original documents. Instead, it learns to perform industrial safety reasoning within a given context, and the generated samples undergo quality filtering. (4); in, For indicator functions, The minimum length of the problem. The minimum length of the answer. The ratio of the answer length to the question length is a threshold. This indicates whether the answer contains rejected, irrelevant, or incorrectly formatted content. express The quality score of this set of instruction samples is selected using the following formula. : (5); This is the dataset for domain-supervised fine-tuning.

[0009] Preferably, the progressive domain adaptation training process consists of domain adaptive pre-training, domain-supervised fine-tuning, and preference optimization, specifically including: In the domain-adaptive pre-training phase, with The text fragments in the text are used as training text. The training text is then subjected to lexicalization to obtain a text sequence. The basic large language model is trained using causal language modeling loss: (6); in, This represents the parameters of the large language model to be trained. The parameter is The loss value of causal language modeling in the domain-adaptive pre-training stage of a large language model. Indicates by The text sequence obtained after the text fragments in the text are processed by lexicalization. Represents a text sequence length and It is a positive integer. Indicates the position of a word in a text sequence and , Represents a text sequence The first in Each word element, Represents a text sequence Located in the middle All lexical units preceding the given lexical unit, The parameter is The model is given a preorder lexical unit Generate the first under the condition each word element The probability of; During the fine-tuning phase of domain supervision, with The instruction samples are used as training samples, with the first instruction sample as the training sample. One instruction sample For example, take and Combination as input instructions , for the Reference answers in the instruction sample Lexicalization is performed by Obtain the target answer sequence The autoregressive supervised fine-tuning loss is calculated using the following formula: (7); in, This represents the parameters of the large language model to be trained. The parameter is The autoregressive supervised fine-tuning loss corresponding to the domain-supervised fine-tuning stage of a large language model. This indicates the number of instruction samples in the domain-supervised fine-tuning data. This represents the index of the instruction sample in the domain-supervised fine-tuning data, and , Indicates by Problems and The input instructions obtained by combining background summaries Indicates the first Reference answers in the instruction sample The target answer sequence obtained after lexicalization. Represents the target response sequence The length of the lexicon. Represents the target response sequence The first in Each word element, Represents the target response sequence Located in the middle All lexical units preceding the given lexical unit, The parameter is Large language models, given input instructions and the preceding answer lexicon Generate target word elements under the condition of The probability of; During the preference optimization phase, preference samples are used as training samples. These preference samples include input prompts, preferred answers, and non-preferred answers. The direct preference optimization loss is calculated using the following formula: (8); in, This represents the parameters of the large language model to be trained. The parameter is The direct preference optimization loss value corresponding to the preference optimization stage of the large language model. Indicates the number of preference samples. Indicates the preference sample index and , Indicates the first Input prompts in a preference sample Indicates the first The preferred answer from a sample of preferences Indicates the first Non-preferred answers from a sample of preferences This represents the output probability distribution of the model to be optimized. This represents the output probability distribution of the reference model. This represents the Sigmoid function. Indicates the preference intensity coefficient and >0; For at least one of the training stages—domain-adaptive pre-training, domain-supervised fine-tuning, and preference optimization—the model weight matrix is ​​updated using a parameter-efficient fine-tuning method. Its update format is as follows: (9); in, This represents the model weight matrix to be adapted. This represents the model weight matrix after efficient parameter fine-tuning. Represents the weight increment matrix. and Represents a low-rank trainable matrix. Represents a low-rank matrix rank, Indicates the scaling factor and >0.

[0010] (III) Beneficial Effects Firstly, regarding industrial safety knowledge understanding and risk reasoning capabilities, this invention organically combines industrial safety corpus construction, topic-oriented semantic filtering, document type adaptive instruction generation, and domain-specific large language model training, forming a continuous processing capability from domain knowledge acquisition to scenario-based risk reasoning. Compared to directly using a general large language model, this invention enables the model to more fully learn safety engineering terminology, regulatory clause expressions, accident investigation report structures, emergency response procedures, and hazard description methods in high-risk work scenarios, thereby improving the model's professionalism and accuracy in tasks such as safety knowledge Q&A, accident cause analysis, regulatory clause supplementation, risk factor identification, and emergency response suggestion generation. Especially in high-risk industrial scenarios such as mines, hazardous chemicals, metal smelting, energy and power, and confined space operations, the model can identify key risk factors in personnel behavior, equipment and facilities, environmental conditions, and management processes based on the input scenario, and further provide the dominant hazard source, handling priority, prohibited behaviors, and resumption conditions, achieving an improvement in capabilities from general text generation to industrial safety risk management auxiliary decision-making.

[0011] Secondly, regarding data construction quality and model adaptation efficiency, the topic-oriented semantic filtering method proposed in this invention can filter text fragments highly relevant to industrial safety tasks from candidate text corpora formed from industrial safety professional documents and candidate public corpora, based on industrial safety capability themes such as personnel behavior risk identification, equipment and facility risk identification, environmental condition risk identification, mine safety, hazardous chemical safety, energy and power safety, risk classification assessment, and emergency response suggestions. This expands the scale of the domain-adaptive pre-training corpus while reducing the interference of irrelevant text on model training. Simultaneously, this invention selects corresponding instruction generation templates based on different document types, such as regulations and standards, accident cases, textbooks and lecture notes, emergency plans, and general safety documents. This ensures that the generated domain instruction samples can cover specific task requirements such as regulatory interpretation, violation identification, accident cause analysis, emergency response judgment, and risk factor summarization. This design improves the relevance and usability of domain-supervised fine-tuning data, enabling the model to not only learn the language distribution of industrial safety texts but also the analysis methods and response structures under different safety management tasks, thereby enhancing the model's adaptability to complex industrial safety scenarios.

[0012] Finally, regarding model safety, reliability, and practical application value, this invention not only employs a progressive domain-adaptive training process consisting of domain-adaptive pre-training, domain-supervised fine-tuning, and preference optimization, but also further introduces model evaluation and screening. The model after preference optimization is evaluated based on comprehensive safety scores, accuracy of supplementary regulatory clauses, risk factor coverage, and emergency response priority, avoiding the reduction of regulatory fidelity, procedural caution, and risk coverage completeness required in industrial safety scenarios due to general preference alignment. By constructing an industrial safety assessment set that includes professional knowledge, open-ended accident analysis, supplementary regulatory clauses, and risk factor coverage, this invention can perform multi-dimensional screening of candidate models, selecting the target model more suitable for industrial safety risk management applications. This method can be applied to scenarios such as enterprise safety training, safety production knowledge Q&A, accident investigation auxiliary analysis, regulatory compliance checks, hazard identification, emergency response auxiliary decision-making, and high-risk operation risk assessment, helping to improve the informatization, intelligence, and standardization of industrial safety management, and has strong engineering application value and promotion prospects. Attached Figure Description

[0013] Figure 1 This is a diagram of the overall training process framework. Detailed Implementation

[0014] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be noted that the following embodiments are only used to further illustrate the present invention and should not be construed as limiting the scope of protection of the present invention. Those skilled in the art can make some non-essential improvements and adjustments to the present invention based on the above-described invention, and these improvements and adjustments should still fall within the scope of protection of the present invention.

[0015] Example 1, according to Figure 1 This invention provides a method for constructing a domain-specific large language model for industrial safety risk management, including: Construction of candidate text fragments for industrial safety: Collect professional documents and candidate public corpora for industrial safety. The documents include safety engineering textbooks, laws and regulations, technical standards, accident investigation reports, emergency plans, internal technical documents of enterprises, and safety popular science materials. Perform optical character recognition and parsing, format normalization, noise removal, sensitive information deletion, duplicate text filtering, quality screening, and structured segmentation on the documents to obtain a set of candidate text fragments for industrial safety. Domain-adaptive pre-training data construction: Construct an industrial safety capability topic set, which includes at least personnel behavior risk identification, equipment and facility risk identification, environmental condition risk identification, mine safety, hazardous chemical safety, energy and power safety, risk classification assessment, emergency plans and disposal suggestions. A topic-oriented semantic screening method is adopted, and the semantic similarity between candidate text fragments and each industrial safety capability topic is calculated using a text embedding model. Candidate text fragments with similarity that meet the preset threshold are added to the domain-adaptive pre-training dataset. Domain-supervised fine-tuning data construction: Candidate text fragments are identified by document type and classified into regulations and standards, accident cases, textbooks and lecture notes, emergency plans, and general safety documents; a document type adaptive instruction data generation method is adopted, and corresponding instruction generation templates are selected according to different document types. The teacher model is called to generate instruction samples containing questions, background summaries, and answers. The generated results are subjected to format parsing, length filtering, rejection content filtering, answer integrity checking, and source text consistency checking to obtain the domain-supervised fine-tuning dataset; Progressive domain adaptation training consists of domain-adaptive pre-training, domain-supervised fine-tuning, and preference optimization. Domain-adaptive pre-training: Using a general large language model as the base model, the model is pre-trained using a domain-adaptive pre-training dataset to learn industrial safety terminology, legal provisions, accident report analysis, and emergency response text structure. Domain-supervised fine-tuning: Based on the model after domain-adaptive pre-training, domain-supervised fine-tuning data is used to perform domain-supervised fine-tuning, enabling the model to form instruction following capability and task reasoning capability for industrial safety risk management; Preference optimization: Based on the model fine-tuned by domain supervision, preference samples are used to optimize preferences, enabling the model to learn an expressive ability that is more suitable for the output style of specific domain scenarios; Model evaluation and selection: Construct an industrial safety assessment set for industrial safety risk management, evaluate candidate models based on professional knowledge accuracy, open-ended accident analysis quality, accuracy of supplementary regulatory provisions, and risk factor coverage, and select the target model for industrial safety risk management applications based on the comprehensive evaluation results.

[0016] Example 2, based on Example 1, illustrates the process of corpus collection and preprocessing in the field of industrial safety. Industrial safety professional documents, such as safety engineering textbooks, laws and regulations, technical standards, accident investigation reports, emergency plans, internal enterprise technical documents, and safety popular science materials, are collected. The collected documents undergo optical character recognition (OCR) parsing, format normalization, noise removal, sensitive information deletion, duplicate text filtering, quality screening, and structured segmentation to obtain a set of candidate text fragments for industrial safety. For regulatory and standard documents, segmentation is prioritized according to clause numbers; for accident investigation reports, the logical integrity between the accident description, cause analysis, responsibility determination, and rectification suggestions is prioritized; for emergency plans, segmentation is combined with chapter titles and clause numbers; for textbooks, lecture notes, and general safety documents, segmentation is done according to natural paragraphs or a sliding window method.

[0017] Example 3, based on Example 1, uses topic-oriented semantic filtering to semantically filter candidate text corpora formed from industrial safety professional documents and candidate public corpora. This filters out corpora related to the field of industrial safety risk management, which are then used to construct training corpora for subsequent domain-adaptive pre-training. Specifically, it includes the following: This invention constructs a set of industrial security capability topics: , The number of topics, a positive integer, in this embodiment, The topic is 8, and includes personnel behavior risk identification, equipment and facility risk identification, environmental condition risk identification, mine safety, hazardous chemical safety, energy and power safety, risk classification and assessment, emergency plans and response recommendations. For any candidate text fragment... , , The total number of candidate text fragments is a positive integer. In this embodiment, The number of candidate texts was 14,000, and the texts were derived from industrial safety professional documents and candidate public corpora, using a text embedding model. Calculate candidate text fragments Vector representation of: In this embodiment, the text embedding model adopts the BAAI / bge-large-zh-v1.5 model. Themes , Calculate the vector representation of the topic : Then, the cosine similarity score between the candidate text fragments and each topic is calculated. : (1); in, Indicates candidate text fragments vector representation With the topic vector representation The vector similarity scores between the text segments are used to select the text segment with the highest topic similarity. Security relevance score : If candidate text fragments Security relevance score satisfy: , Then the text fragment reserve, In this embodiment, the threshold representing the relevance score is... It is 0.6. Indicates candidate text fragments The number of characters, This represents the minimum number of characters. In this embodiment, It is 500. This represents the maximum number of characters. In this embodiment, The domain-adaptive pre-training dataset is 5000, obtained using the following formula. : (2); This is the dataset for domain-adaptive pre-training.

[0018] Example 4, based on Example 1, introduces document type adaptive instruction data generation. To enable the model to learn multiple task outputs, a domain-adaptive pre-training dataset is used. Teacher Model Constructing a domain-supervised fine-tuning dataset covering multiple task types It is used for domain-based supervision and fine-tuning, and specifically includes the following: For domain-adaptive pre-trained datasets text fragments First, the document type is identified through rule matching or classification models. : According to document type Select the corresponding task template : For accident case studies, the problem perspectives include direct cause analysis, indirect cause analysis, identification of management loopholes, basis for liability determination, and deficiencies in emergency response; for regulations and standards, the problem perspectives include regulatory interpretation, applicable conditions, key inspection points, identification of violations, and operational precautions; for emergency response plans, the problem perspectives include response level assessment, handling procedures, resource allocation, and conditions for resuming work, and the use of a teacher model. Generate instruction samples: (3); in, To indicate a problem, This represents a background summary. Indicates the reference answer, teacher model In this embodiment, a large language model is used, specifically the teacher model. The Deepseek-v4-pro model is employed, with context summarization used to retain the core facts needed to answer questions. This avoids the model merely learning to memorize original documents, instead learning to perform industrial safety reasoning within a given context, and performs quality filtering on the generated samples. (4); in, For indicator functions, The minimum length of the problem. The minimum length of the answer. The ratio of the answer length to the question length is a threshold. This indicates whether the answer contains rejected, irrelevant, or incorrectly formatted content. express The quality score of this set of instruction samples is selected using the following formula. : (5); This is the dataset for domain-supervised fine-tuning.

[0019] Example 5: This example is based on Example 1. In this example, domain-adaptive pre-training is performed using a domain-adaptive pre-training dataset. The model is trained to learn industrial safety terminology, regulatory expressions, accident report analysis, and emergency response text structure, specifically including the following: In the domain-adaptive pre-training phase, with The text fragments in the text are used as training text. The training text is then subjected to lexicalization to obtain a text sequence. The basic large language model is trained using causal language modeling loss: (6); in, This represents the parameters of the large language model to be trained. The parameter is The loss value of causal language modeling in the domain-adaptive pre-training stage of a large language model. Indicates by The text sequence obtained after the text fragments in the text are processed by lexicalization. Represents a text sequence length and It is a positive integer. Indicates the position of a word in a text sequence and , Represents a text sequence The first in Each word element, Represents a text sequence Located in the middle All lexical units preceding the given lexical unit, The parameter is The model is given a preorder lexical unit Generate the first under the condition each word element The probability of.

[0020] Example 6: This example is based on Example 1. In this example, domain-supervised fine-tuning is performed using the domain-supervised fine-tuning dataset obtained in the previous steps. Autoregressive supervised fine-tuning is performed to enable the model to develop command-following and task-reasoning capabilities for industrial safety risk management. This includes the following: During the fine-tuning phase of domain supervision, with The instruction samples are used as training samples, with the first instruction sample as the training sample. One instruction sample For example, take and Combination as input instructions , for the Reference answers in the instruction sample Lexicalization is performed by Obtain the target answer sequence The autoregressive supervised fine-tuning loss is calculated using the following formula: (7); in, This represents the parameters of the large language model to be trained. The parameter is The autoregressive supervised fine-tuning loss corresponding to the domain-supervised fine-tuning stage of a large language model. This indicates the number of instruction samples in the domain-supervised fine-tuning data. This represents the index of the instruction sample in the domain-supervised fine-tuning data, and , Indicates by Problems and The input instructions obtained by combining background summaries Indicates the first Reference answers in the instruction sample The target answer sequence obtained after lexicalization. Represents the target response sequence The length of the lexicon. Represents the target response sequence The first in Each word element, Represents the target response sequence Located in the middle All lexical units preceding the given lexical unit, The parameter is Large language models, given input instructions and the preceding answer lexicon Generate target word elements under the condition of The probability of.

[0021] Example 7, based on Example 1, focuses on preference optimization. It utilizes preference samples from a publicly available dataset for preference alignment training, enabling the model to learn an expressive ability more suited to the output style of a specific domain scenario. Specifically, it includes the following: During the preference optimization phase, preference samples are used as training samples. These preference samples include input prompts, preferred answers, and non-preferred answers. The direct preference optimization loss is calculated using the following formula: (8); in, This represents the parameters of the large language model to be trained. The parameter is The direct preference optimization loss value corresponding to the preference optimization stage of the large language model. Indicates the number of preference samples. Indicates the preference sample index and , Indicates the first Input prompts in a preference sample Indicates the first The preferred answer from a sample of preferences Indicates the first Non-preferred answers from a sample of preferences This represents the output probability distribution of the model to be optimized. This represents the output probability distribution of the reference model. This represents the Sigmoid function. Indicates the preference intensity coefficient and >0.

[0022] For at least one of the training stages—domain-adaptive pre-training, domain-supervised fine-tuning, and preference optimization—the model weight matrix is ​​updated using a parameter-efficient fine-tuning method. Its update format is as follows: (9); in, This represents the model weight matrix to be adapted. This represents the model weight matrix after efficient parameter fine-tuning. Represents the weight increment matrix. and Represents a low-rank trainable matrix. Represents a low-rank matrix rank, Indicates the scaling factor and >0.

[0023] Example 8, based on Example 1, focuses on model evaluation and screening. An industrial safety assessment set is constructed, and candidate models are evaluated for accuracy in professional knowledge, quality of open-ended accident analysis, accuracy in supplementing regulatory provisions, and coverage of risk factors. Based on the comprehensive evaluation results, a target model is selected for industrial safety risk management applications. Specifically, this includes the following: To verify the suitability of candidate models for industrial safety risk management scenarios, an industrial safety assessment set, IndusSafetyEval, was constructed, encompassing professional knowledge, incident analysis, regulatory supplementation, and risk factor coverage. IndusSafetyEval includes four types of tasks: multiple-choice (MCQ), open-ended (QA), fill-in-the-blank (COMP), and risk factor coverage (RiskID). These tasks are used to evaluate the candidate models' certified safety knowledge mastery, open-ended incident analysis capabilities, regulatory supplementation capabilities, and scenario risk factor identification capabilities, respectively. The evaluation is based on the accuracy of professional knowledge, the quality of open-ended incident analysis, the accuracy of regulatory supplementation, and the risk factor coverage rate.

[0024] The professional knowledge accuracy rate is used to evaluate the candidate model's mastery of basic industrial safety knowledge, professional knowledge, and regulatory common sense. For each valid question in the multiple-choice (MCQ) test, the options output by the candidate model are compared with the preset standard answer. If they match, the answer to the question is considered correct; otherwise, the answer to the question is considered incorrect. The number of questions answered correctly by the candidate model is counted, and the ratio of the number of correctly answered questions to the total number of valid questions is used as the professional knowledge accuracy rate.

[0025] The open-ended accident analysis quality is used to evaluate the quality of the analysis results generated by the candidate model for industrial safety accident scenarios. For each valid question in the QA (Question and Answer) section, the candidate model's response is evaluated from three dimensions: factual accuracy, regulatory compliance, and reasoning completeness. Factual accuracy measures whether the accident facts, hazard factors, accident causes, and response measures in the response are consistent with the given scenario and reference information. Regulatory compliance measures whether the laws, regulations, technical standards, and safety requirements cited or relied upon in the response are applicable to the corresponding industrial safety scenario. Reasoning completeness measures whether the response forms a complete analysis process from scenario fact identification, hazard factor analysis, accident cause judgment to the generation of response suggestions. Evaluation scores for the above three dimensions are obtained according to preset scoring rules. The accident analysis evaluation score for a single question is obtained by averaging the evaluation scores of the three dimensions or by weighting them according to preset weights. Finally, the accident analysis evaluation scores of all valid questions and answers are averaged to obtain the open-ended accident analysis quality evaluation result of the candidate model.

[0026] The accuracy rate for supplementing regulatory clauses is used to evaluate the ability of candidate models to identify and supplement applicable regulatory clauses based on a given industrial safety scenario. For each valid question in the fill-in-the-blank COMP section, the regulatory name, clause content, or element of the clause to be supplemented output by the candidate model is compared with a preset standard answer. If the candidate model output meets a preset consistency criterion, the question is considered correct; otherwise, it is considered incorrect. The number of questions answered correctly by the candidate model is counted, and the ratio of the number of correctly answered questions to the total number of valid questions is used as the accuracy rate for supplementing regulatory clauses. The consistency criterion includes at least one of character consistency, standardized text consistency, or semantic equivalence.

[0027] The risk factor coverage rate is used to evaluate the completeness of the candidate model in identifying reference risk factors for a given industrial safety scenario. For each valid question in the RiskID risk factor coverage question set, a set of reference risk factors corresponding to that question is pre-set. The risk factors output by the candidate model are matched item by item with each reference risk factor in the set of reference risk factors. When there is a risk description in the candidate model output that is the same in meaning or semantically equivalent to a certain reference risk factor, the reference risk factor is determined to be covered; otherwise, it is determined to be uncovered. The number of covered reference risk factors in a single question is counted, and the ratio of the number of covered reference risk factors to the total number of reference risk factors in that question is taken as the risk factor coverage rate of that question. Then, the risk factor coverage rates of all valid risk factor coverage questions are averaged to obtain the average risk factor coverage rate of the candidate model.

[0028] Candidate models are screened based on the accuracy of professional knowledge, the quality evaluation results of open-ended accident analysis, the accuracy of supplementary regulatory provisions, and the average risk factor coverage. For each evaluation indicator, a corresponding preset safety threshold is set. First, candidate models whose evaluation indicators are below the corresponding preset safety threshold are excluded. For the remaining candidate models, a comprehensive evaluation is performed based on the evaluation results of each indicator according to preset weights. The candidate model with the highest comprehensive evaluation result is determined as the target model. Alternatively, when the comprehensive evaluation results of multiple candidate models meet a preset difference range, the candidate model with higher average risk factor coverage and accuracy of supplementary regulatory provisions is prioritized. The model parameters of the determined candidate model are then used for industrial safety risk management applications.

[0029] It is understood that the present invention has been described through some embodiments, and those skilled in the art will recognize that various changes or equivalent substitutions can be made to these features and embodiments without departing from the spirit and scope of the invention. Furthermore, under the teachings of the present invention, these features and embodiments can be modified to adapt to specific situations and materials without departing from the spirit and scope of the invention. Therefore, the present invention is not limited to the specific embodiments disclosed herein, and all embodiments falling within the scope of the claims of this application are within the protection scope of the present invention.

Claims

1. A method for constructing a domain-specific large language model for industrial safety risk management, characterized in that, include: Construction of candidate text fragments for industrial safety: Obtain professional documents and candidate public corpora for industrial safety, preprocess the obtained texts, and obtain a set of candidate text fragments for industrial safety; Domain-adaptive pre-training data construction: Construct an industrial safety capability topic set and use a topic-oriented semantic filtering method to obtain a domain-adaptive pre-training dataset; Domain-supervised fine-tuning data construction: Document type identification is performed on text fragments in the domain-adaptive pre-training dataset, and instruction samples are obtained using a document type adaptive instruction data generation method. The quality of the generated instruction samples is then screened to obtain the domain-supervised fine-tuning dataset. Progressive domain adaptation training: It consists of domain adaptive pre-training, domain-supervised fine-tuning and preference optimization. It uses a general large language model as the base model, performs domain adaptive pre-training using the domain adaptive pre-training dataset, performs domain-supervised fine-tuning using the domain-supervised fine-tuning dataset, and performs preference optimization using preference samples to obtain a candidate model for industrial safety risk management. Model evaluation and screening: Construct an industrial safety assessment set for industrial safety risk management, conduct multi-dimensional capability assessments of the candidate models, and determine the target model for industrial safety risk management based on the assessment results.

2. The method for constructing a domain-specific large language model for industrial safety risk management according to claim 1, characterized in that: The construction of the industrial security candidate text fragment specifically includes: We acquire professional documents on industrial safety and candidate public texts. We then perform optical character recognition (OCR) analysis, format normalization, noise removal, sensitive information deletion, duplicate text filtering, quality screening, and structured segmentation on the acquired texts to obtain a set of candidate text fragments for industrial safety.

3. The method for constructing a domain-specific large language model for industrial safety risk management according to claim 1, characterized in that: The topic-oriented semantic filtering method specifically includes: An industrial safety capability topic set is constructed. The vector representations of candidate text fragments and each industrial safety capability topic are calculated using a text embedding model. Then, the similarity scores between the candidate text fragments and each industrial safety capability topic are calculated. The maximum topic similarity score is taken as the safety relevance score of the candidate text fragment. Candidate text fragments whose safety relevance scores meet a preset threshold and whose number of characters meets a preset range are retained to obtain the domain-adaptive pre-training dataset.

4. The method for constructing a domain-specific large language model for industrial safety risk management according to claim 1, characterized in that: The document type adaptive instruction data generation method specifically includes: For text fragments in the domain-adaptive pre-training dataset, their document types are identified, and corresponding task templates are selected based on the identified document types. The teacher model is then invoked to generate instruction samples containing questions, background summaries, and reference answers. The generated instruction samples are then subjected to quality filtering to obtain the domain-supervised fine-tuning dataset.

5. The method for constructing a domain-specific large language model for industrial safety risk management according to claim 1, characterized in that: The progressive domain adaptation training process consists of domain adaptive pre-training, domain-supervised fine-tuning, and preference optimization, specifically including: In the domain-adaptive pre-training stage, a general large language model is used as the base model, and the domain-adaptive pre-training dataset is used to perform domain-adaptive pre-training, enabling the model to learn industrial safety terminology, legal provisions, accident report analysis, and emergency response text structure. In the domain-supervised fine-tuning stage, based on the model after domain-adaptive pre-training, domain-supervised fine-tuning data is used to perform domain-supervised fine-tuning, enabling the model to form instruction following capability and task reasoning capability for industrial safety risk management. In the preference optimization stage, based on the model fine-tuned by domain supervision, preference samples are used to optimize preferences, enabling the model to learn an expressive ability that is more suitable for the output style of specific domain scenarios. For at least one of the training stages—domain adaptive pre-training, domain supervised fine-tuning, and preference optimization—the model weight matrix is ​​updated using a parameter-efficient fine-tuning method.

6. The method for constructing a domain-specific large language model for industrial safety risk management according to claim 1, characterized in that: The model evaluation and screening specifically includes: An industrial safety assessment set is constructed, and candidate models are evaluated for accuracy in terms of professional knowledge, quality of open-ended accident analysis, accuracy in terms of supplementary regulatory provisions, and coverage of risk factors. Based on the comprehensive evaluation results, the target model for industrial safety risk management is determined.