Specialized Text Editing LLM Development through Instruction Tuning

grammarly · Tech · 2023 · source Agentic: no · promotional bias: med · source-backed · extracted with prompt 0.5.6 (schema v2)

Generated from extraction.json — do not edit by hand. Every claim cites verbatim source evidence; stated means the quote directly asserts the claim, implied means it supports it indirectly.

Problem

Domain: Text-editing model development

Grammarly wanted a smaller, higher-quality model specialized for text editing because general-purpose LLMs were not trained on dense editing tasks and suffered from usability, quality, performance, and reproducibility gaps.

Constraints:

Architecture

Grammarly built CoEdIT by translating text-editing categories into natural-language instructions, adding paraphrased instruction templates, fine-tuning FLAN-T5 L/XL/XXL models on the CoEdIT dataset, and evaluating the resulting specialist models against supervised editing baselines, instruction-tuned LLMs, decoder-only LLMs, human preferences, adjacent tasks, and composite editing tasks.

Diagram confidence: explicit (topology described by the source).

flowchart LR
  iterate_r_editing_dataset["IteraTeR+ editing dataset"] --> instruction_template_builder["Instruction-template builder"]
  instruction_template_builder --> coedit_fine_tuning_dataset["CoEdIT fine-tuning dataset"]
  coedit_fine_tuning_dataset --> flan_t5_base_models["FLAN-T5 base models"]
  flan_t5_base_models --> coedit_model_family["CoEdIT model family"]
  coedit_model_family --> benchmark_evaluation_suite["Benchmark evaluation suite"]
  coedit_model_family --> human_evaluation_panel["Human evaluation panel"]
Drag to pan · scroll or use +/− to zoom · reconstructed from the source's described component topology

Components

Component Role Interacts with
IteraTeR+ editing dataset Base source of editing tasks focused on non-meaning-changing edits. Instruction-template builder
Instruction-template builder Translates edit categories into natural-language instructions, sub-intentions, and paraphrased templates. IteraTeR+ editing dataset, CoEdIT fine-tuning dataset
CoEdIT fine-tuning dataset Dense text-editing instruction data used to specialize FLAN-T5 models. Instruction-template builder, FLAN-T5 base models
FLAN-T5 base models Pre-trained L, XL, and XXL models fine-tuned into CoEdIT variants. CoEdIT fine-tuning dataset, CoEdIT model family
CoEdIT model family Instruction-tuned specialist models for text editing. Benchmark evaluation suite, Human evaluation panel
Benchmark evaluation suite Standard test sets and adjacent/composite tasks used to measure editing performance. CoEdIT model family
Human evaluation panel Expert evaluators comparing model outputs for fluency, accuracy, and meaning preservation. CoEdIT model family

Data flow

Editing categories from IteraTeR+ are converted into natural-language instructions and enriched with sub-intentions plus paraphrased templates. Those examples fine-tune FLAN-T5 variants into CoEdIT models. The models are then evaluated on benchmark test sets, human preference comparisons, adjacent editing tasks, and composite-task prompts.

3 supporting quotes
“To construct our dataset, we built upon the IteraTeR+ dataset1, which contains a variety of text editing tasks while focusing on non-meaning-changing edits.”article, stated
“we fine-tuned a few different versions of a pre-trained FLANT52 LLM (L: 770 million parameters, XL: 3 billion parameters, XXL: 11 billion parameters) with the CoEdIT dataset.”article, stated
“Representatives from each of these four comparison groups, along with CoEdIT, were then evaluated against standard test sets from a variety of text editing benchmarks7.”article, stated

Why this architecture

Grammarly chose task-specific instruction tuning because text editing is a dense task family: specializing on closely related edits should improve quality, interpretability, and adjacent-task generalization while using models far smaller than general-purpose editing baselines.

3 supporting quotes
“for more well-scoped tasks like text editing, instruction tuning can be a very effective way to build higher-quality, smaller, and more performant LLMs.”article, stated
“a more specific, or “dense,” task distribution would cover tasks that are more closely related, like “paraphrase this text” and “make this text coherent.””article, stated
“performing well on “adjacent” tasks—tasks that are close to, but not exactly, its specialty—would be significantly easier for CoEdIT than it would be for an LLM generalist.”article, stated

Models used: CoEdIT-L · CoEdIT-XL · CoEdIT-XXL · FLAN-T5 · GPT3-Edit · ChatGPT · LLaMA

Scale

Alternatives considered (roads not taken)

General-purpose LLM training

Rejected because: Grammarly argues sparse general task distributions limit quality for the well-scoped text-editing domain.

“General tasks represent a “sparse task distribution”—anything from “summarize this text’” to “translate this text to French,””article, stated

Existing supervised editing models

Rejected because: CoEdIT was evaluated against supervised text-editing models and the smallest CoEdIT model still outperformed them.

“even our smallest model, CoEdIT-L, outperforms other supervised text editing models, instruction-tuned models, and general-purpose LLMs.”article, stated

GPT3-Edit for text editing

Rejected because: Human preference and composite-task evaluations favored CoEdIT variants over GPT3-Edit in the reported comparisons.

“Evaluators preferred CoEdIT’s output 64 percent of the time, compared to just 10 percent for GPT3-Edit.”article, stated
“CoEdIT-Composite was preferred, outshining GPT3-Edit (38 percent to 34 percent)”article, stated

Patterns

fine-tuning-adaptation (model adaptation)

Grammarly fine-tuned FLAN-T5 variants on a task-specific editing instruction dataset to produce specialist CoEdIT models.

“we fine-tuned a few different versions of a pre-trained FLANT52 LLM (L: 770 million parameters, XL: 3 billion parameters, XXL: 11 billion parameters) with the CoEdIT dataset.”article, stated

eval-driven-development (evaluation)

CoEdIT was evaluated with benchmark suites, model comparison groups, human preference tests, adjacent tasks, and composite-task prompts.

“Given this subjectivity, and the lack of accepted quantitative measures for some of the qualities we were interested in, we devised both qualitative and quantitative benchmarks of how well CoEdIT performed.”article, stated
“we performed human evaluations to understand human perception and preference of edits generated by CoEdIT.”article, stated

data-quality-loop (training data)

The dataset work added natural-language instructions, sub-intentions, and paraphrases to make editing examples consistent and robust to instruction phrasing.

“we introduced specific sub-intentions like Paraphrasing, Formality Style Transfer, and Neutralization.”article, stated
“Additionally, to make sure our model would understand different phrasings of the same actual instruction (i.e., “write” versus “rewrite” a sentence), we created paraphrases of instruction templates and added those to the dataset.”article, stated

Tradeoffs

Train a dense text-editing specialist.

Chose Task-specific instruction tuning on editing examples over General-purpose task training.

Rationale: The article argues that related editing tasks create a dense distribution where specialist models can outperform generalists, including on adjacent tasks.

“The opportunity, then, was to use instruction tuning to turn CoEdIT into a text editing specialist.”article, stated
“performing well on “adjacent” tasks—tasks that are close to, but not exactly, its specialty—would be significantly easier for CoEdIT than it would be for an LLM generalist.”article, stated

Use smaller FLAN-T5 variants.

Chose 770M, 3B, and 11B CoEdIT models over Relying on 175B-parameter GPT3-Edit-style models.

Rationale: CoEdIT sought accessible, smaller models that still outperformed much larger baselines on editing tasks.

“CoEdIT is an open-source LLM that is not only up to 60 times smaller than popular LLMs like GPT-3-Edit (175 billion parameters) and ChatGPT”article, stated

Include paraphrased instruction templates.

Chose Multiple phrasings for the same editing instruction over Single canonical instruction wording.

Rationale: The model needed to understand different phrasings like write versus rewrite rather than overfitting to one template.

“to make sure our model would understand different phrasings of the same actual instruction (i.e., “write” versus “rewrite” a sentence)”article, stated

Gotchas (what bit them)

Broad instruction corpora are a poor fit for specialized text-editing behavior.

Root cause: Sparse general tasks are not closely related to one another, so they do not teach the dense editing skill distribution Grammarly wanted.

Resolution: Construct a dense editing dataset from IteraTeR+ categories, sub-intentions, and paraphrased editing instructions.

“Not training on task-specific datasets (i.e., training on highly general datasets), which limited their quality”article, stated
“To achieve consistency, particularly in subjective areas like style, we introduced specific sub-intentions”article, stated

Subjective editing quality required more than automated benchmarks.

Root cause: Writing and edit quality depend on human judgment, and accepted quantitative measures are missing for some target qualities.

Resolution: Use both quantitative benchmarks and human evaluations comparing fluency, accuracy, and preservation of meaning.

“Judging writing and edit quality is a naturally subjective process: Any one writer’s opinion might differ from another’s.”article, stated
“we performed human evaluations to understand human perception and preference of edits generated by CoEdIT.”article, stated

Composite editing tasks still showed room for improvement.

Root cause: Composite-task comparisons were closer than familiar-task evaluations.

Resolution: Grammarly created CoEdIT-Composite and identified future enhancements for complex multi-part editing.

“However, the closer margins signaled opportunities for future enhancements, so we’re excited to continue this promising line of research with composite-tuned CoEdIT.”article, stated

Evaluation

CoEdIT used quantitative benchmark test sets, comparison groups covering baselines and LLM families, human preference evaluations, adjacent-task tests, and composite-task comparisons.

Metrics: CoEdIT achieved state-of-the-art performance on multiple benchmark test sets. · CoEdIT-L used 12 to 60 times fewer parameters while outperforming compared models. · Human evaluators preferred CoEdIT-XL 64% of the time versus 10% for GPT3-Edit. · CoEdIT-Composite was preferred 38% versus 34% for GPT3-Edit and 34% versus 21% for CoEdIT-XL.

3 supporting quotes
“CoEdIT achieves state-of-the-art performance on multiple benchmark test sets, spanning syntactic, semantic, and stylistic edit requirements.”article, stated
“The results were clear: Evaluators preferred CoEdIT’s output 64 percent of the time, compared to just 10 percent for GPT3-Edit.”article, stated
“CoEdIT-Composite was preferred, outshining GPT3-Edit (38 percent to 34 percent) and the original CoEdIT-XL (34 percent to 21 percent).”article, stated

Outcomes

The public model family spans FLAN-T5 L, XL, and XXL sizes from 770M to 11B parameters and is reported as up to 60 times smaller than GPT-3-Edit.

“On both, we found that CoEdIT outperformed competitors, including GPT3-Edit. As we’d expected, CoEdIT was an expert at adapting to new tasks related to its text editing specialty due to task-specific instruction tuning.”article, stated
“CoEdIT makes this use case significantly more accessible with its state-of-the-art performance, small size (up to 60 times smaller than comparable performers)”article, stated