Customizing Large Language Model Generation Style using Parameter-Efficient Finetuning

Xinyue Liu, Harshita Diddee, Daphne Ippolito

Introduction

Modern Large Language Models (LLMs) are typically trained to be "human-aligned," a process that often results in a standardized, helpful, but ultimately homogenized prose style. While this "one-size-fits-all" approach ensures safety and utility, it frequently strips away the unique linguistic nuances—the "idiolect"—that define individual human voices. This homogenization can hinder students from developing their own writing styles, introduce subtle cultural biases, and fail users who require a writing assistant that mirrors their specific tone.

To address this, researchers at Carnegie Mellon University have introduced StyleTunedLM. This framework utilizes Parameter-Efficient Finetuning (PEFT) to tailor LLMs to the specific writing styles of individual authors, ensuring that models can capture stylistic flair without losing their fundamental ability to follow complex natural language instructions.

The Problem: The "ChatGPT-ification" of Prose

Existing solutions for stylistic customization face significant hurdles. Prompt engineering, which involves providing the model with examples in a few-shot context, is often "finicky" and strictly limited by the model's context window. Conversely, full model finetuning is computationally prohibitive for state-of-the-art models with billions of parameters. Furthermore, standard finetuning on unstructured text often leads to "catastrophic forgetting," where the model loses its instruction-following capabilities and general reasoning skills in favor of mimicking the training data.

Methodology: Decoupling Style from Content

StyleTunedLM builds on the Llama-2-7b architecture and employs three core techniques to achieve efficient and effective style adaptation:

1. Low-Rank Adaptation (LoRA)

Instead of updating the entire parameter space, the researchers trained small "adapter" matrices. This PEFT approach makes the process computationally efficient and allows for the modular swapping of different styles depending on the user's needs.

2. Named Entity Masking

A primary challenge in style-tuning is ensuring the model learns how someone writes rather than simply what they write about. To prevent the model from merely memorizing and "name-dropping" characters or locations from the source text, the researchers used spaCy to identify person names in the training data. These entities were masked during the loss calculation, forcing the model to focus on syntactic structures, vocabulary choices, and rhythmic patterns rather than specific content.

3. LoRA Module Merging

To maintain the model's utility as a functional assistant, the authors proposed a novel module-merging technique. They merged the style-tuned LoRA adapter with an instruction-tuned adapter (trained on the LIMA dataset) by concatenating the weight matrices. This creates a single, unified model that retains both the target stylistic nuances and the ability to follow user prompts.

Experimental Setup and Datasets

The study evaluated the method using a diverse set of literary data and benchmarks:

  • Author Dataset: Works from 10 iconic authors sourced from Project Gutenberg, including Jane Austen, George Orwell, Virginia Woolf, and P. G. Wodehouse.
  • Instruction Data: The LIMA dataset was utilized for the instruction-following component of the merged models.
  • Evaluation Metrics: The researchers used a combination of perplexity, linguistic precision (lexical and syntactic alignment), and a BERT-based classifier to determine how well the model mimicked the target author.

Key Results

The results demonstrate that StyleTunedLM significantly outperforms few-shot prompting and standard instruction-tuned baselines:

  • Superior Alignment: The model achieved an average 7.0% reduction in perplexity across all authors compared to baseline models.
  • High Classification Accuracy: A BERT classifier trained to identify the 10 authors achieved 87.9% accuracy on text generated by StyleTunedLM, a substantial improvement over the ~69% accuracy achieved by few-shot approaches.
  • Stability and Intelligence: Standard LLM benchmarks (MMLU, WinoGrande, and TruthfulQA) confirmed that the merging process did not degrade the model's general reasoning capabilities. The merged models successfully adopted the target style while remaining stable and functional assistants.

Discussion and Ethical Considerations

StyleTunedLM provides a viable path to combat the homogenization of digital writing, allowing for the preservation of diverse linguistic backgrounds and historical styles. The research proves that significant stylistic markers can be captured with relatively small datasets (1k–50k tokens), making personalized LLMs accessible for individual users.

However, the authors acknowledge significant ethical concerns. The ability to perfectly mimic a specific person's voice could be misused for impersonation, the generation of sophisticated scams, or the creation of "fake news." As this technology matures, the development of robust verification and watermarking processes for custom styles will be a critical necessity. Future work will also focus on testing these methods in low-resource settings, specifically for writers from underrepresented backgrounds with limited available data.

Summary updated

BibTeX
@inproceedings{liu2024customizing,
  author = {Xinyue Liu and Harshita Diddee and Daphne Ippolito},
  title = {{Customizing Large Language Model Generation Style using Parameter-Efficient Finetuning}},
  booktitle = {INLG},
  year = {2024},
  doi = {10.18653/v1/2024.inlg-main.34},
}
Figure