Sentence generation device, information processing system, sentence generation method, and program
The sentence generation device analyzes and processes generated sentences to ensure relevance to the underlying information, addressing the issue of hallucinations in LLMs by outputting only relevant information and marking or deleting irrelevant parts.
Patent Information
- Application Number
- JP2024198810
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-03-06
- Filing Date
- 2024-11-14
- Publication Date
- 2025-09-19
AI Technical Summary
Generative AI systems, such as large language models (LLMs), often produce hallucinations, leading to the output of false information that can damage a company's credibility, necessitating a method to determine the relevance between generated sentences and the underlying information.
A sentence generation device with a search unit, generation unit, determination unit, processing unit, and output unit to analyze the relationship between generated sentences and related information, processing and outputting only relevant information while marking or deleting irrelevant parts.
Ensures the relevance of generated sentences to the underlying information is determined, reducing the likelihood of false information being presented, thereby enhancing the credibility of the output.
Smart Images

Figure 2025137370000001_ABST
Abstract
Description
[Technical Field]
[0001] The present invention relates to a sentence generation device, an information processing system, a sentence generation method, and a program. [Background technology]
[0002] Technologies that automatically generate follow-up sentences and responses based on user input have been developed and are already known. For example, generative AI based on large language models (LLMs), such as ChatGPT, is becoming increasingly popular. Summary of the Invention [Problem to be solved by the invention]
[0003] One of the problems with generative AI is hallucination, a phenomenon in which false information is output in a plausible manner. Hallucination can develop into a serious problem when using LLM in companies and businesses, and in some cases, it carries the risk of damaging the company's credibility. Therefore, there is a challenge in understanding the relationship between sentences generated based on information and the information in question.
[0004] The present invention has been made in consideration of the above points, and aims to determine the relevance between a sentence generated based on information and the information, and to output based on the determination result. [Means for solving the problem]
[0005] In order to solve the above problem, the sentence generation device has a search unit that searches for related information for an input character string, a generation unit that generates a sequence of sentences based on the character string and the related information, a determination unit that determines the relationship between the sequence of sentences and the related information, a processing unit that processes a sequence of output sentences including the sequence of sentences based on the result of the determination, and an output unit that outputs the processed sequence of output sentences. [Effects of the Invention]
[0006] The relevance between the sentence generated based on the information and the information can be determined, and output based on the determination result. [Brief explanation of the drawings]
[0007] [Figure 1] 1 is a diagram illustrating an example of a configuration of an information processing system according to an embodiment of the present invention. [Figure 2] 1 is a diagram illustrating an example of a hardware configuration of a sentence generation device 10 according to an embodiment of the present invention. [Figure 3] 1 is a diagram illustrating an example of a functional configuration of an information processing system according to an embodiment of the present invention. [Figure 4] 10 is a flowchart illustrating an example of a processing procedure executed by the sentence generation device 10. [Figure 5] FIG. 10 is a diagram showing a first display example of a processed output sentence sequence. [Figure 6] FIG. 10 is a diagram showing a second display example of a processed output sentence sequence. [Figure 7] FIG. 10 is a diagram showing a third display example of a processed output sentence sequence. [Figure 8] FIG. 10 is a diagram showing a fourth display example of a processed output sentence sequence. [Figure 9] FIG. 10 is a diagram showing a fifth display example of a processed output sentence sequence. [Figure 10] FIG. 10 is a diagram showing a sixth display example of a processed output sentence sequence. DETAILED DESCRIPTION OF THE INVENTION
[0008] Hereinafter, an embodiment of the present invention will be described with reference to the drawings. Fig. 1 is a diagram showing an example of the configuration of an information processing system according to an embodiment of the present invention. In Fig. 1, the information processing system includes a terminal 20, a sentence generation device 10, an information source 30, etc. These are connected via a network such as a LAN (Local Area Network) or the Internet.
[0009] The terminal 20 is a terminal used by a user. For example, the terminal 20 may be a personal computer (PC), a smartphone, a tablet terminal, or the like.
[0010] The sentence generation device 10 is one or more computers that generate sentences in response to sentences input by a user at a terminal 20 .
[0011] The information source 30 is one or more computers that store various types of information. For example, the information source 30 may be a group of computers that store information to be searched on the Internet.
[0012] The sentence generation device 10 may be included in the terminal 20. In other words, the terminal 20 may also function as the sentence generation device 10.
[0013] Fig. 2 is a diagram showing an example of the hardware configuration of a sentence generation device 10 according to an embodiment of the present invention. The sentence generation device 10 in Fig. 2 includes a drive device 100, an auxiliary storage device 102, a memory device 103, a processor 104, and an interface device 105, which are all interconnected by a bus B.
[0014] The program that realizes the processing in the sentence generation device 10 is provided by a recording medium 101 such as a CD-ROM. When the recording medium 101 storing the program is set in the drive device 100, the program is installed from the recording medium 101 to the auxiliary storage device 102 via the drive device 100. However, the program does not necessarily have to be installed from the recording medium 101, but may be downloaded from another computer via a network. The auxiliary storage device 102 stores the installed program as well as necessary files, data, etc.
[0015] When an instruction to start a program is received, the memory device 103 reads and stores the program from the auxiliary storage device 102. The processor 104 is a CPU or a GPU (Graphics Processing Unit), or a CPU and a GPU, and executes functions related to the sentence generation device 10 in accordance with the program stored in the memory device 103. The interface device 105 is used as an interface for connecting to a network.
[0016] The terminal 20 may also have hardware such as that shown in FIG.
[0017] Fig. 3 is a diagram showing an example of the functional configuration of an information processing system according to an embodiment of the present invention. In Fig. 3, terminal 20 has input unit 21 and display control unit 22. These units are realized by processing in which one or more programs installed in terminal 20 are executed by a processor of terminal 20.
[0018] The sentence generation device 10 has a reception unit 11, a search unit 12, a generation unit 13, a determination unit 14, a processing unit 15, and an output unit 16. Each of these units is realized by a process executed by a processor 104 of one or more programs installed in the sentence generation device 10.
[0019] The input unit 21 of the terminal 20 accepts input of a character string from which a sentence will be generated from a user. The character string may be, for example, a natural sentence written in a natural language, or may be a single word. Hereinafter, the character string will be referred to as a "question sentence." The input unit 21 transmits the input question sentence to the sentence generation device 10.
[0020] The display control unit 22 displays a sequence of sentences generated based on the question sentence by the sentence generation device 10. A sequence of sentences refers to an ordered set of one or more sentences.
[0021] The reception unit 11 receives a question sent from the terminal 20 and searches for information related to the question from the information source 30. Information related to the question refers to information related to the question. The search for information related to the question may be performed using a known search technique with the question as a query. The related information may be the information source of the sentence to be generated.
[0022] The generation unit 13 generates a sequence of sentences based on the question sentence and related information using a large-scale language model (LLM), which is a pre-trained machine learning model. Hereinafter, the large-scale language model will be simply referred to as an LLM. The sequence of sentences generated by the generation unit 13 will be referred to as a generated sentence sequence or a sequence of generated sentences.
[0023] The determination unit 14 determines the relationship between the generated sentence sequence and the related information for each predetermined unit (hereinafter referred to as a "verification unit") constituting the generated sentence sequence generated by the generation unit 13. The verification unit is, for example, a sentence or a phrase. Alternatively, a set of two or more sentences may be the predetermined unit. The relationship between the generated sentence sequence and the related information refers to the semantic closeness between the generated sentence sequence and the related information. The relationship between the generated sentence sequence and the related information may be the presence or absence of an entailment relationship, or the degree of word agreement or similarity. Hereinafter, the determination of the relationship between the generated sentence sequence and the related information may be referred to as a determination of whether or not the relationship is based on the related information. A determination that there is a (strong) relationship between a predetermined unit constituting the generated sentence sequence and the related information is a determination result in cases such as there is an entailment relationship between the two, the degree of word agreement between the two is equal to or greater than a threshold, or the similarity between the two is equal to or greater than a threshold. Hereinafter, the determination that there is a (strong) relationship between a predetermined unit constituting the generated sentence sequence and the related information may be referred to as being based on the related information. The determination result that there is no (weak) relationship between the predetermined unit constituting the generated sentence sequence and the related information is the determination result in cases where there is no entailment relationship between the two, the degree of word matching between the two is equal to or smaller than a threshold, the degree of similarity between the two is equal to or smaller than a threshold, etc. Hereinafter, the determination result that there is no (weak) relationship between the predetermined unit constituting the generated sentence sequence and the related information may be referred to as not being based on related information.
[0024] The processing unit 15 processes the output sentence sequence including the sentence sequence generated by the generation unit 13 based on the result of the judgment by the judgment unit 14. For example, the processing unit 15 deletes from the sentence sequence a predetermined unit that is judged not to be based on related information. Alternatively, the processing unit 15 makes the aspect of the part of the sentence sequence that corresponds to the predetermined unit that is judged not to be based on related information different from the other parts. The output sentence sequence is a sentence sequence that is output to the terminal 20. The output sentence sequence may be only a sentence sequence generated by the generation unit 13 (generated sentence sequence), or may include related information. The output sentence sequence is also called the output sentence sequence.
[0025] The output unit 16 outputs (transmits) an output sentence sequence including the sequence of sentences generated by the generation unit 13 to the terminal 20. When processing is performed by the processing unit 15, the output unit 16 outputs the processed output sentence sequence.
[0026] The following describes the processing procedure executed by the sentence generation device 10. Fig. 4 is a flowchart for explaining an example of the processing procedure executed by the sentence generation device 10.
[0027] In step S101, the receiving unit 11 receives from the input unit 21 of the terminal 20 a question sentence that the input unit 21 has received from the user.
[0028] Next, the search unit 12 searches (obtains) information related to the question sentence from the information source 30 using the question sentence as a query (S102). Note that the related information may be part of the information obtained as the search results that has a high search score.
[0029] Next, the generation unit 13 generates a sequence of sentences (hereinafter referred to as a "generated sentence sequence") based on the question sentence and related information (S103). For example, the generation unit 13 generates a prompt based on the question sentence and related information, and inputs the prompt to the LLM. The generation unit 13 acquires a sequence of sentences output from the LLM in response to the input of the prompt. Note that the content of the prompt may be, for example, natural language that indicates that an answer to the question sentence is to be generated using related information.
[0030] Next, the determination unit 14 determines whether each verification unit (e.g., each sentence) of the generated sentence sequence is based on related information (S104). For example, entailment recognition (https: / / www.nogawanogawa.com / entry / rte) may be used for this determination. Specifically, the determination unit 14 performs entailment recognition for each verification unit between each unit in the related information that corresponds to the verification unit (hereinafter referred to as a "corresponding unit"), and determines that a verification unit having a corresponding unit with an entailment relationship is based on related information, while determining that a verification unit not having such an entailment relationship is not based on related information. Alternatively, the determination unit 14 calculates the word agreement between each corresponding unit for each verification unit, and determines that a verification unit having a corresponding unit with an agreement degree equal to or greater than a threshold is based on related information, while determining that a verification unit not having such an agreement is not based on related information. Alternatively, the determination unit 14 calculates, for each verification unit, a similarity (e.g., cosine similarity) between the embedding vector of the verification unit and the embedding vector of each corresponding unit, and determines that a verification unit having a corresponding unit with a similarity equal to or greater than a threshold is based on related information, and determines that a verification unit having such a similarity is not based on related information. This determination may be made using other known techniques. Furthermore, this determination may be made using the LLM used by the generation unit 13 to generate a sentence sequence.
[0031] Next, the processing unit 15 determines whether or not there are any verification units determined not to be based on related information in the determination result by the determination unit 14 (S105). If there are no verification units determined not to be based on related information (No in S105), the process proceeds to step S107. If there are verification units determined not to be based on related information (No in S105), the processing unit 15 performs a predetermined processing on the portion of the output sentence sequence including the generated sentence sequence that corresponds to the verification unit determined not to be based on related information (S106). For example, the processing unit 15 deletes the corresponding portion from the output sentence sequence. Alternatively, the processing unit 15 changes the appearance of the corresponding portion in the output sentence sequence from the other portions. The appearance may be, for example, the shape of the characters (such as font), or the presence or absence of a modification for emphasis, such as underlining or a change in background color. The processing unit 15 may process the output sentence sequence either on the generated sentence sequence or on the related information. A predetermined process may be performed on a portion of the generated sentence sequence corresponding to a verification unit determined not to be based on related information, or a predetermined process may be performed on a portion corresponding to a verification unit determined to be based on related information. Also, a predetermined process may be performed on a portion corresponding to a corresponding unit of related information that contributed to the determination of a verification unit determined to be based on related information.
[0032] Next, the output unit 16 outputs the output sentence sequence (S108). At this time, if step S106 has been executed, the processed output sentence sequence is output. "Output" refers to transmission to the terminal 20. Upon receiving the output sentence sequence, the display control unit 22 of the terminal 20 displays the output sentence sequence. As a result, the user obtains an answer to the question sentence. At this time, a predetermined process is performed on the parts of the answer sentence (output sentence sequence) that are not based on related information (i.e., parts that are likely to be hallucinations). Therefore, if the predetermined process is deletion, it is possible to avoid presenting information that is likely to be hallucinations to the user, thereby increasing the reliability of the output sentence sequence. It is also possible to notify the user of the deleted portions so that the user knows that they have been deleted. For example, it is possible to add a deletion marker (e.g., a character string such as "[]" or a string such as "This part has been deleted") to the deleted portions in the generated sentence sequence, or to generate a report of the deleted portions or deleted sentences separately from the output sentence sequence and report them to the user. A character sequence displayed as a report separately from the output sentence sequence is called a "deleted character sequence." The deleted character sequence may be generated and output as the "deleted location (line number, etc.)" and "deleted character string" at the end of the answer sentence, or may be notified in a separate document. If the specified processing is a change in appearance (processing that makes the appearance of the relevant part in the output sentence sequence different from the other parts), the user can be notified that the information is likely to be hallucination, which reduces the workload of the user's confirmation work. For example, when the question "Please tell me some trivia about hotcakes" is input, and the related information "Hotcakes are commonly called pancakes in English origins. January 25th is registered as Hotcake Day by confectionery companies" is searched for, and the generation unit 13 generates the generated sentence sequence "In Japan, they are called hotcakes, but overseas they are often called pancakes. February 14th is Hotcake Day.", an example of the output sentence displayed on the terminal 20 is shown below. Here, in the generated sentence sequence, "In Japan, they are called hotcakes, but overseas they are often called pancakes." is a part that is determined to be based on related information, with the related information "Hotcakes are commonly called pancakes in English origins" as the corresponding unit. Therefore, in the generated sentence sequence, "February 14th is Hotcake Day." is a part that is determined not to be based on related information. FIG. 5 is a diagram showing a first display example of a processed output sentence sequence. The output sentence sequence display screen 510 shown in FIG. 5 includes a question sentence q1, a generated sentence sequence g1, and an output sentence sequence o1. The generated sentence sequence g1 constitutes the output sentence sequence o1. FIG. 5 shows an example in which "2 / 14 is Pancake Day," which was determined not to be based on related information in the generated sentence sequence, has been processed in bold. FIG. 6 is a diagram showing a second display example of a processed output sentence sequence. In FIG. 6, the same or corresponding parts as in FIG. 5 are given the same reference numerals, and their explanation will be omitted as appropriate. FIG. 6 shows an example in which processing has been performed to underline "In Japan, it's called hotcake, but overseas it's often called pancake.", which was determined to be based on related information in the generated sentence sequence g1. Note that the verification unit here is a sentence unit. FIG. 7 is a diagram showing a third display example of a processed output sentence sequence. In FIG. 7, the same parts as or corresponding parts to those in FIG. 5 are given the same reference numerals, and their explanations will be omitted where appropriate. FIG. 7 shows an example in which the sentence "2 / 14 is Pancake Day" is deleted from the generated sentence sequence g1, which was determined not to be based on related information, and the character string *This part has been deleted* is added to indicate that it has been deleted. FIG. 8 is a diagram showing a fourth display example of a processed output sentence sequence. In FIG. 8, parts that are the same as or correspond to those in FIG. 5 are given the same reference numerals, and their description will be omitted where appropriate. The output sentence sequence display screen 510 shown in FIG. 8 further includes a deleted character sequence d1 that generates deleted portions and sentences from the generated sentence sequence g1 and reports them to the user. The sentence "2 / 14 is Pancake Day" that was determined not to be based on related information in the generated sentence sequence g1 is deleted, and the deleted portion is displayed with the character string [1] to indicate that it has been deleted. The deleted character sequence d1 includes a character sequence "Deleted Sentence Report: [1] "2 / 14 is Pancake Day" was deleted because it was likely to contain an error" that generates deleted portions and sentences and reports them to the user. FIG. 9 is a diagram showing a fifth display example of a processed output sentence sequence. In FIG. 9, the same parts as or corresponding parts to those in FIG. 5 are given the same reference numerals, and their explanation will be omitted as appropriate. In FIG. 9, in addition to the generated sentence sequence g1, related information r1 constitutes the output sentence sequence o1. In the generated sentence sequence g1, "2 / 14 is 'Pancake Day'," which was determined not to be based on the related information r1, is highlighted. Figure 10 is a diagram showing a sixth display example of a processed output sentence sequence. In Figure 10, parts that are the same as or correspond to those in Figure 9 are given the same reference numerals, and their explanation will be omitted where appropriate. In Figure 10, the generated sentence sequence g1 is processed to underline "Hotcakes are commonly called pancakes in English-speaking countries," which is related information related to "In Japan, they are called hotcakes, but overseas they are often called pancakes.", which was determined based on related information r1.
[0033] As described above, according to this embodiment, it is possible to determine the relevance between a sentence generated based on information and the information, and to output based on the determination result.
[0034] The functions of the above-described embodiments can be realized by one or more processing circuits. Here, the term "processing circuit" in this specification includes a processor programmed to execute each function by software, such as a processor implemented by an electronic circuit, as well as devices such as an ASIC (Application Specific Integrated Circuit), a DSP (Digital Signal Processor), an FPGA (Field Programmable Gate Array), and conventional circuit modules designed to execute each of the above-described functions.
[0035] Additionally, the devices described in the example are merely representative of one of several computing environments for implementing the embodiments disclosed herein.
[0036] In one embodiment, sentence generation apparatus 10 includes multiple computing devices, such as a server cluster, configured to communicate with each other via any type of communication link, including a network, shared memory, etc., and to perform the processes disclosed herein.
[0037] Although the embodiments of the present invention have been described in detail above, the present invention is not limited to such specific embodiments, and various modifications and variations are possible within the scope of the gist of the present invention as described in the claims.
[0038] For example, aspects of the present invention are as follows. <1> a search unit that searches for information related to an input character string; a generation unit that generates a sequence of sentences based on the character string and the related information; a determination unit that determines a relationship between the sequence of sentences and the related information; a processing unit that processes a sequence of output sentences including the sequence of sentences based on a result of the determination; an output unit that outputs the sequence of processed output sentences; A sentence generation device comprising: <2> the determination is performed for each predetermined unit constituting the sequence of sentences, the processing unit deletes a portion corresponding to a predetermined unit from the sequence of sentences based on the result of the determination. Characterized by <1> The sentence generation device described. <3> the determination is performed for each predetermined unit constituting the sequence of sentences, the processing unit, based on the result of the determination, makes a part corresponding to a predetermined unit in the sequence of sentences different in appearance from other parts; Characterized by <1> The sentence generation device described. <4> the determination unit makes the determination based on entailment recognition; Characterized by <1> ~ <3> 10. The sentence generation device according to claim 1 . <5> The output unit notifies the user that there is a deleted portion. Characterized by <2> The sentence generation device described. <6> An information processing system including a terminal and a sentence generation device, The sentence generation device a search unit that searches for information related to a character string input to the terminal; a generation unit that generates a sequence of sentences based on the character string and the related information; a determination unit that determines a relationship between the sequence of sentences and the related information; a processing unit that processes a sequence of output sentences including the sequence of sentences based on a result of the determination; an output unit that outputs the processed sequence of output sentences to the terminal; An information processing system comprising: <7> A search procedure for searching for related information for an input character string; a generation step of generating a sequence of sentences based on the character string and the related information; a determination step of determining a relationship between the sequence of sentences and the related information; a processing procedure for processing a sequence of output sentences including the sequence of sentences based on the result of the determination; an output step for outputting the sequence of processed output sentences; A sentence generation method characterized by being executed by a computer. <8> A search procedure for searching for related information for an input character string; a generation step of generating a sequence of sentences based on the character string and the related information; a determination step of determining a relationship between the sequence of sentences and the related information; a processing procedure for processing a sequence of output sentences including the sequence of sentences based on the result of the determination; an output step for outputting the sequence of processed output sentences; A program characterized by causing a computer to execute the above. [Explanation of symbols]
[0039] 10 Sentence generator 11 Reception 12 Search section 13 Generation part 14 Judgment section 15 Processing Department 16 Output section 20 terminals 21 Input section 22 Display control unit 30 Sources of information 100 Drive device 101 Recording media 102 Auxiliary storage device 103 Memory Device 104 processors 105 Interface Device B Bus [Prior art documents] [Patent documents]
[0040] [Patent Document 1] Japanese Patent Application Publication No. 2023-125311
Claims
1. a search unit that searches for information related to an input character string; a generation unit that generates a sequence of sentences based on the character string and the related information; a determination unit that determines a relationship between the sequence of sentences and the related information; a processing unit that processes a sequence of output sentences including the sequence of sentences based on a result of the determination; an output unit that outputs the sequence of processed output sentences; A sentence generation device comprising:
2. the determination is performed for each predetermined unit constituting the sequence of sentences, the processing unit deletes a portion corresponding to a predetermined unit from the sequence of sentences based on the result of the determination.
2. The sentence generation device according to claim 1, wherein:
3. the determination is performed for each predetermined unit constituting the sequence of sentences, the processing unit, based on the result of the determination, makes a part corresponding to a predetermined unit in the sequence of sentences different in appearance from other parts; 2. The sentence generation device according to claim 1, wherein:
4. the determination unit makes the determination based on entailment recognition; 2. The sentence generation device according to claim 1, wherein:
5. The output unit notifies the user that there is a deleted portion.
3. The sentence generation device according to claim 2.
6. An information processing system including a terminal and a sentence generation device, The sentence generation device a search unit that searches for information related to a character string input to the terminal; a generation unit that generates a sequence of sentences based on the character string and the related information; a determination unit that determines a relationship between the sequence of sentences and the related information; a processing unit that processes a sequence of output sentences including the sequence of sentences based on a result of the determination; an output unit that outputs the processed sequence of output sentences to the terminal; An information processing system comprising:
7. A search procedure for searching for related information for an input character string; a generation step of generating a sequence of sentences based on the character string and the related information; a determination step of determining a relationship between the sequence of sentences and the related information; a processing procedure for processing a sequence of output sentences including the sequence of sentences based on the result of the determination; an output step for outputting the sequence of processed output sentences; A sentence generation method characterized by being executed by a computer.
8. A search procedure for searching for related information for an input character string; a generation step of generating a sequence of sentences based on the character string and the related information; a determination step of determining a relationship between the sequence of sentences and the related information; a processing procedure for processing a sequence of output sentences including the sequence of sentences based on the result of the determination; an output step for outputting the sequence of processed output sentences; A program characterized by causing a computer to execute the above.
Citation Information
Patent Citations
Language model learning device, interaction device, and trained language model
JP2023125311A