Llama 3 8B — RL-MPQ Quantized (Thesis Release)
Quantized variant of meta-llama/Meta-Llama-3-8B using RL-MPQ (Reinforcement Learning Mixed-Precision Quantization): per-layer bit-width policies trained with PPO, validated on WikiText-2 perplexity.
This repo ships five compression scenarios as subfolders — from near-FP16 fidelity to aggressive survival mode — so you can pick the bits-vs-quality trade-off for your thesis experiments.
| Base model | meta-llama/Meta-Llama-3-8B |
| Method | RL-MPQ (PPO per-layer bit policy) |
| Format | Fake-quant FP16 weights + rlmpq_policy.json |
| Recommended start | subfolder="Balanced" |
Scenarios
High_Fidelity/— load withsubfolder="High_Fidelity"Conservative/— load withsubfolder="Conservative"Balanced/— load withsubfolder="Balanced"Aggressive/— load withsubfolder="Aggressive"Extreme_Survival/— load withsubfolder="Extreme_Survival"
Results (WikiText-2)
| Scenario | Avg bits | Compression vs FP16 | Perplexity |
|---|---|---|---|
| High_Fidelity | 6.875 | 2.3273x | 5.8133 |
| Conservative | 5.25 | 3.0476x | 5.9652 |
| Balanced | 4.5 | 3.5556x | 6.0199 |
| Aggressive | 3.7188 | 4.3025x | 6.6793 |
| Extreme_Survival | 2.875 | 5.5652x | 32.393 |
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
repo = "AvoCahDoe/llama-3-8b-rlmpq"
scenario = "Balanced" # High_Fidelity | Conservative | Aggressive | Extreme_Survival
model = AutoModelForCausalLM.from_pretrained(repo, subfolder=scenario, torch_dtype="float16")
tokenizer = AutoTokenizer.from_pretrained(repo, subfolder=scenario)
Important: Always pass
subfolder=<scenario>. Rootconfig.jsondescribes the collection; weights and tokenizer live inside each scenario folder.
Method (thesis summary)
- Phase 3 — PPO agent selects per-layer bit widths under scenario-specific reward targets.
- Phase 4 — Policies replayed on real weights; WikiText-2 PPL measures quality retention.
- Export — Fake-quantized FP16 checkpoints (compatible with Hugging Face Transformers).
Citation
@misc{rlmpq2026,
title = {RL-MPQ: Reinforcement Learning Mixed-Precision Quantization},
author = {AvoCahDoe},
year = {2026},
url = {https://huggingface.co/AvoCahDoe/llama-3-8b-rlmpq}
}
Part of the RL-NMP-Model-Quantasation thesis framework.