Quantification device, quantification method and quantification program

The quantification device integrates search quality indices to evaluate uncertainty in search expansion generation, enhancing the reliability of generative language models by quantifying response accuracy and detecting hallucinations.

JP2025161542APending Publication Date: 2025-10-24KDDI CORP
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
JP2024064828
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Filing Date
2024-04-12
Publication Date
2025-10-24

AI Technical Summary

Technical Problem

Conventional methods for quantifying uncertainty in generative language models do not account for search quality in search expansion generation, leading to unreliable evaluations in specialized applications.

Method used

A quantification device and method that incorporates a first index for uncertainty in generative language models and a second index for search quality, adjusting the influence of search quality on output uncertainty using a normalization function, allowing for a comprehensive evaluation of response uncertainty in search expansion generation.

Benefits of technology

Enables quantitative evaluation of response uncertainty, improving the reliability of systems using search expansion generation and generative language models by providing a reference for response accuracy and estimating hallucination.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2025161542000001_ABST
    Figure 2025161542000001_ABST
Patent Text Reader

Abstract

To provide a quantification device, a quantification method and a quantification program capable of quantitatively evaluating uncertainty of a response in a system using retrieval extension generation and a generation language model.SOLUTION: A quantification device 1 includes a first index calculation unit 11 for calculating a first index that shows uncertainty of an output generated to an input to a generation language model and does not consider retrieval quality in retrieval extension creation, a second index calculation unit 12 for calculating a second index showing the retrieval quality in the retrieval extension generation, an index adjustment unit 13 for normalizing the second index and adjusting it as an influence degree to an output of the retrieval quality, and an output unit 14 for multiplying the first index by an adjusted value and outputting it as a value obtained by quantifying the uncertainty of the output in the generation language model using the retrieval extension generation.SELECTED DRAWING: Figure 1
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

[0001] The present invention relates to a technique for quantifying the uncertainty of generated sentences in a search expansion generation task using a generative language model. [Background technology]

[0002] A generative language model is a model that outputs a sentence as a response to an input sentence called a prompt, and an example is the Generative Pre-trained Transformer (GPT) shown in Non-Patent Document 1. A generative language model internally processes the smallest unit of sentence called a token, and generates a response by predicting the token that immediately follows the prompt sentence. A generative language model that has learned a large number of sentences can output natural sentences as responses in dialogues and question-answering tasks, achieving high performance.

[0003] However, generative language models are known to have a phenomenon called "hallucination," in which they output untrue content in natural-sounding sentences, making it difficult to correctly evaluate the truth of the content based on the generated sentences alone. For this reason, a method for evaluating the validity of the output of generative language models is desired.

[0004] Semantic Uncertainty, as disclosed in Non-Patent Document 2, is one example of a method for quantifying the uncertainty of the output of a generative language model. In this method, an evaluator first generates N responses to one prompt and then obtains the likelihood of the response sentences together. The likelihood of a sentence can be calculated, for example, by taking the geometric mean of the entire sentence using the likelihood of the predicted tokens. Next, the evaluator classifies the response sentences into categories taking into account semantic differences. For example, in response to the prompt "What is the capital of France?", "Paris" and "It is Paris" have the same meaning and are therefore in the same category, while "London" has a different meaning and is therefore in a different category.

[0005] Here, the semantic likelihood p(c|x) of a category c for a prompt x to the generative language model is expressed as follows:

number

number

[0006] [Non-Patent Document 1] A. Radford et al., "Improving Language Understanding by Generative Pre-Training," 2018, [online], retrieved March 29, 2024, Internet<https: / / cdn.openai.com / research-covers / language-unsupervised / language_understanding_paper.pdf> . [Non-patent document 2] L. Kuhn et al., "Semantic Uncertainty: Linguistic Invariances for Uncertainty Estimation in Natural Language Generation," International Conference on Learning Representations, 2023. Summary of the Invention [Problem to be solved by the invention]

[0007] However, since generative language models are trained on a large number of documents as prior knowledge, simply using them as is will not produce good responses to prompts that do not involve prior knowledge. Therefore, Retrieval Augmented Generation is a method for generating responses by referencing external knowledge. In Retrieval Augmented Generation, external knowledge is stored in advance as a database, and when the generative language model generates a response, it searches for and quotes appropriate sentences from this database.

[0008] Specifically, the external knowledge document is first divided, and the divided pieces (chunks) are vectorized. The chunks and vectors are then stored in a database in a corresponding format. When a prompt is entered by the user, the question is vectorized in the same way as the chunks, and chunks with high similarity are searched for in the database using the vector similarity as an index. A new prompt is constructed by quoting the chunks corresponding to the highly similar vectors, and this is then input into a generative language model, resulting in a response based on the external knowledge.

[0009] Search expansion generation is a promising technique for utilizing generative language models in specialized applications. However, conventional techniques for quantifying uncertainty (e.g., semantic entropy) assume evaluation of the generative language model alone, and do not anticipate evaluation in applications such as search expansion generation.

[0010] An object of the present invention is to provide a quantification device, a quantification method, and a quantification program that can quantitatively evaluate the uncertainty of a response in a system that uses search expansion generation and a generative language model. [Means for solving the problem]

[0011] The quantification device of the present invention includes a first index calculation unit that calculates a first index that indicates the uncertainty of the output generated in response to an input to a generative language model and does not take into account search quality in search expansion generation; a second index calculation unit that calculates a second index that indicates the search quality in the search expansion generation; an index adjustment unit that normalizes the second index and adjusts it as the degree of influence of the search quality on the output; and an output unit that multiplies the first index by the value adjusted by the index adjustment unit and outputs a value that quantifies the uncertainty of the output in the generative language model using search expansion generation.

[0012] The second measure may be based on a similarity between the input prompt and chunks retrieved from external documents by the search expansion generation.

[0013] The second measure may be based on a similarity between the output and chunks retrieved from external documents by the search expansion generation.

[0014] The second index may be based on a similarity between a sentence formed by concatenating the input prompt and the output and a chunk obtained by searching an external document through the search expansion generation.

[0015] The index adjuster may activate the degree of influence when the second index exceeds a threshold value using a sigmoid function.

[0016] In a quantification method according to the present invention, a computer uses a first index calculation unit to calculate a first index that indicates the uncertainty of an output generated in response to an input to a generative language model and does not take into account the search quality in search expansion generation; a second index calculation unit to calculate a second index that indicates the search quality in the search expansion generation; an index adjustment unit normalizes the second index and adjusts it as the degree of influence of the search quality on the output; and an output unit multiplies the first index by the value adjusted by the index adjustment unit to output a value that quantifies the uncertainty of the output in the generative language model using search expansion generation.

[0017] A quantification program according to the present invention causes a computer to function as the quantification device. [Effects of the Invention]

[0018] According to the present invention, it is possible to quantitatively evaluate the uncertainty of responses in a system that uses search expansion generation and a generative language model. [Brief explanation of the drawings]

[0019] [Figure 1] FIG. 2 is a block diagram showing the functional configuration of the quantification device according to the embodiment. DETAILED DESCRIPTION OF THE INVENTION

[0020] An example of an embodiment of the present invention will be described below. In search expansion generation, the accuracy of the process of searching a database based on a prompt affects the quality of the response. Therefore, in order to quantify the uncertainty of the response by taking into account the process of search expansion generation, it is necessary to consider the search quality. In the quantification method of this embodiment, an index representing the search quality in search expansion generation is introduced in evaluating the uncertainty of the output in the generative language model.

[0021] First, we consider the conventional uncertainty quantification index (e.g., the aforementioned U se Let U(x) be the input (prompt) to the generative language model. U(x) is a positive value, and the larger the value, the more different the meaning of each output. In other words, it indicates that the language model is likely to be unable to output a consistent answer and generate uncertain sentences.

[0022] In search expansion generation, the external knowledge is divided into chunks and each chunk is vectorized. Let D be the document containing the external knowledge, d be the divided chunks, and the operation of vectorizing d be denoted as f(d). When a prompt x is input, a system using search expansion generation creates a new prompt x' in the following steps and outputs an answer y based on x'. (1)v x =f(x) gives the vector v of prompt x x Calculate. (2) i-th chunk d i For each prompt, the similarity s i =σ(v x ,f(d i )) is calculated, where σ is a function for calculating the similarity, and for example, cosine similarity is used. (3) For the original prompt x, s i is the largest chunk d i Cite as a reference and create a new prompt x'.

[0023] FIG. 1 is a block diagram showing the functional configuration of a quantification device 1 according to this embodiment. The quantification device 1 is an information processing device that includes a control unit 10, a storage unit 20, and various input / output interfaces.

[0024] The control unit 10 is a part that controls the entire quantification device 1, and realizes each function in this embodiment by appropriately reading and executing various programs and data stored in the storage unit 20. The control unit 10 may be a CPU. The storage unit 20 is a storage area for storing various programs for causing the hardware group to function as the quantification device 1, various data, and the like, and may be a ROM, RAM, flash memory, hard disk drive (HDD), or the like.

[0025] The control unit 10 executes software (quantification program) stored in the storage unit 20, thereby functioning as a first index calculation unit 11, a second index calculation unit 12, an index adjustment unit 13, and an output unit 14.

[0026] The first index calculation unit 11 calculates a first index that indicates the uncertainty of the output generated in response to the input to the generative language model. This first index is the aforementioned index U(x), and is a value that does not take into account the search quality in search expansion generation.

[0027] The second index calculation unit 12 calculates a second index that indicates the search quality in search expansion generation. Here, we define the function that quantifies the search quality as ρ(x s ,y r ) where x s is the original sentence to be searched, y r are the sentences obtained as a result of the search. For example, the following set of values ​​can be assigned to each of them. (1)x s = prompt x, y r = chunk d (2)x s = the generative language model's answer y j , y r = chunk d However, y j represents the jth output when the generative language model generates the output multiple times when quantifying uncertainty.

[0028] The second index may be calculated by either (1) or (2), or may be a value obtained by combining (for example, adding or multiplying) the two calculated values. Alternatively, the second index may be calculated by combining (1) or (2) the prompt x and the answer y of the generative language model. j The sentence that combines and is x s It may also be possible to use the following.

[0029] The function ρ is used to evaluate the similarity, and specifically, may be implemented using, for example, any of the following indices: - Cosine similarity when each sentence is vectorized. Rouge-L, Rouge-N, and other Rouge-related indicators (see Reference A). - Metrics such as BERTScore (see Reference B) calculated using a language model. Document A: C. Lin, "ROUGE: A Package for Automatic Evaluation of Summaries," Association for Computational Linguistics, 2004. Literature B: T. Zhang et al., "BERTScore: Evaluating Text Generation with BERT," International Conference on Learning Representations, 2020.

[0030] In this way, the second metric is calculated based on the similarity between the input prompt to the generative language model and the chunks retrieved from the external document by search expansion generation, or the similarity between the output of the generative language model and the chunks retrieved from the external document by search expansion generation, or both.

[0031] The index adjuster 13 normalizes the second index, for example, between 0 and 1, using the adjustment function g(), and adjusts the degree of influence on the output of search quality. That is, the function ρ′ that quantifies the search quality by introducing an adjustment function is ρ′(x s ,y r )=g(ρ(x s ,y r )), where ρ′ takes a larger value as the retrieval quality decreases, increasing the uncertainty of the output of the generative language model.

[0032] Specifically, the following function may be adopted as the adjustment function g(z): The minimum value z that the original function ρ can take min and the maximum value z max and normalize it to between 0 and 1.

number

number

[0033] Depending on the definition of the argument z, the adjustment function may be, for example, g'(z)=(1-g(z)) so that the lower the search quality, the larger the value becomes, as described above.

[0034] The output unit 14 multiplies the first index by the value adjusted by the index adjustment unit 13, and outputs the result as a value that quantifies the uncertainty of the output in the generative language model using search expansion generation. That is, when the uncertainty of the output taking into account the search quality is denoted as U′, the uncertainty U′(x) for prompt x is expressed by the following equation:

number

[0035] According to this embodiment, the quantification device 1 incorporates an index of the search quality in search expansion generation when quantifying the uncertainty of the output from the generative language model. That is, the quantification device 1 obtains the index of the search quality in search expansion generation and then calculates a value that normalizes and adjusts the influence of the uncertainty using an adjustment function. The quantification device 1 then multiplies the value of the uncertainty quantified using a conventional method by the output of the adjustment function to obtain an index that takes into account the search quality of search expansion generation.

[0036] Therefore, the quantification device 1 can quantitatively evaluate the uncertainty of responses in a system that uses search expansion generation and a generative language model. Quantitative evaluation of uncertainty makes it possible to obtain a reference value for the reliability of the response of the generative language model, which is expected to improve the reliability of the system as a whole. More specifically, it becomes possible to estimate the accuracy of, for example, whether hallucination occurs in the output response.

[0037] The quantification device 1 can quantify the search quality in search expansion generation based on the similarity between the input prompt and the chunk obtained by searching from an external document through search expansion generation, or based on the similarity between the output of the generative language model and the chunk, or by combining these. Specifically, the similarity between the prompt and the chunk is a value that evaluates the accuracy of the search, and the similarity between the output and the chunk is a value that evaluates whether the generative language model correctly generated a response based on the chunk, i.e., whether the searched chunk was of high quality. This allows the quantification device 1 to appropriately quantify the search quality resulting from search expansion generation.

[0038] The quantification device 1 may also quantify search quality based on the similarity between a sentence concatenating the prompt and the output of the generative language model and chunks obtained by searching from an external document through search expansion generation. This means that, for example, if the chunk to be searched is a pair of questions and answers such as an FAQ, the format of the chunk will be consistent by linking the prompt and the output of the generative language model, making it possible to calculate the similarity appropriately.

[0039] When quantifying search quality, the quantification device 1 may use a sigmoid function to activate the second index when it exceeds a threshold value. This makes it possible to highly evaluate the impact on uncertainty by, for example, raising a similarity calculated to be low and lowering a similarity calculated to be high, even if there is a bias in the similarity values, such as when the writing style of external documents is different.

[0040] Furthermore, this embodiment makes it possible to quantitatively present the uncertainty in the response of a generative language model using, for example, search expansion generation, which makes it possible to contribute to Goal 9 of the United Nations-led Sustainable Development Goals (SDGs), which is to "Develop resilient infrastructure, promote sustainable industrialization and foster innovation."

[0041] Although the embodiments of the present invention have been described above, the present invention is not limited to the above-described embodiments. Furthermore, the effects described in the above-described embodiments are merely a list of the most preferable effects resulting from the present invention, and the effects of the present invention are not limited to those described in the embodiments.

[0042] The quantification method using the quantification device 1 is realized by software. When realized by software, the programs constituting this software are installed in an information processing device (computer). These programs may be recorded on removable media such as CD-ROMs and distributed to users, or may be distributed by being downloaded to the user's computer via a network. Furthermore, these programs may be provided to the user's computer as a web service via a network without being downloaded. [Explanation of symbols]

[0043] 1 Quantification device 10 Control Unit 11 First index calculation section 12 Second index calculation section 13 Index adjustment section 14 Output section 20 Memory section

Claims

1. a first index calculation unit that calculates a first index indicating uncertainty of an output generated in response to an input to the generative language model, the first index not taking into account search quality in search expansion generation; a second index calculation unit that calculates a second index indicating search quality in the search expansion generation; an index adjustment unit that normalizes the second index and adjusts it as a degree of influence of the search quality on the output; an output unit that multiplies the first index by the value adjusted by the index adjustment unit and outputs the result as a value that quantifies the uncertainty of the output in the generated language model using search expansion generation.

2. The quantification device according to claim 1 , wherein the second index is based on a similarity between the input prompt and chunks retrieved from an external document by the search expansion generation.

3. The quantification device according to claim 2 , wherein the second index is based on a similarity between the output and chunks obtained by retrieval from an external document by the search expansion generation.

4. The quantification device according to claim 1 , wherein the second index is based on a similarity between a sentence formed by concatenating the input prompt and the output and a chunk obtained by searching an external document through the search expansion generation.

5. 5. The quantification device according to claim 1, wherein the index adjuster activates the influence degree when the second index exceeds a threshold value using a sigmoid function.

6. The computer a first index calculation unit calculating a first index indicating uncertainty of an output generated in response to an input to the generative language model, the first index not taking into account search quality in search expansion generation; a second index calculation unit calculating a second index indicating search quality in the search expansion generation; an index adjustment unit normalizes the second index and adjusts it as an influence of the search quality on the output; an output unit multiplying the first index by the value adjusted by the index adjustment unit, and outputting the result as a value that quantifies the uncertainty of the output in the generated language model using search expansion generation.

7. A quantification program for causing a computer to function as the quantification device according to any one of claims 1 to 4.

Citation Information

Cited By

  • Generating AI information consistency verification device, generating AI information consistency verification method, and computer program

    JP7911185B1