Intelligent knowledge question-answering method, device and equipment and storage medium
By introducing a combination of user intent recognition and sparse autoencoder-MLP classifier into the retrieval enhancement generation system, the problems of accuracy and fine granularity in hallucination detection in existing systems are solved, improving the accuracy and reliability of knowledge question answering, and effectively reducing the risk of hallucination, especially in complex logic problems.
Patent Information
- Application Number
- CN202511707271.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-20
- Publication Date
- 2026-02-17
- Estimated Expiration
- 2045-11-20
AI Technical Summary
Existing retrieval enhancement generation systems still suffer from illusion problems when dealing with complex logic and multi-hop reasoning. They struggle to achieve fine-grained illusion localization of specific sentences or phrases in the answers. Furthermore, existing illusion detection methods are computationally expensive, have limited accuracy, and are unable to identify user intent and have insufficient generalization ability.
By using a user intent recognition model to distinguish between objective queries and subjective analysis intent, and by using a sparse autoencoder and an MLP classifier to perform dimensionality enhancement processing and hallucination probability prediction on the intermediate hidden states of a large language model, we can achieve sentence-level hallucination detection and labeling.
It improves the accuracy and reliability of knowledge-based question answering, reduces the risks associated with large language model illusions, achieves fine-grained illusion recognition and transparency for complex logical problems, and enhances the practicality of the RAG system and the credibility of the generated content.
Smart Images

Figure CN121543724A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of natural language processing technology, and in particular to an intelligent knowledge question answering method, apparatus, device and storage medium. Background Technology
[0002] With the rapid development of artificial intelligence and natural language processing (NLP) technologies, large language models (LLMs) have demonstrated powerful text generation and comprehension capabilities. However, LLMs suffer from the illusion problem (i.e., generating content that is inconsistent with facts or logically incoherent), which hinders their widespread application. Currently, retrieval-augmented generation (RAG) systems, by combining the retrieval capabilities of external knowledge bases with the generation capabilities of LLMs, can provide external factual evidence for LLMs, thereby alleviating the illusion problem to some extent and improving the accuracy and reliability of the generated content.
[0003] However, even with the assistance of RAG systems, the illusion problem in LLM remains unresolved, especially when dealing with complex logic, multi-hop reasoning, or queries requiring precise fact-checking, where the model may still generate subtle illusions. To address this illusion problem, various illusion detection methods have been proposed. For example, one method involves sampling model responses multiple times and checking the consistency between different responses to determine if the model is exhibiting illusions; another method involves sampling responses multiple times and checking the statistical similarity of the model's intermediate hidden states corresponding to different responses to aid in the judgment; yet another method involves directly extracting the model's intermediate hidden states and training a classifier for binary classification of whether illusions are present or not. Furthermore, the training and evaluation of current illusion detection methods often rely on a limited number of publicly available illusion detection datasets.
[0004] The aforementioned detection methods still have several limitations in practical applications. First, detection methods based on multiple sampling are generally computationally expensive, and their detection granularity usually remains at the overall answer level, making it difficult to achieve fine-grained illusion localization of specific sentences or phrases within the answer. This makes it difficult for users to accurately identify and correct specific inaccurate information. Second, methods that directly classify based on intermediate hidden states are often limited in accuracy by the model's ability to capture complex semantics and factual errors, and they are insufficient in distinguishing user subjective intent (e.g., whether seeking objective factual queries or subjective analysis from the model). When a user's question is for subjective analysis, the model's output of subjective ideas should not be incorrectly judged as an illusion, but current detection systems often lack the ability to recognize such user intent. Furthermore, relying on limited public datasets for training also limits the generalization ability of the detection model and its ability to identify novel illusion patterns, especially when facing complex logical problems that easily induce illusions in large models; the detection performance still needs improvement. Summary of the Invention
[0005] In view of this, the purpose of this application is to provide an intelligent knowledge question answering method, apparatus, device, and storage medium, which can significantly improve the accuracy, reliability, and transparency of RAG system responses, effectively reduce the potential risks caused by the illusion of large language models, and thus improve the quality and accuracy of knowledge question answering results. The specific solution is as follows:
[0006] Firstly, this application discloses an intelligent knowledge question-answering method, applied to a retrieval enhancement generation system, comprising:
[0007] The system acquires knowledge-based question-and-answer requests submitted by the current target user and inputs these requests into a user intent recognition model to identify the target user's questioning intent.
[0008] If the intent of the questioning behavior is an objective query type intent, then factual knowledge corresponding to the knowledge question and answer request is obtained from the preset knowledge base, and the factual knowledge is input into the target large language model to answer the knowledge question and answer request based on the factual knowledge, so as to obtain an initial knowledge answer;
[0009] Extract the hidden state vector of the last token of each sentence in the initial knowledge answer in the middle layer of the model to obtain the current hidden state vector;
[0010] The current hidden state vector is input into the trained sparse autoencoder to perform dimensionality upscaling on the current hidden state vector, resulting in an upscaled state vector.
[0011] The upgraded state vector is input into the target MLP classifier to predict the current illusion probability of each sentence in the initial knowledge answer, and the sentences in the initial knowledge answer are labeled based on the current illusion probability to obtain the target knowledge answer.
[0012] Optionally, before obtaining the knowledge question-and-answer request submitted by the current target user, the method further includes:
[0013] Collect historical knowledge question and answer text corpus, and use a preset large language model to extract entities and relationships between different entities from the historical knowledge question and answer text corpus to obtain historical entities and historical entity relationships;
[0014] A structured knowledge graph is constructed based on the historical entities and their relationships to obtain a historical knowledge graph;
[0015] On the historical knowledge graph, questions involving multiple historical entities are randomly sampled and generated using the preset large language model to obtain multiple simple questions, and the multiple simple questions are fused to obtain complex questions;
[0016] Generate standard answers for each of the simple questions and the complex questions to obtain a historical question dataset containing the simple questions, the complex questions, and the corresponding standard answers;
[0017] The questions in the historical question dataset are used to ask the target large language model in sequence. During the process of the target large language model answering the questions, the hidden state vector of the last token of each sentence in the historical answer text output by the target large language model in the middle layer of the model is obtained and extracted to obtain the historical hidden state vector.
[0018] Using the target large language model and referring to the standard answer, hallucination annotation is performed on the historical answer text to generate corresponding hallucination tags for each sentence in the historical answer text;
[0019] The initial sparse autoencoder is trained using the historical hidden state vector, and the historical hidden state vector is upgraded during the training process to obtain the upgraded historical feature vector, so as to generate the trained sparse autoencoder.
[0020] The initial MLP classifier is trained using the historical upscaling feature vector to obtain the target MLP classifier used for predicting the probability of hallucination in sentences.
[0021] Optionally, training the initial MLP classifier using the historical upscaling feature vector to obtain the target MLP classifier for predicting the hallucination probability of sentences includes:
[0022] The historical upgraded feature vector is weighted using a preset gate vector to obtain a weighted feature vector.
[0023] The initial MLP classifier is trained using the weighted feature vector to obtain the target MLP classifier used for predicting the probability of hallucination in sentences.
[0024] Optionally, training the initial MLP classifier using the weighted feature vector to obtain the target MLP classifier for predicting the probability of hallucination in sentences includes:
[0025] The initial MLP classifier is trained using a weighted loss function and the weighted feature vector to obtain the target MLP classifier for predicting the probability of hallucination in sentences.
[0026] The formula for the weighted loss function is:
[0027] ;
[0028] In the formula, The probability that the i-th sentence is not a hallucination, as predicted by the MLP classifier; Let N be the hallucination label for the i-th sentence, where 0 indicates no hallucination and 1 indicates hallucination; N is the total number of training samples. and This is the loss weight used to balance positive and negative samples.
[0029] Optionally, after obtaining the historical question dataset containing the simple question, the complex question, and the corresponding standard answer, the method further includes:
[0030] The questions in the historical question dataset are classified and labeled to obtain a set of objective query questions and a set of subjective analysis questions.
[0031] The objective query question set and the subjective analysis question set are input into a lightweight large language model for fine-tuning to obtain the user intent recognition model;
[0032] The problems in the subjective analysis problem set are those that directly use a large language model for problem reasoning without needing to perform hallucination detection; the problems in the objective query problem set are those that use a large language model for problem reasoning and perform hallucination detection on the reasoning results.
[0033] Optionally, the intelligent knowledge question-answering method further includes:
[0034] If the intent of the questioning behavior is a subjective analytical intent, then factual knowledge corresponding to the knowledge question and answer request is obtained from the preset knowledge base;
[0035] The factual knowledge is input into the target large language model to answer the knowledge question-and-answer request based on the factual knowledge, thereby obtaining the target knowledge answer.
[0036] Optionally, the step of marking sentences in the initial knowledge answer based on the current hallucination probability to obtain the target knowledge answer includes:
[0037] Determine whether the current hallucination probability corresponding to each sentence in the initial knowledge answer is greater than a preset hallucination threshold;
[0038] If the current hallucination probability is greater than a preset hallucination threshold, then the corresponding sentence in the initial knowledge answer is marked to obtain the target knowledge answer;
[0039] Accordingly, after marking sentences in the initial knowledge answer based on the current hallucination probability to obtain the target knowledge answer, the process further includes:
[0040] The target knowledge answer is sent to the front-end page for visualization and display, and hallucination anomaly prompts are generated for target sentences that exceed the preset hallucination threshold.
[0041] Secondly, this application discloses an intelligent knowledge question-answering device, applied to a retrieval enhancement generation system, comprising:
[0042] The request retrieval module is used to retrieve knowledge Q&A requests submitted by the current target user;
[0043] The intent recognition module is used to input the knowledge question-and-answer request into the user intent recognition model in order to identify the questioning intent of the target user;
[0044] The knowledge acquisition module is used to retrieve factual knowledge corresponding to the knowledge question and answer request from a preset knowledge base if the intent of the questioning behavior is an objective query type intent;
[0045] The knowledge input module is used to input the factual knowledge into the target large language model, so as to answer the knowledge question-and-answer request based on the factual knowledge and obtain an initial knowledge answer;
[0046] The extraction module is used to extract the hidden state vector of the last token of each sentence in the initial knowledge answer in the middle layer of the model, so as to obtain the current hidden state vector;
[0047] The vector input module is used to input the current hidden state vector into the trained sparse autoencoder to perform dimensionality upscaling on the current hidden state vector to obtain the dimensionality upscaled state vector.
[0048] The hallucination detection module is used to input the upgraded state vector into the target MLP classifier to predict the current hallucination probability of each sentence in the initial knowledge answer, and to label the sentences in the initial knowledge answer based on the current hallucination probability to obtain the target knowledge answer.
[0049] Thirdly, this application discloses an electronic device, including a processor and a memory; wherein, when the processor executes a computer program stored in the memory, it implements the aforementioned intelligent knowledge question-and-answer method.
[0050] Fourthly, this application discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the aforementioned intelligent knowledge question-answering method.
[0051] As can be seen, this application is applied to a retrieval enhancement generation system. First, it obtains a knowledge question-and-answer request from the current target user and inputs it into a user intent recognition model to identify the target user's questioning intent. If the questioning intent is an objective query type intent, it retrieves factual knowledge corresponding to the knowledge question-and-answer request from a preset knowledge base and inputs this factual knowledge into a target large language model to answer the knowledge question-and-answer request based on the factual knowledge, obtaining an initial knowledge answer. Next, it extracts the hidden state vector of the last token of each sentence in the initial knowledge answer from the model's intermediate layer to obtain the current hidden state vector. This current hidden state vector is then input into a trained sparse autoencoder to perform dimensionality upscaling, obtaining an upscaled state vector. This upscaled state vector is then input into a target MLP classifier to predict the current illusion probability of each sentence in the initial knowledge answer, and the sentences in the initial knowledge answer are labeled based on the current illusion probability to obtain the target knowledge answer. This application uses a user intent recognition model to identify the intent of a user's question-and-answer request. When the intent is an objective query type, a large language model is used to provide a knowledge answer. The hidden state vector of the last token in each sentence of the knowledge answer is increased in dimensionality in the middle layer of the model. The increased state vector is then input into an MLP classifier to predict the illusion probability of each sentence in the knowledge answer. Sentences in the knowledge answer are labeled based on the illusion probability. In this way, not only can the knowledge answer be obtained, but also the illusion probability assessment at the sentence level can be achieved. This significantly improves the accuracy, reliability, and transparency of the RAG system's response, effectively reduces the potential risks caused by illusions in the large language model, and thus improves the quality and accuracy of the knowledge question-and-answer results. Attached Figure Description
[0052] To more clearly illustrate the technical solutions in the embodiments of this application 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 embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0053] Figure 1 This is a flowchart of an intelligent knowledge question-answering method disclosed in this application;
[0054] Figure 2 This is a flowchart of a specific intelligent knowledge question-answering method disclosed in this application;
[0055] Figure 3 This is a flowchart of a specific intelligent knowledge question-answering method disclosed in this application;
[0056] Figure 4 This is a schematic diagram of the structure of an intelligent knowledge question-answering device disclosed in this application;
[0057] Figure 5 This is a structural diagram of an electronic device disclosed in this application. Detailed Implementation
[0058] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0059] This application discloses an intelligent knowledge question-answering method, applied to a retrieval enhancement generation system. See also... Figure 1 As shown, the method includes:
[0060] Step S11: Obtain the knowledge question and answer request raised by the current target user, and input the knowledge question and answer request into the user intent recognition model to identify the target user's questioning intent.
[0061] It should be noted that the intelligent knowledge question answering scheme proposed in this application is applied to retrieval enhancement generation systems (such as question answering systems in the financial field). This RAG system can be used in knowledge question answering scenarios with strict requirements for answer accuracy and operational efficiency (such as intelligent customer service, medical auxiliary diagnosis, legal consultation, scientific research, high-quality question answering, etc.). In these scenarios, even subtle hallucinations can lead to serious consequences. The RAG system in this application can achieve hierarchical recognition (i.e., fine-grained recognition) and adaptive suppression of hallucinations during the question answering process, thereby improving the reliability, authenticity, and accuracy of the output of the large language model when processing factual queries. Furthermore, it alleviates the hallucination problem caused by knowledge gaps or insufficient reasoning ability in complex question answering by traditional large language models. At the same time, it solves the problem that traditional hallucination detection methods cannot meet the practical application requirements for high-precision, fine-grained, and intelligent hallucination detection.
[0062] Specifically, when the RAG system receives a knowledge question and answer request from a user, it first inputs the request into a pre-created user intent recognition model to identify the user's behavioral intent in making the knowledge question and answer request, thus obtaining the questioning intent.
[0063] The intent behind the question reflects the complexity of the current question, which can be categorized into two types: objective query intent and subjective analysis intent. Objective query intent indicates that the user's question aims to retrieve factual knowledge from the knowledge base; the question is relatively complex and requires illusion detection. Subjective analysis intent, on the other hand, indicates that the user's question directly seeks analysis or subjective opinions from the large language model; the question is relatively simple and does not require illusion detection. By recognizing behavioral intent, the system can accurately distinguish between factual query requests and subjective analysis requests, effectively avoiding misjudging reasonable responses based on subjective judgment or analysis by the large language model as illusions. This improves the discrimination accuracy and user acceptance of the RAG system, thereby enhancing its practicality and the accuracy and credibility of the generated content.
[0064] For example, when a financial question-and-answer system receives a request from a financial analyst for the following knowledge-based question: "Analyze the volatility of my country's A-share market over the past year and its main driving factors, predict the trend for the next three months, and assess the investment risk of a specific sector (such as new energy vehicles)," the system first inputs the request into a pre-created user intent recognition model to identify whether the user's (i.e., the financial analyst's) behavioral intent in making the knowledge-based question request is "query" or "analysis," so as to generate a corresponding answer based on the user's behavioral intent and the latest financial data and macroeconomic reports.
[0065] Step S12: If the intent of the questioning behavior is an objective query type intent, then obtain the factual knowledge corresponding to the knowledge question and answer request from the preset knowledge base, and input the factual knowledge into the target large language model to answer the knowledge question and answer request based on the factual knowledge, and obtain the initial knowledge answer.
[0066] In this embodiment, if the intent of the questioning behavior is an objective query type intent (i.e., the user is seeking objective financial facts or knowledge, indicating that the current question is highly complex and requires illusion detection), then factual knowledge corresponding to the current knowledge question and answer request can be obtained from a preset knowledge base (such as a knowledge base containing the latest financial data, macroeconomic reports, etc.). Then, the factual knowledge is input into the trained target large language model, thereby reasoning and answering the current knowledge question and answer request based on the factual knowledge, and obtaining the initial knowledge answer.
[0067] It should be noted that before obtaining the knowledge question-and-answer request from the current target user, it is necessary to create a target large language model for intelligent knowledge question-and-answer, as well as a sparse autoencoder and MLP classifier for hallucination detection. Specific steps include: collecting historical knowledge question-and-answer text corpus, and using a preset large language model to extract entities and relationships between different entities from the historical knowledge question-and-answer text corpus to obtain historical entities and historical entity relationships; constructing a structured knowledge graph based on the historical entities and historical entity relationships to obtain a historical knowledge graph; randomly sampling on the historical knowledge graph and using the preset large language model to generate questions involving multiple historical entities to obtain multiple simple questions, and fusing the multiple simple questions to obtain a complex question; generating standard answers for each simple question and the corresponding complex question to obtain a result containing the simple questions, the complex questions, and the corresponding standard answers. The system uses a historical question dataset. Questions from this dataset are sequentially posed to a target large language model (MLM). During the MLM's response process, the hidden state vector of the last token in each sentence of the output historical response text is obtained and extracted from the model's intermediate layers, resulting in a historical hidden state vector. Using the target MLM and referring to the standard answer, hallucination labeling is performed on the historical response text to generate corresponding hallucination tags for each sentence. The historical hidden state vector is used to train an initial sparse autoencoder, and during training, the historical hidden state vector is dimensionality-increasing to obtain a historical dimensionality-increasing feature vector, which is then used to generate the trained sparse autoencoder. The historical dimensionality-increasing feature vector is used to train an initial MLP classifier, resulting in the target MLP classifier used for predicting the hallucination probability of sentences. In this embodiment, see [link to example]. Figure 2As shown, the process begins with the large-scale collection of historical knowledge question-and-answer text corpora. For example, it involves collecting massive amounts of financial text corpora, such as listed company financial reports, industry analysis reports, macroeconomic data, market news, and regulatory policy documents. Next, a pre-trained large language model is used to extract key entities and the relationships between different key entities from the historical knowledge question-and-answer text corpora. This process identifies entities and their relationships, such as company names, stock codes, and macroeconomic indicators (e.g., GDP, CPI, PMI). The system identifies entities such as the index, financial products (e.g., bonds, funds, futures), industry sectors, monetary policy tools (e.g., reserve requirement ratio, open market operations), and international financial organizations. It establishes relationships between these entities, categorized by terms like "holding," "issuing," "influencing," "belonging to," "issuing," and "regulating." Based on these entities and their relationships, a structured financial knowledge graph is constructed. Random sampling is then used with a large language model to generate several simple, conceptual questions involving single or a small number of entities, such as "Please explain the calculation method of the 'price-to-earnings ratio' (P / E Ratio) and its basic meaning in valuation," or "What is the 'benchmark interest rate'? What direct effects does a bank's adjustment of the benchmark interest rate typically have?"
[0068] Furthermore, to increase the difficulty of illusion detection and simulate complex user query requests, these simple questions can be fused and obfuscated using a large language model, thus creating complex questions with intricate logic (i.e., compound questions). By deeply fusing these conceptually simple questions or factual queries into complex questions with complex logic using a large language model, the likelihood of the large language model generating illusions during reasoning can be increased. For example, organically combining independent conceptual questions such as "What are the goals and means of quantitative easing policy?", "What is the principle of reverse repurchase in a bank's open market operations?", and "What is the interest rate corridor mechanism?" can generate a complex question that requires the model to comprehensively understand and reason, such as: "In the context of major economies generally implementing quantitative easing (QE) policies, please explain how a bank influences short-term liquidity in the interbank market through its reverse repurchase tool in open market operations, and further explain how this influence is transmitted to and supports the lower limit of its established 'interest rate corridor' mechanism." Such complex questions require the large language model not only to understand the various financial concepts but also to accurately grasp the causal chain and interaction mechanism between them, making it highly susceptible to fabrication or logical confusion in the details of the transmission path.
[0069] Then, standard answers to each simple and complex question are generated, resulting in a historical question dataset containing simple and complex questions and their corresponding standard answers. In other words, the final synthesized dataset contains both complex questions and relatively simple conceptual query questions (i.e., simple questions), thus effectively solving the problem of scarce hallucination data. This provides sufficient training samples for the subsequent hallucination detection model based on MLP (Multi-Layer Perceptron) classifier and Sparse Autoencoder (SAE), ensuring the diversity and hallucination-inducing nature of the dataset, and comprehensively covering knowledge question-and-answer scenarios that may produce hallucinations of different complexities.
[0070] Next, questions from the aforementioned historical question dataset are used to sequentially pose questions to the target large language model (e.g., Llama or GPT (Generative Pre-trained Transformer) series models fine-tuned in the financial domain). As the target large language model answers the questions, the hidden state of the last token of each sentence in the generated historical answer text is recorded and extracted in an intermediate layer of the model (e.g., a hidden layer of the Transformer), resulting in a historical hidden state vector. Where i represents the sentence index. Simultaneously, using the target large language model and referring to the standard answers in the dataset, fine-grained annotations are performed on the responses of the target large language model (i.e., historical answer text), generating a phantom label for each sentence. Here, 0 represents no illusion, and 1 represents the presence of an illusion. That is, it determines whether each statement contains a factual illusion. For example, if the large model answers "A company's stock rose 10% yesterday, reaching a new all-time high," but actual financial data shows that the stock fell 5% yesterday, then the statement is labeled as an illusion. At this point, we can obtain the hidden state vector and illusion label needed to train the sparse autoencoder and MLP classifier, denoted as […]. .
[0071] Furthermore, utilizing the aforementioned historical hidden state vector The initial sparse autoencoder (SAE) is trained, and the original historical hidden state vector is used during the training process. Encoding and upscaling into a higher-dimensional vector aims to decouple and highlight potential features related to illusion in the hidden state, making the meanings of different features simpler and more distinguishable, resulting in the upscaled feature vector. (in Furthermore, by incorporating sparsity constraints, the meaning of features becomes simpler and more decoupled. The training objective of SAE is to minimize the reconstruction error, and a sparsity penalty term is added, which is equivalent to minimizing the loss function used in training. for:
[0072] ;
[0073] In the formula, This represents the historical hidden state vector of the last token in the nth sentence extracted from the historical response text generated by the target large model; It is the encoder in a sparse autoencoder, used to convert... Mapping to a higher-dimensional sparse representation vector, i.e., the feature vector after the history is upgraded to higher dimensions. ; It is the decoder in a sparse autoencoder, used to extract features from a high-dimensional sparse representation (i.e., the feature vector after historical dimensionality increase). Reconstructing back to the original hidden state (i.e., the historical hidden state vector) N is the total number of training samples; The sparsity penalty coefficient is used to adjust the strength of the sparsity penalty and control the high-dimensional sparse representation (i.e., The sparsity of the encoder output vector; D is the dimension of the encoder output vector; This represents the high-dimensional sparse representation of the encoder output (i.e. The absolute value of the j-th component of ).
[0074] In addition, the entire loss function It consists of two parts, including the reconstruction error part. The average L2 norm error of all training samples was calculated to measure the original historical hidden state vector. The difference between the input state and the reconstructed state from the encoder and decoder ensures that the autoencoder can accurately recover the input information; sparsity penalty term. L1 regularization is then applied to sum the absolute values of each component in the encoder output vector to encourage most elements in the high-dimensional vector to be zero, thereby enhancing sparsity. Feature engineering of the model intermediates using a sparse autoencoder significantly improves the discriminativeness and interpretability of hallucination features.
[0075] Finally, the upgraded feature vectors from the historical data are used as input to the initial MLP classifier to train an end-to-end target MLP classifier for predicting the probability of hallucination in sentences. This classifier aims to predict the probability that a sentence is not a hallucination. As shown above, the trained sparse autoencoder is used to map the hidden state vectors of the intermediate layers of the model to a higher-dimensional and more decoupled representation space, while the MLP classifier is based on this high-dimensional sparse representation (i.e., The algorithm performs end-to-end binary classification on the data and outputs the probability of no hallucination for each sentence, thereby achieving accurate prediction of the hallucination probability for each sentence and ultimately providing sentence-level hallucination detection capabilities.
[0076] In one specific implementation, training the initial MLP classifier using the historical upscaled feature vector to obtain the target MLP classifier for predicting the probability of hallucination in sentences may specifically include: weighting the historical upscaled feature vector using a preset gating vector to obtain a weighted feature vector; and training the initial MLP classifier using the weighted feature vector to obtain the target MLP classifier for predicting the probability of hallucination in sentences. In this embodiment, during the training of the initial MLP classifier, a weighted loss function can be used to address the sparsity of hallucination samples, and a gating mechanism can be introduced for feature selection to focus on the features most discriminative for hallucination detection. For example, in the high-dimensional sparse representation of the output of the sparse autoencoder (i.e., ... Before being input into the MLP classifier, the feature vector can be weighted by a learnable gating vector, thereby achieving soft selection of different features. Specifically, the feature vector after being weighted by the preset gating vector... It can be represented as:
[0077] ;
[0078] In the formula, For the high-dimensional sparse representation of the output of the sparse autoencoder (i.e. ), with a dimension of D; This indicates element-wise multiplication; It is a learnable parameter vector with the same dimension as the feature, which serves as the "weights" of the gate and is optimized during training; The sigmoid activation function maps elements in g to the range (0,1), generating a gating value between 0 and 1 for each feature. These gating values dynamically adjust the importance of each feature, giving higher weights to features that contribute more to hallucination detection and suppressing features that contribute less. Then, the weighted feature vector is... The gating mechanism is used as input to the initial MLP classifier to predict the probability of hallucinations. This gating mechanism is optimized end-to-end with the MLP classifier during training, automatically identifying and reinforcing the features most critical to the task, thereby improving the accuracy and efficiency of hallucination detection.
[0079] Specifically, training the initial MLP classifier using the weighted feature vector to obtain the target MLP classifier for predicting the probability of hallucination in sentences can include: training the initial MLP classifier using a weighted loss function and the weighted feature vector to obtain the target MLP classifier for predicting the probability of hallucination in sentences. In this embodiment, a noise reduction strategy can be combined with feature dimensionality enhancement, and a weighted loss function and feature selection strategy can be used during training to address data imbalance, improve model robustness, and balance the detection performance of different types of hallucinations. The formula for calculating the weighted loss function is:
[0080] ;
[0081] In the formula, The probability that the i-th sentence is not a hallucination, as predicted by the MLP classifier; Let N be the hallucination label for the i-th sentence, where 0 indicates no hallucination and 1 indicates hallucination; N is the total number of training samples. and To balance the loss weights for positive and negative samples, a sentence-level hallucination probability assessment can be achieved by using a sparse autoencoder to increase the dimensionality of features and leveraging an MLP classifier that includes a weighted loss function and a gating mechanism.
[0082] Furthermore, after obtaining the historical question dataset containing the simple question, the complex question, and the corresponding standard answer, the method further includes: classifying and labeling each question in the historical question dataset to obtain an objective query question set and a subjective analysis question set; inputting the objective query question set and the subjective analysis question set into a lightweight large language model for fine-tuning to obtain the user intent recognition model; wherein, the questions in the subjective analysis question set are questions that directly utilize the large language model for question reasoning without requiring hallucination detection; the questions in the objective query question set are questions that utilize the large language model for question reasoning and perform hallucination detection on the reasoning results. In this embodiment, the questions in the historical question dataset are first finely classified and labeled, categorized into two main types: "Query" and "Analysis." "Query" questions correspond to objective query intents, meaning users aim to obtain / query specific factual knowledge (i.e., objective knowledge or facts) from a knowledge base (such as a financial knowledge base). These questions require reasoning using a large language model and illusion detection of the reasoning results. Examples include "What was the highest price of a certain stock in the past month?" or "What are the key points of a bank's latest monetary policy report?". "Analysis" questions, on the other hand, correspond to subjective analysis intents, indicating users want to directly obtain the reasoning, opinions, subjective thoughts, predictions, or evaluations from the large language model. Such outputs should not be judged as illusions, i.e., questions that do not require illusion detection. Examples include "How do you think the A-share market will develop in the next year?" or "Please evaluate the long-term impact of a company's latest financial report on its stock price." Through the above classification and annotation operations, we can obtain a set of objective query questions and a set of subjective analysis questions. Then, we use these annotated question sets to fine-tune a pre-trained large language model with a small number of parameters and high computational efficiency (e.g., a lightweight BERT variant or RoBERTa model) so that it can accurately identify whether the user's intention in asking a question is "query" or "analysis". That is, we can determine whether the user's intention in querying is to "query" specific factual knowledge or to "analyze" and seek subjective opinions. This lightweight large language model can be deployed at the front end of a financial question-answering system to obtain a user intent recognition model.
[0083] In another specific implementation, it may further include: if the intent of the questioning behavior is a subjective analysis type intent, then obtaining factual knowledge corresponding to the knowledge question-and-answer request from a preset knowledge base; inputting the factual knowledge into the target large language model to answer the knowledge question-and-answer request based on the factual knowledge, thereby obtaining the target knowledge answer. In this embodiment, if the current user's questioning behavior intent is a subjective analysis type intent, it indicates that the current user is seeking prediction or subjective evaluation from the large language model, and the complexity of the current request is low. In this case, the RAG system will not perform hallucination detection, but will directly input the corresponding factual knowledge obtained from the preset knowledge base into the target large language model to answer the current knowledge question-and-answer request based on the aforementioned factual knowledge.
[0084] Step S13: Extract the hidden state vector of the last token of each sentence in the initial knowledge answer in the middle layer of the model to obtain the current hidden state vector.
[0085] In this embodiment, the hidden state of the last token (token / word element, representing the smallest unit of text) of each sentence generated by the target large language model when responding to a user's knowledge question and answer request can be extracted in real time in the middle layer of the model to obtain the current hidden state vector.
[0086] Step S14: Input the current hidden state vector into the trained sparse autoencoder to perform dimensionality upscaling on the current hidden state vector to obtain the dimensionality upscaled state vector.
[0087] In this embodiment, the captured current hidden state vector is input into the trained sparse autoencoder for dimensionality upscaling, thereby extracting more discriminative feature representations and obtaining the dimensionality-upgraded state vector.
[0088] Step S15: Input the upgraded state vector into the target MLP classifier to predict the current illusion probability of each sentence in the initial knowledge answer, and label the sentences in the initial knowledge answer based on the current illusion probability to obtain the target knowledge answer.
[0089] In this embodiment, after increasing the dimensionality of the current hidden state vector, the increased state vector is further input into the target MLP classifier. This classifier predicts the illusion probability of each sentence in the initial knowledge answer, obtaining the current illusion probability (including two main categories: illusion probability and no illusion probability). Then, based on this current illusion probability, the sentences in the initial knowledge answer are labeled (e.g., only the no-illusion probability is labeled), resulting in the labeled target knowledge answer, which is then sent to the corresponding target user terminal. Through these steps, fine-grained, sentence-level detection and labeling of illusions that may occur in the answering of complex financial questions using a large language model can be achieved.
[0090] As can be seen, this embodiment of the application identifies the user's intent to ask a knowledge-based question and answer request using a user intent recognition model. When the intent is an objective query type, a large language model is used to provide a knowledge answer to the request. The hidden state vector of the last token in each sentence of the knowledge answer is increased in dimensionality in the middle layer of the model. The increased state vector is then input into an MLP classifier to predict the illusion probability of each sentence in the knowledge answer. The sentences in the knowledge answer are labeled based on the illusion probability. In this way, not only can a knowledge answer be obtained, but also a sentence-level illusion probability assessment can be achieved. This significantly improves the accuracy, reliability, and transparency of the RAG system's response, effectively reduces the potential risks caused by illusions in the large language model, and improves the accuracy and reliability when dealing with complex logic and multi-entity association problems.
[0091] This application discloses a specific intelligent knowledge question-answering method, applied to a retrieval enhancement generation system. See also... Figure 3 As shown, the method includes:
[0092] Step S21: Obtain the knowledge question and answer request raised by the current target user, and input the knowledge question and answer request into the user intent recognition model to identify the target user's questioning intent.
[0093] Step S22: If the intent of the questioning behavior is an objective query type intent, then obtain the factual knowledge corresponding to the knowledge question and answer request from the preset knowledge base, and input the factual knowledge into the target large language model to answer the knowledge question and answer request based on the factual knowledge, and obtain the initial knowledge answer.
[0094] Step S23: Extract the hidden state vector of the last token of each sentence in the initial knowledge answer in the middle layer of the model to obtain the current hidden state vector.
[0095] Step S24: Input the current hidden state vector into the trained sparse autoencoder to perform dimensionality upscaling on the current hidden state vector to obtain the dimensionality upscaled state vector.
[0096] Step S25: Input the upgraded state vector into the target MLP classifier to predict the current hallucination probability of each sentence in the initial knowledge answer, and determine whether the current hallucination probability corresponding to each sentence in the initial knowledge answer is greater than the preset hallucination threshold.
[0097] In this embodiment, the current hallucination probability (between 0 and 1, where 0 indicates no hallucination and 1 indicates complete hallucination) of each sentence in the initial knowledge answer can be predicted by the target MLP classifier, and it can be determined whether the current hallucination probability corresponding to each sentence in the initial knowledge answer is greater than a preset hallucination threshold.
[0098] Step S26: If the current hallucination probability is greater than the preset hallucination threshold, then mark the corresponding sentence in the initial knowledge answer to obtain the target knowledge answer.
[0099] In this embodiment, if the current hallucination probability is greater than the preset hallucination threshold, it indicates that the hallucination probability of the corresponding sentence is relatively high. At this time, the corresponding sentence in the initial knowledge answer can be marked (for example, by highlighting the corresponding sentence, adding a warning icon, or adding a prompt text containing the hallucination probability value), thereby obtaining the marked target knowledge answer.
[0100] Alternatively, based on the above marking, sentences with a current hallucination probability less than or equal to a preset hallucination threshold can be further marked, or only sentences with a current hallucination probability less than or equal to a preset hallucination threshold can be marked.
[0101] Step S27: Send the target knowledge answer to the front-end page for visualization and generate hallucination anomaly prompt information for target sentences that exceed the preset hallucination threshold.
[0102] In this embodiment, the tagged target knowledge answers can be sent to the front-end page for visualization, thereby displaying sentences that may contain hallucinations. Additionally, hallucination anomaly alerts can be generated for target sentences with a high probability of hallucination (i.e., sentences with a probability greater than the preset hallucination threshold), thus reminding the user of sentences containing hallucination anomalies. For example, in the sentence "According to historical data, this stock has risen [highlighted: 15%] in the past year," if the actual increase is 5%, the system will display "The system has detected that this sentence may contain factual errors; please refer to it with caution," thus assisting users in discerning the reliability of information when using a financial question-and-answer system.
[0103] For more detailed processing procedures of steps S21 to S24, please refer to the relevant content disclosed in the foregoing embodiments, which will not be repeated here.
[0104] As can be seen, in this embodiment, a hallucination detection model based on a target MLP classifier and a trained sparse autoencoder is used for fine-grained hallucination detection at the sentence level. Compared to traditional RAG systems, which can only perform hallucination detection at the document or paragraph level, this application can more accurately locate the specific location where the hallucination occurs, providing refined information for subsequent optimization or user prompts, and improving the reliability of the RAG system and even the entire LLM application. Furthermore, the hallucination detection results output by the hallucination detection model are used to achieve real-time presentation of hallucination risk assessment at the sentence level on the user interface, and visual cues such as color coding or confidence markers are used to enhance the user's perception and judgment of the reliability of the generated content, balancing user experience and information quality. In addition, traditional hallucination detection schemes often rely on high-cost multiple sampling or complex models, which are difficult to support real-time and efficient operation. However, this application uses a lightweight MLP classifier and sparse autoencoder, which can significantly reduce the complexity of hallucination detection, thereby improving the efficiency of hallucination detection and reducing the hallucination rate while maintaining generation efficiency. In addition, by visualizing the probability of illusion for each sentence on the front-end page, the transparency and user experience of the RAG system are greatly enhanced, allowing users to clearly understand which parts of the model's response may contain factual biases, thereby assisting users in making information judgments and adoptions.
[0105] Accordingly, this application also discloses an intelligent knowledge question-answering device applied to a retrieval enhancement generation system, see [link to relevant documentation]. Figure 4 As shown, the device includes:
[0106] Request retrieval module 11 is used to retrieve knowledge question and answer requests submitted by the current target user;
[0107] The intent recognition module 12 is used to input the knowledge question-and-answer request into the user intent recognition model in order to identify the questioning intent of the target user;
[0108] The knowledge acquisition module 13 is used to acquire factual knowledge corresponding to the knowledge question and answer request from a preset knowledge base if the intent of the questioning behavior is an objective query type intent;
[0109] The knowledge input module 14 is used to input the factual knowledge into the target large language model, so as to answer the knowledge question and answer request based on the factual knowledge and obtain an initial knowledge answer;
[0110] Extraction module 15 is used to extract the hidden state vector of the last token of each sentence in the initial knowledge answer in the middle layer of the model to obtain the current hidden state vector;
[0111] The vector input module 16 is used to input the current hidden state vector into the trained sparse autoencoder to perform dimensionality upscaling on the current hidden state vector to obtain the dimensionality upscaling state vector.
[0112] The hallucination detection module 17 is used to input the upgraded state vector into the target MLP classifier to predict the current hallucination probability of each sentence in the initial knowledge answer, and to label the sentences in the initial knowledge answer based on the current hallucination probability to obtain the target knowledge answer.
[0113] The specific workflow of each of the above modules can be found in the relevant content disclosed in the foregoing embodiments, and will not be repeated here.
[0114] As can be seen, this embodiment of the application identifies the user's intent to ask a knowledge-answering request using a user intent recognition model. When the intent is an objective query type, it provides a knowledge answer using a large language model. Furthermore, it performs dimensionality upscaling on the hidden state vector of the last token in each sentence of the knowledge answer within the model's intermediate layer, and then inputs the dimensionality-upgraded state vector into an MLP classifier to predict the illusion probability of each sentence in the knowledge answer. Based on the illusion probability, the sentences in the knowledge answer are labeled. This not only provides the knowledge answer but also enables sentence-level illusion probability assessment, significantly improving the accuracy, reliability, and transparency of the RAG system's responses. It effectively reduces the potential risks caused by large language model illusions, thereby improving the quality and accuracy of the knowledge-answering results.
[0115] Furthermore, embodiments of this application also disclose an electronic device, Figure 5 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content of the diagram should not be construed as limiting the scope of this application.
[0116] Figure 5 This is a schematic diagram of the structure of an electronic device 20 provided in an embodiment of this application. Specifically, the electronic device 20 may include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 stores a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the intelligent knowledge question-answering method disclosed in any of the foregoing embodiments. Alternatively, the electronic device 20 in this embodiment may specifically be an electronic computer.
[0117] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this application, and is not specifically limited here; the input / output interface 25 is used to acquire external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.
[0118] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk or optical disk, etc. The resources stored thereon can include operating system 221, computer program 222, etc., and the storage method can be temporary storage or permanent storage.
[0119] The operating system 221 is used to manage and control the various hardware devices on the electronic device 20 and the computer program 222, which may be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program capable of performing the intelligent knowledge question-answering method executed by the electronic device 20 as disclosed in any of the foregoing embodiments, the computer program 222 may further include a computer program capable of performing other specific tasks.
[0120] Furthermore, this application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the aforementioned intelligent knowledge question-answering method. Specific steps of this method can be found in the corresponding content disclosed in the foregoing embodiments, and will not be repeated here.
[0121] Furthermore, embodiments of this application also disclose a computer program product, including a computer program / instructions, which, when executed by a processor, implement the steps of the intelligent knowledge question-answering method disclosed above.
[0122] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section.
[0123] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0124] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.
[0125] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0126] The above provides a detailed description of the intelligent knowledge question-answering method, apparatus, device, and storage medium provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The description of the above embodiments is only for the purpose of helping to understand the method and its core ideas. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. An intelligent knowledge question answering method, characterized by, The application is applied to a retrieval enhancement generation system, comprising: acquiring a knowledge question and answer request proposed by a current target user, and inputting the knowledge question and answer request into a user intention recognition model to recognize the questioning behavior intention of the target user; if the questioning behavior intention is an objective query type intention, acquiring factual knowledge corresponding to the knowledge question and answer request from a preset knowledge base, and inputting the factual knowledge into a target large language model to answer the knowledge question and answer request based on the factual knowledge to obtain an initial knowledge answer; extracting a hidden state vector of a last token of each sentence in the initial knowledge answer in a middle layer of the model to obtain a current hidden state vector; inputting the current hidden state vector into a trained sparse autoencoder to perform dimensionality increasing processing on the current hidden state vector to obtain a dimension-increased state vector; inputting the dimension-increased state vector into a target MLP classifier to predict a current hallucination probability of each sentence in the initial knowledge answer, and marking the sentences in the initial knowledge answer based on the current hallucination probability to obtain a target knowledge answer. 2.The smart knowledge Q&A method of claim 1, wherein, Before the acquiring a knowledge question and answer request proposed by a current target user, the method further comprises: collecting historical knowledge question and answer text corpus, and extracting entities and relationships between different entities in the historical knowledge question and answer text corpus using a preset large language model to obtain historical entities and historical entity relationships; constructing a structured knowledge graph based on the historical entities and the historical entity relationships to obtain a historical knowledge graph; randomly sampling and generating questions involving multiple historical entities on the historical knowledge graph using the preset large language model to obtain multiple simple questions, and fusing the multiple simple questions to obtain a complex question; generating standard answers corresponding to each simple question and the complex question to obtain a historical question dataset containing the simple questions, the complex question, and the corresponding standard answers; using the questions in the historical question dataset to sequentially ask a target large language model, and acquiring and extracting hidden state vectors of last tokens of each sentence in historical answer text output by the target large language model in a middle layer of the model to obtain historical hidden state vectors during the process of the target large language model answering questions; performing hallucination annotation on the historical answer text using the target large language model and referring to the standard answers to generate corresponding hallucination labels for each sentence in the historical answer text; training an initial sparse autoencoder using the historical hidden state vectors, and performing dimensionality increasing processing on the historical hidden state vectors during the training process to obtain historical dimension-increased feature vectors to generate the trained sparse autoencoder; training an initial MLP classifier using the historical dimension-increased feature vectors to obtain the target MLP classifier for predicting hallucination probabilities of sentences. 3.The smart knowledge Q&A method of claim 2, wherein, The training an initial MLP classifier using the historical dimension-increased feature vectors to obtain the target MLP classifier for predicting hallucination probabilities of sentences comprises: The history dimension-increased feature vector is weighted by using a preset gating vector to obtain a weighted feature vector; The initial MLP classifier is trained by using the weighted feature vector to obtain the target MLP classifier for hallucination probability prediction of a sentence. 4.The smart knowledge Q&A method of claim 3, wherein, The training of the initial MLP classifier by using the weighted feature vector to obtain the target MLP classifier for hallucination probability prediction of a sentence comprises: The initial MLP classifier is trained by using a weighted loss function and the weighted feature vector to obtain the target MLP classifier for hallucination probability prediction of a sentence; The formula of the weighted loss function is: ; wherein, the probability of the ith sentence predicted by the MLP classifier to be hallucination-free; the hallucination label of the ith sentence, 0 for hallucination-free and 1 for hallucination; N is the total number of training samples; and is the loss weight for balancing positive and negative samples. 5.The smart knowledge Q&A method of claim 2, wherein, After the history question data set containing the simple questions, the complex questions and the corresponding standard answers is obtained, the following further comprises: The questions in the history question data set are classified and labeled to obtain an objective query type question set and a subjective analysis type question set; The objective query type question set and the subjective analysis type question set are input into a lightweight large language model for fine-tuning to obtain the user intent recognition model; The questions in the subjective analysis type question set are questions that are directly reasoned by the large language model without hallucination detection; and the questions in the objective query type question set are questions that are reasoned by the large language model and subjected to hallucination detection. 6.The smart knowledge Q&A method of claim 1, wherein, Further comprising: If the questioning behavior intent is a subjective analysis type intent, fact-based knowledge corresponding to the knowledge question and answer request is obtained from a preset knowledge base; The fact-based knowledge is input into a target large language model to answer the knowledge question and answer request based on the fact-based knowledge to obtain a target knowledge answer. 7.The smart knowledge Q&A method according to any one of claims 1 to 6, characterized in that, The marking of the sentences in the initial knowledge answer based on the current hallucination probability to obtain a target knowledge answer comprises: It is respectively judged whether the current hallucination probability corresponding to each sentence in the initial knowledge answer is greater than a preset hallucination threshold value; If the current hallucination probability is greater than the preset hallucination threshold value, the corresponding sentence in the initial knowledge answer is marked to obtain a target knowledge answer; Correspondingly, after the marking of the sentences in the initial knowledge answer based on the current hallucination probability to obtain a target knowledge answer, the following further comprises: The target knowledge answer is sent to a front-end page for visual display, and hallucination anomaly prompt information for the target sentence greater than the preset hallucination threshold value is generated.
8. An intelligent knowledge question answering apparatus, characterized by comprising: Applied to a retrieval enhancement generation system, comprising: A request acquisition module is configured to acquire a knowledge question and answer request proposed by a target user; An intent recognition module is configured to input the knowledge question and answer request into a user intent recognition model to identify a questioning behavior intent of the target user; A knowledge acquisition module is configured to acquire fact-based knowledge corresponding to the knowledge question and answer request from a preset knowledge base if the questioning behavior intent is an objective query type intent; A knowledge input module is configured to input the fact-based knowledge into a target large language model to answer the knowledge question and answer request based on the fact-based knowledge to obtain an initial knowledge answer; and extracting a current hidden state vector of a last token of each sentence in the initial knowledge answer in a middle layer of the model; inputting the current hidden state vector into a trained sparse autoencoder to perform dimensionality increasing processing on the current hidden state vector to obtain an increased dimension state vector; inputting the increased dimension state vector into a target MLP classifier to predict a current hallucination probability of each sentence in the initial knowledge answer, and marking the sentences in the initial knowledge answer based on the current hallucination probability to obtain a target knowledge answer.
9. An electronic device, comprising: A computer program product comprising a computer readable medium storing a computer program, wherein the computer program is executable by a processor to implement the intelligent knowledge question answering method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, A computer program product comprising a computer readable medium storing a computer program, wherein the computer program is executable by a processor to implement the intelligent knowledge question answering method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Large model generation content information security enhancement-oriented system and method
CN119558403A
Graph retrieval enhancement generation method based on telecom specification multi-mode knowledge graph
CN120804148A
Knowledge cross validation question and answer method and system for reducing illusion of large language model
CN120910218A
Large language model illusion suppression method, product and equipment based on multi-order detection
CN120975246A
Hallucination detection and handling for a large language model based domain-specific conversation system
US20250061286A1