Method and system for dynamic large model compression
Abstract
The present teaching relates to compressing a model for an application to generate a compressed model. The model has multiple layers, each of which has multiple nodes. Operating the model utilizing an application-dependent dataset, redundant nodes/layers in the model are identified via a loss-based assessment. The loss-based assessment using aggregated output vectors computed based on output vectors produced by the nodes/layers of the model in response to the data samples of the application-dependent dataset. Removing the redundant nodes/layers yields the compressed model.
Interactive Citation Constellation Global Citation Ranking
Interactive SVG Citation Constellation renders in Rust/WebAssembly. Prior art cited: 1 · Forward citations: 0.
Claims (20 — 3 Independent, 17 Dependent)
- Claim 1Independent Claim
A method, comprising: receiving an application-dependent dataset representative of an application to which an original machine learning model can be applied; providing, to the original model, each of data samples in the application-dependent dataset so that each node/layer in the original model produces an output vector in response to the data sample; obtaining, with respect to each of a plurality of nodes of each of multiple layers in the original machine learning model, an aggregated output vector based on the output vectors produced by the each node/layer in response to the data samples, respectively; computing similarity metrics that measure the similarity of aggregated output vectors of a pair of nodes or a pair of layers in the original machine learning model; selecting, based on the similarity metrics, removal candidate nodes and removal candidate layers that are functionally non-contributing to solving problems associated with the application; evaluating, based on an impact of removal on an overall performance of the original machine learning model, each of the removal candidate nodes and each of the removal candidate layers to identify redundant nodes and layers in the original machine learning model; removing redundant nodes and layers from the original model to generate a compressed model; and deploying the compressed model for the application.
- Claim 2Depends on #1
The method of claim 1, wherein the original model is an artificial neural network (ANN) having the multiple layers including an input layer, one or more intermediate layers, and an output layer, wherein each of the multiple layers includes a plurality of nodes.
- Claim 3Depends on #1
The method of claim 1, wherein the similarity metrics include: node level similarity metrics each of which represents the similarity of two aggregated output vectors of a pair of nodes; and layer level similarity metrics each of which represents the similarity of two aggregated output vectors of a pair of layers, wherein removal candidate nodes are selected based on the node level similarity metrics, and removal candidate layers are selected based on the layer level similarity metrics.
- Claim 4Depends on #3
The method of claim 3, wherein a similarity metric is computed via an inner product of two aggregated output vectors.
- Claim 5Depends on #4
The method of claim 4, further comprising: identifying a removal candidate node if the similarity metric of its aggregated output vector with that of another node satisfies a first pre-determined condition; and identifying a removal candidate layer if the similarity metric of its aggregated output vector with that of another layer satisfies a second pre-determined condition.
- Claim 6Depends on #1
The method of claim 1, wherein the evaluating comprises: selecting a removal candidate, which is either a removal candidate node or a removal candidate layer; simulating a removal of the removal candidate from the original model; computing, during the simulation, a first overall loss of the original model without the removal candidate based on a pre-determined loss function; assessing whether the first overall loss and a second overall loss of the original with the removal candidate therein satisfy a pre-determined condition; designating, if the pre-determined condition is satisfied, the removal candidate as redundant so that it is to be removed from the original model.
- Claim 7Depends on #6
The method of claim 6, further comprising: when the pre-determined condition is not satisfied, designating the removal candidate as non-redundant.
- Claim 8Independent Claim
A machine readable and non-transitory medium, having information recorded thereon, wherein the information, once read by the machine, causes the machine to perform the following steps: obtaining an original model from training via machine learning, wherein the original model includes multiple connected layers, each of which has a plurality of nodes; receiving an application-dependent dataset representative of an application to which the original model can be applied; providing, to the original model, each of data samples in the application-dependent dataset so that each node/layer in the original model produces an output vector in response to the data sample; obtaining, with respect to each of the plurality of nodes of each of the multiple layers, an aggregated output vector based on the output vectors produced by the node/layer in response to the data samples, respectively; computing similarity metrics each of which measures the similarity of aggregated output vectors of a pair of nodes or a pair of layers; selecting, based on the similarity metrics, removal candidate nodes and removal candidate layers that are functionally non-contributing to solving problems associated with the application; evaluating, based on an impact of removal on an overall performance of the original machine learning model, each of the removal candidate nodes and each of the removal candidate layers to identify redundant nodes and layers in the original model; removing redundant nodes and layers from the original model to generate a compressed model; and deploying the compressed model for the application.
- Claim 9Depends on #8
The medium of claim 8, wherein the original model is an artificial neural network (ANN) having the multiple layers including an input layer, one or more intermediate layers, and an output layer, wherein each of the multiple layers includes a plurality of nodes.
- Claim 10Depends on #8
The medium of claim 8, wherein the similarity metrics include: node level similarity metrics each of which represents the similarity of two aggregated output vectors of a pair of nodes; and layer level similarity metrics each of which represents the similarity of two aggregated output vectors of a pair of layers, wherein removal candidate nodes are selected based on the node level similarity metrics, and removal candidate layers are selected based on the layer level similarity metrics.
- Claim 11Depends on #10
The medium of claim 10, wherein a similarity metric is computed via an inner product of two aggregated output vectors.
- Claim 12Depends on #11
The medium of claim 11, wherein a removal candidate node is identified if the similarity metric of its aggregated output vector with that of another node satisfies a first pre-determined condition; and a removal candidate layer is identified if the similarity metric of its aggregated output vector with that of another layer satisfies a second pre-determined condition.
- Claim 13Depends on #8
The medium of claim 8, wherein the evaluating comprises: selecting a removal candidate, which is either a removal candidate node or a removal candidate layer; simulating a removal of the removal candidate from the original model; computing, during the simulation, a first overall loss of the original model without the removal candidate based on a pre-determined loss function; assessing whether the first overall loss and a second overall loss of the original with the removal candidate therein satisfy a pre-determined condition; designating, if the pre-determined condition is satisfied, the removal candidate as redundant so that it is to be removed from the original model.
- Claim 14Depends on #13
The medium of claim 13, wherein, the information, when read by the medium, further causes the machine to perform the following steps: when the pre-determined condition is not satisfied, designating the removal candidate as non-redundant.
- Claim 15Independent Claim
A system, comprising: an original model obtained from training via machine learning, wherein the original model includes multiple connected layers, each of which has a plurality of nodes, wherein the original model is configured for: receiving each of data samples in an application-dependent dataset representative of an application which the original model can be applied, and producing, at each node/layer of the original model, an output vector in response to each of the data samples; a model compression pipeline implemented by a processor and configured for: obtaining, with respect to each of the plurality of nodes of each of the multiple layers, an aggregated output vector based on the output vectors produced by the node/layer in response to the data samples, respectively, computing similarity metrics each of which measures the similarity of aggregated output vectors of a pair of nodes or a pair of layers, selecting, based on the similarity metrics, removal candidate nodes and removal candidate layers that are functionally non-contributing to solving problems associated with the application, evaluating, based on an impact of removal on an overall performance of the original machine learning model, each of the removal candidate nodes and each of the removal candidate layers to identify redundant nodes and layers in the original model, and removing redundant nodes and layers from the original model to generate a compressed model.
- Claim 16Depends on #15
The system of claim 15, wherein the similarity metrics include: node level similarity metrics each of which represents the similarity of two aggregated output vectors of a pair of nodes; and layer level similarity metrics each of which represents the similarity of two aggregated output vectors of a pair of layers, wherein removal candidate nodes are selected based on the node level similarity metrics, and removal candidate layers are selected based on the layer level similarity metrics.
- Claim 17Depends on #16
The system of claim 16, wherein a similarity metric is computed via an inner product of two aggregated output vectors.
- Claim 18Depends on #17
The system of claim 17, wherein a removal candidate node is identified if the similarity metric of its aggregated output vector with that of another node satisfies a first pre-determined condition; and a removal candidate layer is identified if the similarity metric of its aggregated output vector with that of another layer satisfies a second pre-determined condition.
- Claim 19Depends on #15
The system of claim 15, wherein the evaluating comprises: selecting a removal candidate, which is either a removal candidate node or a removal candidate layer; simulating a removal of the removal candidate from the original model; computing, during the simulation, a first overall loss of the original model without the removal candidate based on a pre-determined loss function; assessing whether the first overall loss and a second overall loss of the original with the removal candidate therein satisfy a pre-determined condition; designating, if the pre-determined condition is satisfied, the removal candidate as redundant so that it is to be removed from the original model.
- Claim 20Depends on #19
The system of claim 19, wherein the model compression pipeline is further configured for: when the pre-determined condition is not satisfied, designating the removal candidate as non-redundant.
Technical Overview & Description
BACKGROUND Machine learning models are used for various purposes including decision making, predicting trends and generating language and images. The models are generally trained initially on training data and then can perform such predictive and generative actions. During the training process, the models acquire the knowledge implicitly represented by the training data and may then be applied to make decisions in the future based on the acquired knowledge. Complex language models that are becoming common today are comprehensive models, constructed, e.g., via an artificial neural network, and may include millions of nodes across many layers. Both training and maintaining such a comprehensive model can be expensive in terms of time, space, computing resources, capital, etc. Although a comprehensive model may be used to handle a subset of the tasks that it is trained for, it may not be justified considering the cost. BRIEF DESCRIPTION OF THE DRAWINGS The methods, systems and/or programming described herein are further described in terms of exemplary embodiments. These exemplary embodiments are described in detail with reference to the drawings. These embodiments are non-limiting exemplary embodiments, in which like reference numerals represent similar structures throughout the several views of the drawings, and wherein: FIG. 1 depicts a model compression framework, in accordance with an embodiment of the present teaching; FIG. 2 A depicts an exemplary construct of an artificial neural network (ANN) with multiple layers, each of which includes a plurality of nodes simulating corresponding neurons; FIG. 2 B shows an exemplary node in an ANN and its function with respect to different inputs; FIG. 2 C shows an exemplary layer of an ANN with a plurality of nodes therein; FIG. 2 D illustrates an exemplary compressed model with certain nodes and layer(s) removed with the reduction determined based on application-dependent data set, in accordance with an embodiment of the pre
Cited By — Indexed Forward Citations (0 of 0 total)
No indexed citing patents in this generation yet. Ingest USPTO/PatentsView bulk citation tables via patents-ingest to expand the local forward citation graph.
References Cited — Backward Prior Art (1)
| Patent | Title | Year | Citations |
|---|
Non-Patent Literature (5)
- Cheng et al., NPL (
- “
- Model Compression and Acceleration for Deep Neural Networks
- ”
- Published 2018 by IEEE, 11 pages (Year: 2018).