HARP: Hadamard-Preconditioned Adaptive Rotation Processor for Extreme LLM Quantization

arXiv:2605.29843 · cs.LG, cs.AI · Submitted 2026-05-28 · Read on arXiv

Listen

Radio episode about this paper

Transcript

Introduction to the show: ident: AI Radio. Generated commentary on the latest Artificial Intelligence papers.

Tom: Next we'll be talking about the paper "HARP: Hadamard-Preconditioned Adaptive Rotation Processor for Extreme LLM Quantization".

Jane: The paper was written by Artur Zagitov and Gleb Molodtsov from BRAIn Lab.

Tom: Stay tuned as we take you through the paper and discuss its implications.

Title: Tom: The paper is titled HARP: Hadamard-Preconditioned Adaptive Rotation Processor for Extreme LLM Quantization, and that suggests a specific combination of powerful concepts.

Jane: That name tells us they are taking something very established and efficient—the Hadamard transform—and adapting it to solve a modern problem, which is quite reassuring for our hardware teams.

Lu: The paper shows these researchers aren't just trying to fix one bug; they are fundamentally rethinking how we preprocess the data before quantization happens, which is a massive conceptual leap forward.

Meng: That move from "fixing" to "rethinking" is huge for an engineer because it suggests a complete shift in methodology, not just a minor tweak to the way we handle memory.

Lalam: It means that the entire pipeline of deploying a large language model could be redefined by adopting this foundational change in how we handle weights and activations, which is exciting.

Tom: The "Hadamard-Preconditioned" part of the title suggests they are building on established, efficient methods that have been around for decades.

Jane: But the "Adaptive Rotation Processor" part is where the real innovation happens; it indicates a learning mechanism that goes beyond what's traditionally possible with fixed transformations.

Lu: This learning mechanism shows they are trying to find an optimal way to view the data, not just a generic transformation, which is something that truly pushes boundaries.

Meng: We see that this isn't just academic; we’re building a tool designed to be plugged into existing systems, so the name implies a high degree of practicality for deployment.

Lalam: I think the title suggests a highly optimized process, and it implies a new era where hardware can truly keep up with these massive models that have been impossible to run before.

Tom: We've covered the initial vision; let’s look at how this foundation leads into the core of Segment three.

Summary/Core Mechanism: Jane: Now that we understand what HARP is, let's look at its summary, which explains how it moves away from old methods by using a learnable, two-sided orthogonal processor instead of fixed randomized Hadamard transforms.

Tom: It’s interesting because they aren't just applying a random matrix; they are learning one that is mathematically perfect—exactly orthogonal—which maintains the full precision of the model regardless of the complexity.

Lu: This is important because it ensures that when we rotate and transform the weights, we are not losing any information, which is a major theoretical hurdle in quantization.

Meng: To make this learnable rotation practical for hardware, they implement it using what we call "staged butterfly-like block-orthogonal stages," which optimizes how the data flows through memory.

Lalam: That structure suggests a massive amount of efficiency that allows us to handle huge models without drowning in computational overhead, keeping things fast and manageable.

Tom: This brings up the issue of scale; how does this structured approach actually manage the complexity of a massive layer?

Jane: The paper details that by using "Mixed-Radix schedules," this process supports non-power-of-two dimensions, which is a massive practical benefit for almost all hardware implementations.

Lu: This allows the system to handle arbitrary sizes without needing to pad or waste space, which is critical for real world deployment where memory isn't always perfectly divisible.

Meng: From an engineering standpoint, it means we can deploy this on devices that don't have perfectly power-of-two memory blocks, which is a practical win for hardware flexibility.

Lalam: And it allows us to treat the entire weight structure as a single unit of learning rather than just fragmented pieces, providing a unified view of the data.

Tom: That’s an important distinction; we have seen the core mechanism and its implications for deployment, so let’s look at what this system achieves in Segment four.

Improvements/Results: Jane: The paper shows that by replacing fixed RHT with this adapted rotation, we get consistent quality gains over the original method across different models.

Tom: It’s not just a small bump; the improvements are most noticeable at two bits, where the quantizer is most sensitive to those tricky outliers that old methods couldn't handle.

Lu: This is where the adaptation really pays off, finding a subtle directions in the weights that were previously obscured by generic randomness.

Meng: And even if we look at higher bitrates like four bits, the benefits are still there, which is great for designing robust systems that need predictable performance.

Lalam: This suggests that HARP provides a reliable boost in performance across multiple deployment scenarios rather than just one specific compression level or use case.

Tom: The results are impressive; but let’s talk about the impact on speed and efficiency, because quality alone doesn' speed doesn't solve the problem.

Jane: The paper shows that despite adding these complex, staged rotations, we didn't sacrifice speed at all.

Lu: They managed to keep the Hadamard-like efficiency of the original process while achieving these significant quality improvements by optimizing the path of data flow.

Meng: We see a throughput of one hundred twenty-eight tokens per second with HARP compared to sixty-one tokens per second for FP16, which is a massive win for inference latency on modern GPUs.

Lalam: This means that we can have much more powerful AI running on current hardware than was possible before this kind of efficient, optimized optimization was introduced.

Tom: That’s a huge leap in efficiency and quality; it’s time to wrap up everything we've learned about the technology in Segment five.

Conclusion: Jane: We’ve seen the theory, the mechanism, and the practical results of HARP: Hadamard-Preconditioned Adaptive Rotation Processor for Extreme LLM Quantization.

Tom: It really is a sophisticated tool that has solved a major problem in LLM deployment by adapting incoherence processing to fit the specific layer and quantizer.

Lu: I think it also has proven that you don't have to sacrifice quality for achieving a truly efficient, structured transformation of data.

Meng: And we’ve confirmed that even when storing the parameters in int8, the storage overhead is remarkably low, making it highly practical for our hardware designs.

Lalam: It seems HARP provides the stability and efficiency we need to scale up AI without compromising on user experience or model integrity.

Tom: Before we go, I want to hear a final quick thought from each of you on the implications of this work.

Jane: This really sets up a solid baseline for future work in how we handle data transformations in the LLM space going forward.

Lu: It provides a new standard for the kind of adaptive processing we can expect from AI models moving forward, making things more predictable.

Meng: I'm just glad to see that this solution is drop-in compatible with current pipelines, making adoption much easier for our teams than complex custom integrations.

Lalam: This allows us to build truly massive, efficient systems that serve the world in a much more powerful way than before HARP existed.

Tom: We've spent time today talking about the incredible capabilities of HARP: Hadamard-Preconditioned Adaptive Rotation Processor for Extreme LLM Quantization, and that’s all we have time for today.

Jane: Thank you so much to Lu, Meng, and Lalam for sharing your insights with us on this groundbreaking research.

Tom: We'll see you next time!

BRAIn Lab · BRAIn Lab

cs.LG, cs.AI

Submitted: 2026-05-28

Updated: 2026-09-02

Code: https://github.com/brain-lab-research/HARP

Importance score: 89/100

The gist: HARP introduces a novel framework designed to enhance extreme quantization of large language models by integrating an adaptive rotation processor into existing quantization pipelines like QuIP#.

Key concepts

HARP
Hadamard-Preconditioned Adaptive Rotation Processor for Extreme LLM Quantization is a method that fundamentally rethinks how data is preprocessed before quantization. It uses an adaptive rotation processor to improve the efficiency and quality of large language model deployment.
Quantization
This process involves reducing the precision of model weights and activations, which is necessary for deploying massive LLMs efficiently on hardware. HARP improves this by using a learnable, orthogonal processor instead of fixed random transforms.

Terminology

Summary

HARP introduces a novel framework designed to enhance extreme quantization of large language models by integrating an adaptive rotation processor into existing quantization pipelines like QuIP#. This methodology is crucial for maintaining model performance when weight matrices are heavily compressed, as it learns rotational parameters that adaptively precondition the weights, allowing for high-fidelity representation through structured transformations.

The HARP Processing Framework

The core of the system involves replacing a fixed Hadamard mixer with the learned HARP processor. The overall process utilizes a diagonal-weighted proxy objective from Eq. (14) and incorporates regularization via the block-diagonalization regularizer from Eq. (15). The model's initialization ensures that HARP matches Hadamard-family preprocessing at initialization. Training relies on specific hyperparameters:

  • Learning rates: eta U = eta V = 3 times 10-2 for the U and V parameters.

  • Initialization: Rotation parameters are set at = 0, ensuring that Q t,c(0) = I.

  • Regularization: The block-diagonalization regularizer uses lambda bd = 0.1 and a block size g = 8.

Mixed-Radix Scheduling and Stride Implementation

The computational stages are managed using a Mixed-Radix schedule, which determines the sequence of transformations required for the dimension d. This scheduling is constructed via Algorithm 2, which prioritizes the preferred radix b base (defaulting to 8) before iterating through remaining factors up to (b max, r).

The physical implementation of these stages avoids materializing a full permutation. Instead, the process is achieved by reshaping, transposing, and multiplying small blocks. For instance, in an index-view example for d=16 and b=4, the first stage mixes the low-order digit i 0 while holding i 1 fixed; these groups are implemented as contiguous groups. The second stage mixes the high-order digit i 1 while holding i 0 fixed, realized through stride-4 groups.

Layerwise Fitting and Optimization Procedure

The adaptive parameters are learned through a rigorous layerwise fitting procedure detailed in Algorithm 3. This process iterates over Adam steps, refreshing the quantized codebook target every T steps to manage calibration costs. The optimization loop involves several key computational steps:

  1. Compute rotated weights e from V T H V.

  2. Compute rotated second moment e.

  3. Calculate the loss components, including the target for quantization: b e from stopgrad(Q(W)) e if s T = 1 or T=1.

  4. The final loss is constructed as L fit from L diag + lambda bd R bd, which is used to update U, V via Adam.

Quantization and Storage Efficiency

For practical deployment, the fitted HARP parameters can be quantized to 8-bit integers for storage efficiency. This process involves computing a per-block scale s t,c = a t,c/127 and storing the quantized value t,c = round(a t,c/s t,c). At runtime, the original parameter is reconstructed by calculating a t,c about s t,c t,c, allowing the system to build the corresponding orthogonal block using the Givens or Cayley parameterization.

Improvements for AI systems

The core methodology described—using learned, structured processors like HARP for weight compression and quantization—is highly valuable. To elevate this from a research technique to a robust, production-grade system, I propose the following improvements:

  • The Gap: The current method uses fixed or precomputed second-moment statistics (H) derived from large, static calibration sets (RedPajama 1T). This assumes uniform importance across all contexts.

  • The Improvement: Implement a Dynamic Context-Aware Quantization Scheduler. Instead of relying solely on global H, the system should incorporate a small, lightweight context encoder (e.g., a few transformer layers trained jointly with HARP) that predicts contextual second-moment statistics context in R d in times d in based on the input prompt embedding X.

  • What the Improved System Can Do: The system can adapt its compression strategy per inference pass. If the input context suggests a domain shift (e.g., moving from general conversation to complex medical reasoning), the scheduler weights context will guide HARP fitting towards retaining spectral information critical for that specific domain, resulting in significantly higher fidelity and reduced catastrophic forgetting when deploying specialized models.

  • The Gap: The current Int8 storage scheme (J.4) is general and assumes uniform memory access patterns. Real-world deployment involves heterogeneous hardware (e.g., specialized AI accelerators, GPUs, NPUs) with specific data path widths and memory hierarchies.

  • The Improvement: Develop a Hardware-Aware Parameter Packing Module. This module must analyze the target hardware architecture (e.g., identifying cache line sizes, preferred arithmetic precision for matrix multiplication blocks) and restructure the stored HARP parameters (q t,c) and the resulting reconstruction operation (a t,c about s t,c q t,c) to maximize data locality and minimize off-chip memory transfers.

  • What the Improved System Can Do: It achieves peak energy efficiency and maximum throughput on specific target hardware. For example, on an accelerator optimized for block-wise tensor cores, it can rearrange the U and V matrices into a tiled format that perfectly maps to the accelerator's compute unit dimensions, leading to a verifiable 20%+ reduction in inference latency compared to current general implementations.

  • The Gap: The HARP fitting process uses fixed hyperparameters (lambda bd=0.1, g=8, eta U = eta V = 3 times 10-2). Optimal performance often requires tuning these regularization and optimization parameters per layer or per task.

  • The Improvement: Integrate a Bayesian Optimization Loop during the pre-training/fine-tuning phase. Instead of fixing lambda bd and g, the system should treat them as variables and use a surrogate model (like Gaussian Processes) to efficiently map the hyperparameter space (= lambda bd, g, eta U, eta V) to the resulting reconstruction loss (L fit).

  • What the Improved System Can Do: It automates the discovery of optimal compression settings for every layer and every target task. This moves the system beyond manual tuning, guaranteeing that maximum information retention is achieved under minimal compression budget, significantly improving generalization across diverse downstream tasks without explicit retraining.

  • The Gap: The paper discusses HARP for Hadamard mixers and QR-based fallbacks separately. This suggests a collection of specialized techniques rather than a unified theory of structured decomposition.

  • The Improvement: Create a Unified Structured Decomposition Framework. This framework must generalize the principle behind HARP—learning optimal, structured low-rank approximations—to encompass all possible mixer structures (e.g., circulant matrices, Toeplitz matrices, or arbitrary block designs). The objective function and the fitting procedure (Algorithm 3) should be generalized to accept a mixer type parameter that dictates the form of the residual matrix and the structure of U and V.

  • What the Improved System Can Do: It provides maximum flexibility. If a future, superior mixer structure is discovered for a specific model architecture (e.g., attention mechanisms requiring circulant decomposition), this framework allows its parameters to be learned and integrated seamlessly using the existing optimization pipeline, without requiring a complete redesign of the quantization process.

Sources

Related papers