Subject Activation Patching for Cross-Lingual Factual Recall
Improving factual recall of multilingual LLMs in Hindi and Bengali without fine-tuning, by patching English subject representations into the model's middle layers.
Code on GitHub · CSALT Lab, IIT Bombay (Dec 2024 – Aug 2025) · Advisor: Prof. Preethi Jyothi
Joint work with Sabyasachi Samantaray.
Overview
Multilingual LLMs are trained mostly on English text, and they recall facts much better when asked in English than in medium- and low-resource languages. On our Hindi test queries, Llama-3.1-8B-Instruct answers 69% correctly when they are asked in English, but only 21% when they are asked in Hindi. For Bengali the two numbers are 57% and 15%. Earlier work closes part of this gap with fine-tuning or with long multilingual prompts such as cross-lingual-thought (XLT) prompting [1]. Fine-tuning can introduce new biases, and long prompts make every query more expensive.
We instead transfer knowledge from English inside the model at inference time, with no fine-tuning. Subject activation patching (SP) copies the hidden state of the English subject name into the target-language prompt, at the position of the subject’s last token in a middle layer. With this single change, Hindi accuracy rises from 21% to 36%, which is better than XLT (31%). Combined with relation patching, it also beats XLT on Bengali (24.4% vs 23.6%).
Setup
Data. We use parallel English–Hindi–Bengali factual queries, each a (subject, relation, object) triple, for 14 Wikidata relations: continent, religion, place of birth, architect, sport, discoverer, instrument, film director, country of a tourist attraction, game developer, book author, music artist, birth year and death year. The test sets contain 2,275 Hindi and 5,770 Bengali queries. A query is the subject name followed by a relation template in the target language. In most runs we add the instruction “The answer is:” after the query, following Wang et al. [2], which helps the instruction-tuned model answer directly.
Model and metric. All results below are for Llama-3.1-8B-Instruct, implemented with TransformerLens hooks [4] and greedy decoding. A query counts as correct if the generated text contains the gold object or one of its aliases (direct match, case-insensitive). We report the average over the 14 relations and an average weighted by the number of queries per relation.
Baselines. We compare against:
- the target-language query, with and without the instruction;
- XLT prompting [1] with two demonstrations, where the model restates the request in English, answers step by step and gives the answer in the target language;
- the parallel English queries, which serve as a reference for how much the model knows.
Method: activation patching
Activation patching replaces a hidden state of one forward pass with the corresponding hidden state from another forward pass [3]. We patch the residual stream at the input of a layer, and the patched positions stay patched while the answer is generated.
- Subject patching (SP). Run the model on the English subject name alone, then copy its residual stream at layer 8, at the subject’s last token, into the target-language prompt at the last token of the subject.
- Relation patching (RP). Run the model on the English version of the query, then copy the residual stream of its last token at layer 12 into the last token of the target-language prompt. In the variant reported below, the English query uses a fixed placeholder subject, so only information about the relation is transferred.
- RP + SP. Both patches together, at layers 12 and 8.
- RP + SP with self-translation. In practice an English version of the query is not available. In this variant the same model first transliterates the subject into English and translates the query into English, each with a two-example prompt. These outputs then serve as the sources for the two patches, so the method needs only the target-language query.
The last section shows how the effect of each patch depends on the layer.
Results
Direct-match accuracy (%) of Llama-3.1-8B-Instruct. All rows except the first use the instruction “The answer is:”. For Bengali, subject patching alone was not run.
| Method | Hindi (avg.) | Hindi (weighted) | Bengali (avg.) | Bengali (weighted) |
|---|---|---|---|---|
| Base, without instruction | 16.6 | 14.8 | 10.8 | 9.7 |
| Base | 20.7 | 27.3 | 14.9 | 19.1 |
| XLT, 2-shot [1] | 30.7 | 36.1 | 23.6 | 26.0 |
| RP (layer 12, fixed subject) | 20.1 | 27.2 | 14.4 | 19.1 |
| SP (layer 8) | 35.8 | 40.4 | – | – |
| RP + SP | 34.4 | 38.9 | 24.4 | 30.3 |
| RP + SP, self-translated | 31.9 | 34.8 | 23.2 | 28.9 |
| English queries (reference) | 69.4 | 70.8 | 57.0 | 53.1 |
- Subject patching gives the largest gain. On Hindi it raises the average accuracy from 20.7% to 35.8%, ahead of XLT (30.7%). It also helps without the instruction, from 16.6% to 29.2%.
- Relation patching alone does not help (20.1% against 20.7% for the base prompt). The choice of the placeholder subject in the English query hardly matters: a different placeholder changes the Hindi result by less than 1.5 points.
- RP + SP matches or beats XLT on both languages. On Bengali it raises the weighted accuracy from XLT’s 26.0% to 30.3%. Even the self-translated version, which needs no English input, is on par with XLT (31.9% vs 30.7% on Hindi, 23.2% vs 23.6% on Bengali). It does so without XLT’s long few-shot prompt and step-by-step answer.
- A large gap to the English queries (69%) remains, so most of the knowledge the model has in English still does not transfer.
Where in the model does patching help?
We also patched one layer at a time and measured the relative change in the mean log-probability of the gold answer for each relation, \((\log p_{\text{patched}} - \log p_{\text{base}}) / \lvert \log p_{\text{base}} \rvert\).
Subject patching raises the gold answer’s log-probability when applied in the early and middle layers, with the largest average gain around layer 8. It has no effect from about layer 20 on. Relation patching has no effect in the early layers and lowers the log-probability from about layer 14 on. A few relations, such as death year, react much more strongly than the rest. The layers used in the results above (8 for the subject, 12 for the relation) lie where subject patching helps most and before relation patching starts to hurt.
The same analysis on four other open models shows the same pattern for Llama-3.2-3B-Instruct, Gemma-2-9B-it and Mistral-7B-Instruct. In BLOOM-7B1, subject patching barely changes the log-probability, with relative changes below 0.05 at every layer.
References
[1] H. Huang, T. Tang, D. Zhang, W. X. Zhao, T. Song, Y. Xia and F. Wei, “Not all languages are created equal in LLMs: Improving multilingual capability by cross-lingual-thought prompting,” Findings of EMNLP 2023, arXiv:2305.07004.
[2] M. Wang, H. Adel, L. Lange, Y. Liu, E. Nie, J. Strötgen and H. Schütze, “Lost in multilinguality: Dissecting cross-lingual factual inconsistency in transformer language models,” arXiv:2504.04264, 2025.
[3] K. Meng, D. Bau, A. Andonian and Y. Belinkov, “Locating and editing factual associations in GPT,” NeurIPS 2022, arXiv:2202.05262.
[4] N. Nanda and J. Bloom, “TransformerLens,” GitHub, 2022, github.com/TransformerLensOrg/TransformerLens.