# US 2026/0065058 A1 · Electronic device and method of training transformer model and performing inference using transformer model

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

- Number: US 2026/0065058 A1
- Document ID: US20260065058A1
- Status: Published application
- Kind: A1
- Application number: 19/298,694
- Filed: 2025-08-13
- Published: 2026-03-05
- Earliest claimed: 2024-08-28
- Assignees: Samsung Electronics Co., Ltd.; Sogang University Research & Business Development Foundation
- Applicants: Samsung Electronics Co., Ltd.
- Inventors: Sukju Kang; Beoungwoo Kang; Seunghun Moon; Hyunwoo Yu; Yubin Cho
- Web page: https://patentgrep.com/patent/US20260065058A1

## CPC

- G06N 3/082: modifying the architecture, e.g. adding, deleting or silencing nodes or connections
- G06N 3/045: Combinations of networks
- G06N 3/0455: Auto-encoder networks; Encoder-decoder networks
- G06N 3/063: using electronic means
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS

## Abstract

Provided is a method of performing inference by using a transformer model including a plurality of encoders and a plurality of decoders, wherein each of the plurality of encoders and the plurality of decoders includes a transformer block including an attention block, and the method is performed by an electronic device and includes receiving input data and using the transformer model to perform inference on the input data, thereby generating output data, wherein the generating of the output data includes skipping performing a key embedding computation, a query embedding computation, and a value embedding computation on input data of the attention block.

## Claims

### Claim 1

An electronic device comprising:
a processor configured to train a transformer model comprising a plurality of encoders and a plurality of decoders, or configured to perform inference by using a pre-trained transformer model; and
memory configured to store instructions executed by the processor,
wherein each of the plurality of encoders comprises a patch embedding block configured to perform patch embedding on input data and a first attention block configured to generate attention value data, and
wherein when the instructions are executed by the processor, the processor is configured to:
perform a normalization computation on patch data, which is a result by the patch embedding block, to thereby generate normalized patch data; and
use the normalized patch data as a query and a result of performing a spatial reduction computation on the normalized patch data as a key and a value in the first attention block, to thereby generate attention value data with respect to the patch data.

### Claim 2 (depends on 1)

The electronic device of claim 1,
wherein each of the plurality of decoders comprises at least one transformer block,
wherein each of the transformer blocks comprises a second attention block configured to generate attention value data, and
wherein the processor is configured to:
perform a normalization computation on first data generated from an encoder of the plurality of encoders corresponding to each of the plurality of decoders or second data generated from a previous transformer block, to thereby generate normalized data; and
use the normalized data as a query and a result of performing a spatial reduction computation on the normalized data as a key and a value in the second attention block, to thereby generate attention value data with respect to the first data or the second data.

### Claim 3 (depends on 1)

The electronic device of claim 1, wherein the processor is configured to skip, in the first attention block, one or more of key embedding, query embedding, and value embedding with respect to data input to the first attention block.

### Claim 4 (depends on 2)

The electronic device of claim 2, wherein the processor is configured to skip, in the second attention block, one or more of key embedding, query embedding, and value embedding with respect to data input to the second attention block.

### Claim 5 (depends on 2)

The electronic device of claim 2, wherein numbers of the transformer blocks in the plurality of decoders are different from each other.

### Claim 6 (depends on 2)

The electronic device of claim 2, wherein, as a number of executions of the patch embedding performed on data input to a first decoder among the plurality of decoders increases, a number of the transformer blocks in the first decoder increases.

### Claim 7 (depends on 1)

The electronic device of claim 1, wherein the processor is configured to:
perform first spatial reduction computation having a first reduction ratio on the normalized patch data, in a first attention block of a first encoder, when training the transformer model; and
perform second spatial reduction computation having a second reduction ratio on the normalized patch data, in the first attention block of the first encoder, when performing inference by using the pre-trained transformer model,
wherein the first reduction ratio is different from the second reduction ratio.

### Claim 8 (depends on 7)

The electronic device of claim 7, wherein the second reduction ratio is greater than the first reduction ratio.

### Claim 9

A method of training a transformer model comprising a plurality of encoders and a plurality of decoders, wherein each of the plurality of encoders and the plurality of decoders comprises a transformer block comprising an attention block, and the method is performed by an electronic device and comprises:
receiving target data and training data; and
training the transformer model to output the target data with respect to the training data,
wherein the training of the transformer model comprises skipping performing one or more of a key embedding computation, a query embedding computation, and a value embedding computation on input data of the attention block.

### Claim 10 (depends on 9)

The method of claim 9,
wherein each of the plurality of encoders comprises a patch embedding block configured to perform patch embedding on input data and a first attention block configured to generate attention value data, and
wherein the training of the transformer model comprises:
performing a normalization computation on patch data, which is a result by the patch embedding block, to thereby generate normalized patch data;
performing a spatial reduction computation on the normalized patch data; and
using the normalized patch data as a query and a result of performing a spatial reduction computation on the normalized patch data as a key and a value in the first attention block, to thereby generate attention value data with respect to the patch data.

### Claim 11 (depends on 9)

The method of claim 9,
wherein each of the plurality of decoders comprises at least one transformer block,
wherein each of the transformer blocks comprises a second attention block configured to generate attention value data, and
wherein the training of the transformer model comprises:
performing a normalization computation on first data generated from an encoder of the plurality of encoders corresponding to each of the plurality of decoders or second data generated from a previous transformer block, to thereby generate normalized data;
performing a spatial reduction computation on the normalized data; and
using the normalized data as a query and a result of performing a spatial reduction computation on the normalized data as a key and a value in the second attention block, to thereby generate attention value data with respect to the first data or the second data.

### Claim 12 (depends on 11)

The method of claim 11, wherein numbers of the transformer blocks in the plurality of decoders are different from each other.

### Claim 13 (depends on 11)

The method of claim 11, wherein, as a number of executions of patch embedding performed on data input to a first decoder among the plurality of decoders increases, a number of the transformer blocks in the first decoder increases.

### Claim 14

A method of performing inference by using a transformer model comprising a plurality of encoders and a plurality of decoders, wherein each of the plurality of encoders and the plurality of decoders comprises a transformer block comprising an attention block, and the method is performed by an electronic device and comprises:
receiving input data; and
using the transformer model to perform inference on the input data, thereby generating output data,
wherein the generating of the output data comprises skipping performing one or more of a key embedding computation, a query embedding computation, and a value embedding computation on input data of the attention block.

### Claim 15 (depends on 14)

The method of claim 14,
wherein each of the plurality of encoders comprises a patch embedding block configured to perform patch embedding on the input data and a first attention block configured to generate attention value data, and
wherein the generating of the output data comprises:
performing a normalization computation on patch data, which is a result by the patch embedding block, to thereby generate normalized patch data;
performing a spatial reduction computation on the normalized patch data; and
using the normalized patch data as a query and a result of performing a spatial reduction computation on the normalized patch data as a key and a value in the first attention block, to thereby generate attention value data with respect to the patch data.

### Claim 16 (depends on 14)

The method of claim 14,
wherein each of the plurality of decoders comprises at least one transformer block, each of the transformer blocks comprises a second attention block configured to generate attention value data, and
wherein the generating of the output data comprises:
performing a normalization computation on first data generated from an encoder of the plurality of encoders corresponding to each of the plurality of decoders or second data generated from a previous transformer block, to thereby generate normalized data;
performing a spatial reduction computation on the normalized data; and
using the normalized data as a query and a result of performing a spatial reduction computation on the normalized data as a key and a value in the second attention block, to thereby generate attention value data with respect to the first data or the second data.

### Claim 17 (depends on 16)

The method of claim 16, wherein numbers of the transformer blocks in the plurality of decoders are different from each other.

### Claim 18 (depends on 16)

The method of claim 16, wherein, as a number of executions of patch embedding performed on data input to a first decoder among the plurality of decoders increases, a number of the transformer blocks in the first decoder increases.

### Claim 19 (depends on 15)

The method of claim 15, further comprising:
performing first spatial reduction computation having a first reduction ratio on first normalized patch data in the first attention block, to thereby pre-train the transformer model,
wherein the generating of the output data further comprises performing second spatial reduction computation having a second reduction ratio on second normalized patch data in the first attention block, to thereby perform inference by using the transformer model, and
wherein the first reduction ratio is different from the second reduction ratio.

### Claim 20 (depends on 19)

The method of claim 19, wherein the second reduction ratio is greater than the first reduction ratio.
