Introduction
Adapting Large Language Models (LLMs) for domain-specific machine translation (MT) presents a significant challenge. While traditional MT models rely on fine-tuning on specialized corpora, this approach is often impractical for proprietary LLMs accessed via APIs. Standard In-Context Learning (ICL) provides source-target pairs but fails to capture domain-specific stylistic preferences or explicitly guide the model on how to correct its systematic errors. This research proposes a Human-in-the-Loop (HIL) pipeline that simulates human feedback to refine translations, teaching the model not just the correct output, but the process of revision.
The HIL Pipeline: Draft-and-Refine
The core of the proposed system is a two-stage "draft-and-refine" process powered by a database of simulated feedback.
Feedback Collection and Database Construction
To create a repository of actionable feedback, the system first generates draft translations for domain-specific texts. An automated algorithm calculates the minimum edit distance between these drafts and ground-truth references. This edit path is then converted into natural language "revision instructions" (e.g., "Replace 'a' with 'an'", "Insert '.' after 'apple'"). These instructions serve as a proxy for human expert feedback, explicitly showing the model how to bridge the gap between a generic draft and a domain-accurate translation.
Retrieval and In-Context Refinement
When a new translation is requested, the LLM generates an initial draft. The system then retrieves relevant historical examples—comprising the source, draft, reference, and revision instructions—from the database using retrieval methods like BM25 or BM25-Rerank. These examples act as ICL demonstrations, guiding the LLM to polish its current draft based on similar past corrections.
Self-Reflection
To ensure the refinement process does not degrade a high-quality initial draft, the pipeline includes a self-reflection step. The LLM compares its original draft with the polished version and selects the higher-quality output, mitigating the risk of the refinement prompt introducing confusion.
Experimental Results
The HIL pipeline was evaluated using a multi-domain German-English translation benchmark across five domains: IT, Koran, Law, Medical, and Subtitles. Using GPT-3.5-Turbo, the HIL pipeline consistently outperformed the zero-shot baseline. For instance, in the IT domain, BLEU scores rose from 34.4 to 35.2, while the Medical domain saw an improvement from 40.0 to 40.9.
Analysis and Key Insights
- The Value of "How-To" Feedback: Providing explicit revision instructions alongside final translations helps the LLM grasp domain-specific nuances better than standard ICL. Qualitative case studies showed the system successfully learned to replace generic terms with domain-specific ones, such as translating "Handbuch" as "Handbook" rather than "manual" in IT contexts.
- Sentence Length Sensitivity: The HIL approach is particularly effective for very short (<10 words) and very long (>60 words) sentences. However, a slight performance drop-off was observed in medium-length sentences, suggesting the refinement prompt may occasionally introduce noise for standard structures.
- POS Accuracy: The method showed marked improvement in translating specific parts of speech, particularly base form verbs and nouns, which are often critical for technical domain accuracy.
Conclusion
By integrating simulated human feedback into the ICL process, the HIL pipeline provides a robust method for domain adaptation without model fine-tuning. Future work will focus on replacing simulated feedback with actual human expert corrections and refining the demonstration database to further enhance translation quality across all sentence lengths.
Summary updated