mirror of
https://github.com/hanzoai/papers.git
synced 2026-10-30 14:58:42 +00:00
83 lines
3.4 KiB
TeX
83 lines
3.4 KiB
TeX
\section{1-Bit Prior Compression (BitDelta)}
|
|
|
|
\label{sec:bitdelta}
|
|
|
|
\subsection{Motivation}
|
|
|
|
Storing full-precision expert factors ($\Delta_m(v) \in \mathbb{R}$) for many
|
|
priors is wasteful given their inherent sparsity and limited dynamic range. We
|
|
propose a 1-bit quantization scheme inspired by
|
|
BitDelta~\cite{liu2024bitdelta} that achieves $29.5\times$ compression with
|
|
minimal quality loss.
|
|
|
|
\subsection{Quantization Scheme}
|
|
|
|
For each expert factor $\Delta_m$, the 1-bit representation is:
|
|
\begin{equation}
|
|
\widehat{\Delta}_m(v) = \alpha_m \cdot \sign(\Delta_m(v)),
|
|
\label{eq:1bit}
|
|
\end{equation}
|
|
where $\alpha_m > 0$ is a per-expert scale factor and $\sign(\cdot) \in \{-1, +1\}$.
|
|
The optimal scale minimizes reconstruction error:
|
|
\begin{equation}
|
|
\alpha_m^* = \argmin_{\alpha \geq 0} \sum_{v \in \mathcal{V}_m}
|
|
\left(\Delta_m(v) - \alpha \cdot \sign(\Delta_m(v))\right)^2
|
|
= \frac{1}{|\mathcal{V}_m|} \sum_{v \in \mathcal{V}_m} |\Delta_m(v)|.
|
|
\end{equation}
|
|
This is simply the mean absolute value of the non-zero entries.
|
|
|
|
\subsection{Compression Analysis}
|
|
|
|
\begin{proposition}[Compression Ratio]
|
|
The 1-bit representation achieves a compression ratio of:
|
|
\begin{equation}
|
|
\text{CR} = \frac{32 \cdot |\mathcal{V}_m|}{|\mathcal{V}_m| + 32} \approx 32 - \frac{32^2}{|\mathcal{V}_m|}
|
|
\end{equation}
|
|
for $|\mathcal{V}_m| \gg 32$, where the numerator accounts for 32-bit floats
|
|
and the denominator for 1-bit signs plus one 32-bit scale.
|
|
\end{proposition}
|
|
|
|
For typical expert factors with $|\mathcal{V}_m| \approx 100$, the compression
|
|
ratio is approximately $32 \times 100 / (100 + 32) \approx 24.2$. Across a full
|
|
prior bank with mixed sparsities, we observe an aggregate ratio of $29.5\times$.
|
|
|
|
\subsection{Approximation Error Bound}
|
|
|
|
\begin{lemma}[Quantization Error]
|
|
\label{lem:quant-error}
|
|
For expert factor $\Delta_m$ with entries drawn from a sub-Gaussian distribution
|
|
with parameter $\sigma$, the expected KL divergence between the exact and
|
|
quantized PoE distributions satisfies:
|
|
\begin{equation}
|
|
\mathbb{E}\left[\KL\left(\pi_{\text{ASO}} \| \hat{\pi}_{\text{ASO}}\right)\right]
|
|
\leq \frac{\eta_m^2}{2} \sum_{v \in \mathcal{V}_m}
|
|
\mathbb{E}\left[(\Delta_m(v) - \widehat{\Delta}_m(v))^2\right]
|
|
\leq \frac{\eta_m^2 \sigma^2 |\mathcal{V}_m|}{2}.
|
|
\end{equation}
|
|
\end{lemma}
|
|
|
|
\begin{proof}
|
|
By Pinsker's inequality and the linearity of the PoE in log-space, the KL
|
|
divergence is bounded by the squared $\ell_2$ norm of the quantization error
|
|
scaled by the expert weight. Each entry's quantization error is bounded by
|
|
$\sigma^2$ in expectation for sub-Gaussian distributions, giving the result.
|
|
\end{proof}
|
|
|
|
\subsection{Hierarchical Compression}
|
|
|
|
For large prior banks ($M > 100$), we employ hierarchical compression:
|
|
\begin{enumerate}[leftmargin=1.5em]
|
|
\item \textbf{Level 1:} Individual priors compressed to 1-bit as above.
|
|
\item \textbf{Level 2:} Similar priors (cosine similarity $> 0.9$) merged
|
|
by averaging their scale factors and ORing their support sets.
|
|
\item \textbf{Level 3:} Task-level aggregation via weighted median
|
|
(see DSO paper for details).
|
|
\end{enumerate}
|
|
|
|
This reduces the effective number of priors from $M$ to approximately
|
|
$M / 3$ without measurable quality loss.
|
|
|
|
% ============================================================================
|
|
% 6. CONVERGENCE ANALYSIS
|
|
% ============================================================================
|