Research implementation comparing full fine-tuning of BERT, RoBERTa, and DistilBERT with LoRA-based fine-tuning of Phi-4-mini and Llama-3.2-1B for symptom-based disease classification.
Python
0
17 commits
updated Sep 30, 2026
Research implementation comparing full fine-tuning of encoder-based Transformer models with LoRA-based parameter-efficient fine-tuning of decoder-only Large Language Models (LLMs) for symptom-based disease classification.
This project investigates the performance, training efficiency, and parameter efficiency of Transformer-based models for classifying diseases from patient-reported symptoms.
The study compares three encoder models trained using conventional full fine-tuning:
with two decoder-only LLMs adapted using Low-Rank Adaptation (LoRA):
The experiments evaluate classification accuracy, macro F1-score, training time, and parameter efficiency.
Title:
Fine-Tuning vs LoRA: Comparing Encoders and Decoder LLMs for Symptom-Based Disease Classification
Author:
Akshay Tanmane
Advisor:
Dr. Ausif Mahmood
Institution:
University of Bridgeport
Research Area:
Natural Language Processing, Large Language Models, Parameter-Efficient Fine-Tuning, Medical Text Classification
The encoder-based models were trained using conventional full fine-tuning.
| Model | Fine-Tuning Method |
|---|---|
| BERT | Full Fine-Tuning |
| RoBERTa | Full Fine-Tuning |
| DistilBERT | Full Fine-Tuning |
The decoder-only models were adapted using LoRA.
| Model | Fine-Tuning Method |
|---|---|
| Phi-4-mini-instruct | LoRA / QLoRA |
| Llama-3.2-1B-Instruct | LoRA / QLoRA |

The experimental pipeline consists of the following stages:
Symptom Description
|
v
Dataset Preparation
|
+----------------------+
| |
v v
Encoder Models Decoder LLMs
| |
Full Fine-Tuning LoRA / QLoRA
| |
+----------+-----------+
|
v
Disease Classification
|
v
Evaluation & Error Analysis
The decoder models were fine-tuned using a parameter-efficient LoRA configuration.
Key configuration used in the study:
LoRA Rank (r): 8
LoRA Alpha: 16
LoRA Dropout: 0
Quantization: 4-bit NF4
Target Modules: All Linear Layers
Training Epochs: 15
The LoRA approach significantly reduces the number of trainable parameters compared with updating the complete model.
The study uses symptom-based disease classification datasets.
The encoder experiments use a 22-class classification setup, while the LoRA experiments use a 24-class dataset.
The LoRA dataset contains:
Training: 840 samples
Validation: 180 samples
Test: 180 samples
Additional disease classes included in the LoRA dataset are:
The experimental results reported in the research paper are summarized below.
| Model | Method | Accuracy |
|---|---|---|
| BERT | Full Fine-Tuning | 92.50% |
| RoBERTa | Full Fine-Tuning | 94.37% |
| DistilBERT | Full Fine-Tuning | 94.37% |
| Phi-4-mini-instruct | LoRA | 93.33% |
| Llama-3.2-1B-Instruct | LoRA | 95.00% |
| BERT | RoBERTa |
|---|---|
![]() | ![]() |
| DistilBERT | Phi-4-mini |
|---|---|
![]() | ![]() |
| Llama-3.2-1B |
|---|
![]() |
Among the evaluated models, Llama-3.2-1B-Instruct with LoRA achieved 95.00% accuracy on the reported test set.

RoBERTa and DistilBERT achieved 94.37%, while Phi-4-mini-instruct achieved 93.33%.

The results demonstrate that LoRA-based adaptation of decoder-only LLMs can achieve competitive classification performance while requiring substantially fewer trainable parameters.
The study particularly highlights the trade-off between:

The experiments identified difficulties in classifying certain symptom descriptions, particularly cases involving overlapping or ambiguous symptoms.
Drug-reaction-related samples were among the challenging categories observed during evaluation.
This highlights the importance of richer symptom descriptions and larger, more diverse medical datasets for improving model robustness.
Python
PyTorch
Hugging Face Transformers
PEFT
LoRA
QLoRA
BitsAndBytes
Scikit-learn
Pandas
NumPy
Jupyter Notebook
fine-tuning-vs-lora-disease-classification/
│
├── data/
│ ├── train/
│ ├── validation/
│ └── test/
│
├── notebooks/
│ ├── bert_training.ipynb
│ ├── roberta_training.ipynb
│ ├── distilbert_training.ipynb
│ ├── phi4_lora_training.ipynb
│ └── llama_lora_training.ipynb
│
├── src/
│ ├── data_preprocessing.py
│ ├── train_encoder.py
│ ├── train_lora.py
│ └── evaluate.py
│
├── results/
│ ├── metrics/
│ ├── confusion_matrices/
│ └── training_results/
│
├── figures/
│
├── requirements.txt
├── README.md
└── LICENSE
Clone the repository:
git clone https://github.com/akshaytanmane150294/fine-tuning-vs-lora-disease-classification.git
cd fine-tuning-vs-lora-disease-classification
Create a virtual environment:
python -m venv .venv
Activate the environment.
.venv\Scripts\activate
source .venv/bin/activate
Install dependencies:
pip install -r requirements.txt
from transformers import AutoTokenizer, AutoModelForSequenceClassification
model_name = "bert-base-uncased"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(
model_name,
num_labels=22
)
The decoder LLM experiments use PEFT-based LoRA adaptation.
from peft import LoraConfig, get_peft_model
config = LoraConfig(
r=8,
lora_alpha=16,
lora_dropout=0.0,
target_modules="all-linear"
)
model = get_peft_model(model, config)
model.print_trainable_parameters()
The models are evaluated using:
Macro F1 is particularly useful for evaluating multi-class classification performance because it gives equal importance to each class.
The experiments indicate that:
Potential future directions include:
For reproducible experiments, the repository should maintain:
If you use this work in your research, please cite:
@article{tanmane2026finetuninglora,
title={Fine-Tuning vs LoRA: Comparing Encoders and Decoder LLMs for Symptom-Based Disease Classification},
author={Tanmane, Akshay},
year={2026},
institution={University of Bridgeport}
}
Akshay Tanmane
M.S. Computer Science
University of Bridgeport
Research interests:
This repository is intended for academic and research purposes.
Research implementation comparing full fine-tuning of BERT, RoBERTa, and DistilBERT with LoRA-based fine-tuning of Phi-4-mini and Llama-3.2-1B for symptom-based disease classification.
Python
0
17 commits
updated Sep 30, 2026
Research implementation comparing full fine-tuning of encoder-based Transformer models with LoRA-based parameter-efficient fine-tuning of decoder-only Large Language Models (LLMs) for symptom-based disease classification.
This project investigates the performance, training efficiency, and parameter efficiency of Transformer-based models for classifying diseases from patient-reported symptoms.
The study compares three encoder models trained using conventional full fine-tuning:
with two decoder-only LLMs adapted using Low-Rank Adaptation (LoRA):
The experiments evaluate classification accuracy, macro F1-score, training time, and parameter efficiency.
Title:
Fine-Tuning vs LoRA: Comparing Encoders and Decoder LLMs for Symptom-Based Disease Classification
Author:
Akshay Tanmane
Advisor:
Dr. Ausif Mahmood
Institution:
University of Bridgeport
Research Area:
Natural Language Processing, Large Language Models, Parameter-Efficient Fine-Tuning, Medical Text Classification
The encoder-based models were trained using conventional full fine-tuning.
| Model | Fine-Tuning Method |
|---|---|
| BERT | Full Fine-Tuning |
| RoBERTa | Full Fine-Tuning |
| DistilBERT | Full Fine-Tuning |
The decoder-only models were adapted using LoRA.
| Model | Fine-Tuning Method |
|---|---|
| Phi-4-mini-instruct | LoRA / QLoRA |
| Llama-3.2-1B-Instruct | LoRA / QLoRA |

The experimental pipeline consists of the following stages:
Symptom Description
|
v
Dataset Preparation
|
+----------------------+
| |
v v
Encoder Models Decoder LLMs
| |
Full Fine-Tuning LoRA / QLoRA
| |
+----------+-----------+
|
v
Disease Classification
|
v
Evaluation & Error Analysis
The decoder models were fine-tuned using a parameter-efficient LoRA configuration.
Key configuration used in the study:
LoRA Rank (r): 8
LoRA Alpha: 16
LoRA Dropout: 0
Quantization: 4-bit NF4
Target Modules: All Linear Layers
Training Epochs: 15
The LoRA approach significantly reduces the number of trainable parameters compared with updating the complete model.
The study uses symptom-based disease classification datasets.
The encoder experiments use a 22-class classification setup, while the LoRA experiments use a 24-class dataset.
The LoRA dataset contains:
Training: 840 samples
Validation: 180 samples
Test: 180 samples
Additional disease classes included in the LoRA dataset are:
The experimental results reported in the research paper are summarized below.
| Model | Method | Accuracy |
|---|---|---|
| BERT | Full Fine-Tuning | 92.50% |
| RoBERTa | Full Fine-Tuning | 94.37% |
| DistilBERT | Full Fine-Tuning | 94.37% |
| Phi-4-mini-instruct | LoRA | 93.33% |
| Llama-3.2-1B-Instruct | LoRA | 95.00% |
| BERT | RoBERTa |
|---|---|
![]() | ![]() |
| DistilBERT | Phi-4-mini |
|---|---|
![]() | ![]() |
| Llama-3.2-1B |
|---|
![]() |
Among the evaluated models, Llama-3.2-1B-Instruct with LoRA achieved 95.00% accuracy on the reported test set.

RoBERTa and DistilBERT achieved 94.37%, while Phi-4-mini-instruct achieved 93.33%.

The results demonstrate that LoRA-based adaptation of decoder-only LLMs can achieve competitive classification performance while requiring substantially fewer trainable parameters.
The study particularly highlights the trade-off between:

The experiments identified difficulties in classifying certain symptom descriptions, particularly cases involving overlapping or ambiguous symptoms.
Drug-reaction-related samples were among the challenging categories observed during evaluation.
This highlights the importance of richer symptom descriptions and larger, more diverse medical datasets for improving model robustness.
Python
PyTorch
Hugging Face Transformers
PEFT
LoRA
QLoRA
BitsAndBytes
Scikit-learn
Pandas
NumPy
Jupyter Notebook
fine-tuning-vs-lora-disease-classification/
│
├── data/
│ ├── train/
│ ├── validation/
│ └── test/
│
├── notebooks/
│ ├── bert_training.ipynb
│ ├── roberta_training.ipynb
│ ├── distilbert_training.ipynb
│ ├── phi4_lora_training.ipynb
│ └── llama_lora_training.ipynb
│
├── src/
│ ├── data_preprocessing.py
│ ├── train_encoder.py
│ ├── train_lora.py
│ └── evaluate.py
│
├── results/
│ ├── metrics/
│ ├── confusion_matrices/
│ └── training_results/
│
├── figures/
│
├── requirements.txt
├── README.md
└── LICENSE
Clone the repository:
git clone https://github.com/akshaytanmane150294/fine-tuning-vs-lora-disease-classification.git
cd fine-tuning-vs-lora-disease-classification
Create a virtual environment:
python -m venv .venv
Activate the environment.
.venv\Scripts\activate
source .venv/bin/activate
Install dependencies:
pip install -r requirements.txt
from transformers import AutoTokenizer, AutoModelForSequenceClassification
model_name = "bert-base-uncased"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(
model_name,
num_labels=22
)
The decoder LLM experiments use PEFT-based LoRA adaptation.
from peft import LoraConfig, get_peft_model
config = LoraConfig(
r=8,
lora_alpha=16,
lora_dropout=0.0,
target_modules="all-linear"
)
model = get_peft_model(model, config)
model.print_trainable_parameters()
The models are evaluated using:
Macro F1 is particularly useful for evaluating multi-class classification performance because it gives equal importance to each class.
The experiments indicate that:
Potential future directions include:
For reproducible experiments, the repository should maintain:
If you use this work in your research, please cite:
@article{tanmane2026finetuninglora,
title={Fine-Tuning vs LoRA: Comparing Encoders and Decoder LLMs for Symptom-Based Disease Classification},
author={Tanmane, Akshay},
year={2026},
institution={University of Bridgeport}
}
Akshay Tanmane
M.S. Computer Science
University of Bridgeport
Research interests:
This repository is intended for academic and research purposes.