Adapter Model for Consistent Factual Extraction from LLMs

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Large language models produce inconsistent responses to factual queries due to variability in query structure, requiring retraining which is computationally expensive and resource-intensive, and often lack available training data.

Innovation Solution

A factual information extraction framework using a pre-trained language model with an adapter model placed between the embedding and attention layers, transforming queries into continuous representations to ensure consistent responses without retraining the language model.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If the language model is retrained to improve response consistency, then the response consistency is improved, but the computational cost and resource consumption increase significantly

Engineering Contradiction:
Improveresponse consistencyVSAvoidcomputational cost
Core Design Contradiction:
ReliabilityVSUse of energy by moving object

Solution Approach 1:

The system segments the language model into two parts: a frozen pre-trained language model and a small trainable adapter model. The adapter model is inserted between the embedding layer and attention layers, allowing only the adapter parameters to be trained while keeping the main language model parameters fixed. This segmentation enables response consistency improvement with minimal computational cost.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The adapter model applies local quality by making only specific parts of the system (the adapter layers) trainable while keeping the rest frozen. The adapter models are trained on task-specific data to improve factual knowledge extraction, while the pre-trained language model remains unchanged. This localized training approach reduces computational overhead while maintaining response consistency.

Inventive Principle:
Principle #3Local quality

2Loss of information

If the language model parameters are increased to improve factual knowledge, then the factual knowledge capacity is improved, but the training resource requirements increase exponentially

Engineering Contradiction:
Improvefactual knowledge capacityVSAvoidtraining resources
Core Design Contradiction:
Loss of informationVSQuantity of substance

Solution Approach 1:

The system separates the large language model into a frozen component and a small trainable adapter component. The adapter models contain the task-specific factual knowledge while the pre-trained language model provides general language understanding. This segmentation allows factual knowledge extraction without requiring the entire large model to be retrained.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The adapter model acts as an intermediary between the pre-trained language model and the factual knowledge extraction task. It translates general language understanding into task-specific factual responses without requiring changes to the underlying large language model, thus avoiding exponential training resource requirements.

Inventive Principle:
Principle #24Intermediary (Mediator)

3Measurement precision

If the language model is fine-tuned on task-specific data to improve query accuracy, then the query accuracy is improved, but the availability of training data is limited

Engineering Contradiction:
Improvequery accuracyVSAvoidtraining data availability
Core Design Contradiction:
Measurement precisionVSQuantity of substance

Solution Approach 1:

The system applies partial action by training only the adapter model parameters rather than the entire language model. This allows effective use of limited task-specific training data to improve query accuracy for factual knowledge extraction, while the pre-trained language model provides robust general language understanding from its extensive pre-training corpus.

Inventive Principle:
Principle #16Partial or excessive action

Data Source

PatentUS12112131B2Systems and methods for factual extraction from language model
Publication Date: 2024.10.08 SALESFORCE INC
  • US12112131B2 patent drawing
  • US12112131B2 patent drawing
  • US12112131B2 patent drawing

AI summary

Embodiments described herein provide a system and method for extracting factual information. The system transforms a query into a natural language prompt in a format of a query subject and a queried relation. The system encodes, via an embedding layer of a pre-trained language model, the natural language prompt into a first embedding. The system encodes, via the adapter model, the first embedding into a second embedding based on a probability that the second embedding returns the factual information when the second embedding is fed the first attention layer of the pre-trained language model. The system decodes, by the first attention layer of the pre-trained language mode, the second embedding into a response to the query. The system extracts the factual information from the decoded response to the query.