Precision As You Need: Stochastic Computing Is a Dense Adaptive Quantizer

Haoran Jin, Kangqi Zhang, Jirong Yang, Barry Lyu, Qiuyi Ding, Ruijie Gao, Nathan BleierNeurIPS 2026

TL;DR

Modern AI chips lock us into rigid numerical boxes like 4-bit or 8-bit integers, making it impossible to dial in just enough math precision where a neural network actually needs it. By revisiting a 1960s paradigm called Stochastic Computing—where numbers are streams of coin flips and multiplication is a single logic gate—the authors turn precision into a smooth knob controlled simply by how long you let the clock run. Better yet, they built a blisteringly fast GPU emulator to prove this hardware concept works at scale on massive modern vision transformers without retraining.

What Problem Does This Paper Address?

Matrix multiplications eat up the vast majority of the compute budget in modern transformer models. To make them faster and cheaper, engineers rely on quantization—shrinking numbers from 16-bit floats down to 8-bit or 4-bit integers. Because squashing an entire network uniformly into 4 bits can wreck its accuracy, mixed-precision methods try to give sensitive parts of the model more bits and forgiving parts fewer.

Here is the catch: conventional silicon is built with rigid, bit-parallel datapaths. A chip usually supports only a sparse menu of formats—say, INT4, INT8, and FP16. If a specific token or matrix row really needs 6.5 bits of precision to stay accurate, tough luck; you have to pay the full hardware and energy price for INT8.

Methods

To escape rigid bit-widths, the authors reframe Stochastic Computing (SC) as a dense adaptive quantizer. Instead of binary positional weights, SC encodes a number as the probability of seeing a 1 in a random bit-stream of length $L$ (for example, 1,1,0,0,1,1,0,0 represents $0.5$). Multiplying two streams reduces to feeding them through a single bitwise AND gate (or XNOR for signed numbers)—shrinking multiplier area and power by orders of magnitude.

Circuit primitives of stochastic computing showing comparator-based bitstream generation, single-gate multiplication with early termination, and conditional bitstream generation.

Precision is now governed by time, not circuit width. Need ~8-bit resolution? Run the stream for $L=256$ cycles. Want ~7.58 bits on a less important row? Just stop counting early at $L=192$ cycles on the exact same logic gate.

To make this practical for modern AI, the authors combine standard SC primitives (like Conditional Bitstream Generation using Sobol sequences to prevent correlation errors) with two major new contributions:

  1. Scalable GPU Emulation: CPU-based SC simulators are glacially slow. The authors built fused Triton GPU kernels that precompute cumulative indicator tables and run SC matrix multiplications as tiled bitwise AND-and-popcount operations—running 95,000$\times$ faster than CPU simulation and exposing stream length $L$ as a per-row runtime argument.
  2. Per-Row Adaptive Mixed Precision: Using a quick offline calibration pass (no model retraining!), they map out thresholds based on lightweight runtime saliency metrics—like peak row activation magnitudes already extracted during standard quantization. At inference, sensitive rows dynamically get longer streams while forgiving rows terminate early, hitting a strict average compute budget.

Datasets

No new benchmarks are introduced; the authors evaluate pretrained models across four distinct vision domains:

  • ImageNet-1k: Used for image classification (50,000 validation images with DINOv2 ViT-L/14) and class-conditional image generation (10,000 generated $256 \times 256$ samples with DiT-XL/2).
  • COCO: 5,000 validation images for object detection and instance segmentation (EVA-01 ViT-g + Cascade Mask R-CNN).
  • wall_single (Dino-WM): 30 single-seed episodes of a 2D visual goal-reaching control task to test closed-loop world-model planning over multi-step rollouts.

Key Insights and Ideas

  • Precision as a temporal dial: Because $L$ can be any positive integer, a single ultra-tiny hardware circuit exposes non-power-of-two operating points (like $L=96$ or $L=192$) simply by halting early.
  • Sensitivity is wildly lopsided: Probing a ViT-L/14 backbone revealed that SC error doesn't hurt all layers equally—late MLP_FC2 blocks accounted for 19 of the top 20 most sensitive tiles in the entire network! Keeping a tiny fraction of hyper-sensitive tiles in higher precision while aggressively trimming stream lengths elsewhere yields massive savings.
  • Deterministic "randomness" unlocks error compensation: Because the GPU kernel uses seed-fixed quasi-random Sobol sequences, SC noise becomes a deterministic function of the inputs—allowing closed-form quantization residual compensation techniques to transfer seamlessly to stochastic streams.
  • Noise can help over-guided diffusion: Under strong classifier-free guidance (CFG=4.0), SC actually improved generation FID scores over full precision—likely because slight stochastic fluctuation restores sample diversity squeezed out by heavy guidance.

Key Results

  • Hardware Efficiency: In 45nm gate-level synthesis, a signed SC XNOR multiplier is 156$\times$ smaller and 399$\times$ lower-power than an INT8 multiplier. Cycle-accurate full-accelerator simulations (uSystolic) show ViT inference with SC mixed precision ($\bar{L}=64$) uses 4.60$\times$ less on-chip energy than an INT8 systolic array.
  • Classification (ImageNet): At an 8-bit equivalent budget ($L=256$), compensated SC achieves 85.70% top-1 accuracy (just 0.70 points below FP16), beating the INT8 QwT baseline by 1.13 points.
  • Detection & Segmentation (COCO): At 7-bit equivalent budgets ($\bar{L}=128$), dynamic per-row mixed precision recovers +1.61 box AP and +2.08 mask AP over uniform SC at the exact same average cycle budget.
  • Generation & Planning: On DiT-XL/2, SC mixed precision ($\bar{L}=64$) lowers FID by 30% (17.33 vs. 24.81) with minimal Inception Score drop. On Dino-WM planning, SC matches full-precision success rates (0.833) across 20-step closed-loop rollouts.

Limitations and Future Work

  • Hybrid Pipeline: The tested setup isn't 100% pure SC; operands still pass through a standard INT8 post-training quantization front-end, and a handful of the most sensitive matrix multiplications (e.g., 30 of 240 tiles in COCO) bypass SC to run in exact precision unless finer quantization groups are used.
  • Simulation vs. Silicon: While the Triton GPU kernels prove algorithmic feasibility at scale, actual energy and area gains rely on gate-level synthesis and cycle-accurate simulators rather than fabricated silicon chips.
  • Scope of Sweeps: Generative and planning tasks were each tested on a single model and configuration (e.g., one CFG scale on DiT, 30 episodes on Dino-WM). Expanding to broader workloads, language models, and ultra-low-bit regimes remains open for future exploration.

Summary updated

Abstract

Matrix multiplications dominate the inference cost of modern transformer-based vision models, yet existing efficiency techniques such as post-training quantization and mixed-precision inference are largely limited to the small set of fixed-width formats—INT4, INT8, BF16, and FP16—supported by conventional accelerators. We revisit stochastic computing (SC) as a way to lift this constraint: viewed as a dense adaptive quantizer, SC controls precision by bit-stream length L rather than a fixed datapath, while each multiplication reduces to a single AND/XNOR gate. We build a GPU library that emulates SC matrix multiplication at scale, exposes stream lengths as first-class kernel arguments, and evaluates SC end-to-end on image classification, object detection and instance segmentation, class-conditional image generation, and visual world-model planning. On top of this substrate, we develop a dynamic per-row mixed-precision policy that assigns stream length per token or group at matched average budget, requires no retraining, and uses the same SC hardware across schedules. Our results show that SC can preserve near-full-precision quality, while mixed precision improves accuracy at a fixed average stream budget. These results provide software-level feasibility evidence that SC can serve as a dense-precision substrate for fine-grained mixed-precision inference on modern vision transformers.
BibTeX
@inproceedings{jin2026precision,
  author = {Haoran Jin and Kangqi Zhang and Jirong Yang and Barry Lyu and Qiuyi Ding and Ruijie Gao and Nathan Bleier},
  title = {{Precision As You Need: Stochastic Computing Is a Dense Adaptive Quantizer}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=63tLNzOrMq},
}
Figure