Back to Blogs
Blogs

Running 27B Model on Single 24GB GPU: Compressing from 54GB to 14GB VRAM with Near Baseline Accuracy and 2.7x Faster Inference

5 Jul 2026 · 7 min read · Quantization, GPTQ, multimodal models
Read original on Medium ↗

Base Model : https://huggingface.co/Qwen/Qwen3.6–27B
Quantized Model : https://huggingface.co/AxisQuant

As large language models increase in size and complexity, deploying them efficiently has become a massive bottleneck. A massive 27 billion parameter model like Qwen3.6-27B requires around 54 GB of VRAM at load in its native BF16 format. This puts it far out of reach for developers relying on standard consumer hardware like a single 24GB GPU .

While model quantization reducing numerical precision to decrease memory usage, accelerate inference, and lower computational costs is the standard solution, it comes with a major catch for Vision Language Models. If you blindly apply standard quantization across the entire network, you risk destroying the model’s visual comprehension capabilities.

This is where our approach introduces a specific novelty.

Instead of a blank compression, we applied a hybrid, selective quantization strategy. We aggressively compressed the language model backbone down to 4-bit integers using Generalized Post Training Quantization ( GPTQ ), while strictly preserving the vision encoder in its native 16 bit precision.

The result is a 27B multimodal model that shrinks from 54 GB to just 14 GB of VRAM, runs 2.7x faster, fits comfortably on a single 24GB GPU with plenty of room for a 32K context window, and retains near perfect vision and language accuracy.

Here is exactly how we did it.

Choosing the Right Quantization : Why PTQ ?

There are two primary approaches to model compression: Quantization Aware Training ( QAT ) and Post Training Quantization ( PTQ ).

QAT introduces quantization effects during the training phase itself, allowing the model to adapt to lower-precision representations. While it yields high accuracy, it requires immense compute resources to finetune a 27B model. PTQ, on the other hand, quantizes a pre trained model after training using a small calibration dataset.

We chose PTQ because it avoids the computational nightmare of retraining. However, simply rounding 16-bit weights to the nearest 4-bit value causes catastrophic quality degradation. Across billions of parameters, tiny rounding errors quickly accumulate.

To solve this, we used GPTQ. When GPTQ quantizes a weight and introduces a small error, it does not simply ignore it. Instead, it uses second-order information from the Hessian matrix to adjust the remaining unquantized weights in the same layer, allowing them to absorb and compensate for the error.

Architecture and The Selective Quantization Delta

We took Qwen3.6–27B and quantized it using GPTQModel v7. To make the experiment fair and measure the real impact, we used no hidden optimizations and no parameter tuning between runs.

Let us look at the architecture to see exactly where our selective GPTQ intervention occurs.

Qwen3.6–27B Internal Architecture [ Source: sebastianraschka.com/llm-architecture-gallery ]

At a high level, Qwen3.6–27B is a massive stack of layers. Input text is converted into embeddings ( hidden size of 5120 ), which pass through multiple layers before being projected into a 248K token vocabulary.

Inside a single language layer, there are two main building blocks. The first is Gated Attention ( Full Attention ) containing the Q, K, and V projections. The second is Gated DeltaNet ( Linear Attention ), a lighter attention mechanism. The architecture mixes these in a 3:1 ratio. After each attention block comes a feed-forward network ( FFN ).

Almost every component here Q, K, V, output projections, and FFNs is fundamentally a large weight matrix. This is where GPTQ operates, compressing these matrices from 16-bit to 4-bit layer by layer.

However, the vision encoder follows a completely different story. We intentionally left the entire vision block untouched in BF16. By isolating the quantization to the language layers, we prevented the loss of image understanding accuracy that usually plagues quantized multimodal models.

The Mechanics of GPTQ

This is the part where the GPTQ algorithm does the heavy lifting. Using the official C4 ( English ) dataset as our calibration set, we pass data through the layers to generate a Hessian matrix. Think of this matrix as a report card that dictates which weights are critical and which are forgiving.

Formally, for a layer’s weight matrix, GPTQ builds the Hessian from the calibration activations. It then quantizes the matrix column by column. It rounds one column to 4 bits, calculates the exact quantization error, and pushes that error onto the remaining unrounded columns, weighted by the inverse Hessian.

This Hessian step is the true secret. Without it, 4-bit quantization is just aggressive rounding. With it, a 27B model throws away roughly 75% of its weight precision while preserving its intelligence.

Here is the pseudocode of how this algorithm operates under the hood:

Algorithm (Pseudocode):

Input:

W: full precision weight matrix
X: calibration activations
bits: target bit-width (e.g , 4)
group_size: e.g., 128
block_size: e.g., 128

1. Compute Hessian approximation:

H = 2 · X Xᵀ

2. Add damping:

H = H + λI

3. Compute inverse Hessian information:

H_inv = inverse(H)
C = Cholesky(H_inv)

4. For each block of columns:

Take W_block

For each column i inside the block:
a. Take current weight column:
w = W[:, i]

b. Quantize it:
q = Quantize(w, bits, scale, zero_point)

c. Store q in Q[:, i]

d. Compute quantization error:
err = w - q

e. Normalize error using Hessian inverse diagonal:
err = err / C[i, i]

f. Update remaining columns inside the block:
W[:, i:] = W[:, i:] - err * C[i, i:]

After the block is done:
g. Update all remaining future columns:

W[:, block_end:] = W[:, block_end:] - block_errors * C[block, future]

5. Save:

quantized weights Q
scales
zero-points
group size metadata

A critical detail for preserving quality was setting the group size to 128. If an entire weight matrix shares a single quantization scale, large values get clipped while small values lose information. Dividing weights into groups of 128, where each group shares its own scale and zero point, allows both extremes to be represented accurately. We also enabled “ desc_act ”, ensuring GPTQ processes the most important weight columns first based on activation magnitude.

Results 1: Model Size Reduction

model weight footprint.

This is the most immediate success of our hybrid approach.

  • VRAM at load dropped from 54 GB to 14 GB (3.9x smaller)
  • Bits per weight dropped from 16 to 4.29 (3.7x fewer)

The native BF16 version requires a costly multi-GPU setup. Our INT4 version comfortably fits on a single RTX 3090/4090, permanently lowering the barrier to entry for deploying a model of this caliber.

Results 2: Inference Speed Improvements

Inference : Benchmarking

During text generation, the GPU spends most of its time fetching weights from memory rather than doing math. Because our weights are roughly 4x smaller, the GPU moves far less data per generated token.

As a result, Output Throughput skyrocketed from 26.29 tokens/sec to 74.43 tokens/sec. The Time Per Output Token ( TPOT ) dropped from 37.99 ms to 13.92 ms. The Time to First Token ( TTFT ) also saw a respectable improvement, dropping from 52.66 ms to 33.43 ms.

Because we drastically reduced the memory bottleneck, the model is significantly faster across the board.

Results 3: Accuracy Retention

Accuracy benchmarks BF16 Vs INT4

Accuracy retention is where we must be honest. We ran identical benchmarks on both models using the lm-evaluation-harness (greedy decoding, thinking disabled, seed 0).

For Knowledge, Mathematics, and Commonsense tasks, there is virtually zero degradation. On MMLU Redux, the drop is less than one point. GSM8K, HellaSwag, and WinoGrande even showed slight statistical improvements (likely due to evaluation variance and the regularization effect of quantization).

Harder reasoning tasks show a slight impact. GPQA Diamond and ARC Challenge dropped by roughly 1.5 points. Code generation, which is highly sensitive to single-token mistakes, was affected the most, with HumanEval dropping by 3.1 points.

Crucially, because we isolated the vision encoder in BF16, visual tasks suffered zero degradation

Who Should Actually Use This Model?

Our INT4 model preserves nearly the exact same quality as the original BF16 model while running 2.7x faster and fitting on a single consumer GPU. It is exceptionally well suited for:

  1. Vision Language Tasks ( due to the preserved BF16 vision encoder )
  2. Chat and Question Answering
  3. RAG and Retrieval Applications
  4. Document Summarization
  5. General Knowledge Tasks

For practical, real world deployment, this hybrid quantization approach proves that you do not need an expensive server rack to run a massive 27B multimodal model.

A Small Update on Adoption

Current month ( June 2026 ): 3.49K downloads.

References


Running 27B Model on Single 24GB GPU : Compressing from 54GB to 14GB VRAM with Near Baseline… was originally published in Glance on Medium, where people are continuing the conversation by highlighting and responding to this story.

Running 27B Model on Single 24GB GPU: Compressing from 54GB to 14GB VRAM with Near Baseline Accuracy and 2.7x Faster Inference · Prashant Takale