Llama-3.2-3B-Instruct β€” Pruned + Distilled + FP8 (PubMedQA assessment)

Compound-compressed variant of meta-llama/Llama-3.2-3B-Instruct for the medical domain: NAS-pruned to ~2.6B params, distilled on PubMedQA text to recover accuracy, then FP8 post-training quantized. Capstone assessment checkpoint for the DLI course.

Base model: Decoder-only Transformer, 28 layers, hidden_size=3072, ffn_hidden_size=8192, 24 attention heads, 8 GQA key-value groups (~3.21B total params).

Compression Pipeline

  1. Pruning β€” see tocsa/llama-3.2-3b-pruned
  2. Knowledge distillation on PubMedQA (tokenized memory-mapped dataset), teacher = full Llama-3.2-3B-Instruct:
    torchrun --nnodes 1 --nproc_per_node 1 distill.py \
        --teacher_hf_path checkpoints/Llama-3.2-3B-Instruct \
        --student_hf_path pruning_assessment/Llama-3.2-3B-Instruct-pruned \
        --data_paths 1.0 datasets/pubmed/pubmed_text_document \
        --seq_length 1024 --mbs 1 --gbs 256 \
        --train_iters 50 --lr 1e-4 --min_lr 1e-5 --lr_warmup_iters 5 \
        --output_dir distillation_assessment --trust_remote_code
    
  3. FP8 quantization (weights, activations, KV cache), calibrated on CNN/DailyMail:
    python3 hf_ptq.py \
        --pyt_ckpt_path=distillation_assessment/Llama-3.2-3B-Instruct-pruned-distilled \
        --export_path=quantization_assessment/Llama-3.2-3B-Instruct-pruned-distilled-fp8 \
        --dataset=cnn_dailymail --qformat=fp8 --kv_cache_qformat=fp8 \
        --export_fmt=hf --trust_remote_code
    

Evaluation

Target: > 0.474 on mmlu_anatomy 5-shot (80% of the teacher's baseline score, 0.80 * 0.593).

Checkpoint Score
Teacher Llama-3.2-3B-Instruct (baseline) 0.593 (reference)
This checkpoint fill in

Framework

Produced with NVIDIA Model-Optimizer / Megatron-Bridge, as the capstone assessment of the DLI course "The Art of Compressing LLMs: Pruning, Distillation, and Quantization Demystified." Domain dataset: PubMedQA.

License

Inherits the license terms of the base model, meta-llama/Llama-3.2-3B-Instruct (Llama 3.2 Community License). Redistribution must comply with that license.

Downloads last month
13
Safetensors
Model size
3B params
Tensor type
BF16
Β·
F8_E4M3
Β·
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support