Label-Modular Prompt Tuning for Dynamic NLP Adaptability

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing natural language processing (NLP) models struggle with adaptability in varying data environments, particularly due to the assumption of independently and identically distributed data, which is not reflective of real-world scenarios with changing contexts and non-stationary environments.

Innovation Solution

The label-modular prompt tuning framework decomposes the prompt sequence into label-modular components called label prompts, which encode task-specific knowledge corresponding to a class label. This framework selects desired label prompts to construct the input prompt for a pretrained language model and uses a novel subset-invariant loss to ensure modular knowledge encoding during training.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Adaptability or versatility

If existing NLP models assume training data and testing data are independently and identically distributed, then the models can be trained efficiently with standard algorithms, but the models fail to adapt to real-world data environments with changing contexts and non-stationary environments

Engineering Contradiction:
Improveadaptability to varying data environmentsVSAvoidperformance in non-stationary environments
Core Design Contradiction:
Adaptability or versatilityVSReliability

Solution Approach 1:

The prompt sequence is segmented into multiple label-specific prompt components, where each label has its own dedicated prompt. This segmentation allows the model to selectively activate relevant label prompts based on the input data, improving adaptability to varying data environments while maintaining reliable performance through targeted label-specific processing.

Inventive Principle:
Principle #1Segmentation

2Reliability

If NLP models are finetuned for each specific NLP task, then the models can achieve high performance on specific tasks, but the process becomes largely impractical and in some cases infeasible

Engineering Contradiction:
Improveperformance on specific tasksVSAvoidcomplexity of finetuning process
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

A universal prompt template is designed that can serve multiple NLP tasks through selective label prompt activation. Instead of creating separate finetuned models for each task, the same base model with the universal prompt structure can handle different tasks by activating appropriate label-specific prompts, reducing the complexity of the finetuning process while maintaining high performance across tasks.

Inventive Principle:
Principle #6Universality (Multi-functionality)

3Adaptability or versatility

If a pretrained language model uses a fixed prompt sequence, then the model structure remains simple and efficient, but the model cannot adapt to dynamic label sets and changing task requirements

Engineering Contradiction:
Improveadaptability to dynamic label setsVSAvoidcomplexity of prompt structure
Core Design Contradiction:
Adaptability or versatilityVSDevice complexity

Solution Approach 1:

The prompt structure is made dynamic by introducing label-specific prompt components that can be selectively activated based on the task requirements and label sets. Instead of a fixed prompt sequence, the system dynamically constructs prompts by combining the base prompt with relevant label prompts, enabling adaptation to dynamic label sets while managing complexity through modular design.

Inventive Principle:
Principle #15Dynamics

Data Source

PatentUS12204857B2Systems and methods for text classification using label modular prompts
Publication Date: 2025.01.21 SALESFORCE INC
  • US12204857B2 patent drawing
  • US12204857B2 patent drawing
  • US12204857B2 patent drawing

AI summary

Embodiments described herein provide training a prompt generator for text classification. A first training dataset associated with a first plurality of class labels is received for a first training process. For a first instance of the first training dataset, a set of labels of interest is generated by sampling from a set of possible class labels including the first plurality of class labels. The prompt generator generates a first prompt based on the set of labels of interest. A pretrained language model generates a task output in response to an input of the first instance prepended with the first prompt. A loss objective is generated based on the task output and the set of labels of interest. Parameters of the prompt generator are updated based on the computed loss function via backpropagation while the pretrained language model is frozen.