Text Generation
Transformers
Safetensors
llama
gsq
gumbel-softmax
quantization
ptq
llama-3.1
vllm
humming
text-generation-inference
Instructions to use ISTA-DASLab/Llama-3.1-70B-Instruct-2Bit-GSQ with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ISTA-DASLab/Llama-3.1-70B-Instruct-2Bit-GSQ with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ISTA-DASLab/Llama-3.1-70B-Instruct-2Bit-GSQ")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("ISTA-DASLab/Llama-3.1-70B-Instruct-2Bit-GSQ") model = AutoModelForCausalLM.from_pretrained("ISTA-DASLab/Llama-3.1-70B-Instruct-2Bit-GSQ") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use ISTA-DASLab/Llama-3.1-70B-Instruct-2Bit-GSQ with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ISTA-DASLab/Llama-3.1-70B-Instruct-2Bit-GSQ" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ISTA-DASLab/Llama-3.1-70B-Instruct-2Bit-GSQ", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/ISTA-DASLab/Llama-3.1-70B-Instruct-2Bit-GSQ
- SGLang
How to use ISTA-DASLab/Llama-3.1-70B-Instruct-2Bit-GSQ with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "ISTA-DASLab/Llama-3.1-70B-Instruct-2Bit-GSQ" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ISTA-DASLab/Llama-3.1-70B-Instruct-2Bit-GSQ", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "ISTA-DASLab/Llama-3.1-70B-Instruct-2Bit-GSQ" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ISTA-DASLab/Llama-3.1-70B-Instruct-2Bit-GSQ", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use ISTA-DASLab/Llama-3.1-70B-Instruct-2Bit-GSQ with Docker Model Runner:
docker model run hf.co/ISTA-DASLab/Llama-3.1-70B-Instruct-2Bit-GSQ
Add model card with GSQ paper citation (arXiv:2604.18556)
Browse files
README.md
CHANGED
|
@@ -1,16 +1,69 @@
|
|
| 1 |
---
|
| 2 |
license: llama3.1
|
| 3 |
-
base_model: meta-llama/Llama-3.1-70B-Instruct
|
| 4 |
-
base_model_relation: quantized
|
| 5 |
library_name: transformers
|
| 6 |
pipeline_tag: text-generation
|
|
|
|
|
|
|
| 7 |
tags:
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
- llama
|
| 9 |
- llama-3.1
|
| 10 |
-
-
|
| 11 |
-
-
|
| 12 |
-
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
license: llama3.1
|
|
|
|
|
|
|
| 3 |
library_name: transformers
|
| 4 |
pipeline_tag: text-generation
|
| 5 |
+
base_model: meta-llama/Llama-3.1-70B-Instruct
|
| 6 |
+
base_model_relation: quantized
|
| 7 |
tags:
|
| 8 |
+
- gsq
|
| 9 |
+
- gumbel-softmax
|
| 10 |
+
- quantization
|
| 11 |
+
- ptq
|
| 12 |
- llama
|
| 13 |
- llama-3.1
|
| 14 |
+
- vllm
|
| 15 |
+
- compressed-tensors
|
| 16 |
+
- arxiv:2604.18556
|
| 17 |
+
---
|
| 18 |
+
|
| 19 |
+
# Llama-3.1-70B-Instruct — 2-bit GSQ
|
| 20 |
+
|
| 21 |
+
2-bit quantization of [`meta-llama/Llama-3.1-70B-Instruct`](https://huggingface.co/meta-llama/Llama-3.1-70B-Instruct)
|
| 22 |
+
produced with **GSQ** (Gumbel-Softmax Quantization) at **≈2.13 bpp**.
|
| 23 |
+
|
| 24 |
+
GSQ is the strongest *scalar* PTQ method we measured at this scale and lands
|
| 25 |
+
within ≈1.7 points of vector-quantized methods (QTIP, PV-Tuning) on the
|
| 26 |
+
standard zero-shot suite (ARC-C/E, HellaSwag, PIQA, Winogrande):
|
| 27 |
+
|
| 28 |
+
| Method | 70B Avg |
|
| 29 |
+
|-----------------|:-------:|
|
| 30 |
+
| FP16 | 78.99 |
|
| 31 |
+
| GPTQ | 57.38 |
|
| 32 |
+
| QuIP | 61.57 |
|
| 33 |
+
| EfficientQAT | 71.43 |
|
| 34 |
+
| QTIP (VQ) | 77.25 |
|
| 35 |
+
| PV-Tuning (VQ) | 76.27 |
|
| 36 |
+
| **GSQ (ours)** | **75.57** |
|
| 37 |
+
|
| 38 |
+
- Paper: [GSQ: Highly-Accurate Low-Precision Scalar Quantization for LLMs via Gumbel-Softmax Sampling](https://arxiv.org/abs/2604.18556) (arXiv:2604.18556)
|
| 39 |
+
- Paper page on HF: <https://huggingface.co/papers/2604.18556>
|
| 40 |
+
- Code: <https://github.com/IST-DASLab/GSQ>
|
| 41 |
+
- Collection: <https://huggingface.co/collections/ISTA-DASLab/gsq>
|
| 42 |
+
|
| 43 |
+
## Quantization details
|
| 44 |
+
|
| 45 |
+
- **Base model:** [`meta-llama/Llama-3.1-70B-Instruct`](https://huggingface.co/meta-llama/Llama-3.1-70B-Instruct)
|
| 46 |
+
- **Bits / weight (effective):** ≈2.13 bpp
|
| 47 |
+
- **Codebook:** 2-bit symmetric scalar `{-2, -1, 0, +1} × scale`
|
| 48 |
+
- **Group size:** 128
|
| 49 |
+
- **Format:** `compressed-tensors` (auto-detected by vLLM)
|
| 50 |
+
- **Pipeline:** GPTQ initialization → Gumbel-Softmax refinement (Lion optimizer)
|
| 51 |
+
|
| 52 |
+
## Serving with vLLM
|
| 53 |
+
|
| 54 |
+
```bash
|
| 55 |
+
vllm serve ISTA-DASLab/Llama-3.1-70B-Instruct-2Bit-GSQ \
|
| 56 |
+
--tensor-parallel-size 2
|
| 57 |
+
```
|
| 58 |
+
|
| 59 |
+
## Citation
|
| 60 |
+
|
| 61 |
+
```bibtex
|
| 62 |
+
@article{gsq2026,
|
| 63 |
+
title = {GSQ: Highly-Accurate Low-Precision Scalar Quantization for LLMs via Gumbel-Softmax Sampling},
|
| 64 |
+
author = {Dadgarnia, Alireza and Tabesh, Soroush and Nikdan, Mahdi and Helcig, Michael and Kurti{\'c}, Eldar and Kleinegger, Max and Alistarh, Dan},
|
| 65 |
+
journal= {arXiv preprint arXiv:2604.18556},
|
| 66 |
+
year = {2026},
|
| 67 |
+
url = {https://arxiv.org/abs/2604.18556}
|
| 68 |
+
}
|
| 69 |
+
```
|