Introduction: The Language Gap in AI
If you ask a modern Large Language Model (LLM) like GPT-4 to translate a sentence from English to French, the result is often indistinguishable from a human translation. The model has seen billions of words of French text during its training. It “knows” French.
But what happens if you ask that same model to translate a sentence into Chokwe, a Bantu language spoken in Angola? Or Gitksan, an indigenous language from British Columbia?
The model likely fails, or hallucinates. This is the great inequality of Natural Language Processing (NLP). The internet is dominated by a handful of languages—English covers more than 50% of web content—while roughly 7,000 other languages are left behind. These “low-resource” languages lack the massive datasets of parallel sentences (e.g., “Hello” paired with “Bonjour”) required to train traditional translation systems.
So, how do we solve this? We could spend decades paying linguists to translate millions of sentences to create training data. Or, we could try a different approach: Make the AI go back to school.
In the research paper “Back to School: Translation Using Grammar Books,” researchers Jonathan Hus and Antonios Anastasopoulos propose a fascinating solution. Instead of training a model from scratch, why not just give an existing LLM a dictionary and a grammar textbook, and ask it to figure it out on the fly?
This seemingly simple idea leverages the massive context windows of modern LLMs (like GPT-4-turbo) to feed entire books into the model’s short-term memory, effectively teaching it a language it has never seen before, right at the moment of translation.
Background: The Data Bottleneck
To understand the innovation of this paper, we first need to understand the limitation of standard Machine Translation (MT).
Traditional Neural Machine Translation (NMT)
Systems like Google Translate or the research model NLLB (No Language Left Behind) rely on supervised learning. They learn \(p(\mathbf{y}|\mathbf{x})\), the probability of a target sentence \(\mathbf{y}\) given a source sentence \(\mathbf{x}\). To learn this probability distribution accurately, they need massive amounts of paired data. For high-resource languages, we have terabytes of this data. For low-resource languages, we might have almost nothing.
The Large Language Model Paradigm
LLMs are different. They are trained to predict the next token in a sequence (\(p(x)\)). Recently, they have been “instruction-tuned” to follow commands. If you prompt an LLM with “Translate this,” it models \(p(\mathbf{y}|\pi)\), where \(\pi\) is the prompt.
The breakthrough exploited in this paper is In-Context Learning. Instead of updating the model’s weights (which is expensive and requires training data), you provide information in the prompt. Previously, prompts were short. You could give the model a few examples (few-shot learning). But with the advent of models supporting 128,000-token context windows, a new possibility emerged: we can fit an entire book into the prompt.
The Core Method: Translation by “Reading the Manual”
The researchers focused on 16 typologically diverse low-resource languages, including Ilokano (Philippines), Guarani (South America), and Wolof (West Africa).
The core of their method is constructing a sophisticated prompt (\(\pi\)) that acts as a crash course in the target language. The prompt \(\pi(\mathbf{x}, t, d, s, g)\) consists of five distinct components:
- The Task (\(t\)): Simple instructions telling the model it is an expert translator.
- The Source Sentence (\(\mathbf{x}\)): The text to be translated.
- The Dictionary (\(d\)): Relevant entries from a bilingual dictionary.
- Parallel Sentences (\(s\)): A few examples of translated sentences similar to the input.
- The Grammar Book (\(g\)): The full text of a linguistic grammar book.
Let’s break down how the researchers gathered and utilized these resources.
1. The Resources
For many of these languages, the only available data comes from field linguists who have documented the language in grammar books or small dictionaries.
Dictionaries: The team sourced bilingual dictionaries from PanLex. These are often simple lists of words. Parallel Sentences: They used the FLORES-200 dataset, a benchmark for low-resource translation. However, for some languages like Gitksan, there are essentially zero parallel sentences available in standard large-scale datasets.
The table below illustrates the scarcity of data for these languages. Notice how languages like Dogri, Gitksan, and Natugu have zero sentences listed in common training corpora (OPUS).

2. The Grammar Books
This is the most novel component. The researchers selected digitized grammar books from the DReaM corpus. These are not neat, machine-readable JSON files; they are often OCR scans of physical books written decades ago. They range from 40,000 to 120,000 tokens in length.

The image above shows the actual titles used. For example, for Dinka, they used a grammar book from 1948. For Kachin, a handbook from 1902. These books contain scanning artifacts, headers, and page numbers, making the task even harder for the LLM.
3. Constructing the Prompt
At inference time (when the translation happens), the system builds the prompt dynamically:
- Dictionary Lookup: The system looks at the words in the source sentence and finds the closest matches in the dictionary using Longest Common Subsequence (LCS) distance. It pastes these definitions into the prompt.
- Sentence Retrieval: It searches the small set of available parallel sentences to find any that share similar words or structures with the input sentence and adds them as examples.
- Book Injection: It pastes the entire text of the grammar book into the prompt.
The LLM is then told: “Here is a dictionary, some examples, and a grammar book. Now translate this sentence.”
Experiments & Results
The researchers compared four different configurations to see what actually helps translation performance:
- Baseline: Zero-shot translation (just the instruction).
- W: Adding Words (dictionary).
- W+S: Adding Words + Sentences.
- W+S+G: Adding Words + Sentences + Grammar Book.
They evaluated the translations using the chrF++ score (a metric that looks at character overlaps, useful for languages with complex morphology) and compared their results against NLLB (No Language Left Behind), the current state-of-the-art specifically trained for multilingual translation.
The Main Results
The results were surprising and nuanced. It wasn’t a straight victory where “more context = better translation” for every language.

Let’s analyze the table above:
- NLLB vs. The LLM: For languages supported by NLLB (like Ilokano and Guarani), NLLB generally performed better. This makes sense; NLLB was trained specifically on these languages. However, the “Back to School” method was competitive and occasionally superior (e.g., Kabuverdianu English\(\to\)X).
- The Impact of Grammar: Adding the grammar book (W+S+G) provided the best results for several languages, particularly Kalamang and Natugu.
- The Surprise: For many languages, simply using Words and Sentences (W+S) was better than adding the Grammar book. In some cases, adding the book actually hurt performance.
Why Does the Grammar Book Sometimes Hurt?
This is the most critical insight of the paper. Why would giving the model more information (a whole book on how the language works) lead to worse translations?
The researchers hypothesized that it depends on how much the model already knows.
If GPT-4 was pre-trained on the web, it likely saw some content in languages like Ilokano or Guarani, which have a decent online presence. If the model already “knows” the language, dumping a noisy, OCR-scanned PDF from 1902 into its context window might act as a distraction rather than a help.
However, for extremely low-resource languages (like Gitksan or Natugu) which have almost zero web presence, the model knows nothing. In these cases, the grammar book is essential.
Visualizing the Correlation
To prove this, the authors plotted the translation quality against the number of available sentences (a proxy for how “known” a language is).

Look closely at the Left Plot (English \(\to\) X) in Figure 1 above:
- The Green Squares (W+S+G, using the grammar book) tend to perform best on the far left of the X-axis—these are the languages with the fewest resources (\(10^1\) to \(10^3\) sentences).
- As you move right (towards high-resource languages), the Orange Crosses (W+S, just examples) or even Blue Circles (Baseline) often take the lead.
This suggests a “crossover point.” If a language is truly unknown to the AI, you need the textbook. If the AI has seen the language before, just give it a few examples to jog its memory.
Regression Analysis
The researchers performed a linear regression to mathematically determine which features predicted success. They looked at dictionary size, corpus size, and grammar book perplexity (how confusing the book is).

The table above confirms their suspicion.
- Dictionary Words: Positive impact. More vocab is always better.
- Grammar Book Length: Positive impact. Longer books usually mean more detailed rules.
- Available Sentences: Negative impact relative to the baseline. This means that as a language becomes more common (more sentences exist), the specific benefit of the complex prompt decreases compared to the baseline.
Conclusion: A Lifeline for the “Long Tail”
This research marks a significant step in democratizing AI translation. It highlights that we don’t necessarily need to scrape the entire web or hire thousands of translators to build systems for rare languages. Sometimes, digitizing a single, well-written grammar book from the 20th century and feeding it into a massive context window is enough to get started.
Key Takeaways
- Context is King: The ability to process 128k tokens allows us to change how we teach models—moving from training weights to providing reference materials in real-time.
- No One-Size-Fits-All: Grammar books are powerful tools for the most obscure languages (the “long tail”). For languages with a digital footprint, few-shot prompting is often sufficient.
- The Resource Gap: The quality of the output is heavily dependent on the quality of the input. A messy OCR scan of a grammar book limits performance. Improving the digitization of linguistic resources is a low-hanging fruit for improving global communication.
The “Back to School” approach suggests a future where preserving a language isn’t just about archiving it in a library—it’s about creating the manual that will one day teach an AI to speak it, ensuring no language is truly lost to history.
](https://deep-paper.org/en/paper/2410.15263/images/cover.png)