Method and device for generating fine tuning data of large language model in target domain

By using extraction templates to generate structured text data and question-and-answer pairs in large-scale language models, the efficiency and quality problems of vertical domain model fine-tuning data generation are solved, and efficient and low-cost data processing and model fine-tuning are achieved.

CN118536604APending Publication Date: 2024-08-23JIANWEI DIGITAL TECH (CHONGQING) CO LTD

Patent Information

Application Number
CN202410767109.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-14
Publication Date
2024-08-23

AI Technical Summary

Technical Problem

The performance of existing large-scale language models in specific vertical fields suffers from data redundancy and generated confusion, and manually constructing fine-tuned data sets is costly, time-consuming, and prone to bias.

Method used

By calling the extraction template in the target field, input the fault description information in the text input area, generate structured text data, and output question and answer pairs after processing, which can be used to fine-tune the initial large language model, simplifying the fine-tuning data generation process.

Benefits of technology

It reduces manual intervention, improves data processing efficiency and quality, reduces the cost of fine-tuning data generation, and ensures high-quality performance of the model in specific fields.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118536604A
    Figure CN118536604A
Patent Text Reader

Abstract

The invention provides a method and a device for generating fine tuning data of a large language model in a target domain. The method comprises the following steps: calling an extraction template of the target domain; inputting fault description information of the target field in the text input area to obtain structured text data; processing the fault description information according to a task demand in the structured text data to obtain answer text data, the answer text data comprising a plurality of target fault indexes and text content extracted from the fault description information and corresponding to each target fault index; outputting question and answer pairs of the target domain according to the answer text data; and according to the question and answer pair of the target domain, determining fine tuning data for fine tuning the initial target domain large language model. Through the method, the generation process of the fine tuning data of the large language model in the target field is simplified.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and more specifically, to a method and device for generating fine-tuning data for a large language model in a target domain. Background Art

[0002] Under the current technological background, the development of large-scale language models (LLMs) has shown a significant acceleration. However, the performance of these models in specific vertical fields still has certain limitations. The output of large language models has problems such as data redundancy and generation confusion. In order to make up for this deficiency, large-scale language models need to be trained and fine-tuned.

[0003] However, training and fine-tuning a large language model that follows user instructions and meets specific needs (such as being proficient in a certain professional field) requires constructing a large number of data sets. Manually constructing data sets is expensive, and the organization and collection of fine-tuning instruction data during the fine-tuning of vertical field models is a major challenge.

[0004] At present, this process mostly relies on manual operations. In order to collect sufficient and comprehensive fine-tuning data, a lot of time and labor are needed to screen and process the data. Manual data processing can easily introduce bias, affecting the quality of the data and the reliability of subsequent model performance. Summary of the invention

[0005] In view of this, the purpose of the present application is to provide a method and device for generating fine-tuning data of a large language model in a target domain, so as to overcome at least one of the above-mentioned defects.

[0006] In a first aspect, an embodiment of the present application provides a method for generating fine-tuning data for a large language model in a target domain, the method comprising: calling an extraction template for the target domain, the extraction template comprising a task requirement and a text input area, the task requirement being associated with the extraction template and being pre-constructed in the extraction template; inputting fault description information of the target domain in the text input area to obtain structured text data; processing the fault description information according to the task requirement in the structured text data to obtain answer text data, the answer text data comprising a plurality of target fault indicators and text content corresponding to each target fault indicator extracted from the fault description information; outputting a question-answer pair for the target domain based on the answer text data; determining fine-tuning data based on the question-answer pair for the target domain for fine-tuning an initial large language model for the target domain.

[0007] In an optional embodiment of the present application, the extraction template includes a first extraction template and a second extraction template, wherein the processing of the fault description information according to the task requirements in the structured text data to obtain answer text data includes: calling a first extraction template of the target field, the first extraction template including a first task requirement and a first text input area, the first task requirement is associated with the extraction template and is pre-constructed in the first extraction template; inputting the fault description information of the target field in the first text input area to obtain the first structured text data; processing the fault description information according to the first task requirement in the first structured text data to obtain field text data, the field The text data includes multiple fault indicators and text content corresponding to each fault indicator is extracted from the fault description information; a second extraction template of the target field is called, the second extraction template includes a second task requirement and a second text input area, the second task requirement is associated with the second extraction template and is pre-constructed in the second extraction template; the field text data is input in the second text input area to obtain second structured text data; the field text data is processed according to the second task requirement in the second structured text data to obtain answer text data, the answer text data includes multiple target fault indicators and text content corresponding to each target fault indicator is extracted from the second structured text data.

[0008] In an optional embodiment of the present application, outputting the question-answer pair of the target domain based on the answer text data includes: calling a question-answer pair generation template for the target domain, the question-answer pair generation template including a third task requirement and a third text input area, the third task requirement being associated with the question-answer pair generation template and being pre-constructed in the question-answer pair generation template; inputting the answer text data in the third text input area to obtain third structured text data; processing the answer text data according to the third task requirement in the third structured text data to obtain a predicted question text corresponding to the answer text data; and outputting the question-answer pair of the target domain based on the predicted question text and the answer text data.

[0009] In an optional embodiment of the present application, the method of determining fine-tuning data based on the question-answer pair of the target domain to fine-tune the initial target domain large language model includes: judging whether the answer text data of the question-answer pair of the target domain contains the target fault indicator; if the answer text data of the question-answer pair of the target domain does not contain the target fault indicator, filtering the question-answer pair of the target domain; if the answer text data of the question-answer pair of the target domain contains the target fault indicator, determining the question-answer pair of the target domain as the target question-answer pair; evaluating the target question-answer pair to determine the fine-tuning data; and fine-tuning the initial target domain large language model based on the fine-tuning data to obtain the target domain large language model.

[0010] In an optional embodiment of the present application, the target question and answer pairs are evaluated to determine the fine-tuning data, including: performing manual evaluation and multi-index evaluation on each target question and answer pair to determine the score of the target question and answer pair under each evaluation item; determining the total score of each target question and answer pair based on the score of each target question and answer pair under each evaluation item; and sorting the total scores of each target question and answer pair to determine the fine-tuning data.

[0011] In an optional embodiment of the present application, the fault description information of the target field is determined in the following manner: obtaining data related to the target field, identifying and converting the data, and determining target text data; cleaning repeated text and typos in the target text data, and summarizing the cleaned target text data to obtain the fault description information of the target field.

[0012] In a second aspect, an embodiment of the present application also provides a device for generating fine-tuning data of a large language model in a target domain, the device comprising: a template calling module, used to call an extraction template of the target domain, the extraction template comprising a task requirement and a text input area, the task requirement being associated with the extraction template and being pre-constructed in the extraction template; a structured text data determination module, used to input fault description information of the target domain in the text input area to obtain structured text data; an answer text data determination module, used to process the fault description information according to the task requirement in the structured text data to obtain answer text data, the answer text data comprising multiple target fault indicators and text content corresponding to each target fault indicator extracted from the fault description information; a question-answer pair determination module for the target domain, used to output the question-answer pair of the target domain according to the answer text data; a fine-tuning data determination module, used to determine the fine-tuning data according to the question-answer pair of the target domain, for fine-tuning the initial large language model of the target domain.

[0013] In an optional embodiment of the present application, the answer text data determination module is also used to: call a first extraction template of the target domain, the first extraction template includes a first task requirement and a first text input area, the first task requirement is associated with the extraction template and is pre-constructed in the first extraction template; input the fault description information of the target domain in the first text input area to obtain first structured text data; process the fault description information according to the first task requirement in the first structured text data to obtain field text data, the field text data includes multiple fault indicators and text content corresponding to each fault indicator extracted from the fault description information; call a second extraction template of the target domain, the second extraction template includes a second task requirement and a second text input area, the second task requirement is associated with the second extraction template and is pre-constructed in the second extraction template; input the field text data in the second text input area to obtain second structured text data; process the field text data according to the second task requirement in the second structured text data to obtain answer text data, the answer text data includes multiple target fault indicators and text content corresponding to each target fault indicator extracted from the second structured text data.

[0014] In a third aspect, an embodiment of the present application further provides an electronic device, comprising: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate via the bus, and when the machine-readable instructions are executed by the processor, the steps of the method described above are performed.

[0015] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the method described above are executed.

[0016] The embodiments of the present application provide a method and device for generating fine-tuning data for a large language model in a target domain. By calling an extraction template for the target domain, fault description information of the target domain is input in a text input area to obtain structured text data. The fault description information is processed according to the task requirements in the structured text data to obtain answer text data. The answer text data includes multiple target fault indicators and text content corresponding to each target fault indicator is extracted from the fault description information. According to the answer text data, question and answer pairs of the target domain are output to fine-tune the initial large language model of the target domain. Through the present application, the generation process of fine-tuning data for the large language model of the target domain is simplified.

[0017] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0019] Figure 1 A flowchart of a method for generating fine-tuning data for a large language model in a target domain provided in an embodiment of the present application;

[0020] Figure 2 A schematic diagram of the structure of a device for generating fine-tuning data of a large language model in a target domain provided in an embodiment of the present application;

[0021] Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0022] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application usually described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, each other embodiment obtained by those skilled in the art without making creative work belongs to the scope of protection of the present application.

[0023] First, the application scenarios to which this application is applicable are introduced. This application can be applied in the field of artificial intelligence technology.

[0024] Research has found that the performance of large-scale language models (LLM) in specific vertical fields still has certain limitations. The output of large language models has problems such as data redundancy and generation disorder. In order to make up for this deficiency, large-scale language models need to be trained and fine-tuned.

[0025] However, training and fine-tuning a large language model that follows user instructions and meets specific needs (such as being proficient in a certain professional field) requires constructing a large number of data sets. The organization and collection of fine-tuning instruction data during vertical field model fine-tuning mostly relies on manual operations. In order to collect enough fine-tuning data with comprehensive coverage, a lot of time and labor are required for data screening and processing. Manual data processing can easily introduce bias, affecting the quality of the data and the reliability of subsequent model performance.

[0026] Based on this, an embodiment of the present application provides a method and device for generating fine-tuning data of a large language model in a target domain. By calling an extraction template of the target domain, fault description information of the target domain is input in a text input area to obtain structured text data. The fault description information is processed according to the task requirements in the structured text data to obtain answer text data. The answer text data includes multiple target fault indicators and text content corresponding to each target fault indicator is extracted from the fault description information. According to the answer text data, question and answer pairs of the target domain are output to fine-tune the initial large language model of the target domain. Through this application, the generation process of fine-tuning data of the large language model of the target domain is simplified.

[0027] See also Figure 1 , Figure 1 This is a flowchart of a method for generating fine-tuning data for a large language model in a target domain provided in an embodiment of the present application.

[0028] Here, the target area refers to the steel industry, specifically the vertical field of production accidents and machinery maintenance in the steel industry.

[0029] like Figure 1 As shown in , the method for generating fine-tuning data of a large language model in a target domain provided by an embodiment of the present application includes:

[0030] S101, calling the extraction template of the target domain.

[0031] Specifically, the extraction template is a pre-built template in the steel field. The extraction template includes task requirements and a text input area. The task requirements are associated with the extraction template. The task requirements include preset tags to control the processor to process the text content entered in the text input area according to the preset tags.

[0032] S102: Input fault description information of the target field in the text input area to obtain structured text data.

[0033] In this step, the fault description information of the target field is determined by:

[0034] Acquire information related to the target field, identify and convert the information, and determine the target text data.

[0035] For example, data related to the target field include various accident reports, equipment operation logs, and maintenance and overhaul reports generated within the steel plant. These data are diverse in form and generally exist in unstructured formats such as text descriptions, tabular data, and pictures taken on site.

[0036] For information stored in the form of images and tables, such as photos of equipment damage and handwritten operation records, optical character recognition (OCR) technology is used to accurately extract text content from the images, and then the extracted text content is determined as the target text data.

[0037] The repeated texts and typos in the target text data are cleaned, and the cleaned target text data are summarized to obtain the fault description information in the target field.

[0038] Specifically, because of unclear photos or inaccurate recognition of handwritten maintenance sheets, after determining the target text data, the duplicate data and typos in the target text data will be cleaned, and the cleaned target text data will be spliced ​​and integrated to construct more comprehensive and continuous data, ensuring the availability of the data.

[0039] S103: Process the fault description information according to the task requirements in the structured text data to obtain answer text data.

[0040] The answer text data includes multiple target fault indicators and text content corresponding to each target fault indicator extracted from the fault description information.

[0041] Here, the extraction template includes a first extraction template and a second extraction template.

[0042] In this step, a first extraction template of the target domain is called, the first extraction template includes a first task requirement and a first text input area, the first task requirement is associated with the extraction template, and is pre-constructed in the first extraction template.

[0043] Here, the first task requirement includes the pre-set name of the fault indicator that is to be extracted from the fault description information of the target domain. The fault indicator is determined in the following way:

[0044] The fault description information in the target field is classified according to the specific content and is mainly divided into two categories: private domain information and common sense information.

[0045] Specifically, private domain information mainly includes accident report analysis within each steel mill, equipment failure statistics, equipment operation stoppage reports and other data. These fault description data are obtained from specific production lines and equipment operations, and contain rich industry-specific information, which is crucial for fine-tuning the model in specific vertical fields.

[0046] Common Sense information is mainly composed of public data such as books, patents, journals and papers. They provide extensive background knowledge and help the model understand and generate more general language content. This type of data plays a role in preventing excessive forgetting during the model fine-tuning process, ensuring that the model can maintain its generality and breadth of knowledge.

[0047] Each type of information has requirements for building fault indicators. These requirements specify in detail which information must be included in the output and which is optional. This distinction helps to increase the flexibility and specificity of data processing while maintaining data integrity.

[0048] For example, for private domain information, the fault indicators constructed are shown in Table 1 below. Table 1 is an example of fault indicators for private domain information:

[0049]

[0050]

[0051] Table 1

[0052] For books, patents, journals, and papers in the common sense information, one fault indicator is constructed, namely the common sense content.

[0053] In order to efficiently classify data, we trained a small TextCNN text classification model to automatically classify text data sources and label them with corresponding categories. In this way, we can ensure that the fault description information in the target field is accurately classified into the corresponding category. This not only optimizes the data storage and query efficiency, but also enhances the accuracy and effect of structured data extraction of large language models.

[0054] In a preferred embodiment, a large language model with text understanding function can be used to realize the extraction function of fault description information for the target field, so as to improve the speed of data processing.

[0055] Specifically, the Prompt project can be used to control the large language model to extract fault description information based on the target fault indicators to ensure data consistency and accuracy. The Prompt project can let the large language model know clearly and accurately what the user wants it to do, thereby guiding the model to fully explore its ability limit, that is, to improve communication efficiency.

[0056] The fine-tuning template information corresponding to the Prompt project includes identity information, task requirement information, and text information. The identity information is used to set the identity and responsibilities of the model, allowing the model to answer questions with more professional knowledge; the task requirement information is used to specifically describe the tasks to be completed, clarify the goals and expected results; and the text information is used to provide relevant fault text data.

[0057] For example, the identity information may be: You are a production fault diagnosis and equipment maintenance assistant in the steel industry, and you have extensive experience in production accident handling and equipment maintenance.

[0058] Alternatively, the identity information can be: As an experienced expert in steel industry maintenance, you have extensive experience in machinery maintenance and deep expertise in managing equipment on hot-rolled steel profiles, strip steel, medium and thick plates, wire rods, and cold rolling mill production lines. Your areas of expertise include maintenance and optimization of square and rectangular billet continuous casters, electrical drive automation, hydraulic lubrication systems, sintered plate dust removal, circulating water treatment and sewage treatment systems, focusing on various equipment in metal rolling, steelmaking, and metal material processes, and providing customized solutions and maintenance services for challenges.

[0059] Identity information and task requirement information can be pre-constructed according to actual needs and are not specifically limited here.

[0060] Here, the first extraction template includes a first task requirement and a first text input area, and the first task requirement is associated with the extraction template and is pre-constructed in the first extraction template.

[0061] Input fault description information of the target field in the first text input area to obtain first structured text data.

[0062] In this step, the first structured text data includes the first task requirement and fault description information of the target domain.

[0063] The fault description information is processed according to the first task requirement in the first structured text data to obtain field text data.

[0064] The field text data includes multiple fault indicators and text content corresponding to each fault indicator extracted from the fault description information.

[0065] Here, the fault description information of the target field is searched to see whether there is text content corresponding to the fault indicator. If so, the name of the fault indicator and the text content corresponding to the fault indicator are output, and the fault indicator name and the corresponding text content are determined as field text data.

[0066] A second extraction template of the target domain is called, the second extraction template includes a second task requirement and a second text input area, the second task requirement is associated with the second extraction template, and is pre-constructed in the second extraction template.

[0067] Here, the second task requirement includes target fault indicators to be extracted from the field text data, that is, the required indicators corresponding to Table 1 above: fault phenomenon, fault cause, treatment measures and preventive measures.

[0068] Field text data is input in the second text input area to obtain second structured text data.

[0069] In this step, the second structured text data includes the second task requirement and field text data.

[0070] The field text data is processed according to the second task requirement in the second structured text data to obtain answer text data.

[0071] The answer text data includes a plurality of target fault indicators and text content corresponding to each target fault indicator is extracted from the second structured text data.

[0072] Here, the fault description information of the target field is searched to see whether there is text content corresponding to the target fault indicator. If so, the name of the target fault indicator and the text content corresponding to the target fault indicator are output, and the target fault indicator name and the corresponding text content are determined as the answer text data.

[0073] S104. Output the question-answer pairs in the target domain based on the answer text data.

[0074] Call the question-answer pair generation template of the target domain.

[0075] Here, the question-answer pair generation template is a pre-built template for generating questions in the steel field. The question-answer pair generation template includes a third task requirement and a third text input area. The third task requirement is associated with the question-answer pair generation template and is pre-built in the question-answer pair generation template. The third task requirement includes a pre-set requirement for generating question-answer pairs in the target field.

[0076] For example, the third task requirement of the question-answering generation model is as follows:

[0077] 1) Based on the fault problem, fault cause analysis and measures given in the following example, generate a new fault problem and related fault cause analysis as well as processing and preventive measures.

[0078] 2) The new content formats generated include fault problems, fault causes (direct causes / root causes), treatment measures, and preventive measures.

[0079] 3) The generated questions should be reasonable and concise.

[0080] 4) The generated answers to the questions, i.e. the fault cause analysis and measures, must be derived from the text content entered in the text input area to ensure that the answers are true, reasonable, and free of logical or factual errors.

[0081] 5) The main information and main keywords of the generated questions and answers should be derived from the text content entered in the text input area as much as possible.

[0082] 6) The generated questions and answers may partially refer to authoritative academic journals to ensure that the generated questions and answers have a certain degree of difference and diversity compared to the text content entered in the text input area, and that the logic is correct.

[0083] 7) Only the generated questions and answers need to be returned, and no other corpus text is needed.

[0084] The content in the third task requirement can be modified according to actual conditions. It is only presented here in the form of examples and is not specifically limited.

[0085] Answer text data is input in the third text input area to obtain third structured text data.

[0086] In this step, the third structured text data includes third task requirements and answer text data.

[0087] The answer text data is processed according to the third task requirement in the third structured text data to obtain a predicted question text corresponding to the answer text data.

[0088] Based on the predicted question text and answer text data, the question-answer pair of the target domain is output.

[0089] Integrate the predicted question text and answer text data to determine the question-answer pairs in the target field.

[0090] In an optional embodiment, the output target domain question-answer pair may be one or more, and all the output target domain question-answer pairs are counted and stored.

[0091] S105. Determine fine-tuning data based on the question-answer pairs in the target domain to fine-tune the initial large language model in the target domain.

[0092] In this step, it is determined whether the answer text data in the question-answer pair in the target domain contains the target fault indicator.

[0093] Here, it is judged whether there are fault phenomena, fault causes, treatment measures, preventive measures and text content corresponding to each target fault indicator in the answer text data.

[0094] If the answer text data in the question-answer pair in the target field does not contain the target fault indicator, the question-answer pair in the target field is filtered.

[0095] Question-answer pairs in the target field whose answer text data do not contain target fault indicators are filtered to exclude low-quality or repeated question-answer pairs.

[0096] Specifically, the question-answer pairs in the target field are effectively identified and excluded through advanced heuristic algorithms. This step can be achieved through automated tools to reduce the burden of manual review and improve the efficiency and accuracy of data processing.

[0097] If the answer text data in the question-answer pair in the target domain contains the target fault indicator, the question-answer pair in the target domain is determined as the target question-answer pair.

[0098] Evaluate the target question-answer pair and determine the fine-tuning data.

[0099] Here, manual evaluation and multi-index evaluation are performed for each target question-answer pair to determine the score of the target question-answer pair under each evaluation item.

[0100] In an optional embodiment, the quality of each target question-answer pair can be judged manually. The human can check whether the target question-answer pair is concise, more relevant to target zero, and the answer question text also includes the target failure indicator. The human can evaluate based on these three aspects and score each target question-answer pair.

[0101] In another optional embodiment, a multi-dimensional indicator system can also be used to score each target question-answer pair. The indicators may include input length (question length in the target field), output length (answer length), reward score, perplexity, vocabulary diversity index, KNN (K-Nearest Neighbors neighbor consistency index), and Unieval series of naturalness, coherence and comprehensibility indicators, etc. These indicators help us analyze the quality of data from multiple angles to ensure that it meets the standards.

[0102] According to the score of each target question-answer pair under each assessment item, the total score of each target question-answer pair is determined.

[0103] The scores obtained through manual evaluation and the scores obtained through the multi-dimensional indicator system are averaged to determine the average value as the total score for each target question-answer pair.

[0104] The fine-tuning data is determined by sorting the total score of each target question-answer pair.

[0105] Sort the total score of each target question and answer pair, and determine the question and answer pair that meets the quality standard as the target question and answer pair. For example, here we take the target question and answer pair with a total score greater than 0.65 as the question and answer pair that meets the quality standard, and determine the target question and answer pair with a total score greater than 0.65 as the fine-tuning data. Here, the target question and answer pair can be the question and answer pair with a preset total score in front, which can be determined according to actual conditions.

[0106] According to the fine-tuning data, the initial target domain large language model is fine-tuned to obtain the target domain large language model.

[0107] The initial target domain large language model is fine-tuned based on the fine-tuning data to increase its specific domain knowledge capabilities and generate high-quality question-answer pairs.

[0108] Here, the fine-tuning data may be SFT (Supervised Fine-Tuning) supervised fine-tuning data, which is used to fine-tune the initial target domain large language model. Through supervised fine-tuning, the model can be fine-tuned according to the fine-tuning data to adapt to specific tasks or domains.

[0109] Targeting the vertical field of production accidents and machinery maintenance in the steel industry, question-answer pairs in this field are used as fine-tuning data to fine-tune the initial target field large language model. The entire process of generating fine-tuning data is automated and does not require excessive human intervention, thereby improving the speed and quality of data processing.

[0110] Here, the initial target domain large language model can be a large-scale language model (LLM), which is a deep learning model trained based on massive text data. It can not only generate natural language text, but also deeply understand the meaning of the text and handle various natural language tasks, such as text summarization, question answering, translation, etc.

[0111] The answers of the initial target domain big language model before fine-tuning were broad and not focused enough on the industry. The target domain big language model after fine-tuning was more concise and relevant to the industry. The question-answer pairs generated by the target domain big language model after fine-tuning included the target fault indicators and the text corresponding to each target fault indicator, making the answer text data in the question-answer pairs clearer.

[0112] For example, the answer to the question-answer pair generated by the target domain large language model after fine-tuning is:

[0113] Answer: Fault name:

[0114] Abnormal noise from refining furnace equipment.

[0115] Cause:

[0116] Wear or looseness of mechanical parts: abnormal noise may be generated if transmission devices, bearings, gears and other parts are worn or loosened due to long-term operation; hydraulic system failure: oil leakage or blockage of hydraulic pump, valve body or oil pipe leads to unstable pressure and noise; electrical control system abnormality: motor overload, inverter failure or poor line contact can cause unstable equipment operation accompanied by noise; uneven distribution of materials in the furnace: molten metal collides with the furnace lining, or large pieces of scrap steel are thrown in to cause impact sound; cooling system problems: cooling water pipe blockage or pump failure can cause local overheating and may also generate noise.

[0117] Treatment measures:

[0118] Check and tighten mechanical parts, replace severely worn parts such as bearings, gears, etc.; conduct a comprehensive inspection of the hydraulic system, repair oil leaks, clean or replace blocked hydraulic components; inspect the electrical system, adjust the motor load, and repair or replace faulty electrical components; adjust the feeding process to ensure even distribution of materials and reduce direct impact; maintain the cooling system, clean blocked pipes, and ensure cooling effect.

[0119] Precautions:

[0120] Conduct equipment inspections regularly to promptly identify and address potential mechanical wear problems; implement a regular maintenance plan for the hydraulic system, including oil replacement and filter cleaning; strengthen daily monitoring of the electrical system and conduct regular electrical safety inspections; optimize feeding operation specifications and train operators on correct feeding techniques; establish cooling system maintenance procedures to ensure efficient and stable operation of the cooling system.

[0121] Through the above steps, the abnormal noise of the refining furnace equipment can be quickly located and the cause analyzed, and corresponding measures can be taken to solve the problem and prevent similar failures in the future.

[0122] The embodiments of the present application provide a method and device for generating fine-tuning data for a large language model in a target domain. By calling an extraction template for the target domain, fault description information of the target domain is input in a text input area to obtain structured text data. The fault description information is processed according to the task requirements in the structured text data to obtain answer text data. The answer text data includes multiple target fault indicators and text content corresponding to each target fault indicator is extracted from the fault description information. According to the answer text data, question and answer pairs of the target domain are output. According to the question and answer pairs of the target domain, fine-tuning data is determined to fine-tune the initial large language model of the target domain. Through the present application, the generation process of fine-tuning data for the large language model of the target domain is simplified.

[0123] This application also adopts the following measures when obtaining fault description information in the target field:

[0124] Breadth expansion: Expand the coverage of the dataset by integrating data from different fields and backgrounds, including incorporating different types of input and output instructions, as well as data in different contexts, thereby increasing the diversity of the dataset.

[0125] Deep expansion: By deeply analyzing each type of data, its inherent complexity is extracted, which includes not only multi-angle processing of basic data, but also mining the deep semantics and context of the data to enrich the content and quality of the data.

[0126] CoT data integration: CoT (Chain of Thought) is a chain of thought method. By introducing this kind of data, we can automatically expand the data set to include more complex reasoning chains. This method not only increases the logical depth of the data, but also improves the practicality of the data and the problem-solving ability of the model by simulating more complex decision-making processes.

[0127] This application mainly covers the collection, cleaning and classification of fault description information in related processes such as production fault handling and equipment maintenance in the steel industry. By adopting a general large language model to generate question-answer pairs, it is able to systematically generate and manage high-quality question-answer pairs. A filtering mechanism is used to ensure that high-quality question-answer pairs are used for fine-tuning of the large language model in the target field, greatly reducing reliance on manual labeling.

[0128] In addition, the question-answer pairs in the target domain are used for continuous fine-tuning of the large language model in the target domain, further improving the performance and adaptability of the large language model in the target domain.

[0129] The method and device for generating fine-tuning data for a large language model in the target domain of the present application reduce the intervention of manual processes through systematic data processing and intelligent data generation processes, thereby reducing costs and significantly improving efficiency. This not only ensures the consistency and reliability of data generation, but also can fine-tune the initial large language model in the target domain based on the generated question-answer pairs in the target domain, thereby supporting a wider range of model applications and technological innovations.

[0130] The processing operations of fault description information for the target field can be performed by the large language model. Based on the deep understanding and powerful reasoning ability of the large language model, the generated SFT data can be used to further fine-tune the large language model, forming a continuous optimization cycle, making the model more accurate and efficient in specific vertical fields. This method effectively improves the practicality of the model and makes it closer to actual application needs.

[0131] Based on the same inventive concept, the embodiments of the present application also provide a device for generating fine-tuning data of a large language model in the target domain corresponding to the method for generating fine-tuning data of a large language model in the target domain. Since the principle of solving the problem by the device in the embodiments of the present application is similar to the method for generating fine-tuning data of a large language model in the target domain mentioned in the embodiments of the present application, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.

[0132] See also Figure 2 , Figure 2 This is a schematic diagram of the structure of a device for generating fine-tuning data of a large language model in a target domain provided in an embodiment of the present application. Figure 2 As shown in , the device 200 includes:

[0133] A template calling module 201 is used to call an extraction template of a target domain, wherein the extraction template includes a task requirement and a text input area, wherein the task requirement is associated with the extraction template and is pre-built in the extraction template;

[0134] A structured text data determination module 202, configured to input the fault description information of the target domain in the text input area to obtain structured text data;

[0135] An answer text data determination module 203 is used to process the fault description information according to the task requirements in the structured text data to obtain answer text data, wherein the answer text data includes a plurality of target fault indicators and text content corresponding to each target fault indicator extracted from the fault description information;

[0136] A target domain question-answer pair determination module 204, configured to output the target domain question-answer pair based on the answer text data;

[0137] The fine-tuning data determination module 205 is used to determine the fine-tuning data according to the question-answer pairs in the target domain, so as to fine-tune the initial target domain large language model.

[0138] In a preferred embodiment, the answer text data determination module is further used for:

[0139] Invoking a first extraction template of a target domain, the first extraction template comprising a first task requirement and a first text input area, the first task requirement being associated with the extraction template and being pre-constructed in the first extraction template;

[0140] Inputting the fault description information of the target field in the first text input area to obtain first structured text data;

[0141] Processing the fault description information according to the first task requirement in the first structured text data to obtain field text data, wherein the field text data includes a plurality of fault indicators and extracting text content corresponding to each fault indicator from the fault description information;

[0142] Calling a second extraction template of the target domain, the second extraction template comprising a second task requirement and a second text input area, the second task requirement being associated with the second extraction template and being pre-constructed in the second extraction template;

[0143] Inputting the field text data in the second text input area to obtain second structured text data;

[0144] The field text data is processed according to the second task requirement in the second structured text data to obtain answer text data, wherein the answer text data includes multiple target fault indicators and text content corresponding to each target fault indicator is extracted from the second structured text data.

[0145] See also Figure 3 , Figure 3 This is a schematic diagram of the structure of the electronic device provided in the embodiment of the present application. Figure 3 As shown in , the electronic device 300 includes a processor 310 , a memory 320 and a bus 330 .

[0146] The memory 320 stores machine-readable instructions executable by the processor 310. When the electronic device 300 is running, the processor 310 communicates with the memory 320 via the bus 330. When the machine-readable instructions are executed by the processor 310, the above-mentioned Figure 1 The steps of the method for generating fine-tuning data for the large language model in the target domain in the method embodiment shown, and the specific implementation method can be found in the method embodiment, which will not be repeated here.

[0147] The present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the computer program can execute the above-mentioned Figure 1 The steps of the method for generating fine-tuning data for the large language model in the target domain in the method embodiment shown, and the specific implementation method can be found in the method embodiment, which will not be repeated here.

[0148] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0149] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.

[0150] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0151] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0152] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present application can essentially be embodied in the form of a software product, or in other words, the part that contributes to the prior art or the part of the technical solution. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0153] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present application, which are used to illustrate the technical solutions of the present application, rather than to limit them. The protection scope of the present application is not limited thereto. Although the present application is described in detail with reference to the above-mentioned embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-mentioned embodiments within the technical scope disclosed in the present application, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.

Claims

1. A method for generating fine-tuning data for a large language model in a target domain, It is characterized in that include: Invoking an extraction template of a target domain, the extraction template comprising a task requirement and a text input area, the task requirement being associated with the extraction template and pre-constructed in the extraction template; Inputting the fault description information of the target field in the text input area to obtain structured text data; Processing the fault description information according to the task requirements in the structured text data to obtain answer text data, wherein the answer text data includes a plurality of target fault indicators and text content corresponding to each target fault indicator extracted from the fault description information; Outputting the question-answer pair of the target domain according to the answer text data; Based on the question-answer pairs in the target domain, fine-tuning data is determined to fine-tune the initial target domain large language model.

2. The method according to claim 1, It is characterized in that The extraction template includes a first extraction template and a second extraction template, The processing of the fault description information according to the task requirements in the structured text data to obtain answer text data includes: Invoking a first extraction template of a target domain, the first extraction template comprising a first task requirement and a first text input area, the first task requirement being associated with the extraction template and being pre-constructed in the first extraction template; Inputting the fault description information of the target field in the first text input area to obtain first structured text data; Processing the fault description information according to the first task requirement in the first structured text data to obtain field text data, wherein the field text data includes a plurality of fault indicators and extracting text content corresponding to each fault indicator from the fault description information; Calling a second extraction template of the target domain, the second extraction template comprising a second task requirement and a second text input area, the second task requirement being associated with the second extraction template and being pre-constructed in the second extraction template; Inputting the field text data in the second text input area to obtain second structured text data; The field text data is processed according to the second task requirement in the second structured text data to obtain answer text data, wherein the answer text data includes multiple target fault indicators and text content corresponding to each target fault indicator is extracted from the second structured text data.

3. The method according to claim 2, It is characterized in that Outputting the question-answer pair of the target domain according to the answer text data includes: Calling a question-answer pair generation template for a target domain, wherein the question-answer pair generation template includes a third task requirement and a third text input area, wherein the third task requirement is associated with the question-answer pair generation template and is pre-constructed in the question-answer pair generation template; Inputting the answer text data in the third text input area to obtain third structured text data; Processing the answer text data according to the third task requirement in the third structured text data to obtain a predicted question text corresponding to the answer text data; Based on the predicted question text and the answer text data, a question-answer pair in the target domain is output.

4. The method according to claim 1, It is characterized in that The step of determining fine-tuning data based on the question-answer pairs in the target domain to fine-tune the initial target domain large language model includes: Determining whether the answer text data in the question-answer pair in the target field contains a target fault indicator; If the answer text data in the question-answer pair in the target field does not contain the target fault indicator, filtering the question-answer pair in the target field; If the answer text data in the question-answer pair in the target domain contains the target fault indicator, determining the question-answer pair in the target domain as the target question-answer pair; Evaluate the target question-answer pair and determine fine-tuning data; The initial target domain large language model is fine-tuned according to the fine-tuning data to obtain a target domain large language model.

5. The method according to claim 4, It is characterized in that The step of evaluating the target question-answer pair and determining fine-tuning data includes: For each target question-answer pair, perform manual evaluation and multi-index evaluation to determine the score of the target question-answer pair under each evaluation item; According to the score of each target question-answer pair under each assessment item, determine the total score of each target question-answer pair; The fine-tuning data is determined by sorting the target question-answer pairs according to their total scores.

6. The method according to claim 1, It is characterized in that Determine the fault description information of the target field by: Acquire data related to the target field, identify and convert the data, and determine target text data; The repeated texts and typos in the target text data are cleaned, and the cleaned target text data are summarized to obtain the fault description information of the target field.

7. A device for generating fine-tuning data of a large language model in a target domain, It is characterized in that include: A template calling module, used to call an extraction template of a target domain, wherein the extraction template includes a task requirement and a text input area, wherein the task requirement is associated with the extraction template and is pre-built in the extraction template; A structured text data determination module, used for inputting the fault description information of the target field in the text input area to obtain structured text data; an answer text data determination module, configured to process the fault description information according to the task requirements in the structured text data to obtain answer text data, wherein the answer text data includes a plurality of target fault indicators and text content corresponding to each target fault indicator extracted from the fault description information; A target domain question-answer pair determination module, configured to output the target domain question-answer pair based on the answer text data; The fine-tuning data determination module is used to determine the fine-tuning data based on the question-answer pairs in the target domain, so as to fine-tune the initial target domain large language model.

8. The device according to claim 7, It is characterized in that The extraction template includes a first extraction template and a second extraction template, Wherein, the answer text data determination module is also used for: Invoking a first extraction template of a target domain, the first extraction template comprising a first task requirement and a first text input area, the first task requirement being associated with the extraction template and being pre-constructed in the first extraction template; Inputting the fault description information of the target field in the first text input area to obtain first structured text data; Processing the fault description information according to the first task requirement in the first structured text data to obtain field text data, wherein the field text data includes a plurality of fault indicators and extracting text content corresponding to each fault indicator from the fault description information; Calling a second extraction template of the target domain, the second extraction template comprising a second task requirement and a second text input area, the second task requirement being associated with the second extraction template and being pre-constructed in the second extraction template; Inputting the field text data in the second text input area to obtain second structured text data; The field text data is processed according to the second task requirement in the second structured text data to obtain answer text data, wherein the answer text data includes multiple target fault indicators and text content corresponding to each target fault indicator is extracted from the second structured text data.

9. An electronic device, It is characterized in that include: A processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the memory via the bus, and the processor executes the machine-readable instructions to perform the steps of any method as claimed in claims 1 to 6.

10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are executed.

Citation Information

Patent Citations

  • Question and answer pair generation method and device and computer readable storage medium

    CN114925184A

  • Prompt text extension method and device, electronic equipment and storage medium

    CN116738250A

  • Enterprise knowledge base question answering system based on large model and knowledge graph

    CN116821310A

  • Method and device for generating high-quality question and answer data by using large language model

    CN117217315A

  • Question and answer pair extraction method and device, electronic equipment and storage medium

    CN117407502A

Cited By

  • Model fine tuning method and device, electronic equipment and storage medium

    CN119337832A

  • Large model training data generation method in medical field and related equipment

    CN119517430A

  • Medical field large model training data generation method and related equipment

    CN119517430B

  • Data processing method and device, electronic equipment and computer readable storage medium

    CN119577453A

  • Data processing methods, apparatus, electronic devices and computer-readable storage media

    CN119577453B