# US 2022/0092382 A1 · Quantization for neural network computation

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

- Number: US 2022/0092382 A1
- Document ID: US20220092382A1
- Status: Published application
- Kind: A1
- Application number: 17/130,690
- Filed: 2020-12-22
- Published: 2022-03-24
- Earliest claimed: 2020-09-23
- Assignees: The Governing Council of the University of Toronto
- Applicants: The Governing Council of the University of Toronto
- Inventors: Andreas Moshovos; Ali Hadi Zadeh; Isak Edo Vivancos; Omar Mohamed Awad
- Web page: https://patentgrep.com/patent/US20220092382A1

## CPC

- G06N 3/04: Architecture, e.g. interconnection topology
- G06N 3/063: using electronic means
- G06N 3/045: Combinations of networks
- G06N 3/0495: Quantised networks; Sparse networks; Compressed networks
- G06N 3/0499: Feedforward networks
- Y02D 10/00: Energy efficient computing, e.g. low power processors, power management or thermal management
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- Y02D: CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE

## Abstract

A method for memory storage including storing a neural network by storing values of the neural network each as a reference to a representative value; and, in some embodiments, storing additional values of the neural network. Each of the representative values can be generated by assigning each of the values of the neural network to a cluster; and for each cluster, selecting a centroid from the cluster. The method can include performing one or more multiply-accumulate operations A1B1+ . . . +AnBn on input vectors A and input vectors B, by accumulating input vectors A to an accumulated sum of input vectors A per input vector B having the same representative value and subsequently multiplying each of the accumulated sums of input vectors A by the representative value of the input vector B. A system is also described, as well as a method for configuring memory according to a data structure.

## Claims

### Claim 1

A computer-implemented method for memory storage, comprising:
storing a neural network in memory by:
storing, in the memory, one or more values of the neural network each as a reference to a representative value; and
storing, in the memory, one or more additional values of the neural network.

### Claim 2 (depends on 1)

The computer-implemented method of claim 1, the reference being the representative value.

### Claim 3 (depends on 1)

The computer-implemented method of claim 1, each of the references being generated by quantizing one of the one or more values of the neural network.

### Claim 4 (depends on 1)

The computer-implemented method of claim 1, further comprising storing, in the memory, a reconstruction table storing each of representative values for each references.

### Claim 5 (depends on 1)

The computer-implemented method of claim 1, each of the one or more representative values being generated by:
assigning each of the one or more values of the neural network to a cluster; and
for each cluster, selecting a selected value from the cluster as the representative value for each of the one or more values of the neural network of the cluster.

### Claim 6 (depends on 5)

The computer-implemented method of claim 5, each selected value being a centroid, the centroid being an average of the one or more values of the neural network in the cluster that the selected value is selected from.

### Claim 7 (depends on 5)

The computer-implemented method of claim 5, further comprising: minimizing a sum of each distance between a) each of the one or more values of the neural network and b) the selected value of the cluster that the value is assigned to by iteratively:
performing the assigning, the assigning further comprising reassigning a first value of the one or more values of the neural network from an original cluster of the clusters to a new cluster of the clusters where an original distance of the first value to the selected value of the original cluster is greater than a new distance of the first value to the selected value of the new cluster; and
subsequently performing the selecting on at least the original cluster and the new cluster;
wherein the first value is a different value of the one or more values of the neural network upon each iteration.

### Claim 8 (depends on 1)

The computer-implemented method of claim 1, further comprising:
generating an output from performing one or more multiply-accumulate operations A1B1+ . . . +AnBn on input vectors A and input vectors B, wherein n is the n-th input vector and wherein one or more of input vectors B are each one of the representative values, by accumulating input vectors A to an accumulated sum of input vectors A per input vector B having the same representative value and subsequently multiplying each of the accumulated sums of input vectors A by the representative value of the input vector B.

### Claim 9 (depends on 8)

The computer-implemented method of claim 8, further comprising storing, in the memory, one or more additional values of the neural network wherein one or more of the input vectors B are each one of the additional values.

### Claim 10 (depends on 1)

The computer-implemented method of claim 1, each of the additional values satisfying a criterion of a distribution, content, or value count of a component of the neural network.

### Claim 11 (depends on 1)

The computer-implemented method of claim 1, each of the additional values being in a component of the neural network and having a probability density function (pdf) less than a threshold value, the pdf defined by
pdf
⁢
(
x
|
μ
,
σ
2
)
=
1
2
⁢
π
⁢
σ
2
⁢
e
-
(
x
-
μ
)
2
2
⁢
σ
2
,
wherein x is the additional value, μ is a mean of one or more parameters in the component of the neural network having x, and σ is a standard deviation of one or more parameters in the component of the neural network having x.

### Claim 12 (depends on 1)

The computer-implemented method of claim 1, each of the additional values being outside a threshold range from a distribution fit of both the values and the additional values in a component of the neural network.

### Claim 13 (depends on 1)

The computer-implemented method of claim 1, at least one of the references being encoded using three bits or four bits.

### Claim 14 (depends on 1)

The computer-implemented method of claim 1, at least one of the one or more values of the neural network being an embedding.

### Claim 15 (depends on 1)

The computer-implemented method of claim 1, at least one of the one or more values of the neural network being a weight.

### Claim 16

A system for computation of layers in a neural network, comprising:
one or more processing elements each configured to accumulate one or more values of the neural network for each of one or more references to an identical representative value to generate an output for each accumulation; and
a shared processing unit configured to, for each of the outputs from each processing element, multiply the output with the identical representative value respective to the output to generate a final output.

### Claim 17 (depends on 16)

The system of claim 16, the shared processing unit further configured to accumulate one or more of the final outputs with one or more outlier values.

### Claim 18

A computer system for memory storage, comprising:
a memory;
at least one processor in communication with the computer memory, the memory comprising instructions which, when executed by the at least one processor, carries out the steps of:
storing a neural network in memory by:
storing, in the memory, one or more values of the neural network each as a reference to a representative value; and
storing, in the memory, one or more additional values of the neural network.

### Claim 19 (depends on 18)

The computer system of claim 18, each of the one or more representative values being generated by:
assigning each of the one or more values of the neural network to a cluster; and
for each cluster, selecting a selected value from the cluster as the representative value for each of the one or more values of the neural network of the cluster.

### Claim 20 (depends on 19)

The computer system of claim 19, the steps further comprising: minimizing a sum of each distance between a) each of the one or more values of the neural network and b) the selected value of the cluster that the value is assigned to by iteratively:
performing the assigning, the assigning further comprising reassigning a first value of the one or more values of the neural network from an original cluster of the clusters to a new cluster of the clusters where an original distance of the first value to the selected of the original cluster is greater than a new distance of the first value to the selected value of the new cluster; and
subsequently performing the selecting on at least the original cluster and the new cluster;
wherein the first value is a different value of the one or more values of the neural network upon each iteration.

### Claim 21 (depends on 18)

The computer system of claim 18, the steps further comprising:
generating an output from performing one or more multiply-accumulate operations A1+ . . . +AnBn on input vectors A and input vectors B, wherein n is the n-th input vector and wherein one or more of input vectors B are each one of the representative values, by accumulating input vectors A to an accumulated sum of input vectors A per input vector B having the same representative value and subsequently multiplying each of the accumulated sums of input vectors A by the representative value of the input vector B.

### Claim 22

A non-transient computer-readable medium containing computer-readable instructions which, when executed by a computer processor, perform a method of:
storing a neural network in memory by:
storing, in the memory, one or more values of the neural network each as a reference to a representative value; and
storing, in the memory, one or more additional values of the neural network.

### Claim 23 (depends on 22)

The non-transient computer-readable medium of claim 22, each of the one or more representative values being generated by:
assigning each of the one or more values of the neural network to a cluster; and
for each cluster, selecting a selected value from the cluster as the representative value for each of the one or more values of the neural network of the cluster.

### Claim 24 (depends on 23)

The non-transient computer-readable medium of claim 23, each selected value being a centroid, the centroid being an average of the one or more values of the neural network in the cluster that the selected value is selected from.

### Claim 25 (depends on 24)

The non-transient computer-readable medium of claim 24, the method further comprising: minimizing a sum of each distance between a) each of the one or more values of the neural network and b) the centroid of the cluster that the value is assigned to by iteratively:
performing the assigning, the assigning further comprising reassigning a first value of the one or more values of the neural network from an original cluster of the clusters to a new cluster of the clusters where an original distance of the first value to the centroid of the original cluster is greater than a new distance of the first value to the centroid of the new cluster; and
subsequently performing the selecting on at least the original cluster and the new cluster;
wherein the first value is a different value of the one or more values of the neural network upon each iteration.

### Claim 26 (depends on 22)

The non-transient computer-readable medium of claim 22, the method further comprising:
generating an output from performing one or more multiply-accumulate operations A1B1+ . . . +AnBn on input vectors A and input vectors B, wherein n is the n-th input vector and wherein one or more of input vectors B are each one of the representative values, by accumulating input vectors A to an accumulated sum of input vectors A per input vector B having the same representative value and subsequently multiplying each of the accumulated sums of input vectors A by the representative value of the input vector B.

### Claim 27 (depends on 26)

The non-transient computer-readable medium of claim 26, the method further comprising storing, in the memory, one or more additional values of the neural network, wherein one or more of the input vectors B are each one of the additional values.
