Skip to main content
QUICK REVIEW

[Paper Review] In-context Learning as Maintaining Coherency: A Study of On-the-fly Machine Translation Using Large Language Models

Suzanna Sia, Kevin Duh|arXiv (Cornell University)|May 5, 2023
Topic ModelingComputer Science3 citations
TL;DR

This paper reframes in-context learning in machine translation as maintaining contextual coherency rather than merely learning from examples. By evaluating coherence through domain consistency and a moving window of prior translations, the authors show that coherency significantly improves translation performance—outperforming similarity-based methods by up to 2.6 BLEU points across three models and three language directions.

ABSTRACT

The phenomena of in-context learning has typically been thought of as "learning from examples". In this work which focuses on Machine Translation, we present a perspective of in-context learning as the desired generation task maintaining coherency with its context, i.e., the prompt examples. We first investigate randomly sampled prompts across 4 domains, and find that translation performance improves when shown in-domain prompts. Next, we investigate coherency for the in-domain setting, which uses prompt examples from a moving window. We study this with respect to other factors that have previously been identified in the literature such as length, surface similarity and sentence embedding similarity. Our results across 3 models (GPTNeo2.7B, Bloom3B, XGLM2.9B), and three translation directions ( exttt{en}$ ightarrow$\{ exttt{pt, de, fr}\}) suggest that the long-term coherency of the prompts and the test sentence is a good indicator of downstream translation performance. In doing so, we demonstrate the efficacy of In-context Machine Translation for on-the-fly adaptation.

Motivation & Objective

  • To reframe in-context learning in machine translation as a coherency maintenance problem rather than example-based learning.
  • To investigate how domain consistency and local coherence affect translation performance in zero-shot and on-the-fly settings.
  • To compare coherency-based prompt selection against established methods like BM25, semantic similarity, and length control.
  • To evaluate the impact of prompt interference—both positive and negative—relative to zero-shot prompting.
  • To assess whether coherency is a more predictive factor than surface or semantic similarity for in-context MT performance.

Proposed method

  • The authors use a moving window of gold-standard translations immediately preceding each test sentence to evaluate local coherence in document-level translation.
  • They compare coherency-based prompt selection against baseline methods: random sampling, BM25, BM25 with word coverage (BM25-s), and nearest neighbor (NN) retrieval.
  • Performance is measured using BLEU scores across three models (GPTNeo2.7B, Bloom3B, XGLM2.9B) and three translation directions (en→{pt, de, fr}).
  • The study controls for sentence length to isolate the effect of coherency from length bias in prompt selection.
  • They analyze interference effects by comparing BLEU scores between zero-shot and prompted settings, quantifying positive and negative interference.
  • A prompt format with 'English' and 'French' labels is used, with alternative separators tested but found not to improve performance.
Figure 1: Factors identified and studied in this paper. Selecting from matching Domain increases coherence ( Appendix C ) and each domain has different length distributions ( subsection 5.2 ). Surface similarity and embedding similarity are associated ( Table 4 ). Surface similarity selection also r
Figure 1: Factors identified and studied in this paper. Selecting from matching Domain increases coherence ( Appendix C ) and each domain has different length distributions ( subsection 5.2 ). Surface similarity and embedding similarity are associated ( Table 4 ). Surface similarity selection also r

Experimental results

Research questions

  • RQ1Does maintaining coherency between prompt examples and the test sentence improve in-context machine translation performance?
  • RQ2How does domain consistency between prompt examples and test sentences affect translation quality?
  • RQ3Can a moving window of previous gold translations serve as a better prompt selection strategy than similarity-based retrieval?
  • RQ4To what extent does coherency outperform surface or semantic similarity in prompt selection for in-context MT?
  • RQ5What is the role of interference—positive or negative—influencing performance when using prompt examples versus zero-shot prompting?

Key findings

  • Coherency between prompt examples and the test sentence is a strong predictor of translation performance, with domain consistency significantly improving results.
  • The moving window method outperforms similarity-based baselines by up to 2.6 BLEU points across all models and translation directions.
  • The window method achieves the highest proportion of positive interference (0.62) and lowest negative interference (0.29) in BLEU score changes compared to zero-shot.
  • Models perform better when prompt examples are drawn from the same domain as the test set, indicating domain-level coherency is crucial.
  • Length control is necessary, as performance differences not explained by similarity metrics are often due to length bias, which coherency helps mitigate.
  • Despite zero-shot capabilities, adding prompt examples generally improves performance, with coherency being a key factor in minimizing negative interference.
Figure 2: Histograms of sentence lengths (word counts) randomly sampled from different domains, which has implications for the total prompt length when sampling from these domains. FLORES sentences tend to be nearly twice as long as MTNT and TED sentences.
Figure 2: Histograms of sentence lengths (word counts) randomly sampled from different domains, which has implications for the total prompt length when sampling from these domains. FLORES sentences tend to be nearly twice as long as MTNT and TED sentences.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.