# US 2026/0093985 A1 · Training Transformers Using Sliceout

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

- Number: US 2026/0093985 A1
- Document ID: US20260093985A1
- Status: Published application
- Kind: A1
- Application number: 19/412,214
- Filed: 2025-12-08
- Published: 2026-04-02
- Earliest claimed: 2020-11-20
- Assignees: Cohere Inc.
- Applicants: Cohere Inc.
- Inventors: Aidan GOMEZ; Seoyeon YOO
- Web page: https://patentgrep.com/patent/US20260093985A1

## CPC

- G06N 3/08: Learning methods
- G06N 3/082: modifying the architecture, e.g. adding, deleting or silencing nodes or connections
- G06F 16/90335: {Query processing}
- G06N 3/0455: Auto-encoder networks; Encoder-decoder networks
- G06N 3/0495: Quantised networks; Sparse networks; Compressed networks
- G06N 3/0499: Feedforward networks
- G06N 3/09: Supervised learning
- G06N 3/048: Activation functions
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A system for training the neural network using dropout with slicing operations preserves the regularization effects of dropout, while speeding up computations and reducing the memory requirements of training the neural network. Instead of randomly dropping weights connected to neurons in a neural network, the system slices contiguous memory segments of weight matrices. For transformer models, the approach first receives input data that consist of a sequence of elements. Based on the input data, input embedding vectors with positional encoding are generated. Then the transformer model is trained by passing the input embedding vectors through various neural network layers. While passing through linear layers, some of the weight matrices are sliced (e.g., masked) such that a contiguous section of a weight matrix is kept unsliced and used for training and the rest of the weight matrix is not accessed.

## Claims

### Claim 1

A method for training a transformer model comprising:
receiving input data, the input data containing a sequence of elements;
generating embedded input vectors based on the input data;
generating a plurality of matrices based on the embedded input vectors;
applying a mask to a matrix of the plurality of matrices, the mask selecting a contiguous section of the matrix resulting in a sliced matrix; and
training the transformer model based at least in part on the sliced matrix by:
training the transformer model with a first subset of data of the input data using a first mask set; and
training the transformer model with a second subset of data of the input data using a second mask set, wherein the second subset of data is different from the first subset of data and the second mask set is different from the first mask set.

### Claim 2 (depends on 1)

The method of claim 1, further comprising:
training an attention layer based on the plurality of matrices; and
training a feed-forward layer based on an output from the attention layer.

### Claim 3 (depends on 2)

The method of claim 2, wherein the feed-forward network further comprises a first feed-forward linear layer and a second feed-forward linear layer with a ReLu activation between the first and the second feed-forward linear layers.

### Claim 4 (depends on 3)

The method of claim 3, further comprising applying a first feed-forward network mask to the first feed-forward linear layer and a second feed-forward network mask to the second feed-forward linear layer, the first feed-forward network mask aligned with the second feed-forward network mask.

### Claim 5 (depends on 1)

The method of claim 1, wherein the starting index of the contiguous section of the matrix is uniformly sampled.

### Claim 6 (depends on 1)

The method of claim 1, wherein the plurality of matrices comprise a query weight matrix, a key weight matrix and a value weight matrix.

### Claim 7 (depends on 6)

The method of claim 6, wherein applying the mask to the matrix of the plurality of matrices comprises:
applying a first mask to the query weight matrix, resulting in a sliced query weight matrix;
applying a second mask to the key weight matrix, resulting in a sliced key weight matrix;
applying a third mask to the value weight matrix, resulting in a sliced value weight matrix;
applying a fourth mask to the embedded input vectors, resulting in a sliced input matrix;
training a plurality of linear layers based on the sliced query weight matrix, the sliced key weight matrix, the sliced value weight matrix and the sliced input matrix; and
generating a sliced query matrix, a sliced key matrix and a sliced value matrix.

### Claim 8 (depends on 7)

The method of claim 7, wherein the first mask aligns with the second mask.

### Claim 9 (depends on 7)

The method of claim 7, further comprising:
multiplying the sliced query matrix with the sliced key matrix, resulting in a score matrix; and
scaling the score matrix based on a first dimension of the sliced query matrix and a second dimension of the sliced key matrix.

### Claim 10

A non-transitory computer-readable storage medium comprising computer program code, the computer program code when executed by a processor causing the processor to perform operations comprising:
receiving input data, the input data containing a sequence of elements;
generating embedded input vectors based on the input data;
generating a plurality of matrices based on the embedded input vectors;
applying a mask to a matrix of the plurality of matrices, the mask selecting a contiguous section of the matrix resulting in a sliced matrix; and
training the transformer model based at least in part on the sliced matrix by:
training the transformer model with a first subset of data of the input data using a first mask set; and
training the transformer model with a second subset of data of the input data using a second mask set, wherein the second subset of data is different from the first subset of data and the second mask set is different from the first mask set.

### Claim 11 (depends on 10)

The non-transitory computer-readable storage medium of claim 10, further causing the processor to perform operations comprising:
training an attention layer based on the plurality of matrices; and
training a feed-forward layer based on an output from the attention layer.

### Claim 12 (depends on 11)

The non-transitory computer-readable storage medium of claim 11, wherein the feed-forward network further comprises a first feed-forward linear layer and a second feed-forward linear layer with a Relu activation between the first and the second feed-forward linear layers.

### Claim 13 (depends on 12)

The non-transitory computer-readable storage medium of claim 12 further causing the processor to perform operations comprising applying a first feed-forward network mask to the first feed-forward linear layer and a second feed-forward network mask to the second feed-forward linear layer, the first feed-forward network mask aligned with the second feed-forward network mask.

### Claim 14 (depends on 10)

The non-transitory computer-readable storage medium of claim 10, wherein the starting index of the contiguous section of the matrix is uniformly sampled.

### Claim 15 (depends on 10)

The non-transitory computer-readable storage medium of claim 10, wherein the plurality of matrices comprising a query weight matrix, a key weight matrix and a value weight matrix.

### Claim 16 (depends on 15)

The non-transitory computer-readable storage medium of claim 15 wherein applying the mask to the matrix of the plurality of matrices comprises:
applying a first mask to the query weight matrix, resulting in a sliced query weight matrix;
applying a second mask to the key weight matrix, resulting in a sliced key weight matrix;
applying a third mask to the value weight matrix, resulting in a sliced value weight matrix;
training a plurality of linear layers based on the sliced query weight matrix, the sliced key weight matrix and the sliced value weight matrix; and
generating a sliced query matrix, a sliced key matrix and a sliced value matrix.

### Claim 17 (depends on 16)

The non-transitory computer-readable storage medium of claim 16, wherein the first mask aligns with the second mask.

### Claim 18 (depends on 16)

The non-transitory computer-readable storage medium of claim 16, further causing the processor to perform operations comprising:
multiplying the sliced query matrix with the sliced key matrix, resulting in a score matrix; and
scaling the score matrix based on a first dimension of the sliced query matrix and a second dimension of the sliced key matrix.

### Claim 19

A computing device comprising a processor and a computer-readable storage medium comprising computer program code, the computer program code when executed by the processor causing the computing device to perform operations comprising:
receiving input data, the input data containing a sequence of elements;
generating embedded input vectors based on the input data;
generating a plurality of matrices based on the embedded input vectors;
applying a mask to a matrix of the plurality of matrices, the mask selecting a contiguous section of the matrix resulting in a sliced matrix; and
training the transformer model based at least in part on the sliced matrix by:
training the transformer model with a first subset of data of the input data using a first mask set; and
training the transformer model with a second subset of data of the input data using a second mask set, wherein the second subset of data is different from the first subset of data and the second mask set is different from the first mask set.

### Claim 20 (depends on 19)

The computing device of claim 19, further causing the processor to perform operations comprising:
training an attention layer based on the plurality of matrices; and
training a feed-forward layer based on an output from the attention layer.
