Greedy Residual Decomposition

How BSA encodes every neural-network weight as a sum of signed powers of two — the foundational algorithm behind Dynamic-R, CIM encoding, and Software Defined Compute.

w × x → Σr=1R sr · (x ≪ er)   where sr ∈ {+1, −1}
Select a Weight to Decompose
0.7346 General (R≈3)
0.5000 Exact PoT (R=1)
0.2500 Exact PoT (R=1)
0.7500 0.5+0.25 (R=2)
−0.3750 Negative (R=2)
3.1416 π (R≈5+)
0.6250 0.5+0.125 (R=2)
w = select a weight above
Press ▶ Decompose or ⏭ Step to begin
Term count (R)
55%
R=1
30%
R=2
10%
R=3
4%
R=4
1%
R≥5
R̄ ≈ 1.6

Quantization-Aware Training (QAT) drives neural-network weights toward exact powers of two. After QAT, the majority of weights are already at — or very near — a single power of two.

This means 55% of weights decompose in just one shift-add cycle, and another 30% need only two. The hardware terminates early per-weight — no wasted compute.

|rR| ≤ |w| · (⅓)R  — geometric convergence, each term captures ≥ ⅔ of the remaining error
R (terms) Max Residual Bits of Precision Equivalent Precision

This greedy decomposition is the foundation of everything. From it, the Dynamic-R hardware adapts per-weight precision. CIM encoding programs RRAM cells with signed power-of-two conductances. And Software Defined Compute maps shift-add terms to heterogeneous accelerators. One algorithm — the entire BSA compute paradigm.