# US 2026/0065029 A1 · Systems and methods for perturbation-based zero-shot hallucination reasoning for large language model generated text

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2026/0065029 A1
- Document ID: US20260065029A1
- Status: Published application
- Kind: A1
- Application number: 18/819,431
- Filed: 2024-08-29
- Published: 2026-03-05
- Earliest claimed: 2024-08-29
- Applicants: Jpmorgan Chase Bank, N.A.
- Inventors: Seongmin LEE; Hsiang HSU; Richard CHEN
- Web page: https://patentgrep.com/patent/US20260065029A1

## CPC

- G06N 3/047: Probabilistic or stochastic networks
- G06F 40/284: Lexical analysis, e.g. tokenisation or collocates
- G06F 40/295: Named entity recognition
- G06F 40/30: Semantic analysis
- G06F 40/40: Processing or translation of natural language (natural language analysis G06F40/20; semantic analysis G06F40/30)
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A method may include: receiving a prompt and generated text from the LLM; computing an original token probability distribution for each token in the prompt and in the generated text; receiving a token position probability distribution for each token position in the generated text from the LLM; identifying keywords in the prompt; perturbing embedding vectors for the keywords used by the LLM by adding noise to the embedding vectors; computing a perturbed probability distribution for the perturbed embedding vectors by providing the perturbed embedding vectors as an input to a neural network used by the LLM, wherein the neural network returns a perturbed token probability distribution; evaluating a divergence between the original token probability distribution and the perturbed token probability distribution; identifying semantically meaningful tokens in the generated text; calculating a mean of divergences for the semantically meaningful tokens; and classifying the LLM based on the mean of divergences.

## Claims

### Claim 1

A method, comprising:
receiving, by a computer program, a prompt provided to a large language model, and generated text from the large language model;
computing, by the computer program and using the large language model, an original token probability distribution for each token in the prompt and in the generated text;
determining, by the computer program, a token position probability distribution for each token position in the generated text by providing the prompt and the generated text to the large language model, wherein the large language model returns the token position probability distribution for each token position in the generated text for tokens that are available to the large language model;
identifying, by the computer program, one or more keywords in the prompt;
perturbing, by the computer program, embedding vectors for the one or more keywords used by the large language model by adding noise to the embedding vectors;
computing, by the computer program, a perturbed probability distribution for the perturbed embedding vectors by providing the perturbed embedding vectors to a neural network used by the large language model as an input, wherein the neural network returns a perturbed token probability distribution;
evaluating, by the computer program, a divergence between the original token probability distribution and the perturbed token probability distribution;
identifying, by the computer program, semantically meaningful tokens in the generated text;
calculating, by the computer program, a mean of divergences for the semantically meaningful tokens; and
classifying, by the computer program, the large language model based on the mean of divergences.

### Claim 2 (depends on 1)

The method of claim 1, wherein the keywords comprise a named entity.

### Claim 3 (depends on 1)

The method of claim 1, wherein the computer program selects one of a plurality of named entities as the keyword based on an amount of attention for each of the named entity by the large language model.

### Claim 4 (depends on 1)

The method of claim 1, wherein the noise comprises Gaussian noise.

### Claim 5 (depends on 1)

The method of claim 1, wherein the divergence is a Kullback-Leibler divergence.

### Claim 6 (depends on 1)

The method of claim 1, wherein a first semantically meaningful token of the semantically meaningful tokens comprises a noun, a proper noun, a verbs, or an adjective.

### Claim 7 (depends on 1)

The method of claim 1, wherein the large language model is classified by comparing the mean of the divergences to a divergence threshold, wherein the divergence threshold is based on a Kolmogorov-Smirnov (KS) test run on a validation data set.

### Claim 8 (depends on 7)

The method of claim 7, further comprising:
evaluating, by the computer program, a negative log-likelihood for each semantically meaningful token in response to the mean of the divergences being less than the divergence threshold.

### Claim 9 (depends on 8)

The method of claim 8, further comprising:
retraining, by the computer program, the large language model in response to a negative log-likelihood being below a negative log-likelihood threshold, wherein the negative log-likelihood is based on a Kolmogorov-Smirnov (KS) test run on the validation data set.

### Claim 10 (depends on 8)

The method of claim 8, further comprising:
classifying, by the computer program, the large language model as having no hallucinations in response to a negative log-likelihood being above a negative log-likelihood threshold.

### Claim 11

A non-transitory computer readable storage medium, including instructions stored thereon, which when read and executed by one or more computer processors, cause the one or more computer processors to perform steps comprising:
receiving a prompt provided to a large language model, and generated text from the large language model;
computing, using the large language model, an original token probability distribution for each token in the prompt and in the generated text;
determining a token position probability distribution for each token position in the generated text by providing the prompt and the generated text to the large language model, wherein the large language model returns the token position probability distribution for each token position in the generated text for tokens that are available to the large language model;
identifying one or more keywords in the prompt;
perturbing embedding vectors for the one or more keywords used by the large language model by adding noise to the embedding vectors;
computing a perturbed probability distribution for the perturbed embedding vectors by providing the perturbed embedding vectors to a neural network used by the large language model as an input, wherein the neural network returns a perturbed token probability distribution;
evaluating divergence between the original token probability distribution and the perturbed token probability distribution;
identifying semantically meaningful tokens in the generated text;
calculating a mean of divergences for the semantically meaningful tokens; and
classifying the large language model based on the mean of divergences.

### Claim 12 (depends on 11)

The non-transitory computer readable storage medium of claim 11, wherein the keywords comprise a named entity.

### Claim 13 (depends on 11)

The non-transitory computer readable storage medium of claim 11, wherein the one of a plurality of named entities is selected as the keyword based on an amount of attention for each of the named entity by the large language model.

### Claim 14 (depends on 11)

The non-transitory computer readable storage medium of claim 11, wherein the noise comprises Gaussian noise.

### Claim 15 (depends on 11)

The non-transitory computer readable storage medium of claim 11, wherein the divergence is a Kullback-Leibler divergence.

### Claim 16 (depends on 11)

The non-transitory computer readable storage medium of claim 11, wherein a first semantically meaningful token of the semantically meaningful tokens comprises a noun, a proper noun, a verbs, or an adjective.

### Claim 17 (depends on 11)

The non-transitory computer readable storage medium of claim 11, wherein the large language model is classified by comparing the mean of the divergences to a divergence threshold, wherein the divergence threshold is based on a Kolmogorov-Smirnov (KS) test run on a validation data set.

### Claim 18 (depends on 17)

The non-transitory computer readable storage medium of claim 17, further comprising instructions stored thereon, which when read and executed by the one or more computer processors, cause the one or more computer processors to perform steps comprising:
evaluating a negative log-likelihood for each semantically meaningful token in response to the mean of the divergences being less than the divergence threshold, wherein the negative log-likelihood is based on a Kolmogorov-Smirnov (KS) test run on the validation data set.

### Claim 19 (depends on 18)

The non-transitory computer readable storage medium of claim 18, wherein, in response to the negative log-likelihood being below a negative log-likelihood threshold, the large language model is retrained.

### Claim 20 (depends on 18)

The non-transitory computer readable storage medium of claim 18, wherein, in response to the negative log-likelihood being above a negative log-likelihood threshold, the large language model is classified as having no hallucinations.
