A method and system for enhancing the knowledge boundary awareness capability of large language models
By constructing a discriminator module and external knowledge retrieval, the perception of knowledge boundaries of the large language model is enhanced, solving the problem of its output exceeding the boundary and realizing more realistic and credible content generation.
Patent Information
- Application Number
- CN202311821315.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-27
- Publication Date
- 2026-11-17
- Estimated Expiration
- 2043-12-27
AI Technical Summary
Large language models lack a clear understanding of their own knowledge boundaries, resulting in outputs that exceed these boundaries, creating an "illusion" problem and affecting the reliability of downstream applications.
Multiple discriminator modules are constructed to filter out questions that exceed the knowledge boundary by retrieving external knowledge and using the discrimination of a large language model, and to provide reasonable responses and explanations.
It enhances the large language model's ability to perceive knowledge boundaries, improves the authenticity and accuracy of the output content, alleviates the "illusion" problem, and improves the quality of the generated content.
Smart Images

Figure CN118013049B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of large language model technology, and in particular to a method and system for enhancing the knowledge boundary perception capability of large language models. Background Technology
[0002] Large language models refer to large-scale neural network models obtained by using deep learning techniques and self-supervised training with a large amount of unlabeled text data. Large language models perform well in various traditional natural language processing tasks (such as text generation, sentiment classification, reading comprehension, dialogue systems, etc.). Typical large language models include ChatGPT and GPT-4 developed by OpenAI, Tongyi Qianwen from Alibaba, Wenxin Yiyan from Baidu, and ChatGLM from Tsinghua University.
[0003] Text generation refers to the process of automatically generating human-understandable text in one or more natural languages. Generally, a text generation task, upon receiving structured data, text, or images, automatically generates a text associated with the input command. The "illusion" of text generation refers to the "deceptive" effect created by large language models generating natural-sounding, grammatically correct text that is actually meaningless or contains factual errors. Possible causes of this "illusion" include: flawed distribution of training data for large language models, insufficient samples, inadequate contextual understanding, and constraints from domain knowledge. Even with techniques like retrieval augmentation, large language models still struggle to avoid problems such as imposed causality and knowledge errors—essentially, "serious nonsense." With the widespread use of large language models in fields including financial services, medical diagnosis, and legal decision-making, the "illusion" of text generation can have serious adverse effects in various application scenarios. Therefore, it is crucial to ensure that large models understand what they can and cannot answer.
[0004] It is generally believed that the knowledge of large language models originates from knowledge learned and understood from large amounts of training data, as well as knowledge acquired through retrieval augmentation. Therefore, the "knowledge boundary" of a large language model generally refers to the overall boundary formed by its knowledge. Limited by training samples and learning methods, the knowledge of large language models is bounded, and thus their ability to answer questions is also limited. However, current large language models often return answers that exceed their "knowledge boundary" when answering questions. For example, when the input is "Please tell the story of Sima Guang smashing the water vat," the large language model will "fabricate" a seemingly true story; or it will use background knowledge supplemented by retrieval augmentation to generate content that does not conform to the facts. For example, given some background information about Sima Guang's life, the large language model will combine the context to create a more vivid and engaging story. Furthermore, when given context and other relevant information to answer the question, the large language model will forcibly establish a causal relationship with the context. For example, given Sima Guang's life and the context of Sima Guang smashing the water vat, the large language model will forcibly establish a causal relationship between smashing the vat and Wang Anshi's reforms, ignoring that the story of Sima Guang smashing the water vat was merely a childhood anecdote. This shows that large language models lack a clear understanding of their own knowledge boundaries, and still generate responses that contradict the facts when faced with unknown facts, thus creating hidden dangers for downstream applications.
[0005] In related technologies, optimization of large language model output is often achieved through retrieval enhancement, thought chains, and post-processing. CN116932776A discloses a method and apparatus for updating knowledge of a large model based on a knowledge graph, which uses knowledge to fine-tune and update the knowledge of the large model, combining the user's question with the recalled knowledge and the input. CN116561278A discloses a knowledge question answering method, apparatus, device, and storage medium, which decomposes the input question into thought chains for answering. CN116719917A discloses a knowledge question answering system, method, and storage medium that combines a large model with external knowledge, in which the answer output by the large language model is modified by a modification network based on external knowledge after the large language model outputs its answer.
[0006] In summary, existing technologies standardize large language models from the perspectives of input, reasoning, and output, but none of them enable large language models to recognize their own knowledge boundaries, thus failing to ensure that large language models only answer questions about the knowledge they are capable of answering. Summary of the Invention
[0007] This invention provides a method and system for enhancing the knowledge boundary perception ability of large language models. It enhances the ability of large language models to perceive their own knowledge boundaries, avoids large language models from outputting knowledge they do not possess, thereby improving the quality of generated content and alleviating the "illusion" problem unique to large language models.
[0008] The technical solution adopted by this invention is as follows: Firstly, this invention provides a method for enhancing the knowledge boundary awareness capability of large language models, comprising:
[0009] Obtaining user questions;
[0010] The retrieval tool retrieves external knowledge based on the question, obtains external knowledge related to the question, and concatenates it with the question to form the input content.
[0011] Construct the first discriminator: Based on the input content, use a large language model to determine whether the question can be answered, and filter out the questions that the large language model believes cannot be answered in advance as the first type of questions that exceed the knowledge boundary;
[0012] Based on the input content, the output content is obtained through a large language model;
[0013] Construct a second discriminator: Based on the input content, use a large language model to judge whether the output content is reasonable, and filter out the problems that the large language model considers to be unreasonable as the second type of problems that exceed the knowledge boundary;
[0014] Construct a third discriminator: Based on the external knowledge retrieved by the retrieval machine that is related to the output content, determine whether it is consistent with the external knowledge related to the question, and filter out questions with inconsistent external knowledge as the third type of questions that exceed the knowledge boundary;
[0015] For the first type of questions that exceed the knowledge boundary, the second type of questions that exceed the knowledge boundary, and the third type of questions that exceed the knowledge boundary, a final response is given. For questions that are not determined to exceed the knowledge boundary, the output of the large language model is given as the final response.
[0016] Furthermore, the output content obtained through the large language model based on the input content includes:
[0017] Construct prompt words so that the large language model can obtain the output content based on the input content.
[0018] Furthermore, the construction of the second discriminator involves using a large language model to determine the rationality of the output content based on the input content, and filtering out issues that the large language model deems the output content unreasonable as a second category of issues exceeding the knowledge boundary, including:
[0019] Based on the input content, a large language model is used to determine whether the output content is correct, and the problems that the large language model considers to have errors in the output content are filtered out as the second type of problems that exceed the knowledge boundary.
[0020] Based on the input content, a large language model is used to determine whether the output content can be deduced. Problems that the large language model believes cannot be deduced are also classified as the second type of problems that exceed the knowledge boundary.
[0021] Furthermore, the construction of the third discriminator involves: based on the external knowledge retrieved by the retrieval machine that is related to the output content, determining whether it is consistent with the external knowledge related to the question, and filtering out questions with inconsistent external knowledge as a third category of questions exceeding the knowledge boundary, including:
[0022] The search engine retrieves knowledge related to the output content from external sources.
[0023] Determine whether the external knowledge related to the question and the external knowledge related to the output content are consistent, filter out questions where the knowledge retrieved in the two searches is inconsistent, and classify them as a third type of question that exceeds the knowledge boundary.
[0024] Furthermore, the final responses provided for the first type of problems exceeding knowledge boundaries, the second type of problems exceeding knowledge boundaries, and the third type of problems exceeding knowledge boundaries respectively include:
[0025] For the first type of question that exceeds the knowledge boundary, inform the user that the large language model cannot answer the question;
[0026] For the second type of question that exceeds the knowledge boundary, inform the user that the large language model is unsure whether the answer is correct, and provide the reason;
[0027] For the third type of problem that exceeds the knowledge boundary, inform the user that the large language model may contain fabricated information, or that the retrieval process may involve inconsistent external knowledge that is repeatedly judged by a third discriminator.
[0028] Secondly, the present invention also provides a method for enhancing the knowledge boundary awareness capability of large language models, comprising:
[0029] Obtain user questions and use those questions as input.
[0030] Construct the first discriminator: Based on the input content, use a large language model to determine whether the question can be answered, and filter out the questions that the large language model believes cannot be answered in advance as the first type of questions that exceed the knowledge boundary;
[0031] Based on the input content, the output content is obtained through a large language model;
[0032] Construct a second discriminator: Based on the input content, use a large language model to judge whether the output content is reasonable, and filter out the problems that the large language model considers to be unreasonable as the second type of problems that exceed the knowledge boundary;
[0033] For the first type of questions that exceed the knowledge boundary and the second type of questions that exceed the knowledge boundary, a final response is given. For questions that are not determined to exceed the knowledge boundary, the output of the large language model is given as the final response.
[0034] Thirdly, the present invention also provides a system for enhancing the knowledge boundary awareness capability of large language models, comprising:
[0035] The user interaction module is used to interact with users and obtain their questions;
[0036] The external knowledge import module is used to retrieve external knowledge related to the question, and then combine it with the question to form the input content.
[0037] The first discriminator module is used to determine whether a question can be answered based on the input content using a large language model, and to filter out questions that the large language model considers unanswerable in advance as the first type of questions that exceed the knowledge boundary;
[0038] The large language model calling module uses the large language model to obtain the output content based on the input content.
[0039] The second discriminator module is used to determine whether the output content is reasonable based on the input content using a large language model, and to filter out the problems that the large language model considers to be unreasonable as the second type of problems that exceed the knowledge boundary;
[0040] The third discriminator module is used to determine whether the external knowledge retrieved by the external knowledge introduction module related to the output content is consistent with the external knowledge related to the problem, and filter out problems with inconsistent external knowledge as the third type of problems that exceed the knowledge boundary.
[0041] The user interaction module is also used to provide final responses for the first type of questions that exceed the knowledge boundary, the second type of questions that exceed the knowledge boundary, and the third type of questions that exceed the knowledge boundary, as well as to provide the output of the large language model as the final response for questions that are not determined to exceed the knowledge boundary.
[0042] Fourthly, the present invention also provides a system for enhancing the knowledge boundary awareness capability of large language models, comprising:
[0043] The user interaction module is used to interact with users and obtain their questions;
[0044] The first discriminator module is used to take the question as input, use a large language model to determine whether the question can be answered, and filter out questions that the large language model believes cannot be answered in advance as the first type of questions that exceed the knowledge boundary.
[0045] The large language model calling module uses the large language model to obtain the output content based on the input content.
[0046] The second discriminator module is used to determine whether the output content is reasonable based on the input content using a large language model, and to filter out the problems that the large language model considers to be unreasonable as the second type of problems that exceed the knowledge boundary;
[0047] The user interaction module is also used to provide final responses for the first type of questions that exceed the knowledge boundary and the second type of questions that exceed the knowledge boundary, as well as to provide the output of the large language model as the final response for questions that are not determined to exceed the knowledge boundary.
[0048] Fifthly, the present invention also provides an electronic device, the electronic device comprising:
[0049] One or more processors;
[0050] Storage device for storing one or more programs;
[0051] When the one or more programs are executed by the one or more processors, the one or more processors implement the method for enhancing the knowledge boundary awareness capability of large language models as described in the first or second aspect.
[0052] In a sixth aspect, the present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method for enhancing the knowledge boundary awareness capability of large language models as described in the first or second aspect.
[0053] The beneficial effects of this invention are: the method for enhancing the knowledge boundary perception ability of large language models provided by this invention can enhance the knowledge boundary perception ability of large language models; it can assist large language models in judging the authenticity and accuracy of output content; it can alleviate the "illusion" problem of text generation in large language models, making the output content more realistic and credible. For any large language model, regardless of whether external knowledge is introduced, it can enhance the large language model's perception ability of its knowledge boundaries, thereby avoiding the output of content outside the knowledge boundaries, alleviating the "illusion" problem of text generation, and improving the quality of generated content. Attached Figure Description
[0054] Figure 1 This is a flowchart of the method for enhancing the knowledge boundary awareness capability of a large language model as disclosed in Embodiment 1 of the present invention;
[0055] Figure 2 This is a flowchart of the method for enhancing the knowledge boundary awareness capability of a large language model as disclosed in Embodiment 2 of the present invention;
[0056] Figure 3 This is a structural block diagram of the system for enhancing the knowledge boundary awareness capability of a large language model, as disclosed in Embodiment 3 of the present invention.
[0057] Figure 4 This is a structural block diagram of the system for enhancing the knowledge boundary awareness capability of large language models disclosed in Embodiment 4 of the present invention;
[0058] Figure 5This is a schematic diagram of the structure of the electronic device disclosed in Embodiment 5 of the present invention. Detailed Implementation
[0059] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.
[0060] It should be understood that, when used in this specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.
[0061] It should also be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the scope of the application. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.
[0062] As used in this specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrases "if determined" or "if [described condition or event] is detected" may be interpreted, depending on the context, as "once determined," "in response to determination," "once [described condition or event] is detected," or "in response to detection of [described condition or event]."
[0063] Example 1:
[0064] This embodiment discloses a method for enhancing the knowledge boundary awareness capability of large language models, including:
[0065] S11: Obtaining user information.
[0066] Optionally, user questions can be obtained directly from the text dialog box, or through voice-to-text conversion; converting user questions to text facilitates subsequent processing.
[0067] S12: Using a retrieval tool, retrieve external knowledge based on the question, obtain external knowledge related to the question, and combine it with the question to form the input content.
[0068] S121: Using a retrieval tool, retrieve knowledge related to the user's question from external knowledge.
[0069] Optionally, the retrieval system may employ the M3E model; external knowledge relevant to the question may be used to score the K highest-scoring knowledge items for the retrieval model; optionally, K may be 3.
[0070] S122: Combine the retrieved external knowledge with the user's question as input; the combination method can be concatenation.
[0071] S13: Construct the first discriminator: Based on the input content, use a large language model to determine whether the question can be answered, and filter out the questions that the large language model believes cannot be answered in advance as the first type of questions that exceed the knowledge boundary.
[0072] S31: By designing prompts, based on external knowledge in the input content, a large language model is used to determine whether the question can be answered.
[0073] Optionally, the prompt can be "Are you sure you can answer the above question?".
[0074] S1321: If the large language model gives a positive response, continue the process.
[0075] S1322: The large language model provides a negative response, which serves as the first type of question input S171 that exceeds the knowledge boundary.
[0076] S14: Based on the input content, the output content is obtained through a large language model.
[0077] S141: By designing prompt words, the large language model can obtain the output content based on the input content.
[0078] Optionally, the prompt can be "Answer the question based on the above information".
[0079] S142: Obtain the output content.
[0080] S15: Construct a second discriminator: Based on the input content, use a large language model to determine whether the output content is reasonable, and filter out the problems that the large language model considers to be unreasonable as the second type of problems that exceed the knowledge boundary.
[0081] S151: Determine if the output content is correct.
[0082] S1511: By designing prompt words, based on the input content, a large language model is used to determine whether the output content is correct.
[0083] Optionally, the prompt word is "Based on the above input, is this answer correct?".
[0084] S1512: If the large language model gives a positive response, continue the process.
[0085] S1513: The large language model provides a negative response, which serves as the input for the second type of question that exceeds the knowledge boundary, S171.
[0086] S1521 uses prompt words to determine whether the output content can be derived based on the input content, and employs a large language model.
[0087] Optionally, the prompt could be "Based on the above input, can this conclusion be drawn?"
[0088] S1522: If the large language model gives a positive response, continue the process.
[0089] S1523: The large language model provides a negative response, which serves as the input for the second type of question that exceeds the knowledge boundary, S171.
[0090] S16: Construct a third discriminator: Based on the external knowledge retrieved by the retrieval machine that is related to the output content, determine whether it is consistent with the external knowledge related to the question, and filter out questions with inconsistent external knowledge as the third type of questions that exceed the knowledge boundary.
[0091] S161: Construct a third discriminator: Based on the external knowledge retrieved by the retrieval machine that is related to the output content, determine whether it is consistent with the external knowledge related to the question.
[0092] Optionally, the retrieval system can adopt the M3E model; the relevant knowledge can be the K knowledge items that score the highest in the retrieval model; optionally, K can be 3.
[0093] Alternatively, "consistent" means exactly the same.
[0094] For example, a user asks, "What are the key features and selling points of the Changhong 86Q9K MAX?". The retrieved knowledge includes the key features and selling points of the Changhong 86Q9K MAX, while the answer is, "The Changhong 8609K MAX is a 55-inch 4K ultra-high-definition smart TV with the following key features and selling points:...". Based on the output, the retrieved knowledge includes screen size and key features. In reality, the Changhong 8609K MAX is an 86-inch TV, demonstrating that the large language model fabricated some information. A third discriminator can filter out these types of questions.
[0095] S162: Determine whether the external knowledge related to the question and the external knowledge related to the output content are consistent, and filter out questions where the knowledge retrieved in the two searches is inconsistent.
[0096] S1621: If the external knowledge retrieved based on the output content is consistent with the external knowledge retrieved based on the input question, continue the process.
[0097] S1622: If inconsistent, input S171 as a third type of problem that exceeds the knowledge boundary.
[0098] S17: Provide final responses for the first type of questions that exceed the knowledge boundary, the second type of questions that exceed the knowledge boundary, and the third type of questions that exceed the knowledge boundary, and provide the output of the large language model as the final response for questions that are not determined to exceed the knowledge boundary.
[0099] S171: Provide the corresponding final response text for questions that exceed the boundaries of knowledge.
[0100] S1711: For the first type of question that exceeds the knowledge boundary, design a message to inform the user that the model cannot answer the question.
[0101] Alternatively, the response could be, "I lack the knowledge and intelligence to answer this question."
[0102] S1712: For the second type of question that exceeds the knowledge boundary, inform the user that the model is unsure whether the answer is correct, and provide the reason.
[0103] S1713: For the third type of problem that exceeds the knowledge boundary, inform the user that the model may contain fabricated information, or add the inconsistent external knowledge duplication process in S16 in S12.
[0104] S172: For questions that have not been determined to exceed the knowledge boundary, provide the output of the large language model as the final response text.
[0105] The method for enhancing the knowledge boundary perception capability of large language models provided in this embodiment can improve the knowledge boundary perception capability of large language models; assist large language models in judging the authenticity and accuracy of output content; and alleviate the "illusion" problem of text generation in large language models, making the output content more realistic and credible. For any large language model, by introducing external knowledge, the perception capability of the large language model of its knowledge boundary can be enhanced, thereby avoiding the output of content outside the knowledge boundary, alleviating the "illusion" problem of text generation, and improving the quality of generated content.
[0106] Example 2:
[0107] See Figure 2 This embodiment discloses a method for enhancing the knowledge boundary perception capability of a large language model. The difference between this embodiment and embodiment 1 is that the method in this embodiment is applicable to situations where there is no external knowledge. Therefore, this embodiment directly uses the problem as input content and does not have the step of constructing a third discriminator in S6 of embodiment 1. Apart from this, this embodiment is the same as embodiment 1.
[0108] Specifically, the method includes:
[0109] S21: Obtain the user's question and use the question as input.
[0110] S22: Construct the first discriminator: Based on the input content, use a large language model to determine whether the question can be answered, and filter out questions that the large language model believes cannot be answered in advance as the first type of questions that exceed the knowledge boundary.
[0111] S23: Based on the input content, the output content is obtained through a large language model.
[0112] S24: Construct a second discriminator: Based on the input content, use a large language model to determine whether the output content is reasonable, and filter out the problems that the large language model considers to be unreasonable as the second type of problems that exceed the knowledge boundary.
[0113] S25: Provide final responses for the first type of questions that exceed the knowledge boundary and the second type of questions that exceed the knowledge boundary, and provide the output of the large language model as the final response for questions that are not determined to exceed the knowledge boundary.
[0114] The method for enhancing the knowledge boundary perception capability of large language models provided in this embodiment can enhance the perception capability of large language models of their knowledge boundaries without introducing external knowledge, thereby avoiding the output of content outside the knowledge boundaries, alleviating the "illusion" problem of text generation, and improving the quality of generated content.
[0115] Example 3:
[0116] See Figure 3 This embodiment provides a system for enhancing the knowledge boundary awareness capability of large language models, including:
[0117] User interaction module 31 is used to interact with users and obtain user questions.
[0118] Specifically, in the user interaction module 31, interaction with the user can be carried out through various methods or media, such as television, digital human shopping guides, etc.; optionally, the information interacted with the user can be converted into text for processing.
[0119] The external knowledge introduction module 32 is used to retrieve external knowledge related to the question, and then combine it with the question to form the input content.
[0120] Specifically, the external knowledge introduction module 32 includes at least:
[0121] External knowledge: Select or collect external knowledge relevant to the application scenario;
[0122] Retrieval tool: Retrieves relevant content from external knowledge based on text and returns it.
[0123] The first discriminator module 33 is used to determine whether a question can be answered based on the input content using a large language model, and to filter out questions that the large language model considers unanswerable in advance as the first type of questions that exceed the knowledge boundary.
[0124] Specifically, the first discriminator module 33 is used to determine whether the content of the response input exceeds the knowledge boundary before inputting into the large language model.
[0125] The large language model calls module 34, which uses the large language model to obtain the output content based on the input content.
[0126] Specifically, in the large language model invocation module 34, various tasks are completed by invoking the large language model through specific prompt words.
[0127] The second discriminator module 35 is used to determine whether the output content is reasonable based on the input content using a large language model, and to filter out problems that the large language model considers to be unreasonable as the second type of problems that exceed the knowledge boundary.
[0128] Specifically, the second discriminator module 35 includes at least: determining whether the output content is correct and determining whether the output content can be inferred. The second discriminator module 35 is used to determine whether the output content is reasonable after the large language model outputs.
[0129] The third discriminator module 36 is used to determine whether the external knowledge retrieved by the external knowledge introduction module related to the output content is consistent with the external knowledge related to the problem, and filter out problems with inconsistent external knowledge as the third type of problems that exceed the knowledge boundary.
[0130] Specifically, the third discriminator module 36 is used to determine whether the external knowledge of the input content and the output content is consistent.
[0131] The user interaction module 31 is also used to provide final responses for the first type of questions that exceed the knowledge boundary, the second type of questions that exceed the knowledge boundary, and the third type of questions that exceed the knowledge boundary, and to provide the output content of the large language model as the final response for questions that are not determined to exceed the knowledge boundary.
[0132] Example 4:
[0133] See Figure 4 This embodiment provides a system for enhancing the knowledge boundary awareness capability of large language models, including:
[0134] User interaction module 41 is used to interact with users and obtain user questions.
[0135] The first discriminator module 42 is used to take the question as input, use a large language model to determine whether the question can be answered, and filter out questions that the large language model considers unanswerable in advance as the first type of questions that exceed the knowledge boundary.
[0136] The large language model calls module 43, which uses the large language model to obtain the output content based on the input content.
[0137] The second discriminator module 44 is used to determine whether the output content is reasonable based on the input content using a large language model, and to filter out problems that the large language model considers to be unreasonable as the second type of problems that exceed the knowledge boundary.
[0138] The user interaction module 41 is also used to provide final responses for the first type of questions that exceed the knowledge boundary and the second type of questions that exceed the knowledge boundary, and to provide the output content of the large language model as the final response for questions that are not determined to exceed the knowledge boundary.
[0139] Example 5:
[0140] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Figure 5 A block diagram is shown of an exemplary electronic device 50 suitable for implementing embodiments of the present invention. Figure 5 The electronic device 50 shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of the present invention.
[0141] like Figure 5 As shown, the electronic device 50 is represented in the form of a general-purpose computing device. The components of the electronic device 50 may include, but are not limited to: one or more processors or processing units 501, system memory 502, and bus 503 connecting different system components (including system memory 502 and processing unit 501).
[0142] Bus 503 represents one or more of several bus architectures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of the various bus architectures. Examples of these architectures include, but are not limited to, the Industry Standard Architecture (ISA) bus, the Micro Channel Architecture (MAC) bus, the Enhanced ISA bus, the Video Electronics Standards Association (VESA) local bus, and the Peripheral Component Interconnect (PCI) bus.
[0143] Electronic device 50 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by electronic device 50, including volatile and non-volatile media, removable and non-removable media.
[0144] System memory 502 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 504 and / or cache memory 505. Electronic device 50 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 506 may be used to read and write non-removable, non-volatile magnetic media (… Figure 5 Not shown; usually referred to as a "hard drive"). Although Figure 5 Not shown, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk") and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 503 via one or more data media interfaces. Memory 502 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of the embodiments of the present invention.
[0145] A program / utility 508 having a set (at least one) of program modules 507 may be stored, for example, in memory 502. Such program modules 507 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. Program modules 507 typically perform the functions and / or methods described in the embodiments of the present invention.
[0146] Electronic device 50 can also communicate with one or more external devices 509 (e.g., keyboard, pointing device, display 510, etc.), and with one or more devices that enable a user to interact with the electronic device 50, and / or with any device that enables the electronic device 50 to communicate with one or more other computing devices (e.g., network card, modem, etc.). This communication can be performed via input / output (I / O) interface 511. Furthermore, electronic device 50 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 512. As shown, network adapter 512 communicates with other modules of electronic device 50 via bus 503. It should be understood that, although... Figure 5 As not shown, other hardware and / or software modules may be used in conjunction with electronic device 50, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0147] The processing unit 501 executes various functional applications and data processing by running programs stored in the system memory 502, such as implementing the method for enhancing the knowledge boundary awareness capability of a large language model provided in Embodiment 1 or Embodiment 2 of the present invention.
[0148] Example 6:
[0149] This embodiment provides a storage medium containing computer-executable instructions, which, when executed by a computer processor, are used to perform the method for enhancing the knowledge boundary awareness capability of large language models as described in Embodiment 1 or Embodiment 2.
[0150] The computer storage medium of this invention can be any combination of one or more computer-readable media. A computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0151] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, capable of sending, propagating, or transmitting programs for use by or in connection with an instruction execution system, apparatus, or device.
[0152] Program code contained on a computer-readable medium may be transmitted using any suitable medium, including—but not limited to—wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.
[0153] Computer program code for performing the operations of embodiments of the present invention can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Python, Java, Smalltalk, and C++, and conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0154] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for enhancing knowledge boundary awareness capability of a large language model, characterized in that, include: Obtaining user questions; The retrieval tool retrieves external knowledge based on the question, obtains external knowledge related to the question, and concatenates it with the question to form the input content. Construct the first discriminator: Based on the input content, use a large language model to determine whether the question can be answered, and filter out the questions that the large language model believes cannot be answered in advance as the first type of questions that exceed the knowledge boundary; Based on the input content, the output content is obtained through a large language model; Construct a second discriminator: Based on the input content, use a large language model to judge whether the output content is reasonable, and filter out the problems that the large language model considers to be unreasonable as the second type of problems that exceed the knowledge boundary; Construct a third discriminator: Based on the external knowledge retrieved by the retrieval machine that is related to the output content, determine whether it is consistent with the external knowledge related to the question, and filter out questions with inconsistent external knowledge as the third type of questions that exceed the knowledge boundary; For the first type of questions that exceed the knowledge boundary, the second type of questions that exceed the knowledge boundary, and the third type of questions that exceed the knowledge boundary, a final response is given. For questions that are not determined to exceed the knowledge boundary, the output of the large language model is given as the final response.
2. The method of Claim 1, wherein, The process of obtaining output content based on input content using a large language model includes: constructing prompt words so that the large language model can obtain output content based on the input content.
3. The method of Claim 1, wherein, The construction of the second discriminator involves using a large language model to determine the reasonableness of the output content based on the input content, and filtering out issues that the large language model deems the output content unreasonable as the second category of issues exceeding the knowledge boundary, including: Based on the input content, a large language model is used to determine whether the output content is correct, and the problems that the large language model considers to have errors in the output content are filtered out as the second type of problems that exceed the knowledge boundary. Based on the input content, a large language model is used to determine whether the output content can be deduced. Problems that the large language model believes cannot be deduced are also classified as the second type of problems that exceed the knowledge boundary.
4. The method of Claim 1, wherein, The construction of the third discriminator involves determining whether the external knowledge retrieved by the retrieval machine that is related to the output content is consistent with the external knowledge related to the question, and filtering out questions with inconsistent external knowledge as a third category of questions that exceed the knowledge boundary, including: The search engine retrieves knowledge related to the output content from external sources. Determine whether the external knowledge related to the question and the external knowledge related to the output content are consistent, filter out questions where the knowledge retrieved in the two searches is inconsistent, and classify them as a third type of question that exceeds the knowledge boundary.
5. The method of Claim 1, wherein, The final responses provided for the first type of questions exceeding knowledge boundaries, the second type of questions exceeding knowledge boundaries, and the third type of questions exceeding knowledge boundaries include: For the first type of question that exceeds the knowledge boundary, inform the user that the large language model cannot answer the question; For the second type of question that exceeds the knowledge boundary, inform the user that the large language model is unsure whether the answer is correct, and provide the reason; For the third type of problem that exceeds the knowledge boundary, inform the user that the large language model may contain fabricated information, or that the retrieval process may involve inconsistent external knowledge that is repeatedly judged by a third discriminator.
6. A system for enhancing knowledge boundary awareness capability of a large language model, characterized by, include: The user interaction module is used to interact with users and obtain their questions; The external knowledge import module is used to retrieve external knowledge related to the question, and then combine it with the question to form the input content. The first discriminator module is used to determine whether a question can be answered based on the input content using a large language model, and to filter out questions that the large language model considers unanswerable in advance as the first type of questions that exceed the knowledge boundary; The large language model calling module uses the large language model to obtain the output content based on the input content. The second discriminator module is used to determine whether the output content is reasonable based on the input content using a large language model, and to filter out the problems that the large language model considers to be unreasonable as the second type of problems that exceed the knowledge boundary; The third discriminator module is used to determine whether the external knowledge retrieved by the external knowledge introduction module related to the output content is consistent with the external knowledge related to the problem, and filter out problems with inconsistent external knowledge as the third type of problems that exceed the knowledge boundary. The user interaction module is also used to provide final responses for the first type of questions that exceed the knowledge boundary, the second type of questions that exceed the knowledge boundary, and the third type of questions that exceed the knowledge boundary, as well as to provide the output of the large language model as the final response for questions that are not determined to exceed the knowledge boundary.
7. An electronic device, comprising: The electronic device includes: One or more processors; Storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the method for enhancing the knowledge boundary awareness capability of large language models as described in any one of claims 1-5.
8. A computer-readable storage medium having stored thereon a computer program, characterized in that, When executed by the processor, the program implements the method for enhancing the knowledge boundary awareness capability of large language models as described in any one of claims 1-5.
Citation Information
Patent Citations
Knowledge question and answer method, device and equipment and storage medium
CN116561278A
Knowledge question-answering system and method combining large model and external knowledge, and storage medium
CN116719917A
Large model knowledge updating method and device based on knowledge graph
CN116932776A
Knowledge base retrieval method and device based on large language model self-evaluation and self-feedback
CN116932717A
Dialogue generation method and system based on large model and knowledge graph, and medium
CN117235215A
