Analyzing Context Contributions in LLM-based Machine Translation

Emmanouil Zaranis, Nuno M. Guerreiro, André F. T. Martins
10/21/2024
cs.CL

No confident code implementation found for this paper.

Abstract

Large language models (LLMs) have achieved state-of-the-art performance in machine translation (MT) and demonstrated the ability to leverage in-context learning through few-shot examples. However, the mechanisms by which LLMs use different parts of the input context remain largely unexplored. In this work, we provide a comprehensive analysis of context utilization in MT, studying how LLMs use various context parts, such as few-shot examples and the source text, when generating translations. We highlight several key findings: (1) the source part of few-shot examples appears to contribute more than its corresponding targets, irrespective of translation direction; (2) finetuning LLMs with parallel data alters the contribution patterns of different context parts; and (3) there is a positional bias where earlier few-shot examples have higher contributions to the translated sequence. Finally, we demonstrate that inspecting anomalous context contributions can potentially uncover pathological translations, such as hallucinations. Our findings shed light on the internal workings of LLM-based MT which go beyond those known for standard encoder-decoder MT models.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{zaranis2024analyzing,
  title  = {Analyzing Context Contributions in LLM-based Machine Translation},
  author = {Emmanouil Zaranis and Nuno M. Guerreiro and André F. T. Martins},
  year   = {2024},
  eprint = {2410.16246},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2410.16246v1}
}

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/2410.16246.svg)](https://codeofpaper.com/paper/2410.16246)

Discussion