# US 2023/0274143 A1 · Complementary Prompting For Rehearsal-Free Continual Learning

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

- Number: US 2023/0274143 A1
- Document ID: US20230274143A1
- Status: Published application
- Kind: A1
- Application number: 18/173,985
- Filed: 2023-02-24
- Published: 2023-08-31
- Earliest claimed: 2022-02-28
- Assignees: Google Inc.
- Applicants: Google LLC
- Inventors: Zizhao Zhang; Zifeng Wang; Chen-Yu Lee; Ruoxi Sun; Sayna Ebrahimi; Xiaoqi Ren; Guolong Su; Vincent Perot; Tomas Pfister; Han Zhang
- Web page: https://patentgrep.com/patent/US20230274143A1

## CPC

- G06N 3/045: Combinations of networks
- G06N 3/08: Learning methods
- G06N 3/096: Transfer learning
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS

## Abstract

A method for rehearsal-free continual learning includes obtaining a set of training samples where training sample in the set of training samples is associated with a respective task of a plurality of different tasks. The method includes obtaining a task-invariant prompt representative of learned knowledge common to each respective task of the plurality of different tasks. The method includes, for each respective task of the plurality of different tasks, obtaining a respective task-specific prompt representative of learned knowledge specific to the respective task. The method includes, during each of one or more training iterations, for each respective training sample in the set of training samples, selecting the respective task-specific prompt representative of the respective task of the respective training sample and training a model using the task-invariant prompt and the selected respective task-specific prompt.

## Claims

### Claim 1

A computer-implemented method when executed by data processing hardware causes the data processing hardware to perform operations comprising:
obtaining a set of training samples, each training sample in the set of training samples associated with a respective task of a plurality of different tasks;
obtaining a task-invariant prompt representative of learned knowledge common to each respective task of the plurality of different tasks;
for each respective task of the plurality of different tasks, obtaining a respective task-specific prompt representative of learned knowledge specific to the respective task; and
during each of one or more training iterations, for each respective training sample in the set of training samples:
selecting the respective task-specific prompt representative of the respective task of the respective training sample; and
training a model using the task-invariant prompt and the selected respective task-specific prompt.

### Claim 2 (depends on 1)

The method of claim 1, wherein each respective training sample comprises an image.

### Claim 3 (depends on 1)

The method of claim 1, wherein training the model comprises updating a pre-trained model with the task-invariant prompt and the selected respective task-specific prompt.

### Claim 4 (depends on 3)

The method of claim 3, wherein updating the pre-trained model with the task-invariant prompt and the selected respective task-specific prompt comprises:
inserting the task-invariant prompt at a first layer of the pre-trained model; and
inserting the respective task-specific prompt at a second layer of the pre-trained model.

### Claim 5 (depends on 4)

The method of claim 4, wherein the first layer and the second layer are each a self-attention layer.

### Claim 6 (depends on 4)

The method of claim 4, wherein inserting the task-invariant prompt at the first layer of the pre-trained model comprises prepending the task-invariant prompt to an input embedding feature of the first layer.

### Claim 7 (depends on 4)

The method of claim 4, wherein inserting the respective task-specific prompt at the second layer of the pre-trained model comprises prepending the respective task-specific prompt to an input embedding feature of the second layer.

### Claim 8 (depends on 1)

The method of claim 1, wherein each respective task-specific prompt is associated with task-specific key representative of one or more features of the respective task.

### Claim 9 (depends on 1)

The method of claim 1, wherein training the model using the task-invariant prompt and the selected respective task-specific prompt comprises determining a cross-entropy loss.

### Claim 10 (depends on 1)

The method of claim 1, wherein each respective task of the plurality of different tasks comprises image classification.

### Claim 11

A system comprising:
data processing hardware; and
memory hardware in communication with the data processing hardware, the memory hardware storing instructions that when executed on the data processing hardware cause the data processing hardware to perform operations comprising:
obtaining a set of training samples, each training sample in the set of training samples associated with a respective task of a plurality of different tasks;
obtaining a task-invariant prompt representative of learned knowledge common to each respective task of the plurality of different tasks;
for each respective task of the plurality of different tasks, obtaining a respective task-specific prompt representative of learned knowledge specific to the respective task; and
during each of one or more training iterations, for each respective training sample in the set of training samples:
selecting the respective task-specific prompt representative of the respective task of the respective training sample; and
training a model using the task-invariant prompt and the selected respective task-specific prompt.

### Claim 12 (depends on 11)

The system of claim 11, wherein each respective training sample comprises an image.

### Claim 13 (depends on 11)

The system of claim 11, wherein training the model comprises updating a pre-trained model with the task-invariant prompt and the selected respective task-specific prompt.

### Claim 14 (depends on 13)

The system of claim 13, wherein updating the pre-trained model with the task-invariant prompt and the selected respective task-specific prompt comprises:
inserting the task-invariant prompt at a first layer of the pre-trained model; and
inserting the respective task-specific prompt at a second layer of the pre-trained model.

### Claim 15 (depends on 14)

The system of claim 14, wherein the first layer and the second layer are each a self-attention layer.

### Claim 16 (depends on 14)

The system of claim 14, wherein inserting the task-invariant prompt at the first layer of the pre-trained model comprises prepending the task-invariant prompt to an input embedding feature of the first layer.

### Claim 17 (depends on 14)

The system of claim 14, wherein inserting the respective task-specific prompt at the second layer of the pre-trained model comprises prepending the respective task-specific prompt to an input embedding feature of the second layer.

### Claim 18 (depends on 11)

The system of claim 11, wherein each respective task-specific prompt is associated with task-specific key representative of one or more features of the respective task.

### Claim 19 (depends on 11)

The system of claim 11, wherein training the model using the task-invariant prompt and the selected respective task-specific prompt comprises determining a cross-entropy loss.

### Claim 20 (depends on 11)

The system of claim 11, wherein each respective task of the plurality of different tasks comprises image classification.
