Skip to content

Fine-tuning a large language model for style-specific text generation using a novel custom loss function and parameter-efficient fine-tuning methods.

Notifications You must be signed in to change notification settings

pgasawa/cs182-project

Repository files navigation

Stylized Text Generation

Parth Asawa, Ayushi Batwara, Jason Ding, Darren Teh

Paper is available here. Public version of the finetuning-final Google Colab here.

Abstract

The task we had was fine-tuning GPT-2 on Sherlock Holmes’ dialogue with the goal of generating output text in response to prompts in the style of the fictional character Sherlock Holmes. Holmes' dialogue is known to be distinct from traditional mainstream English in its punctuation, aloofness, elevated tone, terminology, complex sentences, parallel structure, and more. Among the methods we tested — including LoRA, LoRA with context, prompt tuning, and others — we discovered that employing LoRA with context yielded the best results. This conclusion is supported by the validation loss and the quality of text generated by the model, as outlined in the report. We additionally designed and explored custom evaluation and training loss function methods for style transfer.

Visual Summary

Custom Loss Function

About

Fine-tuning a large language model for style-specific text generation using a novel custom loss function and parameter-efficient fine-tuning methods.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •