mirror of
https://github.com/zoo-apps/papers.git
synced 2026-10-30 14:56:54 +00:00
42 lines
1.2 KiB
TeX
42 lines
1.2 KiB
TeX
\section{BitDelta Compression}
|
|
|
|
\label{sec:compression}
|
|
|
|
\subsection{Algorithm}
|
|
|
|
BitDelta compresses embeddings through delta encoding and quantization:
|
|
|
|
\begin{algorithm}
|
|
\caption{BitDelta Compression}
|
|
\label{alg:bitdelta}
|
|
\begin{algorithmic}[1]
|
|
\REQUIRE Embedding $v \in \mathbb{R}^{7680}$
|
|
\STATE Compute reference: $v_{\text{ref}} = \text{median}(\text{corpus})$
|
|
\STATE Compute delta: $\delta = v - v_{\text{ref}}$
|
|
\STATE Quantize: $\hat{\delta} = \text{round}(\delta / s) \cdot s$ where $s = \frac{\max|\delta|}{127}$
|
|
\STATE Store: scale $s$ (4 bytes) + quantized $\hat{\delta}$ (7680 bytes / 8 = 960 bytes)
|
|
\RETURN Compressed: 964 bytes total
|
|
\end{algorithmic}
|
|
\end{algorithm}
|
|
|
|
\subsection{Decompression}
|
|
|
|
\begin{equation}
|
|
\hat{v} = v_{\text{ref}} + s \cdot \hat{\delta}
|
|
\end{equation}
|
|
|
|
Decompression requires only the shared reference vector and per-embedding scale + deltas.
|
|
|
|
\subsection{Quality Analysis}
|
|
|
|
\begin{proposition}[Compression Error Bound]
|
|
BitDelta compression with 8-bit quantization achieves:
|
|
\begin{equation}
|
|
\frac{\|v - \hat{v}\|_2}{\|v\|_2} < 0.5\%
|
|
\end{equation}
|
|
for typical embedding distributions.
|
|
\end{proposition}
|
|
|
|
This translates to $<$0.3\% degradation in retrieval accuracy.
|
|
|