LLM4Variants-Qwen3-4B

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

The model wraps the backbone Qwen/Qwen3-4B 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

Metric Value
Code accuracy 0.9309
Strength accuracy 0.9374
Joint accuracy 0.8822
Strength acc | correct code 0.9477
Code weighted-F1 0.9307
Strength weighted-F1 0.9351

Training configuration

Hyperparameter Value
Learning rate 0.0001
Effective batch size 128
Epochs 8
Max length 256
ฮป (strength loss) 1.0
Code emb dim 64
Negative ratio 0.25
Seed 42
Train / val / test size 19161 / 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:

from safetensors.torch import load_file
from huggingface_hub import hf_hub_download

model = DualHeadLLM("Qwen/Qwen3-4B", num_keywords=28, num_strengths=6)
state = load_file(hf_hub_download("HFXM/LLM4Variants-Qwen3-4B", "model.safetensors"))
model.load_state_dict(state)
Downloads last month

-

Downloads are not tracked for this model. How to track
Safetensors
Model size
4B params
Tensor type
F32
ยท
BF16
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for HFXM/LLM4Variants-Qwen3-4B

Finetuned
Qwen/Qwen3-4B
Finetuned
(1,240)
this model