CoolFace
Modelpublic

llm-semantic-router/mmbert-feedback-detector-lora

sourceHugging Faceapache-2.0updated 8mo agoView on Hugging Face
0likes6downloads
Model Card

mmBERT Feedback Detector (LoRA Adapter)

A lightweight LoRA adapter for multilingual 4-class feedback classification, fine-tuned on mmBERT-base using AMD MI300X GPU.

Model Description

This is a LoRA adapter (27 MB) that can be loaded on top of mmBERT-base for efficient inference and further fine-tuning.

Labels

LabelIDDescriptionF1 Score
SAT0User is satisfied100.0%
NEED_CLARIFICATION1User needs more information99.7%
WRONG_ANSWER2System gave incorrect response96.2%
WANT_DIFFERENT3User wants something different95.9%

Performance

MetricValue
Accuracy98.63%
F1 Macro97.94%

LoRA Configuration

ParameterValue
Rank (r)32
Alpha64
Target Modulesquery, key, value, dense
Trainable Parameters6.7M (2.15% of total)

Training

Hardware

ComponentSpecification
GPUAMD Instinct MI300X
VRAM192 GB HBM3
FrameworkPyTorch with ROCm
Training Time~2 minutes

Usage

With PEFT

python
from transformers import AutoTokenizer, AutoModelForSequenceClassification
from peft import PeftModel

# Load base model
base_model = AutoModelForSequenceClassification.from_pretrained(
    "jhu-clsp/mmBERT-base",
    num_labels=4
)

# Load LoRA adapter
model = PeftModel.from_pretrained(
    base_model,
    "llm-semantic-router/mmbert-feedback-detector-lora"
)
tokenizer = AutoTokenizer.from_pretrained("llm-semantic-router/mmbert-feedback-detector-lora")

# Classify
labels = ["SAT", "NEED_CLARIFICATION", "WRONG_ANSWER", "WANT_DIFFERENT"]
inputs = tokenizer("Thank you, that was helpful!", return_tensors="pt")
outputs = model(**inputs)
pred = outputs.logits.argmax(-1).item()
print(f"Label: {labels[pred]}")

Merge LoRA Weights

python
from peft import PeftModel

# Merge for faster inference
merged_model = model.merge_and_unload()
merged_model.save_pretrained("merged_model")

Advantages of LoRA

  • Small Size: 27 MB vs 1.2 GB (full model)
  • Fast Training: Only 2.15% of parameters trained
  • Easy Deployment: Can swap adapters without reloading base model
  • Further Fine-tuning: Can continue training on domain-specific data

Related Models

Citation

bibtex
@model{mmbert_feedback_detector_lora,
  title={mmBERT Feedback Detector LoRA},
  author={LLM Semantic Router Team},
  year={2025},
  url={https://huggingface.co/llm-semantic-router/mmbert-feedback-detector-lora}
}

License

Apache 2.0