LLM Decoding Constraint Term for Hallucination Reduction

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing large language models (LLMs) for text generation often produce inaccurate or non-factual outputs, known as hallucination, and may generate toxic or unreasonable text.

Innovation Solution

A decoding mechanism is introduced that adds a constraint term to the decoding logits to generate text outputs with specific desired behaviors, such as reducing toxicity or including desired keywords, thereby improving factual correctness.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If large language models generate text outputs with given instructions, then text generation capability is improved, but factual accuracy deteriorates due to hallucination

Engineering Contradiction:
Improvetext generation capabilityVSAvoidfactual accuracy
Core Design Contradiction:
ProductivityVSReliability

Solution Approach 1:

The patent implements a feedback mechanism where the generated text is evaluated against factual constraints, and the decoding process is adjusted based on this feedback. The system computes a constraint term that provides feedback signals to guide the decoding towards factually accurate outputs while maintaining generation capability.

Inventive Principle:
Principle #23Feedback

Solution Approach 2:

The patent modifies the decoding parameters by adding a constraint term to the logit distribution. This parameter change allows the model to balance between generating fluent text and adhering to factual constraints, resolving the contradiction between productivity and reliability.

Inventive Principle:
Principle #35Parameter changes

2Reliability

If constraint term is added to decoding logits, then factual accuracy is improved, but decoding complexity increases

Engineering Contradiction:
Improvefactual accuracyVSAvoiddecoding complexity
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The patent performs preliminary action by pre-computing the constraint term based on the input prompt and factual knowledge before the actual decoding process. This allows the constraint to be integrated efficiently into the decoding logits without requiring complex real-time computations during text generation.

Inventive Principle:
Principle #10Preliminary action

3Reliability

If decoding mechanism is adjusted with constraints, then hallucination is reduced, but generation flexibility decreases

Engineering Contradiction:
Improvehallucination reductionVSAvoidgeneration flexibility
Core Design Contradiction:
ReliabilityVSAdaptability or versatility

Solution Approach 1:

The patent implements a dynamic constraint application where the strength and type of constraints are adjusted based on the specific decoding context and the model's confidence. This allows the system to maintain flexibility in generation while reducing hallucination, adapting the constraint level to each generation step.

Inventive Principle:
Principle #15Dynamics

Data Source

PatentUS20250111198A1Systems and Methods for Constrained Text Generation Using Large Language Models
Publication Date: 2025.04.03 SALESFORCE INC
  • US20250111198A1 patent drawing
  • US20250111198A1 patent drawing
  • US20250111198A1 patent drawing

AI summary

In view of the need to improve text generation technology, embodiments described herein provide a neural network model that generates a text output with constraints to achieve desired output behavior, such as reduced toxicity or hallucinations, and inclusion of certain keywords.