CoolFace
Modelpublic

daggar/flan-t5-dialogsum-lora

sourceHugging Faceapache-2.0updated 1mo agoView on Hugging Face
0likes4downloads
Model Card

Flan-T5-Large + LoRA on DialogSum

google/flan-t5-large adapted for dialogue summarization on DialogSum, trained as part of an IIT-D Gen-AI course project comparing four fine-tuning methods under identical conditions.

Method: LoRA (r=16, alpha=32, dropout=0.05, target modules q & v)

Code, evaluation harness and the other three models: https://github.com/dipika-s/iitd-genai

Usage

python
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
from peft import PeftModel

base = AutoModelForSeq2SeqLM.from_pretrained("google/flan-t5-large")
model = PeftModel.from_pretrained(base, "daggar/flan-t5-dialogsum-lora")
tokenizer = AutoTokenizer.from_pretrained("daggar/flan-t5-dialogsum-lora")

dialogue = "#Person1#: Hi, how was your weekend?\n#Person2#: Great, I went hiking."
inputs = tokenizer("Summarize the following dialogue:\n" + dialogue,
                   return_tensors="pt", max_length=512, truncation=True)
print(tokenizer.decode(model.generate(**inputs, max_new_tokens=128)[0],
                       skip_special_tokens=True))

Inputs must use the training prompt — "Summarize the following dialogue:\n" followed by the dialogue — truncated to 512 tokens. Summaries were trained at up to 128 tokens.

Training

Base model`google/flan-t5-large`
Datasetknkarthick/dialogsum — 12,460 train / 500 validation / 1,500 test
Epochs3
Optimizer steps4,674
Trainable parameters4,718,592 of 787,868,672 (0.5989%)
Peak GPU memory4.51 GB
Training time94.7 min on an AWS g5.2xlarge (A10G 24GB)
Final training loss1.0294
Final eval loss0.8958

Evaluation

Measured on the full 1,500-example DialogSum test split, against the untuned base model.

MetricBaseThis model
BLEU5.71299.8709
ROUGE-137.318345.5048
ROUGE-215.122119.8054
ROUGE-L30.851937.4039
METEOR22.282434.3109
GLEU9.731415.7709
BERTScore89.370191.6589
CoSIM34.36641.0212
Repetition rate2.24151.6046
Flesch reading ease75.061767.1588
Toxicity0.78890.6659
Novelty71.75960.7914
Diversity22.80922.2496

All four methods

MethodTrainable paramsPeak GPUROUGE-LBERTScore
Full FT783M (100%)16.11 GB37.4291.64
LoRA4.7M (0.60%)4.51 GB37.4091.66
QLoRA4.7M (0.60%)2.52 GB37.0191.58
Prefix4.9M (0.62%)8.85 GB30.85*89.37*

\* see the known issue on the prefix model card.

Limitations

Trained only on DialogSum, which is two-speaker English conversation transcripts using #Person1# / #Person2# speaker tags. Summaries of longer, multi-party, domain-specific or non-English dialogue will be unreliable. Dialogues over 512 tokens are truncated, so content late in a long conversation may be dropped. The model inherits any biases present in google/flan-t5-large and in DialogSum, and summaries can contain details not supported by the source dialogue.