On the Similarity of Circuits across Languages: a Case Study on the Subject-verb Agreement Task

Javier Ferrando, Marta R. Costa-jussà


Abstract
Several algorithms implemented by language models have recently been successfully reversed-engineered. However, these findings have been concentrated on specific tasks and models, leaving it unclear how universal circuits are across different settings. In this paper, we study the circuits implemented by Gemma 2B for solving the subject-verb agreement task across two different languages, English and Spanish. We discover that both circuits are highly consistent, being mainly driven by a particular attention head writing a ‘subject number’ signal to the last residual stream, which is read by a small set of neurons in the final MLPs. Notably, this subject number signal is represented as a direction in the residual stream space, and is language-independent. Finally, we demonstrate this direction has a causal effect on the model predictions, effectively flipping the Spanish predicted verb number by intervening with the direction found in English.
Anthology ID:
2024.findings-emnlp.591
Volume:
Findings of the Association for Computational Linguistics: EMNLP 2024
Month:
November
Year:
2024
Address:
Miami, Florida, USA
Editors:
Yaser Al-Onaizan, Mohit Bansal, Yun-Nung Chen
Venue:
Findings
SIG:
Publisher:
Association for Computational Linguistics
Note:
Pages:
10115–10125
Language:
URL:
https://preview.aclanthology.org/build-pipeline-with-new-library/2024.findings-emnlp.591/
DOI:
10.18653/v1/2024.findings-emnlp.591
Bibkey:
Cite (ACL):
Javier Ferrando and Marta R. Costa-jussà. 2024. On the Similarity of Circuits across Languages: a Case Study on the Subject-verb Agreement Task. In Findings of the Association for Computational Linguistics: EMNLP 2024, pages 10115–10125, Miami, Florida, USA. Association for Computational Linguistics.
Cite (Informal):
On the Similarity of Circuits across Languages: a Case Study on the Subject-verb Agreement Task (Ferrando & Costa-jussà, Findings 2024)
Copy Citation:
PDF:
https://preview.aclanthology.org/build-pipeline-with-new-library/2024.findings-emnlp.591.pdf