Multi-Task Instruction Tuning of LLaMa for Specific Scenarios: A Preliminary Study on Writing Assistance

Yue Zhang, Leyang Cui, Deng Cai, Xinting Huang, Tao Fang, Wei BiarXiv 2023 · DOI · arXiv

Introduction

While proprietary Large Language Models (LLMs) like ChatGPT have demonstrated remarkable general-purpose capabilities, their performance in "vertical" or domain-specific applications—such as medical advice, financial analysis, or writing assistance—remains a subject of investigation. This study explores whether a smaller, open-source model like LLaMA-7B can be transformed into a "scenario expert" through multi-task instruction tuning. The research specifically evaluates whether such a specialized model can outperform larger generalist models and how it compares to traditional, task-specific state-of-the-art (SOTA) models.

Methodology

The researchers focused on the writing-assistant scenario, encompassing seven distinct tasks: Grammaticality, Fluency, Clarity, Coherence, Simplification, Neutralization, and Paraphrasing. The core approach involved reformulating existing NLP datasets into an instruction-following format.

Table 1: Task definitions, prompts, and examples used for instruction tuning.

To develop Writing-Alpaca, the team utilized:

  • Multi-Task Instruction Tuning: Datasets were converted into "Instruction-Input-Output" triplets to teach the model specific editing behaviors.
  • Data Mixing: Approximately 60,000 task-specific writing instances were combined with 52,000 general-purpose instructions from the Stanford Alpaca project. This mixture is essential to maintain the model's general instruction-following capabilities and prevent performance collapse on unseen tasks.
  • Parameter-Efficient Tuning: The primary experiments employed Low-Rank Adaptation (LoRA) to fine-tune LLaMA-7B and 13B models, comparing these results against full-model fine-tuning.

Results and Key Insights

The specialized Writing-Alpaca-7B model demonstrated significant performance gains over the base LLaMA model and generalist instruction-tuned models.

Table 2: Performance comparison across various writing tasks and model configurations.

The "Scenario Expert" Advantage

Writing-Alpaca-7B achieved an average score of 48.65 across the benchmark, a substantial increase from the base LLaMA-7B (30.64) and the general Alpaca-7B (43.07). Notably, Writing-Alpaca-7B outperformed much larger models, including the 175B-parameter InstructGPT (42.5) and ChatGPT (40.9), on the majority of writing tasks.

The Role of Generalization

A critical finding was that fine-tuning solely on specific writing tasks led to a performance collapse on related but "unseen" tasks like paraphrasing. Including general instruction data (Alpaca) served as a necessary regularizer, preserving the model's overall "intelligence" and versatility.

Challenges: Hallucination and Efficiency

Despite its strengths, Writing-Alpaca faces two major hurdles:

  1. Hallucination: In tasks like Grammatical Error Correction (GEC), the model often suffers from "memory distortion," changing factual details (e.g., proper names) rather than just correcting grammar. This results in lower accuracy compared to specialized models like GECToR.
  2. Efficiency Gap: LLMs are significantly slower than traditional small SOTA models. For instance, RoBERTa-Large can process over 274 instances per second, whereas LLaMA-13B-GEC manages only 0.7 instances per second.

Conclusion

This preliminary study confirms that multi-task instruction tuning can effectively specialize smaller LLMs for specific scenarios like writing assistance, allowing them to punch above their weight class against larger generalist models. However, for high-volume, single-task applications, traditional small SOTA models remain more practical due to their superior speed and lower hallucination rates. Future research will focus on mitigating hallucinations and expanding this approach to other vertical domains.

Summary updated

Abstract

Proprietary Large Language Models (LLMs), such as ChatGPT, have garnered significant attention due to their exceptional capabilities in handling a diverse range of tasks. Recent studies demonstrate that open-sourced smaller foundational models, such as 7B-size LLaMA, can also display remarkable proficiency in tackling diverse tasks when fine-tuned using instruction-driven data. In this work, we investigate a practical problem setting where the primary focus is on one or a few particular tasks rather than general-purpose instruction following, and explore whether LLMs can be beneficial and further improved for such targeted scenarios. We choose the writing-assistant scenario as the testbed, which includes seven writing tasks. We collect training data for these tasks, reframe them in an instruction-following format, and subsequently refine the LLM, specifically LLaMA, via instruction tuning. Experimental results show that fine-tuning LLaMA on writing instruction data significantly improves its ability on writing tasks. We also conduct more experiments and analyses to offer insights for future work on effectively fine-tuning LLaMA for specific scenarios. Finally, we initiate a discussion regarding the necessity of employing LLMs for only one targeted task, taking into account the efforts required for tuning and the resources consumed during deployment.
BibTeX
@misc{zhang2023multi,
  author = {Yue Zhang and Leyang Cui and Deng Cai and Xinting Huang and Tao Fang and Wei Bi},
  title = {{Multi-Task Instruction Tuning of LLaMa for Specific Scenarios: A Preliminary Study on Writing Assistance}},
  year = {2023},
  eprint = {2305.13225},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2305.13225},
}
Figure