Quality assurance · Production

Grammarly's mEdIT: fine-tuning multilingual LLMs to support cross-lingual text editing across seven languages

The problem

Popular foundational LLMs produce low-quality outputs for text editing tasks, and prior fine-tuning efforts addressed either multiple editing tasks for a single language or a single task across multiple languages—never both simultaneously.

First attempt

GPT3.5 and GPT4 used as zero-shot baselines performed poorly relative to fine-tuned models on multilingual text editing tasks, with GPT3.5 performing the least well of all models considered.

Workflow diagram · grounded in source
1
Curate multilingual training data
integration
“Our training data for these tasks included more than two hundred thousand pairs of instructions and rewrite outputs, all curated from publicly available data sets”
2
Native speaker instruction review
human_review
“we asked native language speakers to review and correct translated instructions after they were automatically generated from English versions”
3
Fine-tune multilingual LLMs
ai_action
“All of these multilingual models were fine-tuned with our instructional data set on 8xA100 80G GPU instances”
4
Evaluate against baselines
validation
“we compared our work against three different zero-shot baselines (copying input to output, GPT3.5, and GPT4)”
5
Collect human evaluator feedback
human_review
“We collected feedback from expert annotators, using a process similar to the process we followed for the CoEdIT work”
6
Publish models and data publicly
output
“Our data and models are publicly available on GitHub and Hugging Face”
Reported outcome

mEdIT fine-tuned models show a substantial improvement over untrained counterparts across multiple languages and editing tasks, generalize to unseen languages, and received high ratings from human evaluators across all languages.

Reported metrics
Improvement over untrained counterpartssubstantial improvement
multilingual vs. English-only instruction training performancemuch better
Human evaluator ratingshigh ratings across all languages
Performance stability across instruction languagesstable across test cases
Show all 6 reported metrics
improvement over untrained counterpartssubstantial improvement
multilingual vs. English-only instruction training performancemuch better
human evaluator ratingshigh ratings across all languages
performance stability across instruction languagesstable across test cases
German model performance with fine-tuningvery large improvement with fine tuning
performance vs. monolingual state of the artcompetitive on multiple language-edit task combinations
Reported stack
mT5mT0BLOOMZPolyLMBactrian-XGPT3.5GPT4GitHubHugging Face
Source
https://www.grammarly.com/blog/engineering/advancing-intelligent-writing/
Read source ↗

Frequently asked questions

What did this team achieve with this AI workflow?

mEdIT fine-tuned models show a substantial improvement over untrained counterparts across multiple languages and editing tasks, generalize to unseen languages, and received high ratings from human evaluators across al…

What tools did this team use?

mT5, mT0, BLOOMZ, PolyLM, Bactrian-X, GPT3.5, GPT4, GitHub, Hugging Face.

What results were reported?

Improvement over untrained counterparts: substantial improvement; multilingual vs. English-only instruction training performance: much better; Human evaluator ratings: high ratings across all languages; Performance stability across instruction languages: stable across test cases (source-reported, not independently verified).

What failed first in this deployment?

GPT3.5 and GPT4 used as zero-shot baselines performed poorly relative to fine-tuned models on multilingual text editing tasks, with GPT3.5 performing the least well of all models considered.

How is this quality assurance AI workflow structured?

Curate multilingual training data → Native speaker instruction review → Fine-tune multilingual LLMs → Evaluate against baselines → Collect human evaluator feedback → Publish models and data publicly.