Multilingual Text Editing via Instruction Tuning

grammarly · Tech · 2024 · source Agentic: no · promotional bias: low · 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: Multilingual writing assistance

Grammarly needed text-editing models that could support multiple edit tasks across multiple languages because general foundation models and earlier specialized editors did not cover that full product surface.

Constraints:

Architecture

Grammarly built mEdIT by fine-tuning multiple multilingual LLM families on curated instruction-output pairs, then evaluating task, language, and cross-lingual instruction performance with automatic and human evaluation.

Diagram confidence: reconstructed (reconstructed from prose).

flowchart LR
  instruction-dataset["Instruction Dataset"]
  human-instruction-review["Human Instruction Review"]
  fine-tuning-jobs["Fine-Tuning Jobs"]
  evaluation-harness["Evaluation Harness"]
  instruction-dataset --> fine-tuning-jobs
  human-instruction-review --> instruction-dataset
  fine-tuning-jobs --> evaluation-harness
Drag to pan · scroll or use +/− to zoom · reconstructed from the source's described component topology

Components

Component Role Interacts with
Instruction Dataset Holds multilingual examples for grammatical correction, simplification, and paraphrasing. Fine-Tuning Jobs
Human Instruction Review Corrects translated instructions for linguistic and cultural accuracy. Instruction Dataset
Fine-Tuning Jobs Specialize multilingual base models for editing tasks. Evaluation Harness
Evaluation Harness Compares models using task-specific automatic metrics and human ratings. —

Data flow

Public multilingual editing datasets were curated into instruction-output pairs, native speakers reviewed translated instructions, candidate multilingual models were fine-tuned on GPU infrastructure, and the resulting models were evaluated against task-specific metrics and human ratings.

“By fine-tuning multilingual LLMs (including mT5, mT0, BLOOMZ, PolyLM, and Bactrian-X) on over 200,000 carefully curated instruction-output pairs across Arabic, Chinese, English, German, Japanese, Korean, and Spanish”summary, stated
“To ensure accuracy and cultural appropriateness, native language speakers reviewed and corrected automatically translated instructions from English versions.”summary, stated

Why this architecture

The team chose instruction tuning over generic prompting because specialized multilingual editing behavior required curated task examples and explicit cross-lingual evaluation.

“The problem addressed was that foundational LLMs produce low-quality outputs for text editing tasks, and prior specialized models only supported either multiple tasks in one language or single tasks across multiple languages.”summary, stated
“Performance remained stable across all these conditions, suggesting that the multilingual instructional pre-training of base models enables effective adaptation during fine-tuning.”summary, stated

Models used: mT5 · mT0 · BLOOMZ · PolyLM · Bactrian-X

Scale

Alternatives considered (roads not taken)

Use general-purpose foundation models without task fine-tuning

Rejected because: They produced poor quality on multilingual editing tasks.

“The fundamental problem Grammarly aimed to solve was the poor quality of foundational LLMs when performing text editing tasks, particularly across multiple languages.”summary, stated

Keep the prior English-only CoEdIT scope

Rejected because: It did not address multilingual writing support.

“Their earlier CoEdIT work had shown that LLMs specifically trained for editing tasks could achieve higher quality and better performance, but that work focused exclusively on English.”summary, stated

Patterns

fine-tuning-adaptation (model-adaptation)

Grammarly fine-tuned multilingual models on curated edit instructions rather than relying on zero-shot foundation model behavior.

“By fine-tuning multilingual LLMs (including mT5, mT0, BLOOMZ, PolyLM, and Bactrian-X) on over 200,000 carefully curated instruction-output pairs”summary, stated

eval-driven-development (evaluation)

The project compared architectures, instruction-language settings, and baselines using task-specific metrics plus human evaluation.

“The evaluation strategy demonstrates mature LLMOps practices with task-specific metrics chosen to align with established research standards.”summary, stated

human-in-the-loop-gate (data-quality)

Native speakers reviewed translated instructions before they entered the training set.

“native language speakers reviewed and corrected automatically translated instructions from English versions.”summary, stated

Tradeoffs

Fine-tune smaller multilingual models

Chose Task-specialized multilingual LLMs over Prompting large general-purpose models.

Rationale: Fine-tuning improved editing quality while keeping deployment feasibility closer to small and medium LLMs.

“positioning the work in the "small to medium-sized LLM" category that can be more practically deployed than massive models like GPT-4.”summary, stated

Cap dataset samples rather than maximize quantity

Chose Randomly sample 10,000 examples where available over Use every available example in larger datasets.

Rationale: Prior experiments showed quality mattered more than raw volume after a threshold.

“quality improvements correlate more strongly with data quality than data quantity.”summary, stated

Gotchas (what bit them)

Training data availability varies sharply by language and task.

Root cause: Public editing datasets are uneven across languages.

Resolution: Sample consistent caps where possible and use all available data for sparse combinations.

“However, data availability was highly uneven—for instance, Spanish GEC only had 398 data points available, while other language-task combinations had much larger datasets.”summary, stated

Automatic metrics can misread high-quality generated edits.

Root cause: Some metrics depend heavily on overlap with reference text.

Resolution: Document metric limitations and supplement with human evaluation.

“GLEU relies heavily on overlap with reference material, which may disadvantage models like GPT-4 that use RLHF and can produce excellent results without reference overlap.”summary, stated

Evaluation

The team evaluated with task-specific automatic metrics, zero-shot baselines, architecture comparisons, cross-lingual instruction conditions, and human ratings.

Metrics: M2 F0.5 · ERRANT · GLEU · SARI · BLEU · Self-BLEU · mUSE · Human ratings

“For GEC, they used language-appropriate metrics including MaxMatch (M2) Scorer, ERRANT, and GLEU, with F0.5 measure for M2 and ERRANT evaluations.”summary, stated

Outcomes

The work covers seven languages, three edit tasks, and over 200,000 curated examples, but it was not yet deployed in Grammarly production.

“mEdIT achieved strong performance across tasks and languages, even when instructions were given in a different language than the text being edited.”summary, stated