# US 2025/0384244 A1 · Systems and methods for constructing neural networks

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

- Number: US 2025/0384244 A1
- Document ID: US20250384244A1
- Status: Published application
- Kind: A1
- Application number: 18/742,328
- Filed: 2024-06-13
- Published: 2025-12-18
- Earliest claimed: 2024-06-13
- Assignees: Salesforce, Inc.
- Applicants: Salesforce, Inc.
- Inventors: Shiva Kumar Pentyala; Bin Bi; Regunathan Radhakrishnan; Sitaram Asur; Na (Claire) Cheng
- Web page: https://patentgrep.com/patent/US20250384244A1

## CPC

- G06N 3/0455: Auto-encoder networks; Encoder-decoder networks
- G06N 3/084: Backpropagation, e.g. using gradient descent
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS

## Abstract

Embodiments provide a merging framework that selectively merges pretrained model parameters of an LLM and retrained adapter weights. Specifically, the merging framework measures a similarity metric between a pretrained base LLM and an adapter that is retrained for a specific task or domain, and then prunes one or more components (weights or layers) of the adapter that have a high similarity with the base LLM and thus are likely to be redundant. The pruned adapter with only sparse features that are most dissimilar to the base LLM is then merged with the base LLM to produce a new neural network model that is adapted for the specific task or domain. In this way, redundant features may be pruned from adapter modules before merging.

## Claims

### Claim 1

A method of constructing a new neural network to perform a specific task, the method comprising:
selecting, from a library of base neural networks, a first base neural network based on a compatibility metric between the first base neural network and a target base neural network;
training an adapter neural network in conjunction with the first base neural network using a training dataset of a specific domain; and
creating the new neural network by merging the trained adapter neural network with the target base neural network without retraining the trained adapter neural network.

### Claim 2 (depends on 1)

The method of claim 1, wherein the compatibility metric indicates that the target base neural network is generated from merging the first base neural network and another neural network.

### Claim 3 (depends on 1)

The method of claim 1, further comprising:
building a library of base neural networks by merging one or more neural networks to produce a new neural network,
wherein the library of base neural networks contains a tree structure indicating merging relationships between the base neural networks.

### Claim 4 (depends on 2)

The method of claim 2, wherein the selecting, from the library of base neural networks, the first base neural network comprises:
selecting the first base neural network based on the tree structure,
wherein the target base neural network is produced through merging the first base neural network with one or more other neural networks.

### Claim 5 (depends on 1)

The method of claim 1, wherein the first base neural network has a smaller size than the target base neural network.

### Claim 6 (depends on 1)

The method of claim 1, wherein the training the adapter neural network in conjunction with the first base neural network using the training dataset of the specific domain comprises:
jointly generating, by a combination of the adapter neural network and the first base neural network, a training output based on a training input from the training dataset; and
updating weights of the adapter neural network based on a training loss computed from the training output while keeping weights of the first base neural network unchanged.

### Claim 7 (depends on 1)

The method of claim 1, wherein the merging the trained adapter neural network with the target base neural network comprises merging a first set of layers of the trained adapter neural network with a second set of layers of the target base neural network based on a per-layer basis.

### Claim 8 (depends on 1)

The method of claim 1, wherein the merging the trained adapter neural network with the target base neural network comprises:
selectively pruning the adapter neural network by removing one or more weights or layers based on similarity metrics between the first set of layers of the adapter neural network and the second set of layers of the target neural network; and
merging remaining weights and/or layers of the selectively pruned adapter neural network with the target neural network to produce the new neural network.

### Claim 9

A system of constructing a new neural network to perform a specific task, the system comprising:
a communication interface;
a memory storing a plurality of processor-executable instructions; and
one or more processors executing the plurality of processor-executable instructions to perform operations comprising:
selecting, from a library of base neural networks, a first base neural network based on a compatibility metric between the first base neural network and a target base neural network;
training an adapter neural network in conjunction with the first base neural network using a training dataset of a specific domain; and
creating the new neural network by merging the trained adapter neural network with the target base neural network without retraining the trained adapter neural network.

### Claim 10 (depends on 9)

The system of claim 9, wherein the compatibility metric indicates that the target base neural network is generated from merging the first base neural network and another neural network.

### Claim 11 (depends on 9)

The system of claim 9, wherein the operations further comprise:
building a library of base neural networks by merging one or more neural networks to produce a new neural network,
wherein the library of base neural networks contains a tree structure indicating merging relationships between the base neural networks.

### Claim 12 (depends on 10)

The system of claim 10, wherein the operation of selecting, from the library of base neural networks, the first base neural network comprises:
selecting the first base neural network based on the tree structure,
wherein the target base neural network is produced through merging the first base neural network with one or more other neural networks.

### Claim 13 (depends on 9)

The system of claim 9, wherein the first base neural network has a smaller size than the target base neural network.

### Claim 14 (depends on 9)

The system of claim 9, wherein the operation of training the adapter neural network in conjunction with the first base neural network using the training dataset of the specific domain comprises:
jointly generating, by a combination of the adapter neural network and the first base neural network, a training output based on a training input from the training dataset; and
updating weights of the adapter neural network based on a training loss computed from the training output while keeping weights of the first base neural network unchanged.

### Claim 15 (depends on 9)

The system of claim 9, wherein the operation of merging the trained adapter neural network with the target base neural network comprises merging a first set of layers of the trained adapter neural network with a second set of layers of the target base neural network based on a per-layer basis.

### Claim 16 (depends on 9)

The system of claim 9, wherein the operation of merging the trained adapter neural network with the target base neural network comprises:
selectively pruning the adapter neural network by removing one or more weights or layers based on similarity metrics between the first set of layers of the adapter neural network and the second set of layers of the target neural network; and
merging remaining weights and/or layers of the selectively pruned adapter neural network with the target neural network to produce the new neural network.

### Claim 17

A non-transitory processor-readable storage medium storing a plurality of processor-executable instructions for constructing a new neural network to perform a specific task, the instructions being executed by one or more processors to perform operations comprising:
selecting, from a library of base neural networks, a first base neural network based on a compatibility metric between the first base neural network and a target base neural network;
training an adapter neural network in conjunction with the first base neural network using a training dataset of a specific domain; and
creating the new neural network by merging the trained adapter neural network with the target base neural network without retraining the trained adapter neural network.

### Claim 18 (depends on 17)

The non-transitory processor-readable storage medium of claim 17, wherein the compatibility metric indicates that the target base neural network is generated from merging the first base neural network and another neural network.

### Claim 19 (depends on 18)

The non-transitory processor-readable storage medium of claim 18, wherein the operations further comprise:
building a library of base neural networks by merging one or more neural networks to produce a new neural network,
wherein the library of base neural networks contains a tree structure indicating merging relationships between the base neural networks.

### Claim 20 (depends on 18)

The non-transitory processor-readable storage medium of claim 18, wherein the operations further comprise:
selecting the first base neural network based on the tree structure,
wherein the target base neural network is produced through merging the first base neural network with one or more other neural networks.
