[Paper Review] Adaptive Few-shot Prompting for Machine Translation with Pre-trained Language Models
AFSP automatically selects suitable translation demonstrations for input sentences using a hybrid LLM-embedding retrieval module, generates multiple outputs, and reranks them with a self-supervised re-ranker, improving MT on diplomatic Chinese–English and UN corpora.
Recently, Large language models (LLMs) with in-context learning have demonstrated remarkable potential in handling neural machine translation. However, existing evidence shows that LLMs are prompt-sensitive and it is sub-optimal to apply the fixed prompt to any input for downstream machine translation tasks. To address this issue, we propose an adaptive few-shot prompting (AFSP) framework to automatically select suitable translation demonstrations for various source input sentences to further elicit the translation capability of an LLM for better machine translation. First, we build a translation demonstration retrieval module based on LLM's embedding to retrieve top-k semantic-similar translation demonstrations from aligned parallel translation corpus. Rather than using other embedding models for semantic demonstration retrieval, we build a hybrid demonstration retrieval module based on the embedding layer of the deployed LLM to build better input representation for retrieving more semantic-related translation demonstrations. Then, to ensure better semantic consistency between source inputs and target outputs, we force the deployed LLM itself to generate multiple output candidates in the target language with the help of translation demonstrations and rerank these candidates. Besides, to better evaluate the effectiveness of our AFSP framework on the latest language and extend the research boundary of neural machine translation, we construct a high-quality diplomatic Chinese-English parallel dataset that consists of 5,528 parallel Chinese-English sentences. Finally, extensive experiments on the proposed diplomatic Chinese-English parallel dataset and the United Nations Parallel Corpus (Chinese-English part) show the effectiveness and superiority of our proposed AFSP.
Motivation & Objective
- Address prompt sensitivity in in-context learning for machine translation by automatically selecting high-quality demonstrations for each source input.
- Build a hybrid demonstration retrieval module using the deployed LLM's embeddings to retrieve semantically related translation demonstrations.
- Introduce a self-supervised re-ranker to select semantically consistent translations and mitigate output bias.
- Create and validate on a high-quality diplomatic Chinese-English parallel dataset and the UN Chinese-English subset to assess effectiveness across domains.
Proposed method
- Use a translation demonstration corpus and a hybrid retrieval module based on the deployed LLM's embeddings (dense, sparse, and multi-vector) to compute a hybrid relevance score and retrieve top-k demonstrations.
- Fill the fixed prompt template with the retrieved demonstrations to form a few-shot prompt for the LLM.
- Have the LLM generate multiple target-language outputs and rerank them with a small-language-model (SLM) re-ranker trained via self-supervision with negative sampling.
- train a self-supervised re-ranker using degenerated target texts and quality scores derived from perturbations to create a large training dataset.
- Compare AFSP against zero-shot, few-shot, and KNN-based baselines across Diplomatic and UN Chinese–English datasets using standard MT metrics and human evaluation.

Experimental results
Research questions
- RQ1Can adaptive demonstration retrieval improve translation quality over fixed prompts across inputs?
- RQ2Does hybrid embedding-based retrieval yield more semantically relevant demonstrations than single-model embeddings?
- RQ3Can a self-supervised reranker improve semantic consistency and reduce output bias in LLM translations?
- RQ4How does AFSP perform on diplomatic Chinese–English and UN Chinese–English data compared to baselines?
Key findings
- AFSP consistently outperforms zero-shot, few-shot, and KNN baselines across evaluated datasets and language directions.
- Using the deployed LLM's embeddings for demonstration retrieval (dense, sparse, multi-vector) with adaptive prompts improves translation metrics.
- A self-supervised reranker effectively selects higher-quality translations, boosting both automatic metrics and human judgments.
- AFSP achieves notable improvements on the Diplomatic corpus and UN Parallel Corpus (Chinese–English) across multiple metrics and demonstrations.
- Human evaluation indicates AFSP delivers better fluency, accuracy, and style retention than baselines.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.