Adaptive Demonstration Retrieval and Candidate Reranking for LLM Machine Translation
AFSP, a framework that replaces the fixed few-shot prompt used for in-context machine translation with demonstrations chosen per input sentence, then filters the model's own output. Two mechanisms carry it. First, a training-free hybrid retrieval module built on the embedding layer of the deployed LLM itself rather than a separate sentence encoder: token embeddings of the query yield a dense max-pooled vector scored by inner product, a sparse lexical representation whose per-token weights come from a rectified linear projection and are summed over shared tokens, and a multi-vector representation scored by late interaction (each query token takes its maximum similarity over candidate tokens), with the two projection matrices left Gaussian-initialized and never trained, and the three scores combined by a weighted sum to select the top-k parallel sentence pairs. Second, a reranker: the LLM samples several translation candidates and a BERT-based scorer maps the CLS encoding through a linear layer and sigmoid to a quality score, trained with mean-squared error on data manufactured self-supervised by applying combinations of six degeneration operations to known-good targets and labelling each result one minus two tenths times the number of operations applied. Evaluated on a newly crawled 5,528-pair diplomatic Chinese-English corpus and the UN Parallel Corpus with BLEU, METEOR, CHRF and COMET-Kiwi across ChatGLM3-6B, InternLM2-7B, Llama3-8B and ChatGPT.
Adaptive Few-shot Prompting for Machine Translation with Pre-trained Language Models Lei Tang1
Tang and colleagues (AAAI 2025) start from a well-documented weakness of using large language models for translation through in-context learning: the models are prompt-sensitive, so a single fixed se…