Learned Step Size Quantization (LSQ) is a quantization-aware training (QAT) method that directly optimizes the quantization step size (Δ) for each layer via gradient descent. Unlike static methods that calibrate Δ using post-training data, LSQ treats Δ as a trainable model parameter, allowing the network to learn the optimal dynamic range for its weights and activations during fine-tuning. This co-optimization of weights and scales minimizes the task loss introduced by low-precision representation, leading to superior accuracy, especially at very low bit-widths like 2-4 bits.
Glossary
LSQ (Learned Step Size Quantization)

What is LSQ (Learned Step Size Quantization)?
Learned Step Size Quantization (LSQ) is an advanced quantization-aware training technique that treats the quantization step size as a trainable parameter, enabling a neural network to jointly optimize its weights and its own quantization scales.
The technique introduces a gradient estimator for the non-differentiable quantization function, enabling backpropagation through the step size parameter. A gradient scale is applied to balance the magnitude of step size updates relative to weight updates. LSQ provides per-layer granularity and is a foundational method within extreme quantization, often outperforming uniform and post-training approaches. It is closely related to techniques like PACT (Parameterized Clipping Activation) and is a key enabler for efficient integer-only inference on edge hardware.
Key Features of LSQ
Learned Step Size Quantization (LSQ) is a quantization-aware training technique that treats the quantization step size as a trainable parameter, allowing the model to jointly optimize weights and quantization scales. The following cards detail its core mechanisms and advantages.
Trainable Step Size Parameter
The defining innovation of LSQ is the treatment of the quantization step size (Δ) as a trainable parameter, updated via gradient descent alongside the network weights. This allows the model to learn the optimal dynamic range for each quantized tensor (weights or activations) directly for the task, rather than relying on static statistics like min/max values. The gradient for the step size is approximated using a Straight-Through Estimator (STE) to handle the non-differentiable quantization function.
Gradient Scale for Stable Optimization
LSQ introduces a critical gradient scaling factor to balance the magnitude of updates between weights and the step size parameter. The gradient with respect to the step size is scaled by 1 / sqrt(N * Q_levels), where N is the number of elements in the tensor and Q_levels is the number of quantization levels. This heuristic prevents the step size from converging too quickly or diverging, ensuring stable joint optimization and faster convergence compared to methods with fixed scales.
Per-Layer or Per-Channel Granularity
LSQ can be applied with different granularities to balance accuracy and overhead:
- Per-Layer: A single step size is learned for an entire weight or activation tensor. This is simple and adds minimal parameters.
- Per-Channel (for weights): A unique step size is learned for each output channel of a convolutional layer or column of a linear layer. This finer granularity accounts for varying dynamic ranges across channels, significantly improving accuracy for low-bit quantization (e.g., 2-4 bits) at the cost of storing more scale parameters.
Integration with Quantization-Aware Training
LSQ is fundamentally a Quantization-Aware Training (QAT) method. It is integrated into the training loop:
- During the forward pass, full-precision weights and activations are quantized using the current learned step sizes.
- The quantization error is incorporated into the loss, forcing the network to adapt its parameters.
- During backpropagation, gradients flow through the quantized representations to update both weights and step sizes. This end-to-end learning minimizes the distortion caused by low-precision arithmetic before deployment.
Superior Accuracy at Low Bit-Widths
By learning optimal quantization scales, LSQ consistently achieves higher accuracy than post-training quantization and other QAT methods with fixed scales, especially at aggressive bit-widths (2-4 bits). For example, on ImageNet with a ResNet-18, LSQ at 4-bit weight and activation quantization can achieve within 1% of the full-precision baseline, whereas methods using min/max statistics may degrade by 3-5%. This makes it a cornerstone technique for extreme quantization targeting edge devices.
Compatibility with Standard Hardware
Despite its learned parameters, LSQ produces models compatible with standard integer-only inference pipelines. The trained step sizes are constants in the deployed model. The quantization operation Q(x) = clamp(round(x/Δ), -Q_levels/2, Q_levels/2 - 1) maps to efficient integer arithmetic. This ensures the benefits of learned optimization are realized without requiring specialized hardware, making LSQ practical for deployment on common Neural Processing Units (NPUs) and mobile CPUs.
LSQ vs. Other Quantization Methods
A technical comparison of Learned Step Size Quantization against other prominent quantization techniques, focusing on methodology, granularity, and training requirements.
| Feature / Metric | LSQ (Learned Step Size Quantization) | Post-Training Quantization (PTQ) | Standard Quantization-Aware Training (QAT) |
|---|---|---|---|
Core Methodology | Treats quantization step size (scale) as a trainable parameter, jointly optimized with weights. | Calibrates quantization ranges (scale/zero-point) using a small dataset after training is complete. | Simulates quantization during training with fixed, pre-defined quantization parameters (e.g., min/max). |
Training Requirement | Requires full quantization-aware training or fine-tuning. | No retraining required; applied directly to a pre-trained model. | Requires quantization-aware training or fine-tuning. |
Parameter Optimization | Optimizes both weights and per-tensor or per-channel step sizes via gradient descent. | Weights are static; optimizes quantization parameters via calibration (e.g., min/max, MSE). | Optimizes weights only; quantization parameters are fixed or determined via simple statistics. |
Typical Granularity | Per-tensor or per-channel (layer-wise or channel-wise). | Primarily per-tensor; advanced methods (e.g., AdaRound) enable per-channel. | Typically per-tensor. |
Accuracy at Low Bits (e.g., 4-bit) | Often higher, due to learned adaptation of quantization scales. | Lower, especially at very low bit-widths, due to lack of model adaptation. | Moderate, but can degrade if fixed quantization ranges are suboptimal. |
Computational Overhead | High (full training loop). | Very Low (calibration pass only). | High (full training loop). |
Integration Complexity | High; requires modifying training code to inject and optimize LSQ parameters. | Low; often a library call in frameworks like TensorFlow Lite or ONNX Runtime. | Moderate; requires inserting fake quantization ops into the training graph. |
Use Case | Production models where maximum accuracy for a given bit-width is critical. | Rapid deployment and model size reduction where some accuracy loss is acceptable. | General-purpose QAT for improved accuracy over PTQ, without LSQ's scale optimization. |
Frequently Asked Questions
Learned Step Size Quantization (LSQ) is a foundational technique in the extreme quantization toolkit, enabling high-performance low-bit neural networks by treating quantization scales as trainable parameters. These questions address its core mechanisms, advantages, and practical implementation.
Learned Step Size Quantization (LSQ) is a quantization-aware training (QAT) technique that treats the quantization step size (the scaling factor between quantized integer values and full-precision values) as a trainable parameter, allowing a neural network to jointly optimize its weights and its own quantization parameters during training.
Unlike traditional methods that use fixed or heuristically calculated scales (e.g., based on min/max ranges), LSQ introduces the step size for each tensor (e.g., per-layer or per-channel) into the computational graph. During the forward pass, weights and activations are quantized using the current step size. During the backward pass, gradients flow not only to the weights but also to the step size parameter itself via a Straight-Through Estimator (STE). This allows the model to learn the optimal dynamic range for quantization, minimizing the quantization error in a task-aware manner, which is particularly crucial for aggressive low-bit quantization (e.g., 2-4 bits).
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
Learned Step Size Quantization (LSQ) is a core technique within extreme quantization. These related concepts define the methods, components, and trade-offs involved in pushing neural networks to very low bit-widths.
Quantization-Aware Training (QAT)
Quantization-Aware Training (QAT) is the broader training paradigm where quantization error is simulated during the training or fine-tuning process, allowing the model to adapt its parameters before low-precision deployment. LSQ is a specific QAT method that makes the quantization step size a trainable variable. Other QAT techniques, like PACT (Parameterized Clipping Activation), focus on learning optimal clipping bounds for activations.
- Core Goal: Minimize accuracy loss from quantization by letting the model 'experience' the precision constraints during training.
- Process: Inserts fake quantization nodes into the computational graph that round values during the forward pass but pass full-precision gradients during the backward pass.
- Contrast with PTQ: Unlike Post-Training Quantization, QAT requires retraining but typically achieves significantly higher accuracy for very low bit-widths (e.g., 2-4 bits).
Straight-Through Estimator (STE)
The Straight-Through Estimator (STE) is the fundamental gradient approximation technique that enables backpropagation through non-differentiable quantization functions, which is essential for training methods like LSQ. Since the rounding or sign function used in quantization has a zero or undefined gradient almost everywhere, the STE simply passes the gradient through as if the quantization operation were the identity function.
- Mechanism: During backward pass, ∂L/∂x ≈ ∂L/∂Q(x), where Q(x) is the quantized output.
- Role in LSQ: Allows gradients to flow to the learnable step size parameter and the network weights, despite the hard rounding involved in mapping to the quantization grid.
- Limitations: The gradient mismatch can cause optimization instability, leading to techniques like gradient clipping to mitigate exploding gradients during QAT.
Scaling Factor (Alpha)
A scaling factor (often denoted α) is a critical parameter in extreme quantization that recovers the dynamic range lost when values are constrained to a small set of discrete levels (e.g., {-1, +1}). In LSQ, this scaling factor is the learned step size. For a tensor x, quantization is performed as: x_q = clamp(round(x / α), -Q_n, Q_p) and dequantization as: x_hat = α * x_q.
- Granularity: Can be layer-wise (one α per layer) or channel-wise (one α per output channel), with channel-wise offering higher accuracy at the cost of more parameters.
- Function: Multiplies the low-bit integer values post-quantization to scale them back to a representative range in the network's floating-point space.
- Optimization: In LSQ, α is updated via gradient descent alongside weights, whereas in simpler methods it may be set via calibration statistics like the tensor's maximum absolute value.
Uniform Quantization
Uniform quantization is the scheme where the quantization levels are evenly spaced across the represented range. LSQ inherently implements uniform quantization because it learns a single step size (α) that defines the uniform spacing between levels. Given a bit-width b, the number of integer quantization levels is 2^b.
- Mathematical Simplicity: The quantizer is defined by: Q(x) = α * round(clamp(x/α, -Q_n, Q_p)).
- Inference Efficiency: Uniform spacing allows quantization and dequantization to be implemented with simple scaling, rounding, and clipping operations, which map efficiently to integer arithmetic on hardware.
- Contrast with Non-Uniform: Non-uniform quantization (e.g., logarithmic quantization) uses unevenly spaced levels, which can better match weight distributions but requires more complex, often lookup-based, operations during inference.
Integer-Only Inference
Integer-only inference is the deployment paradigm where all computations of a quantized model are executed using integer arithmetic, eliminating the need for floating-point units. Models trained with LSQ are prime candidates for this, as the learned step size (α) can be fused into integer weights or handled with fixed-point arithmetic.
- Hardware Target: Enables efficient execution on edge devices, microcontrollers (TinyML), and dedicated AI accelerators (NPUs) that have optimized integer compute pipelines.
- Deployment Flow: After LSQ training, the floating-point α and weights are converted to integers. For a matrix multiplication:
Y_int = (W_int * X_int), with a subsequent dequantization that can often be fused into the next layer's operation. - Benefit: Dramatically reduces power consumption and latency compared to floating-point inference, which is the ultimate goal of techniques like LSQ.
Post-Training Quantization (PTQ)
Post-Training Quantization (PTQ) is an alternative compression approach where a pre-trained full-precision model is quantized without any retraining. This contrasts with LSQ, which is a Quantization-Aware Training (QAT) method. PTQ uses a small calibration dataset to estimate statistics (e.g., range, distribution) to set parameters like clipping bounds and scaling factors.
- Advantage: Fast and requires no labeled data or GPU resources for retraining.
- Disadvantage: Accuracy degradation is typically more severe than QAT, especially for bit-widths below 8 bits, making it less suitable for extreme quantization.
- Advanced PTQ: Methods like AdaRound improve PTQ by optimizing how weights are rounded to integers, bridging the performance gap to QAT for some models.

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us