Middle-Layer Representation Alignment for Cross-Lingual Transfer in Fine-Tuned LLMs

Danni Liu, Jan Niehues
2/20/2025
cs.CLcs.AI

Official code: dannigt/mid-align (15 stars, last commit 2025-09-30).

Abstract

While large language models demonstrate remarkable capabilities at task-specific applications through fine-tuning, extending these benefits across diverse languages is essential for broad accessibility. However, effective cross-lingual transfer is hindered by LLM performance gaps across languages and the scarcity of fine-tuning data in many languages. Through analysis of LLM internal representations from over 1,000+ language pairs, we discover that middle layers exhibit the strongest potential for cross-lingual alignment. Building on this finding, we propose a middle-layer alignment objective integrated into task-specific training. Our experiments on slot filling, machine translation, and structured text generation show consistent improvements in cross-lingual transfer, especially to lower-resource languages. The method is robust to the choice of alignment languages and generalizes to languages unseen during alignment. Furthermore, we show that separately trained alignment modules can be merged with existing task-specific modules, improving cross-lingual capabilities without full re-training. Our code is publicly available (https://github.com/dannigt/mid-align).

View on arXivView PDF

Code Implementations(1)

dannigt/mid-alignOfficial100%
153C, C++Feb 20, 20251 years ago

Similar Papers

Cite this paper

@article{liu2025middlelayer,
  title  = {Middle-Layer Representation Alignment for Cross-Lingual Transfer in Fine-Tuned LLMs},
  author = {Danni Liu and Jan Niehues},
  year   = {2025},
  eprint = {2502.14830},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2502.14830v3}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2502.14830.svg)](https://codeofpaper.com/paper/2502.14830)

Discussion