利用索引濃縮與低位元量化技術於推薦系統中實現嵌入表壓縮

Embedding Table Compression in Recommender Systems via Index Condensation and Low-Bit Quantization

檔案

全文將於 2027年9月5日 起公開。

日期

2022

類型

語言

英文

摘要

本篇論文之中提出兩項可應用於推薦系統(Recommender System)中之嵌入表(Embedding Table)上實現模型壓縮的技術,分別為索引濃縮(Index Condensation)以及低位元量化技術(Low-Bit Quantization)。此兩項技術皆可以大幅減少模型中參數的數量,以減緩過大的嵌入表造成的大量記憶體用量需求。同時由於參數經過量化,經過壓縮後的模型可以使用整數運算器在硬體上進行推論,相較於使用32位元浮點數運算器有更小的硬體面積、功耗以及更低的運算延遲。
本篇論文提出的第一項索引濃縮技術針對嵌入表的索引維度進行壓縮。嵌入表是一個用於將模型輸入之分類資料(Categorical Data)轉換為特徵向量(Feature Vector)的矩陣,透過將不同的分類資料映射(Mapping)成為索引值(Index)並經由查表的方式來得出特徵向量。本項技術透過分析特徵向量之權重(Weight)數值來計算矩陣中各個索引的重要程度,並將重要程度低於一定閥值之索引透過雜湊(Hashing)的方式分組並映射至壓縮後的嵌入表索引,最後再將模型重新訓練。藉由權重共享的概念,使數個較為不重要的索引共用同一特徵向量以達到減少索引數量以及壓縮嵌入表的效果。
第二項則是使用低位元格式對模型進行量化,首先我們使用對稱量化(Symmetric Quantization)技術將模型以八位元整數格式進行量化,而針對參數量大的嵌入表,我們進一步採用比八位元更少位元數的格式來做儲存,以減少模型整體的大小。在本篇論文中,我們新提出一個可適應嵌入表中不同權重分布的彈性六位元格式(Flexible-6-Bit Format),相較於原始的六位元整數格式能更精確地表示參數,藉以降低因量化而產生的誤差。此外我們所提出的彈性六位元格式只需要簡單的硬體便可以轉換成標準的八位元整數格式以利進行後續的運算,在硬體方面並不會需要過大的代價。為了對模型進一步的壓縮,我們還使用了更低位元的格式,並使用K-平均分群演算法(K-means Clustering)來尋找數個集群中心值,再以編碼(Encoding)的方式表示。透過上述的方法,我們可以在模型的精準度損失不大的情況下將表示每個參數所需的位元數最多可降低至三個位元。
透過結合上述兩項技術並套用至由Facebook推出的點擊率預測模型DLRM,並搭配資料前處理以及特徵濃縮(Feature Condensation)兩項相關的壓縮技術,在使用Criteo Terabyte資料集的情況下可以在不損失準確度的同時在嵌入表上實現超過三萬倍以上的壓縮,其中單獨計算本篇的兩項技術共計可帶來超過22倍的壓縮,表現十分優異。
In this thesis, we proposed two techniques, named Index Condensation and Low-Bit Quantization, which can be applied to embedding tables of recommender systems for model compression. We can dramatically reduce the model size to minimize the memory footprint required by huge embedding tables. Furthermore, since all parameters have been quantized, the model inference can be done with only integer computing engines, which have smaller hardware areas, lower energy consumption, and lower latency than 32-bit floating point ones.
The first technique is Index Condensation, which targets on compression embedding tables through index dimension. An embedding table is a matrix that can transfer input categorical data into feature vectors by mapping each entry of categorical data to an index and then get its corresponding feature vector via embedding table lookup. In our Index Condensation, the significance of each index in an embedding table is measured first. Then we map those indices which significance lower than a specific threshold to a new index of the condensed embedding table by a hashing function, then retrain the model. Index Condensation merges multiple insignificant feature vector into one to reduce the number of indices of each embedding table to achieve model compression.
The second technique is to utilize low-bit formats for model quantization. First, we apply symmetric quantization to the whole model. Then, low-bit formats are further used to represent parameters of large embedding tables. In this thesis, we proposed a new 6-bit format, named Flexible-6-bit, which can fit various weight distributions of an embedding table. It can represent parameter values in embedding tables more precisely than the original 6-bit integer format. Moreover, the number represented in Flexible-6-bit format can be easily converted back to the same value in 8-bit integer format for computation and the above conversion only requires simple hardware. Furthermore, to increase the compression ratio, we have also tried to do model quantization with even fewer bits. By using the K-means clustering algorithm to find the center values and represent them through encoding, we can further reduce the number of bits per parameter up to 3 bits only with a minor model accuracy loss.
The proposed techniques are applied to Facebook’s Click-Through Rate prediction model DLRM and evaluated using the Criteo Terabyte dataset. Incorporating the proposed two techniques with data preprocessing and Feature Condensation, we successfully achieve an extraordinary compression rate of 30,000x+ with no model accuracy loss. while the compression rate provided by two techniques proposed in this thesis is over 22x.

所屬典藏

電子研究所
顯示完整詮釋資料 統計資料

引用此條目

Chu, Y.-D. (2022). Embedding Table Compression in Recommender Systems via Index Condensation and Low-Bit Quantization. https://thesis.lib.nycu.edu.tw/handle/20.500.14371/80982

BibTeX RIS

引用文字依 APA 第 7 版格式自動產生,使用前請再核對。

分享

永久網址:https://thesis.lib.nycu.edu.tw/handle/20.500.14371/80982