Fine-grained knowledge generation agent approach to embedded metadata cue engineering

By analyzing and labeling the elements that generate research questions, and by fine-tuning the large language model using the DeBERta model and LoRA technology, the accuracy problem of the language model in generating research questions was solved, and high-quality research question generation was achieved.

CN119647578BActive Publication Date: 2025-11-18DOCUMENT & INFORMATION CENT OF CHINESE ACAD OF SCI
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411804989.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-10
Publication Date
2025-11-18
Estimated Expiration
2044-12-10

AI Technical Summary

Technical Problem

Existing technologies train models based on general datasets, ignoring domain-specific knowledge elements, resulting in poor accuracy and redundant output when language models generate research questions.

Method used

By analyzing the elements that generate research questions, a knowledge element training dataset is constructed. The DeBERta model is used for training and fine-tuning, and the LoRA fine-tuning technique is combined to optimize the large language model, generating embedded metadata prompt words to improve the accuracy of research question generation.

Benefits of technology

This improves the accuracy and quality of language models in generating research questions, ensuring the precision and efficiency of the generated results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119647578B_ABST
    Figure CN119647578B_ABST
Patent Text Reader

Abstract

The application discloses an embedded metadata prompt word engineering fine-grained knowledge generation Agent method, and relates to the technical field of data processing, and the method comprises the following steps: analyzing research problem generation elements, determining research problem generation knowledge elements; constructing a knowledge element training data set; training and fine-tuning a DeBERta model to obtain a fine-grained knowledge data set; constructing an embedded metadata prompt word engineering; obtaining a research problem fine-tuning data set; fine-tuning and optimizing a large language model by using LoRA fine-tuning technology, and generating a research problem. The technical problems that the prior art has the problems of model training based on a general data set, ignoring specific domain knowledge elements, not analyzing and screening fine-grained knowledge, resulting in redundant data, and further leading to an inaccurate language model and poor accuracy of the generated research problem are solved, and the technical effects of improving the accuracy and quality of language model training and research problem result generation are achieved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of data processing, and particularly relates to a fine-grained knowledge generation Agent method embedded in a metadata prompt word engineering. BACKGROUND

[0002] In the current natural language processing (NLP) field, the application of language models has become an important tool for solving complex knowledge generation problems. Prompt engineering (Prompt) is a technology for designing and optimizing input prompts to guide large language models to generate specific outputs or perform specific tasks, mainly including instructions, contexts and examples, so that the large language model can better understand the task requirements and produce the required output, and generate research questions according to the input text. The generation of research questions mainly utilizes the summarization and generation capabilities of large language models on scientific literature, and the process is as follows: first, the large model analyzes and understands the input scientific literature, then based on the model knowledge base and the understanding of the scientific research paradigm, the large model identifies potential research gaps, contradictions or expandable directions in the literature, then the large model uses this information to construct possible research questions, and ensures that the generated questions meet the expression specifications, and finally the model generates multiple candidate research questions and sorts them according to relevance and quality. However, traditional language models have many challenges in dealing with high complexity and fine-grained knowledge generation tasks, for example, when constructing prompts, the fine-grained knowledge required by specific domains or tasks is ignored, that is, most of the content generation of large language models is based on the training of general data sets, which means that prompts that ignore specific domain knowledge elements may not be able to guide the large model to focus on professional theories, methods and other information within the field; in addition, for specific generation tasks, without analyzing and filtering fine-grained knowledge, a small number of large language models generated for specific tasks attempt to train on relevant domain text data, but without filtering and refining fine-grained knowledge for specific generation tasks, there are still a lot of redundant information, which further leads to low accuracy of language models and reduces the accuracy of generated research questions.

[0003] In the related art at this stage, there are technical problems such as model training based on general data sets, ignoring specific domain knowledge elements, not analyzing and filtering fine-grained knowledge, making data redundant, and further leading to inaccurate language models and poor accuracy of research question generation results. SUMMARY

[0004] The application solves the technical problems in the prior art that the model training is based on general data sets, specific domain knowledge elements are ignored, fine-grained knowledge is not analyzed and screened, data is redundant, and the language model is not accurate, and the generation result accuracy of research problems is poor, by providing a fine-grained knowledge generation Agent method embedded with metadata prompt engineering, and a technical effect of improving the accuracy and quality of language model training and research problem result generation is achieved.

[0005] The application provides a fine-grained knowledge generation Agent method embedded with metadata prompt engineering, which comprises: analyzing research problem generation elements to determine research problem generation knowledge elements, wherein the research problem generation knowledge elements include a research purpose sentence and a research method sentence; performing data labeling and syntactic structure analysis on the research purpose sentence and the research method sentence to construct a knowledge element training data set; training and fine-tuning a DeBERta model based on the knowledge element training data set, and extracting the research purpose sentence and the research method sentence using the fine-tuned DeBERta model to obtain a fine-grained knowledge data set; constructing an embedded metadata prompt engineering according to the fine-grained knowledge data set; obtaining a research problem fine-tuning data set based on the embedded metadata prompt engineering, wherein the research problem fine-tuning data set consists of a task description part, an input part and an output part; fine-tuning and optimizing a large language model based on the research problem fine-tuning data set using LoRA fine-tuning technology, and generating a research problem based on the optimized large language model.

[0006] In a possible implementation, the method further comprises the following processing: collecting a scientific and technological literature data set; labeling the scientific and technological literature data set using an artificial labeling method and an iterative-based semi-automatic labeling method to construct a research purpose sentence data set and a research method sentence data set; performing syntactic structure analysis on the research purpose sentence data set and the research method sentence data set to extract a purpose sentence feature word set and a method sentence feature word set; performing feature sentence pattern analysis on the research purpose sentence data set and the research method sentence data set to obtain a purpose sentence feature sentence pattern set and a method sentence feature sentence pattern set; and constructing the knowledge element training data set based on the purpose sentence feature word set and the method sentence feature word set, and the purpose sentence feature sentence pattern set and the method sentence feature sentence pattern set.

[0007] In a possible implementation, the construction of the research objective sentence dataset and the research method sentence dataset further includes the following processing: manually annotating a predetermined proportion of the scientific literature dataset to obtain a manually annotated dataset; training the manually annotated dataset using an iterative semi-automatic annotation method to obtain a basic annotation model; iteratively training the basic annotation model to obtain an automatic annotation model; and using the automatic annotation model to annotate the scientific literature dataset to construct the research objective sentence dataset and the research method sentence dataset.

[0008] In a possible implementation, the LoRA fine-tuning technique, based on the dataset used for the research problem, fine-tunes and optimizes the large language model, and further performs the following processes: selecting and acquiring a pre-trained large language model and setting the fine-tuning hyperparameters; defining a LoRA module, wherein the LoRA module is composed of a first low-rank projection matrix A. i Second low-rank projection matrix B i Composition, where i is the i-th layer of the large language model; introducing the first low-rank projection matrix A i Second low-rank projection matrix B i The large language model is trained, fine-tuned, and optimized based on the dataset and the fine-tuning hyperparameters used to address the research question.

[0009] In a possible implementation, the fine-grained knowledge generation agent method for embedding metadata cue words further performs the following processing: introducing the first low-rank projection matrix A onto each layer i of the large language model. i Second low-rank projection matrix B i Based on the fine-tuned dataset and the fine-tuned hyperparameters, the large language model is trained by forward propagation to obtain the original forward computation result h of the i-th layer of the large language model. i =f i (x i ), where x i f is the input of the i-th layer. i Let A be the forward computation function of the i-th layer; based on the first low-rank projection matrix A i Second low-rank projection matrix B i The original forward calculation result is corrected to obtain the forward correction calculation result; a model loss function is constructed with minimizing the model loss function as the optimization objective; and the large language model is fine-tuned and optimized based on the forward correction calculation result according to the optimization objective.

[0010] In a possible implementation, obtaining the forward correction calculation result further includes performing the following processing: based on the first low-rank projection matrix A i Second low-rank projection matrix Bi , construct a forward correction calculation formula: h i ′ = f i (x i ) + A i B i f i (x i ) = f i (x i ) + Delta i , wherein Delta i = A i B i f i (x i ) represents a correction term introduced by the LoRA module; based on the forward correction calculation formula, the original forward calculation result is corrected to obtain the forward correction calculation result.

[0011] In a possible implementation, the fine-grained knowledge generation Agent method of the embedded metadata prompt word engineering further performs the following processing: the model loss function is specifically:

[0012]

[0013] wherein theta represents fixed parameters of an original model, represents all projection matrices introduced by the LoRA module, is a training data set of a new task, is a task-related loss function.

[0014] In a possible implementation, the fine-grained knowledge generation Agent method of the embedded metadata prompt word engineering further performs the following processing: according to the first low-rank projection matrix A i and the second low-rank projection matrix B i , a first matrix dimension (d, r) and a second matrix dimension (r, d) are determined, wherein d is a model hidden layer dimension, r is a projection dimension, and r << d.

[0015] The fine-grained knowledge generation Agent method of the embedding metadata prompt word engineering provided by the embodiment of the present application can analyze research question generation elements, determine research question generation knowledge elements, perform data labeling and syntax structure analysis, construct a knowledge element training data set, train and fine-tune the DeBERta model, extract research purpose sentences and research method sentences, obtain a fine-grained knowledge data set, construct an embedding metadata prompt word engineering, obtain a research question fine-tuning data set, fine-tune and optimize a large language model by using the LoRA fine-tuning technology, and generate a research question. The technical problems of the prior art, such as training a model based on a general data set, ignoring specific domain knowledge elements, not analyzing and screening fine-grained knowledge, resulting in data redundancy, and thus leading to inaccurate language models and poor accuracy of research question generation results, are solved, and the technical effects of improving the accuracy and quality of language model training and research question generation results are achieved. BRIEF DESCRIPTION OF DRAWINGS

[0016] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings of the embodiments of the present application will be briefly introduced below. In the present application, a flowchart is used to illustrate the operations performed by the system according to the embodiments of the present application. It should be understood that the foregoing or the following operations are not necessarily performed in sequence. On the contrary, various steps can be processed in reverse order or simultaneously as needed. At the same time, other operations can be added to these processes, or one or more steps of operations can be removed from these processes.

[0017] Figure 1 The flowchart of the fine-grained knowledge generation Agent method of the embedding metadata prompt word engineering provided by the embodiment of the present application is shown in Figure 1.

[0018] Figure 2 The flowchart of constructing the research purpose sentence and research method sentence data set in the fine-grained knowledge generation Agent method of the embedding metadata prompt word engineering provided by the embodiment of the present application is shown in Figure 2. DETAILED DESCRIPTION

[0019] The above description is only a summary of the technical solutions of the present application. In order to more clearly understand the technical means of the present application, the embodiments of the present application can be implemented according to the content of the specification, and in order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the following specific embodiments of the present application are described.

[0020] In order to make the purposes, technical solutions and advantages of the present application more clear, the present application will be further described in detail below with reference to the drawings, and the described embodiments should not be regarded as limiting the present application. All other embodiments obtained by those of ordinary skill in the art without making creative efforts fall within the scope of protection of the present application.

[0021] In the following description, "some embodiments" are referred to, which describe a subset of all possible embodiments, but it can be understood that "some embodiments" can be the same subset or different subsets of all possible embodiments, and can be combined with each other without conflict, and the term "first\second" referred to only distinguishes similar objects, and does not represent a specific order for the objects. The terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or server including a series of steps or units does not have to be limited to those steps or units clearly listed, but can include other steps or modules not clearly listed or inherent to these processes, methods, products or devices, unless otherwise defined, all technical and scientific terms used herein have the same meaning as understood by those skilled in the art belonging to the technical field of the present application. The terms used herein are only for the purpose of describing the embodiments of the present application.

[0022] The embodiments of the present application provide a fine-grained knowledge generation Agent method embedded in metadata prompt word engineering, as shown in Figure 1 The method comprises the following steps:

[0023] In step S100, the research problem generation elements are analyzed to determine the research problem generation knowledge elements, and the research problem generation knowledge elements include research purpose sentences and research method sentences.

[0024] Preferably, the research question generation method based on fine-grained knowledge Prompt mainly analyzes the knowledge elements required by large models to generate research questions, and then extracts fine-grained knowledge from scientific literature and constructs Prompts. Among them, the research question prompt format integrating fine-grained knowledge is as follows: Given the title: the title of the paper, the research objective: the research purpose sentence, the research methods: the research method sentence, can we distill a concise question summarizing the research issue addressed in this article? (Can we distill a concise question summarizing the research issue addressed in this article?) Please use appropriate question words! (Please use appropriate question words) Question: the summarized research question, and then fine-tune the large model to finally realize the accurate generation of research questions in scientific literature. Specifically, research questions can be divided into two categories: theoretical questions and methodological questions. Among them, theoretical questions focus on exploring the nature, laws and mechanisms of things, aiming to establish or develop scientific theories; In scientific literature, this question is usually reflected in the research purpose part, and the researcher will clearly point out what theoretical question he wants to explore. Methodological questions arise from the challenges of technical routes or methods in the scientific research process, aiming to explore effective solutions. In scientific literature, methodological questions are usually reflected in the research method, and researchers will focus on introducing specific technical solutions and implementation steps to solve problems.

[0025] Preferably, the analysis of research question generation elements refers to the systematic disassembly of research questions to identify core information closely related to research tasks, so as to provide accurate and fine-grained basis for the knowledge generation process, including research purpose sentences and research method sentences, and then form research question generation knowledge elements. Specifically, the research purpose sentence is a sentence used to clearly state the main goal or intention of the research work, usually answering the core question of “what problem does the research solve?” or “what result does the research hope to achieve?” The research purpose sentence can directly reflect the motivation and direction of the research, and is the core driving force of the research question. The research method sentence is a description of the specific method, technology or path to achieve the research goal, usually answering the question of “how is the research conducted?” or “which means and tools are used?” The research method sentence provides technical support for the realization of the research goal, and embodies the operability and logic of the research.

[0026] Step S200, data labeling and syntactic structure analysis are performed on the research purpose sentence and the research method sentence to construct a knowledge element training data set.

[0027] Preferably, data labeling and syntactic structure analysis of research purpose sentences and research method sentences refer to fine processing and structuring of text data in research problems, i.e. construction of research purpose sentence and method sentence data sets by using artificial labeling and semi-automatic labeling based on iteration, a total of 15000 high-quality corpora are obtained, a knowledge element training data set is constructed, specifically, data labeling refers to semi-automatic labeling of contents related to research purpose sentences and research method sentences in text data, clarifying semantic boundaries and category attributes, including extracting parts that may belong to research purpose sentences and research method sentences in research problem text through predefined rules or preliminary models, assigning corresponding labels to the extracted sentences, and accurately labeling keywords, phrases and syntactic components in the sentences to ensure consistency of labeling among different samples; syntactic structure analysis refers to parsing the syntactic structure of research purpose sentences and research method sentences, extracting syntactic relations such as subject-predicate-object and modification components, specifically, the sentence is segmented, each word is assigned a part of speech (such as noun, verb, etc.), the dependency tree of the sentence is constructed using natural language processing tools (such as spaCy, Stanza, etc.), the grammatical dependency in the sentence is clarified, and the syntactic pattern is extracted to simplify complex sentences into patterned structures. Collect research problem texts from multiple fields to ensure a wide range of data sources and cover different types of research purposes and methods, organize text data and labeling results into training samples, store them in a structured manner, and construct a knowledge element training data set containing labeled research purpose sentences and research method sentences.

[0028] Further, step S200 further comprises step S210 of collecting a science and technology literature data set; step S220 of labeling the science and technology literature data set by using artificial labeling and semi-automatic labeling based on iteration to construct a research purpose sentence data set and a research method sentence data set; step S230 of performing syntactic structure analysis on the research purpose sentence data set and the research method sentence data set to extract a purpose sentence feature word set and a method sentence feature word set; step S240 of performing feature sentence pattern analysis on the research purpose sentence data set and the research method sentence data set to obtain a purpose sentence feature sentence pattern set and a method sentence feature sentence pattern set; and step S250 of constructing the knowledge element training data set based on the purpose sentence feature word set and the method sentence feature word set, and the purpose sentence feature sentence pattern set and the method sentence feature sentence pattern set.

[0029] Preferably, relevant field scientific literature, including journal papers, conference papers, technical reports, etc., covering research problems, research purposes, research methods and results, is collected from open access databases (such as PubMed, IEEE Xplore), in-house literature resource databases, etc. as scientific literature datasets. The scientific literature datasets are labeled using manual labeling and semi-automatic labeling combining manual labeling and automatic tools (such as NLP models) to obtain research purpose sentence datasets and research method sentence datasets. The labeled research purpose sentences and research method sentences are then parsed to extract feature words, i.e. the sentences are decomposed into words and tagged with parts of speech (such as nouns, verbs, adjectives, etc.), the syntactic structure is parsed through dependency tree analysis to extract core components and modifier components, and the purpose sentence feature word set and the method sentence feature word set are obtained.

[0030] Preferably, based on the labeled sentences, the common sentence pattern of the research purpose sentence and the research method sentence is analyzed, the sentence features are extracted, and the common sentence pattern is extracted. The purpose sentence feature sentence pattern example is to improve efficiency or the target is to explore the influence of X. The method sentence feature sentence pattern example is to use experimental analysis method for verification or to achieve optimization through big data analysis. Then the purpose sentence feature sentence pattern set and the method sentence feature sentence pattern set are obtained. Finally, based on the purpose sentence feature word set and the method sentence feature word set, as well as the purpose sentence feature sentence pattern set and the method sentence feature sentence pattern set, the sentences in the labeled data are matched with the feature words and the feature sentence patterns to obtain the knowledge element training dataset.

[0031] Further, as shown in Figure 2 Step S220 further includes step S221 of labeling a preset proportion of the scientific literature dataset using a manual labeling method to obtain a manually labeled dataset; step S222 of training the manually labeled dataset using an iterative semi-automatic labeling method to obtain a basic labeling model; step S223 of iterative labeling training based on the basic labeling model to obtain an automatic labeling model; and step S224 of labeling the scientific literature dataset using the automatic labeling model to construct the research purpose sentence dataset and the research method sentence dataset.

[0032] Preferably, a certain proportion of literature (such as 10%-20%) is selected from the scientific literature data set, and the sentences are accurately labeled by manual means using a labeling platform (such as Label Studio, Prodigy) to clearly identify the research purpose sentences and the research method sentences as the manually labeled data set, wherein each sentence is labeled with a category (purpose sentence or method sentence). A model suitable for sequence labeling or classification tasks (such as BERT, RoBERTa, etc.) is selected, and the manually labeled data set is used to train the model to obtain a basic labeling model that can initially identify research purpose sentences and research method sentences, but may have limitations in boundary identification and complex sentence processing.

[0033] Preferably, the basic labeling model is used for multiple rounds of iterative optimization, and through the cycle of manual correction and retraining, the labeling ability of the model is gradually improved. Specifically, the basic labeling model is used to predict the unlabeled literature, the model prediction results are manually reviewed, the incorrect labeling is corrected, the corrected prediction results are added to the training data set, the basic labeling model is retrained using the expanded training data, and the above cycle is continuously performed to gradually reduce the proportion of manual intervention, and an automatic labeling model with high precision is obtained, which can accurately label the unlabeled data; finally, the automatic labeling model is used to fully label the remaining unlabeled scientific literature data set to obtain a research purpose sentence data set (containing all sentences labeled as purpose sentences) and a research method sentence data set (containing all sentences labeled as method sentences).

[0034] Step S300, training and fine-tuning the DeBERta model based on the knowledge element training data set, and extracting research purpose sentences and research method sentences using the fine-tuned DeBERta model to obtain a fine-grained knowledge data set.

[0035] Preferably, the DeBERta model is fine-tuned according to the knowledge element training dataset, wherein DeBERta (Decoding-enhanced BERT with disentangled attention) is an advanced language model that can capture rich contextual information and perform fine-grained semantic analysis on sentences. Specifically, a pre-trained DeBERta model is used as the base model, inheriting its existing language knowledge. A classification or sequence labeling task is defined to classify sentences into "research purpose sentences", "research method sentences", or "non-target sentences". The research question text in the training data is input into the model in the form of segmented words, and the labeling information of the specific task is added. Through training, the model can assign a probability value to each sentence or text segment, indicating the likelihood of belonging to a "research purpose sentence" or a "research method sentence". The cross-entropy loss function is used to optimize the error between the model's prediction results and the labeled labels. The model is iteratively trained until its performance on the validation set reaches the expected level. The fine-tuned DeBERta model is then used to process new research question texts to automatically extract research purpose sentences and research method sentences. That is, the new research question text is input into the fine-tuned DeBERta model, and the model classifies each sentence or segment and outputs its class probability. Based on the classification results, the research purpose sentences and research method sentences in the text are extracted to form a fine-grained knowledge dataset, which is high-quality structured data extracted by the model from research question texts and can accurately describe the core information of research questions.

[0036] Step S400, according to the fine-grained knowledge dataset, construct embedded metadata prompt word engineering.

[0037] Preferably, the extracted fine-grained knowledge such as research purpose sentences and research method sentences is converted into a prompt word design method, and through the embedding of metadata, structured task descriptions are generated to guide the language model to more accurately generate research questions that meet specific goals. Specifically, embedding metadata is the research purpose sentences and research method sentences extracted from the fine-grained knowledge dataset, which are integrated into the prompt according to structured rules as auxiliary information for the language model to generate research questions, such as research purpose, research method, and task background. Prompt engineering is an input structure designed for language models (such as large language models) to guide the model to generate the required content through explicit task descriptions, input conditions, and target outputs. Finally, the prompt engineering constructed by the fine-grained knowledge dataset is optimized to ensure its guiding effect on the language model and significantly improve the efficiency and quality of the research question generation task.

[0038] Step S500, based on the embedding metadata prompt engineering, obtaining a research question fine-tuning dataset composed of a task description part, an input part and an output part.

[0039] Preferably, obtaining a research question fine-tuning dataset based on embedding metadata prompt engineering means that the task description, input and output are parsed from the embedding metadata prompt engineering and converted into samples of the fine-tuning dataset, i.e., obtaining a research question fine-tuning dataset composed of a task description part, an input part and an output part. The task description clearly states what the generation task is, what task the model needs to complete, and what specific requirements and restrictions are, etc., providing clear guidance for subsequent input and output. Specifically, the task description part clearly states the goal of the task or the task that the language model needs to complete, helping the model understand the type of task to be performed or the content goal to be generated; the input part provides the context information or reference data required for the model to complete the task, which comes from the fine-grained knowledge dataset, including research purpose sentences and research method sentences, providing specific information input for the model to generate research questions; the output part is the output content that the model is expected to generate, which is usually a complete answer or extended description for the input part, guiding the form and content of the model generated results, for example, actual dataset examples are shown in the following table:

[0040]

[0041]

[0042] Step S600, using LoRA fine-tuning technology to fine-tune and optimize the large language model based on the research question fine-tuning dataset, and generating research questions based on the optimized large language model.

[0043] Preferably, using LoRA (Low-Rank Adaptation) fine-tuning technology, fine-tuning and optimizing the large language model based on the research question fine-tuning dataset, and generating research questions based on the optimized model, means that the pre-trained large language model is adapted in a lightweight manner to make it more accurate in performing research question generation tasks while reducing computing and storage costs. LoRA is a lightweight fine-tuning technology that aims to adjust the weights of a large model by introducing a low-rank matrix without changing the original model's weights, thereby significantly reducing the parameter overhead and computational requirements during fine-tuning. LoRA is very suitable for tasks that require frequent fine-tuning, such as research question generation, which requires optimization for domain data.

[0044] Preferably, the constructed research question fine-tuning dataset is used, each sample consisting of a task description, an input part and an output part, and a specific layer (usually the weight matrix part in the attention mechanism) of a large language model (such as DeBERTa) is selected for adjustment. LoRA fine-tuning only affects the low-rank representation part of these layers, without modifying the entire model. Low-rank adjustment refers to adding a low-rank matrix adjustment term on the attention layer weight, specifically, initializing the low-rank matrix to random values or zero, converting the task description, input part and output part in the research question fine-tuning dataset into training samples of the model, using gradient descent method to optimize the low-rank matrix, so that the output generated by the model is closer to the reference answer provided in the fine-tuning dataset, and the remaining part of the model remains in a frozen state to avoid resource waste; finally, the new research objectives and methods are input as input, and the model generates research questions guided by prompt words. The optimized model can generate research questions with clear content, reasonable logic and expected semantics according to the input.

[0045] Further, step S600 further comprises step S610 of selecting a pre-trained large language model and setting fine-tuning hyperparameters; step S620 of defining a LoRA module, the LoRA module being composed of a first low-rank projection matrix A i and a second low-rank projection matrix B i , wherein i is the i-th layer of the large language model; step S630 of introducing the first low-rank projection matrix A i and the second low-rank projection matrix B i , and training and fine-tuning the large language model based on the research question fine-tuning dataset and the fine-tuning hyperparameters.

[0046] Preferably, a pre-trained large language model is selected, and the fine-tuning hyperparameters are set, batch_size: int = 10 (batch size: integer 10), micro_batch_size: int = 2 (micro batch size: integer 2), num_epochs: int = 2 (training rounds: integer 2), learning_rate: float = 1e-5 (learning rate: float 1e-5 = 0.00001), lora_r: int = 8 (LoRA parameter rank: integer 8), lora_alpha: int = 16 (LoRA parameter alpha value: integer 16), lora_dropout: float = 0.05 (dropout probability of LoRA parameters: float 0.05); define the LoRA module, which is used to significantly reduce the parameter update amount and memory usage during fine-tuning, limit the weight update of the original model to a low-rank subspace, rather than updating the weights of the entire model, and Ai and Bi are two trainable low-dimensional matrices responsible for projecting the input into a low-rank space and restoring it from the low-rank space, respectively. Finally, based on the research problem fine-tuning dataset and fine-tuning hyperparameters, the large language model is trained and fine-tuned for optimization. Specifically, the original weights of the large language model are frozen (the main parameters of the model remain unchanged), and Ai and Bi are trained through gradient descent. The effect of the fine-tuned model is close to full-parameter fine-tuning, but the computational cost is greatly reduced, allowing the model to perform better on the target task dataset.

[0047] Further, step S600 further comprises introducing the first low-rank projection matrix A i and the second low-rank projection matrix B i on each layer i of the large language model; step S640, based on the research problem fine-tuning dataset and the fine-tuning hyperparameters, forward propagating training the large language model to obtain the original forward calculation result h i of the i-th layer of the large language model = f i (x i ), where x i is the input of the i-th layer, and f i is the forward calculation function of the i-th layer; step S650, based on the first low-rank projection matrix A i and the second low-rank projection matrix B i , correcting the original forward calculation result to obtain a forward correction calculation result; step S660, constructing a model loss function, with minimizing the model loss function as the optimization objective; step S670, based on the forward correction calculation result, fine-tuning the large language model according to the optimization objective.

[0048] Step S650 further comprises step S651, determining the first low-rank projection matrix Ai and a second low-rank projection matrix B i , a forward correction calculation formula: h i ' = f i (x i ) + A i B i f i (x i ) = f i (x i ) + Δ i , wherein Δ i = A i B i f i (x i ) represents a correction term introduced by the LoRA module; and step S652, correcting the original forward calculation result based on the forward correction calculation formula to obtain the forward correction calculation result.

[0049] Step S660 further includes that the model loss function is specifically:

[0050]

[0051] wherein θ represents a fixed parameter of an original model, represents all projection matrices introduced by the LoRA module, is a training data set of a new task, is a task-related loss function.

[0052] Step S620 further includes determining a first matrix dimension (d, r) and a second matrix dimension (r, d) according to the first low-rank projection matrix A i and the second low-rank projection matrix B i , wherein d is a model hidden layer dimension, r is a projection dimension, and r << d.

[0053] Preferably, the core idea of LoRA is to introduce a set of low-rank projection matrices on each layer of a large model, and to realize adaptation of the original model by optimizing these matrices. Specifically, for the i-th layer of the model, LoRA defines two projection matrices A i and B i with dimensions (d, r) and (r, d), respectively, wherein d is a model hidden layer dimension, r is a projection dimension, and r << d. During forward propagation, LoRA adds a correction term based on the projection matrix to the original layer calculation result. Assuming that the original forward calculation of the i-th layer can be represented as:

[0054] h i = f i (x i ).

[0055] where x i is the input of the i-th layer, f i is the forward computation function of the i-th layer (such as self-attention, feedforward network, etc.). In LoRA, the revised forward computation formula is:

[0056] h i ′=f i (x i )+A i B i f i (x i )=f i (x i )+Δ i ;

[0057] where Δ i =A i B i f i (x i ) represents the correction term introduced by LoRA, which can be regarded as adding a low-rank perturbation to the original layer output f i (x i ).

[0058] The optimization objective of LoRA is to minimize the loss function of the revised model on the new task:

[0059]

[0060] where θ represents the fixed parameters of the original model, represents all the projection matrices introduced by LoRA, is the training data set of the new task, is the task-related loss function (such as cross-entropy loss). In the optimization process, we only update while keeping θ unchanged, therefore, the training overhead of LoRA is much smaller than that of traditional full-parameter fine-tuning, and since the rank r of the projection matrix is much smaller than the dimension d of the original model, the amount of additional parameters introduced by LoRA is also much smaller than the original model. By screening and refining the specific generated task knowledge, the key knowledge types and elements required for research question generation are analyzed, and two types of sentences, research purpose sentences and research method sentences, are extracted from scientific literature. Then, the extracted fine-grained knowledge is used to construct a prompt for generating research questions. The research question prompt that integrates fine-grained knowledge is artificially constructed to fine-tune the large language model, providing more accurate and targeted input for the research question generation model, and improving the quality and accuracy of the generated results.

[0061] The foregoing DETAILED DESCRIPTION, including the above section titled "Detailed Description," is not to be taken as limiting the scope of the application. Various modifications, combinations, and equivalents can be apparent to those skilled in the art and can be made once the nature of the application is understood. Any modification, combination, or equivalent, which falls within the principles and the scope of the present application, is intended to be included in the present application. In some instances, the actions or steps can be performed in different order from those described herein, and still achieve desirable results. Additionally, the process depicted in the figures can not necessarily require the particular order shown or sequential order to achieve the desired results. In certain implementations, multitasking and parallel processing can be advantageous.

Claims

1. A fine-grained knowledge generation agent method for embedding metadata prompt words, characterized in that: The method includes: Analyze the elements that generate research questions to determine the knowledge elements that generate research questions, including research purpose statements and research method statements; Data annotation and syntactic structure analysis were performed on the research objective sentences and research method sentences to construct a knowledge element training dataset; The DeBERta model is trained and fine-tuned based on the knowledge element training dataset, and the fine-tuned DeBERta model is used to extract research purpose sentences and research method sentences to obtain a fine-grained knowledge dataset. Based on the fine-grained knowledge dataset, construct an embedded metadata prompt word project; Based on the embedded metadata prompt word project, a research question fine-tuning dataset is obtained, which consists of a task description part, an input part, and an output part; The LoRA fine-tuning technique is used to fine-tune the dataset based on the research question, and the large language model is fine-tuned and optimized. The research question is then generated based on the optimized large language model. The construction of the knowledge element training dataset includes: Collect and acquire scientific and technological literature datasets; The scientific literature dataset was annotated using manual annotation and iterative semi-automatic annotation methods to construct a dataset of research objective sentences and a dataset of research method sentences. Syntactic structure analysis was performed on the research objective sentence dataset and the research method sentence dataset to extract the target sentence feature word set and the method sentence feature word set; Feature sentence pattern analysis was performed on the research objective sentence dataset and the research method sentence dataset to obtain the target sentence feature sentence pattern set and the method sentence feature sentence set; Based on the target sentence feature word set and method sentence feature word set, as well as the target sentence feature sentence pattern set and method sentence feature sentence pattern set, the knowledge element training dataset is constructed.

2. The fine-grained knowledge generation agent method for embedding metadata prompt words as described in claim 1, characterized in that, The construction of the research objective sentence dataset and the research method sentence dataset includes: A predetermined proportion of the scientific literature dataset is annotated using manual annotation methods to obtain a manually annotated dataset. The manually labeled dataset is trained using an iterative semi-automatic annotation method to obtain a basic annotation model; Based on the aforementioned basic annotation model, iterative annotation training is performed to obtain an automatic annotation model; The automatic annotation model is used to annotate the scientific literature dataset to construct the research objective sentence dataset and the research method sentence dataset.

3. The fine-grained knowledge generation agent method for embedding metadata prompt words as described in claim 1, characterized in that, The LoRA fine-tuning technique, based on the dataset used in the research question, is employed to fine-tune and optimize the large language model, including: Choose to acquire a pre-trained large language model and set fine-tuned hyperparameters; Define a LoRA module, wherein the LoRA module is composed of a first low-rank projection matrix A. i Second low-rank projection matrix B i Composition, where i is the i-th layer of the large language model; Introducing the first low-rank projection matrix A i Second low-rank projection matrix B i The large language model is trained, fine-tuned, and optimized based on the dataset and the fine-tuning hyperparameters used to address the research question.

4. The fine-grained knowledge generation agent method for embedding metadata prompt words as described in claim 3, characterized in that, The method includes: The first low-rank projection matrix A is introduced at each level i of the large language model. i Second low-rank projection matrix B i ; Based on the fine-tuned dataset and the fine-tuned hyperparameters, the large language model is trained by forward propagation to obtain the original forward computation result h of the i-th layer of the large language model. i =f i (x i ), where x i f is the input of the i-th layer. i Let i be the forward computation function of the i-th layer; Based on the first low-rank projection matrix A i Second low-rank projection matrix B i The original forward calculation result is corrected to obtain the forward corrected calculation result; Construct a model loss function with the optimization objective of minimizing the model loss function; The large language model is fine-tuned and optimized based on the forward correction calculation results according to the optimization objective.

5. The fine-grained knowledge generation agent method for embedding metadata prompt words as described in claim 4, characterized in that, Obtaining the forward correction calculation result includes: According to the first low-rank projection matrix A i Second low-rank projection matrix B i Construct the forward correction calculation formula: h i ′=f i (x i )+A i B i f i (x i )=f i (x i )+Δ i , where Δ i =A i B i f i (x i ) indicates a correction introduced by the LoRA module; The original forward calculation result is corrected based on the forward correction calculation formula to obtain the forward correction calculation result.

6. The fine-grained knowledge generation agent method for embedding metadata prompt words as described in claim 5, characterized in that, The model loss function is specifically as follows: Where θ represents the fixed parameters of the original model, This represents all projection matrices introduced by the LoRA module. For the training dataset of the new task, This is the task-related loss function.

7. The fine-grained knowledge generation agent method for embedding metadata prompt words as described in claim 3, characterized in that, The method includes: According to the first low-rank projection matrix A i and the second low-rank projection matrix B i Determine the first matrix dimension (d, r) and the second matrix dimension (r, d), where d is the hidden layer dimension of the model, r is the projection dimension, and r < d / r. <d。

Citation Information

Patent Citations

  • Domain review generation method and system based on large language model

    CN118152557A

  • Heuristic knowledge navigation recommendation method fusing user retrieval intention

    CN118939787A