C o E d IT : Text Editing by Task-Specific Instruction Tuning (2023)

Abstract: We introduce CoEdIT, a state-of-the-art text editing system for writing assistance. CoEdIT takes instructions from the user specifying the attributes of the desired text, such as “Make the sentence simpler” or “Write it in a more neutral style,” and outputs the edited text. We present a large language model fine-tuned on a diverse collection of task-specific instructions for text editing (a total of 82K instructions). Our model (1) achieves state-of-the-art performance on various text editing benchmarks, (2) is competitive with publicly available largest-sized LLMs trained on instructions while being ~60x smaller, (3) is capable of generalizing to unseen edit instructions, and (4) exhibits abilities to generalize to composite instructions containing different combinations of edit actions. Through extensive qualitative and quantitative analysis, we show that writers prefer the edits suggested by CoEdIT relative to other state-of-the-art text editing models. Our code, data, and models are publicly available at https://github.com/vipulraheja/coedit.

## introduction large language models (llms) have made remarkable progress toward generating coherent text in a wide variety of tasks and domains to support writing assistance @xcite @xcite , such as grammatical error correction @xcite ), text simplification @xcite , paraphrasing @xcite , and style transfer @xcite . one of the emergent abilities of llms is the capability to generalize to unseen tasks by following new or composed instructions. instruction-tuning, where llms are fine-tuned on a collection of tasks phrased as instructions, makes the models more adept at interpreting and following instructions, reducing the need for few-shot exemplars @xcite @xcite . 1 code, data, and models available at https://github. com/vipulraheja/coedit 2 and 11 . publicly available models are denoted with (*). text editing is a complex task because human writers cannot simultaneously grasp multiple demands and constraints of the task and tend to iterate and revise their work multiple times @xcite @xcite . this poses a significant challenge for intelligent writing assistants. in this work, we aim to improve the capabilities of instruction-tuned models for text editing by leveraging instruction-tuning from diverse tasks of text editing benchmarks. while multiple previous works have attempted to develop general-purpose text editing models using llms, they are either not trained with instruction-tuning @xcite , trained on much smaller models or not trained on task-specific datasets @xcite , or are not publicly available @xcite , which limits their effectiveness, performance, or usability. we introduce coedit, a text editing system designed to provide writing assistance with a natural language interface. a user can employ coedit by providing natural language instructions such as "paraphrase the sentence" or "fix the grammar". our experiments demonstrate that fine-tuning instructions for specific tasks is more effective than multi-task learning and general-purpose instruction tuning. we conjecture that task-specific instructions increase the density of the instruction space, reinforcing the complementary effects of multiple tasks and facilitating their generalization to composite and new text editing tasks, as shown in fig. 2 . to build coedit, we fine-tune a pre-trained sequence-to-sequence model on a parallel corpus of instruction-based 82k input-output pairs. the inputs and outputs are sourced from publicly available corpora for different text editing tasks, and the instructions are constructed based on rules that introduce lexical and semantic variations. our main contributions are as follows: • we achieve state-of-the-art performance on multiple text editing tasks: grammatical error correction, text simplification, sentence fusion, iterative text editing, and three stylistic editing tasks (formality style transfer, neutralization, and paraphrasing). ## related work large language models for text editing in general, our work is related to many prior works that leverage llms; for instance, finetuning t5 @xcite on pairs of original and edited text @xcite @xcite @xcite . however, these aforementioned works are either not based on instruction tuning, use different modeling techniques such as tag-based se-quence labeling, or are not general enough to work on multiple text editing tasks. moreover, several llms are trained to solve specific tasks only, such as grammar errors @xcite ), text simplification @xcite , paraphrase generation (chowdhury et al., 2022), or style transfer @xcite , which limits their generalizability. instruction tuning for writing assistance explicitly teaching models how to follow natural language instructions is closely related to recent work for fine-tuning models using large datasets of human-written instructions @xcite @xcite @xcite @xcite . recently, advanced data augmentation and instruction tuning, starting with the flan models @xcite , have shown that strong results stem both from the larger and more diverse set of tasks. additionally, enriching task diversity and balancing task sources @xcite are shown to be critical to performance, suggesting instruction-tuned models offer a more computationally-efficient starting checkpoint for downstream applications, corroborating @xcite and @xcite . on instruction tuning for writing assistance, our work is closely related to peer @xcite , who fine-tuned t5-based llms by following user-provided text-editing plans to perform the said edits. there are a few significant differences in our approach compared to peer. while peer attempts to either create or leverage a user-provided plan, realize the edits conditioned on the plan, and try to explain the plan, we focus only on the plan and edit parts of the pipeline. even when it comes to handling editing plans in the form of natural language instructions, our work focuses on edits that do not add new information. therefore, we compare our models only against peer-edit models. finally, no prior works, to the best of our knowledge, have investigated the ability of instructiontuned llms for text editing to generalize to composite instructions. ## experimental setup we conduct experiments to determine if a standard instruction-tuned language model fine-tuned using task-specific data can improve text editing performance and if it can further generalize into a general-purpose text editing model capable of following human-written instructions and handling a wider array of editing tasks, such as unseen and composite instructions. specifically, we aim to answer the following research questions: ## qualitative results we now address rq2 and rq3 (section 4). we show that coedit shows generalization abilities to adjacent tasks not seen during fine-tuning and can generalize to composite instructions containing a combination of tasks. further, our human evaluation studies show that expert human evaluators find the text generated by coedit to be of higher quality than a much larger instruction-tuned llm. ## conclusions we present coedit -an open-sourced dataset and set of instruction-tuned large language models that can act as a writing assistant by following natural language instructions to perform various textual edits by removing, updating, or adding words, phrases, and sentences. coedit achieves state-ofthe-art performance on multiple text editing benchmarks, spanning syntactic, semantic, and stylistic edit requirements. through extensive experiments, we have shown that coedit is capable of further generalizing to unseen, adjacent, and composite instructions to perform edits along multiple dimensions in a single turn. in our human evaluations, we observe that coedit can assist writers with various aspects of the text revision process at scale by following natural language instructions.