A method for generating a topic based on a self-evaluation model
Patent Information
- Application Number
- CN202611044313.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-14
- Publication Date
- 2026-10-13
AI Technical Summary
[0005]针对传统人工生成专题方式效率过低,规则和传统自然语言处理nlp技术准确性不足,利用大模型生成技术容易产生幻觉等问题,本发明提供一种基于自评价模型的专题生成方法,可有效解决上述问题,满足科技领域专题生成的高效、准确、可信要求
[0054]本发明提供一种基于自评价模型的专题生成方法,使用自评价生成大模型进行知识边界判断,使用科技知识库和联网搜索服务作为外部知识补充,综合利用大模型自评价检索增强技术生成专题数据,有效的解决了大模型的知识时效性、科技领域知识稀疏性和幻觉问题,增强了最终专题结果的准确度和可信度。
Smart Images

Figure CN122903614A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of natural language processing technology, and more specifically to a topic generation method based on a self-evaluation model. Background Technology
[0002] As science and technology management work continues to deepen, the need to be familiar with the layout of science and technology resources is becoming increasingly strong, and the importance of keeping up with the dynamics of science and technology development is becoming increasingly prominent. Science and technology-related data are characterized by their large quantity, rich sources, and rapid growth rate. Therefore, classifying and statistically analyzing science and technology data by topic has become an important means of science and technology information management.
[0003] Specifically, a topic is a collection of content gathered and organized around a specific theme or topic. Classifying documents in the field of science and technology by specific topics helps users understand the current situation in the field of science and technology, keep up with the dynamics of scientific and technological development, and strengthen the management of scientific and technological information.
[0004] With the development of artificial intelligence technology, the application of large model technology in text generation and information management has gradually become a hot topic. However, due to the time-sensitivity of knowledge within large models and the knowledge sparsity in the field of science and technology, they are prone to illusions when faced with complex tasks, resulting in a lack of credibility in thematic data generated using large models. Summary of the Invention
[0005] To address the problems of low efficiency in traditional manual topic generation methods, insufficient accuracy of rules and traditional natural language processing (NLP) techniques, and the potential for illusions when using large model generation techniques, this invention provides a topic generation method based on a self-evaluation model. This method effectively solves the above problems and meets the requirements of high efficiency, accuracy, and reliability in topic generation in the scientific and technological field.
[0006] The technical solution adopted in this invention is as follows:
[0007] This invention provides a topic generation method based on a self-evaluation model, the method comprising:
[0008] Step S1: Construct a topic library and a topic document library; the topic library stores the correct topic name generated based on a general large model for each collected scientific and technological text; the topic document library stores each scientific and technological text and its corresponding correct topic name;
[0009] Step S2: Set up a self-evaluation native large model; based on the topic library and the topic document library, construct a training sample set for each training sample, which includes scientific and technological text, a set of candidate topic names, and the correct topic name; the self-evaluation native large model is trained on the training sample set to generate a self-evaluation generation large model;
[0010] The self-evaluation generation model receives a complete self-evaluation task instruction consisting of the scientific text and the candidate topic name set. It then uses its internal knowledge to self-evaluate the scientific text and outputs a self-evaluation result in a specified format. This specified format self-evaluation result embeds a rich semantic retrieval token that dynamically assesses and displays the factual and reliability aspects of the self-evaluation generation process. This rich semantic retrieval token identifies whether additional retrieval is required to complete the task, including a Direct token and a Search token. The Direct token indicates that no additional retrieval is needed to complete the task; the Search token indicates that additional retrieval is required to complete the task.
[0011] Step S3: Construct a science and technology knowledge base; the science and technology knowledge base includes a science and technology knowledge text database and a science and technology knowledge vector database;
[0012] Step S4: Using the self-evaluation native large model as the training base; during the training process of the self-evaluation generation large model, the scientific and technological text corresponding to the Search tag is obtained, and a hybrid search is performed in the scientific and technological knowledge base. The scientific and technological text recalled by the hybrid search is used as the reference scientific and technological text, and combined with the scientific and technological text with the Search tag, the corresponding candidate topic name set, and the correct topic name to form a search enhancement sample, thereby constructing a search enhancement sample set; the self-evaluation native large model is trained on the search enhancement sample set to generate a search generation large model; the search generation large model and the self-evaluation generation large model have the same knowledge boundary. When the self-evaluation generation large model outputs the self-evaluation result in the specified format of the Search tag, it outputs the correct topic name of the scientific and technological text based on the scientific and technological knowledge base and the online search service.
[0013] Furthermore, step S1 includes:
[0014] Raw science and technology-related data are collected from open-source data sources across the internet; the raw science and technology-related data is then parsed, cleaned, filtered, and deduplicated to obtain the science and technology text.
[0015] The general large model is used to generate at least one topic name for each of the scientific and technological texts. After manual review by professionals and deduplication and merging of similar topic names, at least one correct topic name for each of the scientific and technological texts is determined.
[0016] Import the correct topic name into the topic library; import the scientific and technological text and its corresponding correct topic name into the topic document library.
[0017] Furthermore, the thematic library adopts a thematic vector library; the thematic document library adopts a thematic document vector library;
[0018] The correct topic name is embedded into a vector to obtain a correct topic name vector, which is then imported into the topic vector library; the scientific and technological text is embedded into a vector to obtain a scientific and technological text vector, which is then imported into the topic document vector library together with the corresponding correct topic name as a scalar.
[0019] Furthermore, the self-evaluation native large model is trained using the training sample set to generate a self-evaluation generation large model. The training process is as follows:
[0020] Step S21: Define training sample categories, including training samples that do not require retrieval and training samples that require retrieval; the training samples that do not require retrieval refer to samples that the trained model can complete the evaluation task through its own internal knowledge, that is, samples that can stably generate correct topic names; the training samples that require retrieval refer to samples that the trained model cannot complete the evaluation task by relying on its own internal knowledge, that is, samples that cannot stably generate correct topic names.
[0021] Step S22: Define the model input format and model output format of the self-evaluation generated large model;
[0022] The model input format includes evaluation instructions, scientific and technological texts, and a set of candidate topic names;
[0023] The model output format embeds special control tags with clear semantic meanings, namely semantically rich retrieval tokens, including Direct tags and Search tags;
[0024] For the input training sample, if the self-evaluation generation model identifies it as a training sample that does not require retrieval, the model output format includes the Direct tag and the generated correct topic name; if it identifies it as a training sample that requires retrieval, the model output format includes the Search tag.
[0025] Step S23: Using a semantic similarity matching algorithm, at least one similar scientific and technological text is obtained for each of the scientific and technological texts in the topic document library. Then, the correct topic name of the similar scientific and technological text is used as the candidate topic name of the scientific and technological text, thereby constructing a training sample set containing scientific and technological texts, a set of candidate topic names, and a correct topic name.
[0026] Step S24: Input each training sample into the self-evaluation native large model, and train the self-evaluation native large model using the multiple generation consistency verification algorithm to obtain the self-evaluation generation large model, while determining the training sample category of each training sample.
[0027] Step S25: Using training samples with the categories of the training samples, fine-tune the evaluation instructions of the self-evaluation generation model to enhance the model's ability to follow evaluation instructions and align with the intention of evaluation instructions, so as to obtain the self-evaluation generation model after instruction fine-tuning.
[0028] Step S26: Perform reinforcement learning training on the self-evaluation generation model after fine-tuning the instructions, and introduce a reward function that includes format reward, accuracy reward and generation similarity reward to obtain the finally trained self-evaluation generation model.
[0029] Furthermore, step S24 includes:
[0030] Each training sample is input into the self-evaluation native large model, which then performs N inferences. Each inference generates a topic name corresponding to the scientific text, resulting in N topic names. The N topic names are compared with the correct topic names in the training samples. If all N topic names are similar to the correct topic names, the consistency verification is passed, and the training sample is marked as a training sample that does not need to be retrieved. Otherwise, it is marked as a training sample that needs to be retrieved.
[0031] Furthermore, step S25 includes: randomly selecting two types of training samples with training sample categories, using cross-entropy loss as the loss function, wherein the loss function uses the difference between the predicted probability of the training sample category and the distribution of the true training sample category as the loss, and the loss is calculated only for training samples that output valid semantically rich retrieval tokens.
[0032] Furthermore, step S26 includes:
[0033] Step S261, Format Reward This is used to encourage models to generate a specified output format that conforms to the semantically rich retrieval token, and to generate a topic name after the output Direct tag;
[0034] ;
[0035] in: This indicates a rich semantic search token reward item when the output begins with a Direct or Search flag. Select 1 if the value is 1, otherwise select 0. This indicates the reward for the correct answer format. The reward applies when the output is marked with the "Direct" tag and includes the topic name, or when the output only has the "Search" tag and does not include the topic name. Select 1 if the value is 1, otherwise select 0.
[0036] Step S262, Accuracy Bonus The evaluation model's ability to determine knowledge boundaries, i.e., the accuracy of the generated rich semantic retrieval tokens, is as follows:
[0037] ;
[0038] in: This represents the semantically rich retrieval token output by the model. This indicates the true class of the training samples. For training samples requiring retrieval, the model output is labeled "Search," and for samples not requiring retrieval, the model output is labeled "Direct," indicating that the model's judgment is correct. Select 1 if the value is 1, otherwise select 0.
[0039] Step S263: Generate similarity reward To evaluate the correctness of the topic names generated by the model, a cosine similarity algorithm is used to calculate the similarity score between the generated topic names and the correct topic names, and a similarity reward is awarded. The calculation formula is:
[0040] ;
[0041] in: A vector representation of the topic names generated by the model; A vector representation of the correct topic name; Represents a scalar; This represents the semantically rich retrieval token output by the model. This indicates a search token with the correct topic name. Indicates the Search tag, This indicates the Direct tag; when the model outputs a semantically rich retrieval token that is the Search tag and is correct. Set the value to 1, otherwise set it to 0; when the model outputs a semantically rich retrieval token that is correctly labeled as "Direct". Select 1 if the value is 1, otherwise select 0.
[0042] Step S264, the total reward function is:
[0043] ;
[0044] in: This is the total reward function.
[0045] Furthermore, the method for training the self-evaluation generation large model using reinforcement learning is as follows:
[0046] Generate candidate evaluation results: Use the reference model to generate multiple candidate evaluation results, including rich semantic search tokens and topic results; where, if the rich semantic search token is marked as Search, the topic results are empty; if it is marked as Direct, the topic results are the topic names;
[0047] Relative reward calculation: Using grouped policy outputs, the model optimization is comprehensively guided. Specifically, from multiple candidate evaluation results generated by the reference model based on the old policy, a group of candidate evaluation results is sampled, and the relative reward of the candidate evaluation results within the group is used as the final reward to update the model for optimization.
[0048] Policy gradient optimization: The model parameters are optimized by policy gradient, so that the model is more inclined to output higher advantages.
[0049] Furthermore, the construction method of the aforementioned scientific and technological knowledge base is as follows:
[0050] The scientific and technological text is obtained by parsing, cleaning, filtering, and deduplicating raw data from various sources. The scientific and technological text is then imported into a scientific and technological knowledge text library. Finally, the scientific and technological text is vectorized using embedding and imported into a scientific and technological knowledge vector library.
[0051] Furthermore, the hybrid retrieval performed in the scientific and technological knowledge base, and the scientific and technological texts retrieved by the hybrid retrieval as reference scientific and technological texts, specifically includes:
[0052] For the scientific and technological text, a hybrid retrieval is performed in the scientific and technological knowledge base, that is, keyword retrieval is performed in the scientific and technological knowledge text base, semantic retrieval is performed in the scientific and technological knowledge vector base, and then the Reranker model is used to sort the two retrieval results to obtain the hybrid retrieval result, which serves as the reference scientific and technological text.
[0053] The topic generation method based on a self-evaluation model provided by this invention has the following advantages:
[0054] This invention provides a topic generation method based on a self-evaluation model. It uses a large self-evaluation model to determine knowledge boundaries, and uses scientific and technological knowledge bases and online search services as external knowledge supplements. It comprehensively utilizes the self-evaluation retrieval enhancement technology of the large model to generate topic data, effectively solving the problems of knowledge timeliness, sparsity of knowledge in the scientific and technological field, and illusion, and enhancing the accuracy and credibility of the final topic results. Attached Figure Description
[0055] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0056] Figure 1 The flowchart illustrates a topic generation method based on a self-evaluation model provided by this invention. Detailed Implementation
[0057] To make the technical problems solved, the technical solutions, and the beneficial effects of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and are not intended to limit the invention.
[0058] This invention provides a topic generation method based on a self-evaluation model. It uses a large self-evaluation model to determine knowledge boundaries, and uses scientific and technological knowledge bases and online search services as external knowledge supplements. It comprehensively utilizes the self-evaluation retrieval enhancement technology of the large model to generate topic data, effectively solving the problems of knowledge timeliness, sparsity of knowledge in the scientific and technological field, and illusion, and enhancing the accuracy and credibility of the final topic results.
[0059] Specifically, this invention utilizes knowledge base enhancement technology and large-scale model generation technology to automatically generate thematic data for documents. A semantic similarity algorithm is employed to obtain candidate similar topics. Then, a self-evaluation-based large-scale model is used to evaluate and independently generate thematic data based on knowledge boundaries. After self-evaluation, a scientific knowledge base and online search services are used to retrieve documents. By referencing candidate topics and supplementing the knowledge in the retrieved documents, the large-scale model generates appropriate thematic results based on the scientific text.
[0060] See Figure 1 This invention provides a topic generation method based on a self-evaluation model, the method comprising steps S1 to S4:
[0061] Step S1: Construct a topic library and a topic document library; the topic library stores the correct topic name generated based on a general large model for each collected scientific and technological text; the topic document library stores each scientific and technological text and its corresponding correct topic name;
[0062] Raw science and technology-related data are collected from open-source data sources across the internet; the raw science and technology-related data is then parsed, cleaned, filtered, and deduplicated to obtain the science and technology text.
[0063] The general large model is used to generate at least one topic name for each of the scientific and technological texts. After manual review by professionals and deduplication and merging of similar topic names, at least one correct topic name for each of the scientific and technological texts is determined.
[0064] Import the correct topic name into the topic library; import the scientific and technological text and its corresponding correct topic name into the topic document library.
[0065] In one implementation, the topic library adopts a topic vector library; the topic document library adopts a topic document vector library; the correct topic name is embedded and vectorized to obtain a correct topic name vector, which is then imported into the topic vector library; the scientific and technological text is embedded and vectorized to obtain a scientific and technological text vector, which is then imported into the topic document vector library together with the corresponding correct topic name as a scalar.
[0066] Step S2: Set up a self-evaluation native large model; based on the topic library and the topic document library, construct a training sample set for each training sample, which includes scientific and technological text, a set of candidate topic names, and the correct topic name; the self-evaluation native large model is trained on the training sample set to generate a self-evaluation generation large model;
[0067] The self-evaluation generation model receives a complete self-evaluation task instruction consisting of the scientific text and the candidate topic name set. It then uses its internal knowledge to self-evaluate the scientific text and outputs a self-evaluation result in a specified format. This specified format self-evaluation result embeds a rich semantic retrieval token that dynamically assesses and displays the factual and reliability aspects of the self-evaluation generation process. This rich semantic retrieval token identifies whether additional retrieval is required to complete the task, including a Direct token and a Search token. The Direct token indicates that no additional retrieval is needed to complete the task; the Search token indicates that additional retrieval is required to complete the task.
[0068] As one implementation method, the self-evaluation native large model is trained using the training sample set to generate a self-evaluation generation large model. The training process is as follows:
[0069] Step S21: Define training sample categories, including training samples that do not require retrieval and training samples that require retrieval; the training samples that do not require retrieval refer to samples that the trained model can complete the evaluation task through its own internal knowledge, that is, samples that can stably generate correct topic names; the training samples that require retrieval refer to samples that the trained model cannot complete the evaluation task by relying on its own internal knowledge, that is, samples that cannot stably generate correct topic names.
[0070] Step S22: Define the model input format and model output format of the self-evaluation generated large model;
[0071] The model input format includes evaluation instructions, scientific and technological texts, and a set of candidate topic names;
[0072] The model output format embeds special control tags with clear semantic meanings, namely semantically rich retrieval tokens, including Direct tags and Search tags;
[0073] For the input training sample, if the self-evaluation generation model identifies it as a training sample that does not require retrieval, the model output format includes the Direct tag and the generated correct topic name; if it identifies it as a training sample that requires retrieval, the model output format includes the Search tag.
[0074] Step S23: Using a semantic similarity matching algorithm, at least one similar scientific and technological text is obtained for each of the scientific and technological texts in the topic document library. Then, the correct topic name of the similar scientific and technological text is used as the candidate topic name of the scientific and technological text, thereby constructing a training sample set containing scientific and technological texts, a set of candidate topic names, and a correct topic name.
[0075] Step S24: Input each training sample into the self-evaluation native large model, and train the self-evaluation native large model using the multiple generation consistency verification algorithm to obtain the self-evaluation generation large model, while determining the training sample category of each training sample.
[0076] Specifically, each training sample is input into the self-evaluation native large model, which then performs N inferences repeatedly. Each inference generates a topic name corresponding to the scientific text, resulting in N topic names. The N topic names are compared with the correct topic names in the training samples. If all N topic names are similar to the correct topic names, the consistency verification is passed, and the training sample is marked as a training sample that does not need to be retrieved. Otherwise, it is marked as a training sample that needs to be retrieved.
[0077] Step S25: Using training samples with the categories of the training samples, fine-tune the evaluation instructions of the self-evaluation generation model to enhance the model's ability to follow evaluation instructions and align with the intention of evaluation instructions, so as to obtain the self-evaluation generation model after instruction fine-tuning.
[0078] As one implementation method, two types of training samples with training sample categories are randomly selected, and cross-entropy loss is used as the loss function. The loss function uses the difference between the predicted probability of the training sample category and the distribution of the true training sample category as the loss, and the loss is calculated only for training samples that output valid semantically rich retrieval tokens.
[0079] Step S26: Perform reinforcement learning training on the self-evaluation generation model after fine-tuning the instructions, and introduce a reward function that includes format reward, accuracy reward and generation similarity reward to obtain the finally trained self-evaluation generation model.
[0080] This step can be implemented using the following methods to carry out the reinforcement learning training process:
[0081] Step S261, Format Reward This is used to encourage models to generate a specified output format that conforms to the semantically rich retrieval token, and to generate a topic name after the output Direct tag;
[0082] ;
[0083] in: This indicates a rich semantic search token reward item when the output begins with a Direct or Search flag. Select 1 if the value is 1, otherwise select 0. This indicates the reward for the correct answer format. The reward applies when the output is marked with the "Direct" tag and includes the topic name, or when the output only has the "Search" tag and does not include the topic name. Select 1 if the value is 1, otherwise select 0.
[0084] Step S262, Accuracy Bonus The evaluation model's ability to determine knowledge boundaries, i.e., the accuracy of the generated rich semantic retrieval tokens, is as follows:
[0085] ;
[0086] in: This represents the semantically rich retrieval token output by the model. This indicates the true class of the training samples. For training samples requiring retrieval, the model output is labeled "Search," and for samples not requiring retrieval, the model output is labeled "Direct," indicating that the model's judgment is correct. Select 1 if the value is 1, otherwise select 0.
[0087] Step S263: Generate similarity reward To evaluate the correctness of the topic names generated by the model, a cosine similarity algorithm is used to calculate the similarity score between the generated topic names and the correct topic names, and a similarity reward is awarded. The calculation formula is:
[0088] ;
[0089] in: A vector representation of the topic names generated by the model; A vector representation of the correct topic name; Represents a scalar; This represents the semantically rich retrieval token output by the model. This indicates a search token with the correct topic name. Indicates the Search tag, This indicates the Direct tag; when the model outputs a semantically rich retrieval token that is the Search tag and is correct. Set the value to 1, otherwise set it to 0; when the model outputs a semantically rich retrieval token that is correctly labeled as "Direct". Select 1 if the value is 1, otherwise select 0.
[0090] Step S264, the total reward function is:
[0091] ;
[0092] in: This is the total reward function.
[0093] The method for training the self-evaluation-generated large model using reinforcement learning is as follows:
[0094] Generate candidate evaluation results: Use the reference model to generate multiple candidate evaluation results, including rich semantic search tokens and topic results; where, if the rich semantic search token is marked as Search, the topic results are empty; if it is marked as Direct, the topic results are the topic names;
[0095] Relative reward calculation: Using grouped policy outputs, the model optimization is comprehensively guided. Specifically, from multiple candidate evaluation results generated by the reference model based on the old policy, a group of candidate evaluation results is sampled, and the relative reward of the candidate evaluation results within the group is used as the final reward to update the model for optimization.
[0096] Policy gradient optimization: The model parameters are optimized by policy gradient, so that the model is more inclined to output higher advantages.
[0097] Step S3: Construct a science and technology knowledge base; the science and technology knowledge base includes a science and technology knowledge text database and a science and technology knowledge vector database;
[0098] As one implementation method, the original science and technology related data from various sources are parsed, cleaned, filtered, and deduplicated to obtain the science and technology text; the science and technology text is imported into a science and technology knowledge text library; the science and technology text is embedded into vectors and imported into a science and technology knowledge vector library.
[0099] Step S4: Using the self-evaluation native large model as the training base; during the training process of the self-evaluation generation large model, the scientific and technological text corresponding to the Search tag is obtained, and a hybrid search is performed in the scientific and technological knowledge base. The scientific and technological text recalled by the hybrid search is used as the reference scientific and technological text, and combined with the scientific and technological text with the Search tag, the corresponding candidate topic name set, and the correct topic name to form a search enhancement sample, thereby constructing a search enhancement sample set; wherein, the hybrid search method is as follows: for the scientific and technological text, a hybrid search is performed in the scientific and technological knowledge base, that is, keyword recall is performed in the scientific and technological knowledge text base, semantic search recall is performed in the scientific and technological knowledge vector base, and then the Reranker model is used to sort the two recall results to obtain the hybrid search recall result, which is used as the reference scientific and technological text.
[0100] The self-evaluation native big model is trained on the retrieval enhancement sample set to generate a retrieval generation big model. The retrieval generation big model and the self-evaluation generation big model have the same knowledge boundary. When the self-evaluation generation big model outputs the self-evaluation results in the specified format of the Search tag, it outputs the correct topic name of the scientific and technological text based on the scientific and technological knowledge base and the online search service.
[0101] To facilitate a further understanding of the present invention, an embodiment is described below:
[0102] Step S1: Initialize the topic library.
[0103] The collected scientific and technological texts are annotated using a combination of large-scale models and manual annotation. The topic names are written into the topic database, and the combination of topic names and scientific and technological texts is written into the topic document database.
[0104] Step S1-1: Collect original science and technology-related data such as science and technology news, policy announcements, science and technology guidelines, and patents from various sources of open source data. Science and technology data generally comes from complex sources and is in various formats.
[0105] Step S1-2: The raw data is processed into scientific and technical text through document parsing (PDF, Word, HTML to TXT or JSON), data cleaning and filtering, and data deduplication.
[0106] Step S1-3: Use a general large model to generate a topic name for each scientific and technological text. This topic name is a candidate topic name.
[0107] Step S1-4: Invite professionals to manually review candidate topic names, determine the topic name for each scientific text, and deduplicate and merge similar topic names. The generated topic names should be clear and unambiguous, have certain scientific significance, and have broad topic coverage.
[0108] Step S1-5: Importing Topic Names into the Database. The topic database and topic document database use the Milvus vector library. All topic names, after manual review, are embedded and vectorized, and the topic name vectors are imported into the vector-based topic database. All scientific and technical texts are also embedded and vectorized, and the scientific and technical text vectors and their corresponding topic names (with the topic names as scalars) are imported together into the vector-based scientific and technical document database.
[0109] Step S2: Train self-evaluation to generate a large model.
[0110] Step S2-1: Self-evaluation generates large model training data categories.
[0111] Training data is divided into "data that does not require retrieval" and "data that requires retrieval". "Data that does not require retrieval" refers to data in which the model can complete the task through its own internal knowledge and can stably generate correct thematic results. "Data that requires retrieval" refers to data in which the model cannot complete the task through its internal knowledge and cannot stably produce correct thematic results.
[0112] Step S2-2: Self-evaluation generates large model training data format.
[0113] The self-evaluation generation model dynamically evaluates and explicitly expresses the factuality and reliability of the generation process by embedding special control tokens (rich semantic retrieval tokens, or simply rich semantic tokens) with clear semantic meanings into the output. Therefore, the output of the training data contains explicit rich semantic intrinsic tokens—"[Direct]" and "[Search]". "[Direct]" indicates that the input can complete the task directly without additional retrieval, while "[Search]" indicates that the input requires additional retrieval to complete the task. The specific formats of the two types of training data are as follows:
[0114] The input format is "No data retrieval required". The input is: <evaluation instruction>+\n\n+<scientific and technological text>+\n\n+<candidate topic name>. The output is: [Direct]+\n\n+<topic name>.
[0115] The input format is "Data to be retrieved". The input is: <Evaluation Instruction> +\n\n + <Scientific Text> +\n\n + <Candidate Topic Name>. The output is: [Search].
[0116] Step S2-3: Self-evaluation to generate raw training data for the large model.
[0117] Using the manually reviewed "scientific and technological texts - correct topic names" in S1 as the original data, semantic similarity matching is performed on the scientific and technological texts in the topic document library to obtain a batch of similar scientific and technological texts and their corresponding topic names. After deduplication of topic names, each piece of original data can be expanded into an original triplet of "scientific and technological texts - candidate topic name set - correct topic name".
[0118] Step S2-4: Use the "multiple generation consistent verification" method to generate self-evaluation data for large model training.
[0119] The self-evaluation native large model (Qwen3-32B model can be used) is trained in this step and then the self-evaluation generated large model is obtained. Note that the subsequent retrieval to generate the native large model needs to be the same model as the self-evaluation native large model to ensure that the two models have the same knowledge boundary.
[0120] In the original triplet "Scientific Text-Candidate Topic Name Set-Correct Topic Name", each data entry uses a scientific text and a candidate topic name set to form the input instruction, in the following format:
[0121] <Self-evaluation instruction> +\n\n+<Technical text>
[0122] Based on the self-evaluation native large model, using the above input instructions, the model is "generated multiple times," meaning it responds N times to generate a topic title that fits the input scientific text. Each data point is compared with the correct topic title to determine consistency. The "consistency verification" first checks if the characters are completely identical; if they are, the "consistency" requirement is met; otherwise, semantic similarity is assessed. Semantic similarity is calculated by using an embedding model to generate vectors for both sentences, and then using a cosine similarity algorithm to calculate the semantic similarity between the two vectors. In this step, the total score after N responses for each data point is calculated. for:
[0123] ;
[0124] ;
[0125] Where: a and b are the two strings that need to be checked for consistency; A and B are their corresponding vectors; The value represents a scalar; the strcmp() formula determines whether two strings are equal, returning 1 if they are equal and 0 if they are not equal. Indicates the first The second answer; As an intermediate variable;
[0126] Data that passes the "consistency verification" is considered "data that does not need to be retrieved," otherwise it is considered "data that needs to be retrieved." Organize the two types of data according to the data format set in step S2-2. The topic name in the output of "data that does not need to be retrieved" is the correct topic name in the original triplet. The formats of the two types of data are shown below:
[0127] <Evaluation Instruction> +\n\n + <Scientific Text> +\n\n + <Candidate Topic Name>, [Direct] +\n\n + <Topic Name>
[0128] <Evaluation Instructions> +\n\n+<Scientific Text> +\n\n+<Candidate Topic Name>, [Search]
[0129] Step S2-5: Self-evaluation generates large model instruction fine-tuning training. When generating the large model output through self-evaluation, it's necessary to first output the intrinsic rich semantic token (whether to retrieve the tag token). Therefore, instruction fine-tuning training is performed first to enhance the large model's instruction compliance ability and align with the evaluation instruction intent. This step of instruction fine-tuning training only extracts a portion of the two types of training data prepared in S2-4. During the instruction fine-tuning stage, cross-entropy loss is used as the loss function, and the loss function formula is as follows:
[0130] ;
[0131] Where: B is the training batch size; S is the sequence length; This means that the loss is calculated only for valid tokens (specified by attention_mask), ignoring the padding part; This means that, given the preceding tokens, the model predicts the true token at position t. The probability of this real token being located at position k in the vocabulary (i.e., The specific formula for calculating the conditional probability P is as follows:
[0132] ;
[0133] in, The probability of taking the number k in the word list at the current position (i.e., the i-th sample, the t-th position), that is, the specific calculation method of the conditional probability P(xi,t|xi,1,xi,2,...,xi,t−1) in the previous formula; Vocabulary_size refers to the original prediction score output by the model for the k-th token in the vocabulary at the i-th sample and t-th step; vocab_size refers to the size of the vocabulary. This refers to the original prediction score output by the model for the j-th token in the vocabulary at the i-th sample and the t-th step; the summation formula in the denominator is used to calculate the sum of the exponential scores of all possible words at the t-th step, with the aim of normalizing the prediction probability.
[0134] Step S2-6: Self-evaluation generates a large model reinforcement learning reward function.
[0135] This invention employs reinforcement learning training to further align the self-evaluation generation model following the SFT with instruction requirements and improve generation quality. The policy optimization algorithm of this invention reduces reliance on the value network and leverages group policy advantages to guide model optimization, resulting in more stable and efficient model training.
[0136] First, it is necessary to determine the reward function. This invention introduces three types of reward functions: format reward, accuracy reward, and generation similarity reward.
[0137] Step S2-6-1: Format Reward. The format reward is used to encourage the model to generate a specified output format that conforms to the semantically rich token, and to generate a topic name after the output does not require token retrieval.
[0138] ;
[0139] When the output begins with an evaluation token, i.e., with "[Direct]" or "[Search]", then... =1, otherwise 0;
[0140] When the output is in the format "[Direct]+\n\n+<topic name>" or "[Search]", =1, otherwise 0.
[0141] Step S2-6-2: Accuracy Reward. This focuses on evaluating the model's ability to determine knowledge boundaries, specifically whether the generated semantically rich retrieval token matches the standard answer.
[0142] ;
[0143] The reward is 1 when the retrieval token output by the model matches the standard answer, and 0 otherwise. That is, the reward is 1 when the output for "data to be retrieved" is [Search] and the output for "data not to be retrieved" is [Direct], and 0 otherwise.
[0144] Step S2-6-3: Generate similarity rewards. This step focuses on evaluating the correctness of the topics generated by the model. The cosine similarity algorithm is used to calculate the similarity score between the generated topic name and the correct topic name, as shown in the formula below:
[0145] ;
[0146] in: A vector representation of the topic names generated by the model; A vector representation of the correct topic name; Represents a scalar; This represents the semantically rich retrieval token output by the model. This indicates a search token with the correct topic name. Indicates the Search tag, This indicates the Direct tag; when the model outputs a semantically rich retrieval token that is the Search tag and is correct. Set the value to 1, otherwise set it to 0; when the model outputs a semantically rich retrieval token that is correctly labeled as "Direct". Select 1 if the value is 1, otherwise select 0.
[0147] Step S2-6-4: The final total reward function combines all reward items:
[0148] ;
[0149] In each round of strategy optimization, compared to a single reward signal, multi-dimensional rewards can more comprehensively measure the generation quality, guide the model to follow instructions, and take into account the accuracy of the output content. The three rewards—format reward, accuracy reward, and generation similarity reward—are all between 0 and 1, and the final total reward also falls within the 0-1 range. Higher reward values indicate higher generation quality.
[0150] Step S2-7: Self-evaluation generates a large model for reinforcement learning training. Once the reward function is determined, reinforcement learning can begin.
[0151] Step S2-7-1: Generate candidate evaluation results. First, use the reference model to generate multiple candidate evaluation results (including semantically rich tokens and thematic results). These candidate evaluations are used for subsequent reward calculations.
[0152] Step S2-7-2: Relative reward calculation utilizes grouped policy outputs to comprehensively guide model optimization. This involves sampling multiple candidate outputs from the old policy, then obtaining the relative advantage of candidate outputs within each group to update the model for optimization. During reinforcement training, the group relative reward is used as the final reward to stabilize training. The relative reward formula is:
[0153]
[0154] in: Indicates the number within the group The candidate output of the th... The relative advantage reward of each token is the th candidate output's intra-group normalized relative reward value, indicating that each token reuses this relative reward value; represents the mean reward value of each candidate output within the group; represents the standard deviation of each candidate output within the group; represents the th candidate output's reward in the group, i.e. ;
[0155] Step S2-7-3: Policy gradient optimization. The training optimizes model parameters through policy gradient, making the model more inclined to outputs with higher advantages. The calculation formula for policy update is as follows:
[0156]
[0157] Wherein: θ is the current model parameter to be optimized; is the objective function of the current policy network; G represents the group size; q and o are respectively the question and output in the policy model; i and t are two loop indices for traversing data and time respectively, that is, i represents the i-th sample, t represents the token at the t-th position, and "<t" in the above formula represents all historical tokens before the t position; represents the i-th generated answer, is the total token length of the i-th generated answer; is the current policy network, is the old policy network, represents the probability of predicting a certain token under a certain policy network; is the relative advantage reward of the i-th candidate output mentioned in the previous step; min[] represents taking the minimum value between the "unclipped score" and the "clipped score"; is the clipping hyperparameter; the clip() part indicates that a clipping strategy is used to prevent the new policy from deviating too much from the old policy, so as to ensure training stability and convergence; β is the KL penalty coefficient, refers to measuring the difference in probability distribution between the current policy network and the initial reference policy network , the final KL divergence penalty term calculates the divergence value by approximating the KL divergence, which can dynamically adjust the estimation accuracy according to the difference between the current policy network and the reference policy network, and reduce the estimation error as much as possible while ensuring calculation efficiency.
[0158] Step S3: Construct a scientific and technical knowledge base.
[0159] Step S3-1: Collect related raw data such as scientific papers, reports, patents from self-owned copyrighted accumulated data and various open-source data on the network. Scientific and technical data generally have complex sources and diverse formats.
[0160] Step S3-2: The raw data is processed into scientific and technical text through document parsing (PDF, Word, HTML to TXT or JSON), data cleaning and filtering, and data deduplication.
[0161] Step S3-3: Inputting scientific and technological knowledge into the database. The scientific and technological knowledge database includes a text database and a vector database. During subsequent searches, a hybrid search method is used to retrieve content from both databases.
[0162] This invention uses Elasticsearch as a scientific and technological knowledge text library, importing scientific and technological texts into the library. Simultaneously, the scientific and technological texts are embedded into vectorized vectors using Milvus as a vector library, and these vectors are then imported into the scientific and technological knowledge vector library.
[0163] Step S4: Train the retrieval system to generate a large model.
[0164] Step S4-1: Prepare training data for the large model. This step uses the original triplet "scientific and technological text - candidate topic set - correct topic" corresponding to "data to be retrieved" in S2 as the data foundation. Using the scientific and technological text from the triplet, a hybrid retrieval is performed in the scientific and technological knowledge base. This involves keyword retrieval in the scientific and technological knowledge text base and semantic retrieval in the scientific and technological knowledge vector base. The Reranker model is then used to rank the results of the two retrievals to obtain the hybrid retrieval result.
[0165] The results of the hybrid retrieval recall are used as "reference text" and combined with the original triples to form the training data for the retrieval generation model. The training data format is as follows:
[0166] Input: <Search Enhancement Generation Command> +\n\n + <Scientific Text> +\n\n + <Candidate Topic Name> +\n\n <Reference Text>, Output: <Topic Name>
[0167] Step S5-2: Retrieval and Generation of Large Model Training. Using the original model that was not trained in S2 as the training base for the retrieved and generated large model, fine-tuning is performed to enhance the large model's instruction compliance ability and the model's topic generation ability.
[0168] The instruction fine-tuning process is similar to step S2-5, using cross-entropy loss as the loss function. The loss function formula is as follows:
[0169]
[0170] Where: B is the batch size; S is the sequence length; ( This indicates that the loss is calculated only for valid tokens (specified by attention_mask), ignoring the padding part; ) is the model prediction probability, obtained from logits through softmax.
[0171] Step S5: Preprocess the raw input file.
[0172] In the formal processing workflow, the original scientific and technological document data comes from complex sources and is in various formats. It needs to be preprocessed into text data before proceeding to subsequent processing steps. The preprocessing workflow includes document parsing and text cleaning and filtering. Document parsing mainly refers to converting raw PDF, Word, and HTML documents into text data. In the text cleaning and filtering section, elements such as HTML symbols and outliers are first removed from the text.
[0173] Step S6: Search for candidate topics.
[0174] Based on scientific and technological texts, the embedding model is first used to vectorize the input text into vector form. This vector text is then used for semantic retrieval in a topic database and a topic document database. The semantic retrieval score is calculated using the cosine similarity algorithm. The formula is as follows:
[0175]
[0176] Where A is the input scientific and technological text, and B is the topic name in the topic database or the scientific and technological text in the topic document database. The topic names retrieved in the topic database and the topic names corresponding to the scientific and technological texts retrieved in the topic document database are merged and deduplicated to obtain a set of candidate topic names.
[0177] Step S7: Model self-evaluation based on introspection.
[0178] A large self-evaluation generation model trained on S2 is used to determine whether the model can independently generate correct thematic results. The input scientific text, along with the self-evaluation instructions and a set of candidate thematic names, constitutes the complete input instructions for the self-evaluation task, in the following format:
[0179] Input: <Self-evaluation instruction> +\n\n + <Input scientific text> +\n\n + <Set of candidate topic names>
[0180] Using the self-evaluation generation model trained in S2, input the complete self-evaluation command mentioned above to obtain the self-evaluation output. This output includes a semantically rich retrieval token and a topic result. If the output format is: [Direct]+\n\n+<topic name>, the self-evaluation model can independently generate topic results. In this case, extract the topic name from the output as the topic result and proceed to step S10. If the output is [Search], it indicates that the model cannot independently generate correct topic results, and the process proceeds to step S8 for knowledge enhancement.
[0181] S8 Step: Hybrid Retrieval Knowledge Enhancement.
[0182] The ability to generate large models is enhanced by acquiring additional knowledge through scientific and technological knowledge bases and online searches.
[0183] Step S8-1: Semantic Retrieval Recall. The semantic retrieval recall process is similar to that of step S6. It uses the cosine similarity algorithm to calculate the semantic similarity score. First, it obtains the scientific and technological text in vector form based on the Embedding model, and then uses this scientific and technological text to perform semantic retrieval recall in the scientific and technological knowledge base.
[0184] Step S8-2: Text Retrieval Recall. Text retrieval recall uses the BM25 (Best Matching 25) algorithm to calculate text similarity scores. Based on an improved probabilistic retrieval framework, this algorithm introduces term frequency saturation control and document length normalization mechanisms to more accurately assess the relevance between the query and the document. The relevance scoring formula is as follows:
[0185] ;
[0186] Where: Q refers to the content entered by the user, and D represents a document in the index. This represents the correlation between Q and D; It is the inverse document frequency, which measures the global distinctiveness of terms; Refers to terms In the document The number of times it appears in; It is the document length; It is the average length of the document collection; , An adjustable factor allows for flexible control over the impact of word frequency and document length.
[0187] Step S8-3: Online Retrieval and Recall. Utilize the general online search service APIs provided by internet companies to retrieve relevant content from the internet based on the input technical text. The raw content retrieved from the internet is parsed (partially parsing JSON, XML, etc. formats), cleaned (removing HTML symbols, outliers, etc.), and deduplicated to obtain a text-formatted online recall document.
[0188] Step S8-4: Merge and deduplicate the recall results. Final recalled document set. As shown below:
[0189] ;
[0190] in: It is the semantic recall result, that is, the document set recalled by using scientific and technological text to perform semantic retrieval in a scientific and technological knowledge base; It is based on retrieving a collection of documents from a scientific and technological text knowledge base using text retrieval. It is a collection of documents obtained from web searches using online search services; It is the final collection of recalled documents; This indicates merging the preceding and following document sets and removing duplicate documents; `Sort()` indicates reordering the results within the parentheses using the Reranker model. This formula shows that... The document collection obtained by merging and deduplicating the results retrieved from the scientific knowledge base (milvus), the scientific knowledge text base (elasticsearch), and the web search results serves as the reference document for generating candidate search enhancements.
[0191] Step S9: Generate a large model based on retrieval enhancement.
[0192] The candidate topics obtained in step S6, the reference documents obtained in step S8, the search enhancement instructions, and the input scientific and technological text are combined to form the complete input instructions for the model. The input format is as follows:
[0193] <Search Enhancement Generation Command> +\n\n+<Input Scientific Text> +\n\n+<Candidate Topic Name Set> +\n\n+<Reference Documents>
[0194] The retrieval generation model is trained based on the S4 steps. Input the complete input instructions mentioned above to obtain the thematic results output by the model.
[0195] Step S10: Generate results, remove duplicates, and store them in the database.
[0196] The topic results obtained in step S7 or S9 are the topic results to be entered into the database. After deduplicating the topic results with the topic names in the topic database, the final topic results can be obtained and entered into the database.
[0197] Step S10-1: Topic Deduplication. First, use the topic name to be added to the database to perform a vector search in the topic database. Determine if there is a topic name in the retrieved topic names that is completely identical to the topic name to be added (completely identical characters). If so, the topic name to be added is the old topic name, and only the scientific and technical documents and the corresponding topic name are imported into the topic document database as scalars.
[0198] If no identical topic name exists, the DeepSeek large model is used to determine if a substitute exists among the recalled topic names. The substitute topic name must describe the same scientific and technological field as the topic name to be added, and the scope of topics and events described by the topic name to be added must be a subset of the substitute topic name. If a substitute topic name exists, the scientific and technological document and the substitute topic name are imported into the topic document library as scalars. If no substitute topic name exists, the scientific and technological document and the topic name to be added are imported into the topic document library as scalars, and the topic name to be added is also imported into the topic library.
[0199] This invention utilizes large language model generation technology to achieve rapid and automatic generation of topics, changing the traditional manual method and improving efficiency. By leveraging the knowledge boundary discrimination capability of the self-evaluating large model, this invention effectively reduces the illusion of a large model and increases the credibility of the topic results. By utilizing candidate topic knowledge provided by a topic knowledge base, supplementary scientific and technological knowledge provided by a scientific and technological knowledge base, and network knowledge provided by external network services, the knowledge boundary of the large model is expanded, improving the accuracy and reliability of the generated topic results. This invention plays a crucial role in scientific and technological information management and analysis.
[0200] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A topic generation method based on a self-evaluation model, characterized in that, The method includes: Step S1: Construct a topic library and a topic document library; the topic library stores the correct topic name generated based on a general large model for each collected scientific and technological text; the topic document library stores each scientific and technological text and its corresponding correct topic name; Step S2: Set up a self-evaluation native large model; based on the topic library and the topic document library, construct a training sample set for each training sample, which includes scientific and technological text, a set of candidate topic names, and the correct topic name; the self-evaluation native large model is trained on the training sample set to generate a self-evaluation generation large model; The self-evaluation generation model receives a complete self-evaluation task instruction consisting of the scientific text and the candidate topic name set. It then uses its internal knowledge to self-evaluate the scientific text and outputs a self-evaluation result in a specified format. This specified format self-evaluation result embeds a rich semantic retrieval token that dynamically assesses and displays the factual and reliability aspects of the self-evaluation generation process. This rich semantic retrieval token identifies whether additional retrieval is required to complete the task, including a Direct token and a Search token. The Direct token indicates that no additional retrieval is needed to complete the task; the Search token indicates that additional retrieval is required to complete the task. Step S3: Construct a science and technology knowledge base; the science and technology knowledge base includes a science and technology knowledge text database and a science and technology knowledge vector database; Step S4: Using the self-evaluation native large model as the training base; during the training process of the self-evaluation generation large model, the scientific and technological text corresponding to the Search tag is obtained, and a hybrid search is performed in the scientific and technological knowledge base. The scientific and technological text recalled by the hybrid search is used as the reference scientific and technological text, and combined with the scientific and technological text with the Search tag, the corresponding candidate topic name set, and the correct topic name to form a search enhancement sample, thereby constructing a search enhancement sample set; the self-evaluation native large model is trained on the search enhancement sample set to generate a search generation large model; the search generation large model and the self-evaluation generation large model have the same knowledge boundary. When the self-evaluation generation large model outputs the self-evaluation result in the specified format of the Search tag, it outputs the correct topic name of the scientific and technological text based on the scientific and technological knowledge base and the online search service.
2. The topic generation method based on a self-evaluation model according to claim 1, characterized in that, Step S1 includes: Raw science and technology-related data are collected from open-source data sources across the internet; the raw science and technology-related data is then parsed, cleaned, filtered, and deduplicated to obtain the science and technology text. The general large model is used to generate at least one topic name for each of the scientific and technological texts. After manual review by professionals and deduplication and merging of similar topic names, at least one correct topic name for each of the scientific and technological texts is determined. Import the correct topic name into the topic library; import the scientific and technological text and its corresponding correct topic name into the topic document library.
3. The topic generation method based on a self-evaluation model according to claim 2, characterized in that, The thematic library uses a thematic vector library; the thematic document library uses a thematic document vector library. The correct topic name is embedded into a vector to obtain a correct topic name vector, which is then imported into the topic vector library; the scientific and technological text is embedded into a vector to obtain a scientific and technological text vector, which is then imported into the topic document vector library together with the corresponding correct topic name as a scalar.
4. The topic generation method based on a self-evaluation model according to claim 1, characterized in that, The self-evaluation native large model is trained on the training sample set to generate a self-evaluation generation large model. The training process is as follows: Step S21: Define training sample categories, including training samples that do not require retrieval and training samples that require retrieval; the training samples that do not require retrieval refer to samples that the trained model can complete the evaluation task through its own internal knowledge, that is, samples that can stably generate correct topic names; the training samples that require retrieval refer to samples that the trained model cannot complete the evaluation task by relying on its own internal knowledge, that is, samples that cannot stably generate correct topic names. Step S22: Define the model input format and model output format of the self-evaluation generated large model; The model input format includes evaluation instructions, scientific and technological texts, and a set of candidate topic names; The model output format embeds special control tags with clear semantic meanings, namely semantically rich retrieval tokens, including Direct tags and Search tags; For the input training sample, if the self-evaluation generation model identifies it as a training sample that does not require retrieval, the model output format includes the Direct tag and the generated correct topic name; if it identifies it as a training sample that requires retrieval, the model output format includes the Search tag. Step S23: Using a semantic similarity matching algorithm, at least one similar scientific and technological text is obtained for each of the scientific and technological texts in the topic document library. Then, the correct topic name of the similar scientific and technological text is used as the candidate topic name of the scientific and technological text, thereby constructing a training sample set containing scientific and technological texts, a set of candidate topic names, and a correct topic name. Step S24: Input each training sample into the self-evaluation native large model, and train the self-evaluation native large model using the multiple generation consistency verification algorithm to obtain the self-evaluation generation large model, while determining the training sample category of each training sample. Step S25: Using training samples with the categories of the training samples, fine-tune the evaluation instructions of the self-evaluation generation model to enhance the model's ability to follow evaluation instructions and align with the intention of evaluation instructions, so as to obtain the self-evaluation generation model after instruction fine-tuning. Step S26: Perform reinforcement learning training on the self-evaluation generation model after fine-tuning the instructions, and introduce a reward function that includes format reward, accuracy reward and generation similarity reward to obtain the finally trained self-evaluation generation model.
5. The topic generation method based on a self-evaluation model according to claim 4, characterized in that, Step S24 includes: Each training sample is input into the self-evaluation native large model, which then performs N inferences. Each inference generates a topic name corresponding to the scientific text, resulting in N topic names. The N topic names are compared with the correct topic names in the training samples. If all N topic names are similar to the correct topic names, the consistency verification is passed, and the training sample is marked as a training sample that does not need to be retrieved. Otherwise, it is marked as a training sample that needs to be retrieved.
6. The topic generation method based on a self-evaluation model according to claim 4, characterized in that, Step S25 includes: randomly selecting two types of training samples with training sample categories, using cross-entropy loss as the loss function, where the difference between the predicted probability of the training sample category and the distribution of the true training sample category is used as the loss, and the loss is calculated only for training samples that output valid semantically rich retrieval tokens.
7. The topic generation method based on a self-evaluation model according to claim 4, characterized in that, Step S26 includes: Step S261, Format Reward This is used to encourage models to generate a specified output format that conforms to the semantically rich retrieval token, and to generate a topic name after the output Direct tag; ; in: This indicates a rich semantic search token reward item when the output begins with a Direct or Search tag. Select 1 if the value is 1, otherwise select 0. This indicates the reward for the correct answer format. The reward applies when the output is marked with the "Direct" tag and includes the topic name, or when the output only has the "Search" tag and does not include the topic name. Select 1 if the value is 1, otherwise select 0. Step S262, Accuracy Bonus The evaluation model's ability to determine knowledge boundaries, i.e., the accuracy of the generated rich semantic retrieval tokens, is as follows: ; in: This represents the semantically rich retrieval token output by the model. This indicates the true class of the training samples. For training samples that need to be retrieved, the model output is marked with a "Search" label; for training samples that do not need to be retrieved, the model output is marked with a "Direct" label, indicating that the model's judgment is correct. Select 1 if the value is 1, otherwise select 0. Step S263: Generate similarity reward To evaluate the correctness of the topic names generated by the model, a cosine similarity algorithm is used to calculate the similarity score between the generated topic names and the correct topic names, and a similarity reward is awarded. The calculation formula is: ; in: A vector representation of the topic names generated by the model; A vector representation of the correct topic name; Represents a scalar; This represents the semantically rich retrieval token output by the model. This indicates a search token with the correct topic name. Indicates the Search tag, This indicates the Direct tag; when the model outputs a semantically rich retrieval token that is the Search tag and is correct. Set the value to 1, otherwise set it to 0; when the model outputs a semantically rich retrieval token that is correctly labeled as "Direct". Select 1 if the value is 1, otherwise select 0. Step S264, the total reward function is: ; in: This is the total reward function.
8. The topic generation method based on a self-evaluation model according to claim 7, characterized in that, The method for training the self-evaluation-generated large model using reinforcement learning is as follows: Generate candidate evaluation results: Use the reference model to generate multiple candidate evaluation results, including rich semantic search tokens and topic results; where, if the rich semantic search token is marked as Search, the topic results are empty; if it is marked as Direct, the topic results are the topic names; Relative reward calculation: Using grouped policy outputs, the model optimization is comprehensively guided. Specifically, from multiple candidate evaluation results generated by the reference model based on the old policy, a group of candidate evaluation results is sampled, and the relative reward of the candidate evaluation results within the group is used as the final reward to update the model for optimization. Policy gradient optimization: The model parameters are optimized by policy gradient, so that the model is more inclined to output higher advantages.
9. The topic generation method based on a self-evaluation model according to claim 1, characterized in that, The scientific and technological knowledge base is constructed in the following way: The scientific and technological text is obtained by parsing, cleaning, filtering, and deduplicating raw data from various sources. The scientific and technological text is then imported into a scientific and technological knowledge text library. Finally, the scientific and technological text is vectorized using embedding and imported into a scientific and technological knowledge vector library.
10. The topic generation method based on a self-evaluation model according to claim 1, characterized in that, The process of performing a hybrid search in the scientific and technological knowledge base, and using the scientific and technological texts retrieved through the hybrid search as reference scientific and technological texts, specifically involves: For the scientific and technological text, a hybrid retrieval is performed in the scientific and technological knowledge base, that is, keyword retrieval is performed in the scientific and technological knowledge text base, semantic retrieval is performed in the scientific and technological knowledge vector base, and then the Reranker model is used to sort the two retrieval results to obtain the hybrid retrieval result, which serves as the reference scientific and technological text.