Introduction
Large Language Models (LLMs) such as Llama 3 and Qwen 2.5 have demonstrated remarkable multilingual capabilities. However, a significant performance gap persists between high-resource languages (e.g., English) and low-resource languages. When these models are fine-tuned for specific downstream tasks—such as structured data extraction or slot filling—they often fail to transfer those newly acquired skills across the linguistic spectrum. This paper investigates the root cause of this failure and proposes a novel method to bridge the gap by aligning internal representations at critical "middle layers" of the network.
The Challenge of Cross-Lingual Transfer
Standard Supervised Fine-Tuning (SFT) typically focuses on optimizing the model for a specific task using available data, which is often predominantly English. While the base model may be multilingual, the fine-tuning process does not naturally improve the alignment between different languages. In fact, the internal representations of semantically identical sentences in different languages often remain distinct in the model's "thought space."
Researchers found that even when a model is fine-tuned on a task, its ability to recognize that a sentence in Swahili and its translation in English represent the same concept does not improve. To achieve true cross-lingual transfer, the model must be explicitly encouraged to map diverse linguistic inputs to a shared semantic space.
Methodology: Middle-Layer Representation Alignment
The authors propose Middle-Layer Representation Alignment, a method designed to anchor task-specific learning to a language-agnostic internal representation. The approach is built on two primary pillars:
1. The "Goldilocks" Layer Selection
By utilizing translation retrieval as a diagnostic tool, the researchers discovered that cross-lingual alignment is not uniform across the model's architecture. Alignment is typically weakest at the input layers (focused on surface-level tokens and scripts) and the output layers (focused on task-specific patterns). The middle layers—specifically layer 16 in a 32-layer model—exhibit the strongest latent alignment and the highest correlation with downstream transfer performance. These layers serve as the ideal "semantic anchor" for cross-lingual training.
2. Alternating Training Objectives
Rather than using a complex joint loss function, the method employs an alternating training strategy during each step:
- Task Objective: A standard cross-entropy loss is applied to optimize the model for the target task (e.g., predicting tokens for slot-filling).
- Alignment Objective: A contrastive loss (InfoNCE) is applied to the mean-pooled hidden states of the selected middle layer. This objective pushes the representations of parallel sentence pairs closer together while distancing non-translations.
This process is implemented using Low-Rank Adaptation (LoRA), ensuring computational efficiency. Furthermore, the authors demonstrate that a "task module" and an "alignment module" can be trained independently and subsequently merged via simple parameter averaging, allowing for modular upgrades to existing models.
Experimental Results
The effectiveness of the method was evaluated across several benchmarks, including MASSIVE (slot filling), ALMA/WMT 23 (translation), and UNER (structured entity extraction).
- Slot Filling: On Llama 3, the method achieved an average improvement of +1.5 F1 points across 15 languages. Gains were more pronounced in low-resource languages, such as Welsh and Javanese, which saw improvements as high as +3.8 F1.
- Internal Alignment: The most striking result was the boost in translation retrieval accuracy at the 16th layer, which jumped from 39.4% to 73.2% in Llama 3, indicating a much more language-agnostic internal state.
- Machine Translation: The approach improved the COMET score by +1.1 in out-of-English directions, suggesting enhanced generation capabilities in non-English languages.
- Zero-Shot Generalization: Aligning a subset of representative languages also improved performance in languages not included in the alignment training, suggesting the model develops broader cross-lingual "muscles."
Discussion and Limitations
While Middle-Layer Representation Alignment significantly improves transfer, some challenges remain. The method is currently less effective for languages with non-Latin scripts (e.g., Japanese or Hindi), likely due to tokenization issues where mean-pooling tokens does not perfectly capture semantic units. Additionally, the alternating objective effectively doubles training time compared to standard SFT.
Future research will explore more sophisticated pooling mechanisms and the potential for simultaneous multi-layer alignment to further refine the model's abstract semantic space without compromising task-specific performance.
Summary updated