# US 2026/0228528 A1 · Systems and methods for lossless weight compression for back-to-back linear layers in transformers and other neural networks

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

- Number: US 2026/0228528 A1
- Document ID: US20260228528A1
- Status: Published application
- Kind: A1
- Application number: 19/530,393
- Filed: 2026-02-05
- Published: 2026-08-06
- Earliest claimed: 2025-02-05
- Inventors: Nils Graef
- Web page: https://patentgrep.com/patent/US20260228528A1

## CPC

- G06N 3/0455: Auto-encoder networks; Encoder-decoder networks
- G06N 3/08: Learning methods
- G06N 3/04: Architecture, e.g. interconnection topology
- G06N 3/044: Recurrent networks, e.g. Hopfield networks
- G06N 3/045: Combinations of networks
- G06N 3/0464: Convolutional networks [CNN, ConvNet]
- G06N 3/048: Activation functions
- G06N 3/0495: Quantised networks; Sparse networks; Compressed networks
- G06N 3/0499: Feedforward networks
- G06N 3/063: using electronic means
- G06N 3/082: modifying the architecture, e.g. adding, deleting or silencing nodes or connections
- G06N 3/084: Backpropagation, e.g. using gradient descent
- G06N 3/09: Supervised learning
- G06N 3/096: Transfer learning
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS

## Abstract

This specification discloses systems and methods for improving the inference and training efficiency of neural networks with back-to-back linear layers as present in transformer and diffusion models. Unlike standard weight compression and pruning techniques, the disclosed methods and systems use matrix inversion to reduce the total number of weights in an exact, mathematically equivalent way and thus without compromising model accuracy. The elimination of weights results in lower compute and memory complexities, and thus lower cost-per-token for generative AI. One embodiment of the invention reduces the total number of weights of a standard transformer model. Another embodiment of the invention discloses a simplified multi-head attention (MLA) scheme with lower memory and compute complexities.

## Claims

### Claim 1

A computer-implemented method for optimizing a neural network, the method comprising: identifying a sequence of back-to-back linear layers within a neural network architecture; generating a reduced set of weights for said sequence of back-to-back linear layers using matrix inversion, wherein the reduced set of weights contains fewer total weights than the original sequence; and configuring the neural network to execute an inference or training operation using the reduced set of weights; wherein the execution using the reduced set of weights is mathematically equivalent to the execution using the original sequence of back-to-back linear layers.

### Claim 2 (depends on 1)

The method of claim 1, wherein the neural network is a transformer model or a diffusion model.

### Claim 3 (depends on 1)

The method of claim 1, wherein there are two back-to-back linear layers with weight matrices WA and WB for the first (WA) and second (WB) linear layers as illustrated in FIG. 1, wherein the method of reducing the size of the weight matrix WB comprises: splitting weight matrix WB into two submatrices WB1 and WB2 where WB1 is a square matrix such that WB=[WB1,WB2]; eliminating submatrix WB1 by fusing it with matrix WA as
W
A
*
=
W
A
⁢
W
B
⁢
1
and by changing WB2 to
W
B
⁢
2
*
=
W
B
⁢
1
-
1
⁢
W
B
⁢
2
,
wherein
W
B
⁢
1
-
1
is the matrix inverse of submatrix WB1; wherein this transformation is mathematically equivalent to the original sequence of back-to-back linear layers and eliminates r2 weights and multiplications where r is the dimension of the r×r square submatrix WB1.

### Claim 4 (depends on 1)

The method of claim 1, wherein there are two back-to-back linear layers with weight matrices WA and WB for the first (WA) and second (WB) linear layers as illustrated in FIG. 2, wherein the method of reducing the size of the weight matrix WA comprises: splitting weight matrix WA into two submatrices WA1 and WA2 where WA1 is a square matrix such that WA=[WA1; WA2]; eliminating submatrix WA1 by fusing it with matrix WB as
W
B
*
=
W
A
⁢
1
⁢
W
B
and by changing WA2 to
W
A
⁢
2
*
=
W
A
⁢
2
⁢
W
A
⁢
1
-
1
,
wherein
W
A
⁢
1
-
1
is the matrix inverse of submatrix WA1; wherein this transformation is mathematically equivalent to the original sequence of back-to-back linear layers and eliminates r2 weights and multiplications where r is the dimension of the r×r square submatrix WA1.

### Claim 5 (depends on 3)

The method of claim 3, wherein the two back-to-back linear layers are the value (V) and output (O) projections for each head of multi-head attention (MHA), multi-latent attention (MLA), multi-query attention (MQA), or grouped-query attention (GQA) of an attention layer in a neural network as illustrated in FIG. 3.

### Claim 6 (depends on 4)

The method of claim 4, wherein the two back-to-back linear layers are the value (V) and output (O) projections for each head of multi-head attention (MHA), multi-latent attention (MLA), multi-query attention (MQA), or grouped-query attention (GQA) of an attention layer in a neural network as illustrated in FIG. 4.

### Claim 7 (depends on 4)

The method of claim 4, wherein the two back-to-back linear layers are the query (Q) and key (K) projections or vice versa for each head of multi-head attention (MHA), multi-latent attention (MLA), multi-query attention (MQA), or grouped-query attention (GQA) of an attention layer in a neural network as illustrated in FIG. 5 and FIG. 6 such that the dot-products of the query and key projections are mathematically equivalent to the dot-products generated by the original query and key projections.

### Claim 8 (depends on 3)

The method of claim 3, wherein the two back-to-back linear layers are the query-latent and query (Q) projections of multi-latent attention (MLA) of an attention layer in a neural network.

### Claim 9 (depends on 4)

The method of claim 4, wherein the two back-to-back linear layers are the query-latent and query (Q) projections of multi-latent attention (MLA) of an attention layer in a neural network.

### Claim 10 (depends on 3)

The method of claim 3, wherein the two back-to-back linear layers are the KV-latent (key-value latent) projection and KV (key-value) projection of multi-latent attention (MLA) of an attention layer in a neural network as illustrated in FIG. 7(b).

### Claim 11 (depends on 10)

The method of claim 10, wherein the separate cache and weight matrix solely used for the ROPE (Rotary Positional Embedding) units is eliminated and instead the ROPE units are directly sourced from the latent cache to better utilize the latent cache as illustrated in FIG. 7(c).

### Claim 12 (depends on 4)

The method of claim 4, wherein the two back-to-back linear layers are the KV-latent (key-value latent) projection and KV (key-value) projection of multi-latent attention (MLA) of an attention layer in a neural network.

### Claim 13 (depends on 3)

The method of claim 3, wherein the two original back-to-back linear layers have been obtained by factorizing an originally larger weight matrix into two smaller matrices by using approximate weight compression schemes such as SVD (singular value decomposition); wherein this originally larger weight matrix is a linear layer of a neural network such as the linear layers of the feedforward network (FFN) in an LLM (large language model) as conceptually illustrated in FIG. 1.

### Claim 14 (depends on 4)

The method of claim 4, wherein the two original back-to-back linear layers have been obtained by factorizing an originally larger weight matrix into two smaller matrices by using approximate weight compression schemes such as SVD (singular value decomposition); wherein this originally larger weight matrix is a linear layer of a neural network such as the linear layers of the feedforward network (FFN) in an LLM (large language model) as conceptually illustrated in FIG. 2.
