# How do you translate between English and French with GPT-3?

Date: 2022-06-25 · Author: Robert Scales · https://guidetoartificialintelligence.com/en/learn/translate-between-english-french-gpt-3/

**Answer:** Give GPT-3 a clear instruction that names the target variety of French (Québec or France), the audience and the tone, then paste the text in a separate, labeled block. Check the result by translating it back into English in a fresh prompt and comparing meanings, and have a fluent speaker review anything important.

GPT-3 was not built as a translator, yet it translates surprisingly well. It learned from a huge collection of web text in which other languages appear naturally alongside English. The GPT-3 paper reports that 93% of its training data by word count is English, which leaves 7% in other languages, French among them. That small share was enough for the model to translate between French and English at a level close to dedicated systems trained without paired translations.

The paper also found a clear imbalance: GPT-3 translates into English noticeably better than it translates out of English. For a French speaker reading English documents, that is good news. For an English speaker writing French for customers, it is a reason to be more careful, and to write a better prompt.

## Why the prompt matters for translation

French is not one target. A text written for readers in Montréal and one written for readers in Paris can differ in vocabulary, spelling habits and tone. In Québec, an email is usually a *courriel* and the weekend is the *fin de semaine*; in France, *mail* and *week-end* are common. A translation can be grammatically perfect and still sound foreign to its readers.

GPT-3 also has to guess the register, meaning the level of formality. French marks this strongly, starting with the choice between *tu* and *vous*. If you do not say which you want, the model picks whatever seems most typical.

Since January, OpenAI's default models on its API are the InstructGPT versions, which are tuned to follow written instructions. That makes it practical to describe the translation you want in plain words rather than only showing examples.

## A worked translation prompt

Here is a prompt for a short notice from a small business, written for customers in Québec. The instruction comes first, the source text is clearly separated, and an open label shows where the answer goes.

```prompt
Translate the English text below into Québec French for local customers of a family hardware store. Use a warm, polite tone and address readers with "vous". Use vocabulary common in Québec. Keep the store name and phone number unchanged.

English text:
"""
Our store will be closed on Monday for the long weekend. Online orders placed by email will be ready for pickup on Tuesday morning. Questions? Call us at 819-555-0142.
"""

Québec French translation:
```

Each line does a job. "Québec French" sets the variety. "Local customers" and "warm, polite tone" set the audience and the voice. "Vous" removes the formality guess. "Keep the store name and phone number unchanged" protects details that must not change. The triple quotes mark exactly where the source text begins and ends, so the model does not mistake it for part of the instruction.

For France French, change two phrases: "Translate ... into French as used in France" and "Use vocabulary common in France." Running both versions side by side is a useful way to see how much the target matters.

A few settings help. A low temperature (the setting that controls how random the output is) keeps the translation close and consistent. Also set the maximum length high enough that the model does not stop in the middle of a sentence.

## A back-translation check

Back-translation means translating the result back into the original language and comparing it with what you started with. It does not prove a translation is good, but it quickly exposes meanings that were lost or changed.

1. Copy GPT-3's French output.
2. In a new prompt, ask: "Translate this French text into English, as literally as possible."
3. Put the original English and the back-translation side by side.
4. Look for differences in facts (days, times, numbers), in who does what, and in tone.

If the original says orders will be ready "on Tuesday morning" and the back-translation says "Tuesday," the morning was dropped. Fix the French, or adjust the prompt and try again. Because GPT-3 is stronger when translating into English, this return step is usually its most reliable part.

> **Try it:** Take a short paragraph you have written in English, translate it with the prompt above, once for Québec and once for France, and back-translate both. List every word or phrase that differs between the two French versions.

## When should you still use a human translator?

Use a professional whenever an error would be costly. Contracts, legal notices, medical or safety instructions and anything involving money or people's rights need a translator who is accountable for the result. GPT-3 writes what sounds likely, and like any language model it can drop a detail, invent one or choose a word with the wrong legal meaning, all in fluent French that hides the mistake.

A human is also the better choice when the text carries your public voice: a website, a brochure, an advertisement or a message to an entire community. A skilled translator understands local expressions, humor and cultural references, and can tell when a literal rendering will sound odd to your readers. That judgment is hard to check with back-translation alone.

A practical middle path works for many small organizations. Use GPT-3 for a first draft and for understanding incoming French or English text, then ask a fluent speaker to review anything that will be published or signed. The model saves time on the draft; the person makes sure it says what you mean to the people who will read it.

## Sources

- Language Models are Few-Shot Learners: https://arxiv.org/abs/2005.14165
- Aligning Language Models to Follow Instructions: https://openai.com/index/instruction-following/
