Manuscript Offprint

arXiv:2610.22621

Noise-shaped Sampling and Annealing for Scalable On-the-edge Training of Binary and Ternary AI Models

Zihao Chen, Zhili Xiao, Rui-Jie Zhu, Yipeng Wang, Jason Eshraghian, Shantanu Chakrabartty

Abstract

The training loss of binary and ternary neural networks, expanded as a multilinear polynomial over the discrete weights, is structurally equivalent to the energy of a hierarchical high-order Ising model. We exploit this equivalence to apply Ising solvers to discrete-weight network training, while accounting for a fundamental difference in objectives: an Ising solver seeks the ground state of a fixed energy function, whereas training seeks solutions that generalize to unseen data. Our key contribution is ΣΔ\Sigma\Delta-Sampler, an optimizer that reconciles these objectives by embedding a stochastic sampling-and-annealing step as a noisy quantizer inside a first-order ΣΔ\Sigma\Delta noise-shaping loop. The loop pushes noise from weight quantization, high-order frustration, and mini-batch sampling out of the low-frequency adaptation band, so that discrete weight updates follow the smooth descent trajectories embedded in the rugged loss landscape. We validate the framework on a planted quadratic unconstrained binary optimization (QUBO) benchmark with a known minimizer; on CIFAR-10, where a 13M-parameter ternary model comes within 1% of full-precision accuracy; on ImageNet-1k, where a ternary ResNet-18 comes within 0.4% Top-5 accuracy.

of a ternary baseline; on class-incremental continual learning, where prior-task accuracy is preserved; and on MatMul-free language models up to 2.7B parameters, where it outperforms a straight-through-estimator baseline under matched continued pre-training. Compared with standard quantization-aware training, ΣΔ\Sigma\Delta-Sampler reduces the training memory footprint by over 50%, delivers an order-of-magnitude speed-up, and reduces weight-update memory traffic by four orders of magnitude, making it attractive for on-device training and fine-tuning of large binary and ternary models.

1 Introduction

The Ising model, originally introduced to describe ferromagnetic phase transitions in statistical physics, has since become a unifying abstraction for combinatorial optimization [1–3]. This has given rise to a rich ecosystem of efficient Ising solvers, including quantum annealers [4, 5], coherent optical Ising machines [6], probabilistic-bit [7, 8] and oscillator-based hardware [9, 10], parallel digital annealing algorithms [11–14], and neuromorphic architectures [15, 16]. In its mth-order generalization, the Hamiltonian (energy function) of the system takes the form

H(m)(s)=−∑cJc(m)∏k∈csk,(1)\mathcal{H}^{(m)}(\mathbf{s})=-\sum_{c}J_{c}^{(m)}\prod_{k\in c}s_{k}, \tag{1}

where sk∈{−1,+1}s_k \in \{-1, +1\} are binary spins, each clause cc is a set of exactly mm spin indices, and Jc(m)J_c^{(m)} is the corresponding mmth-order coupling strength [16]. The appeal of these solvers is that they treat the discreteness of the spin space as a structural feature rather than an obstacle, performing massively parallel stochastic search using only binary states, thermal fluctuations, and local-field arithmetic as computational primitives. This makes these solvers highly efficient on dedicated hardware. To date, Ising solvers have been applied predominantly to combinatorial optimization, where the Hamiltonian is explicitly specified and success is defined as reaching the exact ground state (global minimum) of the energy function. Whether the algorithmic principles underlying these solvers can be leveraged for learning problems remains an open question. In learning, the goal is not its exact ground state but a solution that minimizes the generalization error. Discrete-weight neural networks are a natural intersection of the two realms. As shown in Fig. 1a, Binary neural networks (BNNs), which constrain the weights to W∈{−1,+1}D\mathbf{W} \in \{-1, +1\}^D, were originally developed as the extreme point of the model-compression spectrum [17–21]: the special case of 1-bit quantization, applied to the weights and, in fully binarized networks, also to the activations [22–24]. Ternary networks extend the weight alphabet to {−1,0,+1}\{-1, 0, +1\}, and recent frameworks such as BitNet [25] enable from-scratch pre-training of large language models (LLMs) with 1-bit (binary) and 1.58-bit (ternary) weights. By replacing multiply-accumulate operations with bitwise XNOR, sign-switching, and popcount instructions, discrete-parameter networks achieve dramatic reductions in both compute and memory, making them compelling candidates for deployment in energy-constrained settings such as embedded sensors, mobile platforms, and edge-intelligence systems [26–32].

The structural correspondence between Ising models and discrete-weight networks is illustrated in Fig. 1b. Consider a network of arbitrary architecture with network output z\mathbf{z}, whose inputs x\mathbf{x} and targets y\mathbf{y} are drawn from a stationary data distribution. The training loss L\mathcal{L} is then a function of the discrete weights W\mathbf{W} alone, that is, a real-valued function on the finite set {−1,+1}D\{-1,+1\}^D of 2D2^D weight configurations. For every subset S⊆{1,…,D}S \subseteq \{1,\ldots,D\} of weight indices, define the parity monomial ∏i∈SWi\prod_{i \in S} W_i. These 2D2^D monomials form an orthonormal basis (the Walsh–Fourier basis) for the space of real-valued functions on {−1,+1}D\{-1,+1\}^D, so the loss admits a unique and exact decomposition

L(W)=∑m=0D∑∣S∣=mJS(m)∏i∈SWi,(2)\mathcal{L}(\mathbf{W})=\sum_{m=0}^{D}\sum_{|S|=m}J_{S}^{(m)}\prod_{i\in S}W_{i}, \tag{2}

where JS(m)J_S^{(m)} is the mth-order coupling among the ∣S∣=m|S| = m weights in SS, and the m=0m = 0 term is a constant offset. The couplings are determined implicitly by the loss function, the network architecture, and the data distribution, but the decomposition itself is architecture-agnostic, and its derivation is given in Methods Section 4.1. Identifying the discrete weights W\mathbf{W} with the spins s\mathbf{s}, and absorbing the sign convention of Eq. (1) into the couplings, the loss becomes a hierarchical sum of Ising Hamiltonians of every order, L(W)=∑m=0DH(m)(W)\mathcal{L}(\mathbf{W}) = \sum_{m=0}^D \mathcal{H}^{(m)}(\mathbf{W}). The same construction extends to ternary weights. Discrete-weight networks are therefore precisely the model class on which an Ising solver can operate, with one caveat that in practice, the loss is evaluated on minibatches, so the effective couplings are stochastic estimates that fluctuate from one iteration to the next and are only quasi-stationary. One approach for training the network is using post-training quantization [20, 33], in which L\mathcal{L} is optimized in the continuous domain and the final floating-point solution is projected onto the discrete-space. However, this procedure has been shown to be sub-optimal compared with quantization-aware training in the extreme-low-bit domain [21, 34]. Moreover, our focus is on methods that enable training and fine-tuning directly in the discrete domain on edge devices.

Irrespective of the choice of the Ising solver or BNN training algorithm, any optimizer that iteratively minimizes L(W)\mathcal{L}(\mathbf{W}) over a discrete set Ω\Omega (e.g., {−1,+1}D\{-1,+1\}^D or {−1,0,+1}D\{-1,0,+1\}^D) can be written as

Wn=Wn−1+dn,Wn,Wn−1∈Ω,(3)\mathbf{W}^{n}=\mathbf{W}^{n-1}+\mathbf{d}^{n},\qquad\mathbf{W}^{n},\mathbf{W}^{n-1}\in\Omega, \tag{3}

where nn is the iteration index and the update vector dn\mathbf{d}^n is constrained such that Wn\mathbf{W}^n remains in Ω\Omega. Note that for a deterministic flip of the ith\mathrm{i}^th spin or weight (Win→−Win−1)(W_i^n \to -W_i^{n-1}), the ith\mathrm{i}^th element of the update vector din=−2Win−1d_i^n = -2W_i^{n-1}. The update rule in Eq. (3) can be viewed as drawing dn\mathbf{d}^n at each iteration from an underlying distribution as shown in Fig. 1d

dn∼P(ωn,Wn−1,Tn)(4)\mathbf{d}^{n}\sim\mathcal{P}\big(\boldsymbol{\omega}^{n},\mathbf{W}^{n-1},T^{n}\big) \tag{4}

Here P denotes a general sampling process parameterized by a decision signal ωn\omega^{n}, the current weights Wn−1W^{n-1}, and a temperature TnT^{n}. In simulated annealing (SA), each

Figure

b

1st1^{st} Order

∑Ji(1)Wi\sum J_i^{(1)} W_i

WiW_i

z1z_1

y1y_1

2nd2^{nd} Order

z2z_2

y2y_2

L(W)L(W)

∑Ji1i2(2)Wi1Wi2\sum J_{i_1i_2}^{(2)} W_{i_1} W_{i_2}

Wi1W_{i_1}

Wi2W_{i_2}

W∈{1,−1}DW \in \{1, -1\}^D

3rd3^{rd} Order

∑Ji1i2i3(3)Wi1Wi2Wi3\sum J_{i_1i_2i_3}^{(3)} W_{i_1} W_{i_2} W_{i_3}

Wi1W_{i_1}

Wi2W_{i_2}

Wi3W_{i_3}

c

High-order Ising Energy

Medium-order Ising Energy

Low-order Ising Energy

Loss/Energy

Parameter space

Ising order

d

Figure

Frequency

Ising order

i 1.0

0.5

0.0

Normalized parameter update rate

Discrete update sampler

AI model

TNN

BNN

Decision

Signal

ωn\omega_{n}

Discrete

Sampler P

TnT_{n}

Weight update

Discrete

signal

dnd_{n}

g

Single-Flip SA

Parallel SA

Loss

W1W_{1}

W2W_{2}

h

Loss

T0T_{0}

TnT_{n}

TNT_{N}

ΣΔ\Sigma\Delta-Sampler

W1W_{1}

W2W_{2}

Fig. 1 ΣΔ\Sigma\Delta-Sampler for training discrete neural networks. (a) A feedforward binary neural network with weights constrained to W∈{−1,+1}D\mathbf{W} \in \{-1, +1\}^D. (b) Equivalence between discrete parameter neural networks and a hierarchical high-order Ising machine under stationary data distribution (x,y)(\mathbf{x}, \mathbf{y}). (c) Conceptual loss/energy profiles for increasing Ising order, where low-order expansions give a smooth landscape and higher-order couplings add frustration, many local minima, and high-frequency components in the gradient space. (d) A general sampler architecture for training discrete weight neural networks. (e) The effect of noise-shaping in spectral domain, where the white-noise is pushed out of the low-frequency adaptation band towards high-frequency. (f) Histogram showing noise-shaping of the Ising decomposition, resulting in the smoother optimization contour that benefits generalization. (g) Rugged non-convex optimization landscape due to parameter discretizations, where traditional simulated annealing optimizers are slow and do not perform well. (h) Optimization trajectory of the ΣΔ\Sigma\Delta-Sampler on the smoothened landscape is more stable and computationally scalable. (i) Parameter update rate maps for a ΣΔ\Sigma\Delta-Sampler at different stages of temperature annealing, early( T0T_0), mid( TnT_n), and late( TNT_N), while training a single layer, showing adaptive regularization on the model parameters tracks the smooth optimization contour.

weight update (spin flip) is accepted according to a Boltzmann criterion [35], with the decision signal ωn=ΔHn\omega^n = \Delta \mathcal{H}^n denoting the change of the Ising Hamiltonian as a result of the spin state configuration change, while the temperature is lowered according to an annealing schedule. Both ingredients map naturally onto dedicated annealing hardware [15, 16] and are closely related to quantum annealing [5]. The temperature controls the degree of randomness in the sampling process, with Tn=0T^n = 0 corresponding to deterministic sampling. The straight-through estimator (STE) corresponds to this zero-temperature limit, and it constitutes the dominant quantization-aware training paradigm [22, 36–38]. STE optimizer samples the discrete update decision by maintaining a full-precision latent copy W^\hat{\mathbf{W}} of every discrete weight as the decision signal ωn\omega^n, re-quantizes W=sign(W^)\mathbf{W} = \text{sign}(\hat{\mathbf{W}}) for the forward pass, and applies the surrogate gradient gn\mathbf{g}^n in updating W^\hat{\mathbf{W}} through conventional gradient-based optimizers with the predominant one being AdamW [39, 40]. Numerous refinements to threshold functions, clipping ranges, and binarization schedules have been proposed [24, 41–44].

However, to generalize well, any weight update rule in Eq. (3) must overcome the challenges revealed by the multi-order decomposition of the loss function, as shown in Fig. 1c. The low-order terms form a smooth envelope with broad basins and well-defined descent directions, because they are dominated by a small number of strong, slowly varying couplings. The high-order terms, in contrast, superimpose fine-grained frustration onto that envelope where exponentially many weak clauses impose competing constraints that cannot all be satisfied simultaneously, producing a proliferation of local minima [45, 46]. Consequently, along the temporal trajectory of any iterative optimizer (such as SA), the contribution of the high-order terms to the update signal fluctuates rapidly (high-frequency), whereas the contribution of the low-order envelope varies slowly (low-frequency). Higher-order frustration is a principal, but not the only, source of these fluctuations. Weight quantization introduces its own error, mini-batch sampling perturbs the couplings from one step to the next, and the stochastic transitions of the sampler add further randomness. Although these sources differ in origin, they share a spectral signature. None of these signals are correlated with the slowly varying descent direction, and each, to a first approximation, exhibits a white-noise (or blue-noise) spectrum across the iteration band. The gradient-descent component, by contrast, arises from the low-order couplings, which change slowly as the optimizer traverses the loss surface and therefore occupy the low-frequency portion of the weight-update trajectory. The STE optimizer omitted the challenges imposed by parameter discretization by tracking the complete continuous counterparts through its decision signal ωn\omega^{n} regardless of the spectral properties of the signal. On the other hand, because signal and noise are separated in frequency rather than in amplitude, the natural remedy is to reshape the noise spectrum rather than to suppress the noise outright.

In this work, we propose a new mechanism for generating the updates dn\mathbf{d}^n, driven by the error between the cumulative gradient and the cumulative update, which we call ΣΔ\Sigma\Delta sampling and can be expressed as:

dn∼P(∣∑k=1ngk−∑k=1ndk∣,Wn,Tn).(ΣΔSampling)(5)\mathbf{d}^{n}\sim\mathcal{P}\left(\left|\sum_{k=1}^{n}\mathbf{g}^{k}-\sum_{k=1}^{n}\mathbf{d}^{k}\right|,\mathbf{W}^{n},T^{n}\right).\quad(\Sigma\Delta Sampling) \tag{5}

Because the sampler is driven by the accumulated error, the low-pass-filtered gradient trajectory and the low-pass-filtered discrete-update trajectory are forced to remain close to each other. Equivalently, ΣΔ\Sigma\Delta-Sampler pushes the white-noise energy introduced by quantization, Ising frustration, and mini-batching out of the low-frequency adaptation band and toward the high-frequency, a mechanism known as noise-shaped learning [47]. Therefore, ΣΔ\Sigma\Delta-Sampler lowers the noise floor within the frequency band occupied by the gradient-descent signal as shown in Fig. 1e. Since the fluctuating component originates partly from the high-order couplings, the sampler exposes the low-order structure at a higher signal-to-noise ratio demonstrated in Fig. 1f, and the optimizer descends along the smooth low-order envelope rather than tracking the frustration layered on top of it. Note that noise-shaping principles also form the core of high-resolution ΣΔ\Sigma\Delta data converters [48], where quantization noise is moved out of the signal band of interest. The ΣΔ\Sigma\Delta-Sampler described in Eq. (5) can be implemented iteratively as

ωn=ωn−1+gn−βn⊙dn−1,(Integrator)(6)\boldsymbol{\omega}^{n}=\boldsymbol{\omega}^{n-1}+\mathbf{g}^{n}-\boldsymbol{\beta}^{n}\odot\mathbf{d}^{n-1},\quad(Integrator) \tag{6} dn∼P(ωn,Tn),(Sampling)(7)\mathbf{d}^{n}\sim\mathcal{P}(\boldsymbol{\omega}^{n},T^{n}),\quad(Sampling) \tag{7}

where ⊙\odot denotes a Hadamard product, ωn\omega^n is the integrator state/ΣΔ\Sigma\Delta decision signal, βn\beta^n is a dynamic feedback-gain, and P(⋅,Tn)\mathcal{P}(\cdot, T^n) is a sampling function detailed in Methods Section 4.3. As in other annealing approaches, the temperature TnT^n controls the degree of randomness in the sampling process. The first-order recursion in Eq. (6) and (7) ensures that ωn\omega^n remains bounded, hence ensuring the stability of the sampling process. The integrator state ωn\omega^n varies smoothly during training and preserves the low-frequency content of the loss landscape that encodes the descent direction. Whereas the per-batch gradient gn\mathbf{g}^n is dominated by high-frequency fluctuations arising from the many local minima of the discrete landscape.

In Fig. 1g, different optimization dynamics are illustrated conceptually using a highly non-convex discrete landscape in [49–51], where we have showed the speculative trajectories of Single-flip SA and Parallel SA optimizers in comparison to the dynamics of ΣΔ\Sigma\Delta-Sampler in Fig. 1h. Single-flip SA proposes one spin flip per iteration; it provably converges to the ground state under a sufficiently slow cooling schedule, but it explores the configuration space sequentially [35, 52, 53]. Parallel SA proposes flips for all spins simultaneously; it scales naturally to high-dimensional networks, but cannot provide convergence guarantee as its single-flip variant. Single-flip SA (gray trajectory) is thermally stable but tends to become trapped among the many local minima of the rugged landscape, and its computational cost becomes intractable at the scale of modern deep networks. Unconstrained parallel SA (orange trajectory) makes long-range moves, but because simultaneous flips are decided from noisy local fields that ignore their mutual interactions, the joint energy change of a multi-spin flip is uncontrolled, causing the optimizer to overshoot and diverge. Fig. 1h shows how the noise-shaping transforms this rugged surface into a smoothed effective landscape on which the ΣΔ\Sigma\Delta-Sampler descends stably and long-range parallel transitions remain energetically well behaved. ΣΔ\Sigma\Delta-Sampler thus inherits the stability of single-flip SA without its per-coordinate, per-iteration cost, and the scalability of parallel SA without its divergence.

on rugged landscapes. In other words, a single mechanism closes both the dynamics gap (stability versus scalability) and the objective gap (ground state versus generalization). In the Results section, we show that ΣΔ\Sigma\Delta-Sampler converges substantially faster than standard SA approaches and some benchmark STE approaches. Because ωn\omega^{n} acts as a per-parameter signal-to-noise readout of the smoothed landscape, the weight-flip activity (changes in weights) are concentrated where the landscape is steep and decays as coordinates settle into a basin. This produces the spatially and temporally structured update-rate maps of Fig. 1i at early (T0)(T^{0}), intermediate (Tn)(T^{n}), and late (TN)(T^{N}) training stages. The per-parameter update budget therefore self-regulates without hand-tuned per-parameter schedules, yielding an emergent, landscape-aware regularization that is analogous to an adaptive learning rate in discrete parameter space.

A further benefit of performing the entire optimization in the discrete domain is best seen in contrast with STE. STE is practical precisely because conventional optimizers acting on the full-precision latent weights operate on the comparatively benign continuous loss landscape of deep networks. The ΣΔ\Sigma\Delta-Sampler, in contrast, modulates the discrete states directly. Neither the latent weights nor the first- and second-moment optimizer states attached to them [39] are needed, so the training memory footprint tends towards the inference memory footprint. The combination of a self-regulating update budget and a near-inference-scale training footprint is important for edge and embedded deployment, where models must keep adapting to new data (non-stationary operating conditions) under tight memory and energy budgets [54–59]. Note that for edge and embedded AI applications, carrying a full-precision training stack defeats the very purpose of quantizing the parameters. In the Results section, we first validate the framework on a planted QUBO benchmark whose exact minimizer is known by construction. We then apply the framework to standard vision benchmarks (CIFAR-10 and ImageNet-1k), class-incremental continual learning, and language-model pre-training at the scale of billions of parameters. Across these settings, ΣΔ\Sigma\Delta-Sampler attains convergence dynamics close to those of state-of-the-art full-precision baselines while operating strictly in the discrete parameter space throughout, with a substantially reduced training memory footprint that makes on-device continual adaptation practical.

References (69)