CoolFace
Modelpublic

HFXM/LLM4Variants-Llama-3.2-1B-Instruct

sourceHugging Faceotherupdated 3mo agoView on Hugging Face
0likes
Model Card

LLM4Variants-Llama-3.2-1B-Instruct

Dual-head sentence classifier for ACMG evidence-code + strength prediction on ClinVar submission comments. This is rank #2 of the grid search (ranked by joint test accuracy).

The model wraps the backbone `meta-llama/Llama-3.2-1B-Instruct` with two heads on top of mean-pooled hidden states:

  • —code head — 28-way ACMG evidence code (PVS1, PS1–PS4, PM1–PM6, PP1–PP5, BA1, BS1–BS4, BP1–BP7 + NO_KEYWORD)
  • —strength head — 6-way strength, conditioned on a learned embedding of the predicted code (Supporting, Moderate, Strong, VeryStrong, NotMet, NoStrength)

Test metrics

MetricValue
Code accuracy0.9270
Strength accuracy0.9346
Joint accuracy0.8773
Strength acc \correct code0.9464
Code weighted-F10.9265
Strength weighted-F10.9322

Training configuration

HyperparameterValue
Learning rate0.0001
Effective batch size128
Epochs8
Max length256
λ (strength loss)1.0
Code emb dim64
Negative ratio0.25
Seed42
Train / val / test size19161 / 1278 / 5110

Files

  • —model.safetensors — full state dict (backbone + code_head + code_embeddings + strength_head).
  • —label_mappings.json — keyword2id / strength2id (and reverse).
  • —tokenizer files + chat_template.jinja.

Loading

This is a custom nn.Module (DualHeadLLM), not a transformers AutoModel. Reconstruct the module (see train_dual_head.py), then load the weights:

python
from safetensors.torch import load_file
from huggingface_hub import hf_hub_download

model = DualHeadLLM("meta-llama/Llama-3.2-1B-Instruct", num_keywords=28, num_strengths=6)
state = load_file(hf_hub_download("HFXM/LLM4Variants-Llama-3.2-1B-Instruct", "model.safetensors"))
model.load_state_dict(state)