Source-linked AI summary

Event-triggered Implicit Perturbation for Zeroth-Order Fine-Tuning of Spiking Transformers

Tengteng Lei, Prabodh Katti, Rashi Dutt, Houssem Sifaou, Tan Peng, Osvaldo Simeone, Kai Xu, Bipin Rajendran

arXiv:2608.21223v1cs.ARcs.LGcs.NE

TL;DR

IMC-based ZO fine-tuning of spiking transformers faces costly per-weight RNG generation and repeated RMW operations from explicit perturbation. The paper proposes IPZO with event-triggered PGU generation, accumulation-domain injection, and PGU-XOR recombination; it reports lower perturbation energy while maintaining software-RNG-comparable performance.

  • Problem

    IMC-based ZO fine-tuning is limited by prohibitive hardware costs for independent per-weight perturbations and repeated RMW operations caused by explicit weight perturbation.

  • Method

    IPZO combines event-triggered PGU perturbation generation with accumulation-domain injection, using PGU-XOR to mitigate correlations from reduced-array RNG reuse.

  • Results

    PGU-XOR achieves comparable performance to software RNGs, reduces total perturbation energy to 0.51× PGU-Reuse at iso-accuracy, and IPZO reaches 0.46–0.83× EPZO perturbation energy.

  • Takeaways & Limitations

    The results support IPZO as a hardware-algorithm co-designed approach for efficient ZO-based on-chip learning in IMC spiking transformers.

Abstract

from arXiv · show

Zeroth-order (ZO) optimization estimates gradients using only forward-pass evaluations, making it suitable for fine-tuning non-differentiable, event-driven spiking neural networks (SNNs). However, its deployment on in-memory computing (IMC) accelerators is constrained by the repeated read-modify-write (RMW) operations arising from explicit weight perturbation and the prohibitive hardware footprint of random number generators (RNGs) for statistically independent per-weight perturbations. To address these challenges, we propose an implicit-perturbation ZO (IPZO) architecture in which perturbation sums computed by an event-triggered perturbation generation unit (PGU) are combined with the weighted sums produced by the IMC array, eliminating perturbation-induced RMW operations while preserving weight-stationary execution of IMC. By exploiting spike sparsity, the PGU generates and accumulates perturbation contributions only for spike-activated weight rows, reducing the required row dimension of the RNG array. An address-driven XOR recombination scheme (PGU-XOR) is further introduced to mitigate the spatial correlations caused by direct RNG reuse (PGU-Reuse). The results show that (1) PGU-XOR matches software RNGs in accuracy on Spikingformer/CIFAR-10 (76.41% vs. 76.53%) and perplexity (PPL) on SpikeGPT/WikiText-2 (54.20 vs. 53.23), whereas PGU-Reuse degrades accuracy by 9.56 percentage points and increases PPL by 11.8; (2) implemented in a TSMC 16-nm CMOS technology, PGU-XOR incurs 40.3%-46.0% area and 15.2%-48.9% energy overhead per matrix-vector multiplication relative to PGU-Reuse, yet its faster convergence reduces the total perturbation energy to 0.51x that of PGU-Reuse at iso-accuracy; (3) IPZO reduces the perturbation energy to 0.46x-0.83x that of conventional explicit weight perturbation for a batch size of B=64 and T=4 time steps, with the advantage growing as BT decreases.

I. INTRODUCTION

The paper addresses hardware barriers to ZO fine-tuning on IMC-based spiking transformers by introducing IPZO, which combines event-triggered perturbation generation with accumulation-domain injection. PGU-XOR preserves comparable learning performance while reducing perturbation energy relative to alternatives.

  • Motivation: ZO optimization suits SNN fine-tuning because it estimates gradients using forward-pass evaluations without backpropagation.This avoids the activation and neuron-state storage required by BPTT.
  • Challenges: Per-weight random perturbations impose prohibitive RNG hardware costs, while RNG reuse introduces spatial correlations that can degrade learning accuracy.These constraints complicate efficient ZO deployment in IMC accelerators.
  • Challenges: Repeated read-modify-write operations in explicit-perturbation ZO undermine IMC’s weight-stationary execution and energy advantage.They arise from repeatedly reading, perturbing, and rewriting the stored weight matrix.
  • Proposed Architecture: IPZO injects perturbation contributions into the accumulation domain, keeping weights stationary and eliminating perturbation-induced RMW operations.The architecture combines perturbation sums from the PGU with weighted sums from the IMC array.
  • Proposed Architecture: PGU-XOR generates perturbations only for spike-activated rows and uses address-driven XOR recombination to reduce RNG dimensions while mitigating correlations from reuse.The design exploits spike sparsity and decouples RNG-array row size from the full weight matrix.
  • Evaluation: 0.51× is the total perturbation energy of PGU-XOR relative to PGU-Reuse, while IPZO reaches 0.46–0.83× the perturbation energy of EPZO.These results come from algorithmic evaluation and post-layout implementation in TSMC 16-nm CMOS.

II. PRELIMINARIES

The preliminaries describe conventional transformers, their spiking extension, and IMC execution. Spiking transformers replace dense, high-precision processing with temporal binary spikes and LIF-based operations that are hardware-oriented.

  • Standard Transformers: A standard transformer stacks blocks containing MHSA, FFN, residual connections, and layer normalization.MHSA projects inputs into queries, keys, and values using learned weight matrices.
  • Standard Transformers: Dense MVMs and high-precision activations in standard transformers create challenges for resource-constrained edge hardware.These operations dominate attention and feedforward computation.
  • Spiking Transformers: Spiking transformers extend transformers temporally by incorporating LIF neurons and encoding Q, K, and V as spike sequences over T time steps.Attention is computed directly in the spike domain at each time step.
  • Spiking Transformers: LIF firing dynamics replace softmax normalization in spiking attention, eliminating exponential and division operations.This simplifies attention computation for hardware implementation.
  • In-Memory Computing: IMC performs computation directly within memory arrays, reducing data movement between storage and computation.Analog and digital IMC use different mechanisms for producing MAC outputs.
  • In-Memory Computing: Binary, event-driven spikes simplify analog IMC MVMs from MAC operations to accumulation with spike-controlled word-line activation.Spike values determine whether each word line receives read voltage or ground.

C. Zeroth-Order Optimization

ZO optimization estimates gradients from finite-difference loss evaluations and updates parameters using SGD. Its forward-only procedure avoids backward-pass activation storage but requires multiple perturbed evaluations per optimization step.

  • Gradient Estimation: ZO estimates gradients from finite differences of loss evaluations, enabling optimization when first-order derivatives are unavailable or costly.The method relies solely on forward-pass evaluations.
  • Gradient Estimation: The gradient estimate uses q random perturbations, perturbation magnitude ϵ, and vectors zi sampled from isotropic Gaussian or uniform distributions.The empirical loss is evaluated on a mini-batch B.
  • Parameter Update: The estimated gradient updates parameters through the SGD rule with learning rate η.The update uses the current parameters and the estimated gradient.
  • Computational Cost: 2q forward-pass evaluations are required per optimization step because each perturbation uses positive and negative evaluations.This requirement follows from the two-sided finite-difference estimator.

III. CHALLENGES

ZO deployment in IMC is constrained by the hardware cost of independent random perturbations and by repeated weight-array RMW operations. Existing reuse strategies reduce RNG footprint but can introduce correlations and leave perturbation updates expensive.

  • Massive Random Number Generation: Fully parallel independent perturbation generation requires substantial on-chip RNG hardware because every weight needs a fresh perturbation element.Uniform perturbations remain costly despite being an alternative to Gaussian perturbations.
  • Massive Random Number Generation: PeZO reuses a small RNG array across weights, but statistical correlations can degrade accuracy when too few random numbers are available.The required RNG configuration varies across models and tasks, limiting portability.
  • Frequent Read-Modify-Write Operations: Explicit-perturbation ZO repeatedly reads, modifies, and writes the stored weight matrix, converting a one-time inference cost into recurring training overhead.These RMW operations consume energy and disrupt weight-stationary IMC dataflow.
  • Frequent Read-Modify-Write Operations: Frequent RMW operations also impose sequential rowwise throughput penalties and worsen write-endurance limitations in NVM-based arrays.Repeated reprogramming can shorten operational lifetime.
  • Existing Approaches: PeZO reduces RNG overhead but still explicitly applies perturbations to stored weights, leaving frequent RMW operations largely unchanged.An eDRAM-IMC approach avoids repeated RRAM reprogramming but still requires perturbation-array data movement.

A. Implicit-Perturbation ZO Architecture

IPZO computes perturbed MVM outputs without modifying stored weights, injecting perturbation sums into the accumulation domain. Event-triggered generation exploits spike sparsity to reduce PGU rows below the IMC array dimension.

  • Architecture: IPZO merges the standard MVM sum x · θ with a PGU-generated perturbation sum x · ϵz_i to reconstruct perturbed outputs.This is functionally equivalent to explicit perturbation by x · (θ ± ϵz_i) = x · θ ± x · ϵz_i.
  • Architecture: IPZO injects perturbations into the accumulation domain, preserving weight-stationary execution and avoiding repeated weight-domain RMW operations.The stored weights remain untouched during a single optimization step.
  • Dimension Reduction: Event-triggered PGU generation processes perturbations only for rows activated by input spikes, rather than for the entire crossbar.The PGU row dimension is therefore determined by concurrently active rows.
  • Dimension Reduction: For an m × n IMC array, the row-reduced PGU uses k physical rows with k ≪ m and dynamically maps them to active IMC rows by spike address.If active rows exceed capacity, the remaining rows are processed over successive cycles.

2) Perturbation Independence:

Row reduction lowers PGU hardware cost but makes perturbation independence difficult because reduced-row resources are reused across the full weight matrix. PGU-XOR addresses this through quotient–remainder XOR recombination, with accumulation hardware trading area for bounded latency.

  • Perturbation Independence: PGU-Reuse shares reduced-row perturbation vectors across interleaved weight-row groups, but repeated reuse of the same random bank introduces statistical correlations.Dynamic remapping changes sharing assignments across iterations but does not remove the underlying reuse.
  • Perturbation Independence: PGU-XOR decomposes each spike address into quotient and remainder components, then XORs outputs from corresponding Q-LFSR and R-LFSR groups.When k is a power of two, address components can be extracted directly from high- and low-order bits.
  • Perturbation Independence: Distinct primitive polynomials for the Q-LFSRs and R-LFSRs produce statistically independent perturbation vectors across all m spike addresses.This removes the perturbation correlations introduced by PGU-Reuse and restores perturbation diversity for ZO gradient estimation.
  • Accumulation Contention: Resource contention among concurrent addresses is handled by serializing accesses through an accumulation network over c cycles instead of over-provisioning LFSRs.The β × φ CLU array and overlapping bit slicing accumulate the generated perturbation segments.
  • Accumulation Contention: Increasing c reduces the CLU array size while distributing random-number generation and accumulation across more cycles, balancing area against latency.The multi-cycle accumulation typically does not add system-level latency within the IPZO pipeline.

C. Data Flow

PGU-XOR reproduces perturbations across forward-pass and update phases while generating them event-by-event during sparse forward computation. Spikingformer measurements support the reduced-row design, and scheduling cycles accommodate observed firing rates.

  • Data Flow: PGU-XOR holds LFSR states constant during an optimization iteration, regenerating identical perturbations for forward evaluation and parameter update without storing them.Forward generation is limited to spike-activated rows, whereas the update phase traverses the full weight matrix.
  • Spatial Sparsity Analysis: Across three datasets, Q, K, and V LIF neurons remain below 15% mean firing rate at every time step.Q neurons reach blockwise maxima of approximately 20% on CIFAR-10 and CIFAR-100, while K and V remain predominantly below 10%.
  • Data Flow: Fig. 5 compares PGU-XOR data flow across alternating forward-pass and weight-update phases.Compare event-driven active-row generation in the forward pass with full-matrix traversal during update.
  • Spatial Sparsity Analysis: Fig. 6 plots mean firing rate ρ for Q, K, and V LIF neurons across transformer blocks and time steps, with shading showing blockwise range.The key comparison is the consistently sparse firing activity across neuron types and datasets.
  • Bit-Level Uniformity: Fig. 7 tracks bit-probability distributions in 128 random sequences generated by PGU-Reuse and PGU-XOR.Compare the evolution of bit distributions between the reuse and XOR schemes.

B. Statistical Property Evaluation

PGU-Reuse and PGU-XOR both generate temporally uncorrelated, uniform binary sequences, but PGU-XOR better suppresses spatial and inter-segment correlations through address-driven recombination and stride selection.

  • Bit-level uniformity: Both PGU-Reuse and PGU-XOR rapidly converge to balanced bit probabilities P(0) and P(1) near 0.5.Bit-level uniformity does not distinguish the two architectures.
  • Temporal and spatial correlation: Both architectures show negligible temporal self-correlation because autocorrelation remains near zero at all non-zero lags.The autocorrelation peak occurs only at zero lag.
  • Temporal and spatial correlation: PGU-Reuse exhibits pronounced periodic cross-correlations among its 128 perturbation sequences, whereas PGU-XOR restores the directional diversity needed for unbiased ZO gradient estimation.The contrast is measured in the spatial domain rather than through temporal autocorrelation.
  • Stride selection: Cross-correlation between overlapping perturbation segments exceeds 0.5 for strides s = 1 and s = 2, falls below 0.1 at s = 4, and is nearly zero at s = 7.Larger strides reduce correlation but also reduce the number of available segments.
  • Stride selection: The design adopts s = 4 to maintain low inter-segment correlation while preserving sufficient perturbation segments.This choice balances statistical independence against hardware efficiency.

C. Accuracy Evaluation

PGU-XOR preserves the optimization quality of software perturbation generators across MNIST, CIFAR-10, and language-model fine-tuning, while PGU-Reuse suffers from correlation-driven instability and degraded performance.

  • MNIST evaluation: 88.8% final MNIST accuracy is achieved by PGU-XOR, comparable to Randint at 89.1% and Randn at 88.7%, while PGU-Reuse reaches 82.7%.PGU-XOR also has a 0.34% standard deviation, versus 4.10% for PGU-Reuse.
  • MNIST evaluation: PGU-XOR, Randint, and Randn show stable MNIST convergence with narrow variance envelopes, whereas PGU-Reuse has substantially larger run-to-run variability.The comparison uses ten independent runs from different random initializations.
  • Update-space analysis: 61.5 effective rank is measured for PGU-Reuse, versus about 120 for PGU-XOR, Randint, and Randn, despite similar weight-update Frobenius norms near 1.74 × 10^3.PGU-Reuse therefore concentrates a similar-magnitude update in fewer independent directions.
  • Large-scale SNNs: 76.41% CIFAR-10 accuracy is achieved by PGU-XOR versus 66.85% for PGU-Reuse, a 9.56 percentage-point gap.PGU-XOR closely matches Randint at 76.53% and Randn at 76.56%.
  • Large-scale SNNs: 54.20 and 83.98 PPL are obtained by PGU-XOR on WikiText-2 and WikiText-103, versus 66.01 and 94.73 for PGU-Reuse.PGU-XOR reaches the PGU-Reuse reference performance in 687 and 777 steps, compared with 3944 and 4000 steps.

D. Hardware Implementation

Post-layout TSMC 16-nm implementations show that PGU-XOR trades additional area and energy per MVM for decorrelated perturbations, while preserving the throughput of PGU-Reuse under the same accumulation cycles.

  • Area: 46.0% area overhead is incurred by PGU-XOR at c = 8, occupying approximately 7,446 µm^2 versus 5,100 µm^2 for PGU-Reuse.The comparison uses the most area-efficient configuration, c = 8.
  • Area: PGU-XOR remains comparable in area to a representative 128 × 128 IMC macro at c = 1, and its relative area cost decreases as c increases.The referenced IMC macro is estimated at approximately 16,000 µm^2 after scaling to 16-nm technology.
  • Throughput: PGU-Reuse and PGU-XOR achieve identical perturbation throughput because the added Q-LFSRs and XOR logic do not increase pipeline depth.Both designs produce one perturbation result every Tc cycles.
  • Throughput model: Each perturbation element contributes one multiplication and one addition, yielding 2mn operations for an m × n PGU array.This operation count underlies the throughput expression used for the PGU.
  • Throughput: 4.10 TOPS at c = 1 decreases to 0.51 TOPS at c = 8 as accumulation is serialized onto a smaller CLU array.The intermediate throughputs are 2.05 TOPS at c = 2 and 1.02 TOPS at c = 4.

2) Energy Consumption:

PGU-XOR has higher per-MVM hardware cost than PGU-Reuse but can reduce total training energy through faster convergence; IPZO is more energy-efficient than EPZO at practical low-BT settings.

  • PGU energy: 48.9% energy overhead at c = 1 narrows to 15.2% at c = 8 for PGU-XOR relative to PGU-Reuse in BIT8 mode.The overhead becomes lower than the corresponding 40.3%–46.0% area overhead for c ≥ 2.
  • Training energy: 0.51× total perturbation energy is required by PGU-XOR relative to PGU-Reuse at the shared 66.85% CIFAR-10 accuracy target.PGU-XOR reaches the target in 84 epochs versus 247 epochs for PGU-Reuse.
  • IPZO versus EPZO: 4.68 pJ for a 64-bit read and 4.20 pJ for a 64-bit write exceed the 0.01 pJ cost of an 8-bit addition by more than two orders of magnitude.This operation-energy disparity motivates replacing weight-memory accesses with accumulation-domain additions.
  • IPZO versus EPZO: 0.83× BIT8 and 0.46× BIT1 energy ratios are achieved by IPZO versus EPZO at B = 64 and T = 4.IPZO is more energy-efficient below BT ≈ 307 in BIT8 mode and BT ≈ 560 in BIT1 mode.

VI. CONCLUSION

IPZO co-designs zeroth-order learning with IMC spiking transformers by moving perturbations into the accumulation domain and using event-triggered, decorrelated generation. It reduces perturbation energy relative to PGU-Reuse and conventional explicit weight perturbation while preserving comparable optimization performance.

  • IPZO moves random perturbations from stored weights to the accumulation domain, eliminating repeated read-modify-write operations while preserving weight-stationary IMC execution.
  • PGU-XOR generates perturbations only for spike-activated rows and uses address-driven XOR recombination to eliminate spatial correlations from RNG reuse.
  • PGU-XOR achieves optimization performance comparable to software RNGs across image classification and language modeling, with near-full-rank parameter-space exploration.
  • 0.51× lower total perturbation energy than PGU-Reuse is achieved by PGU-XOR through faster convergence despite added perturbation-decorrelation hardware.
  • 0.46–0.83× the perturbation energy of EPZO is achieved by IPZO with PGU-XOR at B = 64 and T = 4.
Loading 2608.21223v1…