AWS on Using Translation Memory for Better Contextual AI Translation – slator.com

January 15, 2025


On January 7, 2025, Narcisse Zekpa and Ajeeb Peter published an article on the AWS Machine Learning Blog titled “Evaluate large language models for your machine translation tasks on AWS.” This is the latest in a series of “how to” articles intended to assist AWS’s customers with diverse tasks. 

The article describes a way to work with real-time machine translation (MT) using foundation models (FMs) available in Amazon Bedrock. Amazon Bedrock is a service that combines FMs from multiple companies, including Anthropic, Cohere, Meta, Mistral AI, Stability AI, and Amazon using a single API. These are the article’s highlights.

The authors discuss the potential of large language models (LLMs) for MT, comparing them to traditional neural machine translation (NMT). They argue that LLMs demonstrate promising capabilities in MT tasks and can compete with NMT models like Amazon Translate.

LLMs, they add, excel at understanding the context of input text, enabling them to pick up on cultural nuances and generate more natural-sounding translations. Contextual understanding is in fact a key strength of LLMs, and can be enhanced with different resources, including translation memories (TMs).

Using Translation Memories with LLMs

The authors argue that there is currently no standard method to integrate past translation knowledge (from translation memories, or TMs) into LLMs, but there is a widely used open standard for exchanging TM data between different computer-assisted translation (CAT) tools and translation management systems (TMSs): Translation Memory eXchange (TMX). 

The proposed solution utilizes prompt engineering and TMX data to guide the LLM’s output and improve translation quality. The integration of TMs with LLMs can lead to improved accuracy and consistency, domain adaptation, efficient reuse of human translations, and reduced post-editing efforts.

“Another approach to integrating TM data with LLMs is to use fine-tuning in the same way you would fine-tune a model for business domain content generation, for instance … The solution proposed in this post relies on LLMs’ context-learning capabilities and prompt engineering. It enables you to use an off-the-shelf model as is without involving machine learning operations (MLOps) activity,” commented the authors.

The article introduces a sample step-by-step application called the “LLM Translation Playground” for experimenting with real-time MT using models in Amazon Bedrock. It allows users to compare different configurations; evaluate prompt engineering and Retrieval Augmented Generation (RAG) for translation; configure language pairs; import, process, and test translations with TMX files; use custom terminology; and track performance, quality, and usage metrics.

The solution has two main flows: 1) translation memory “ingestion” and 2) text translation. TMs can be integrated using two modes: vector search and document search. 

Vector search involves embedding the source segments and storing them in a local FAISS (Facebook AI Similarity Search — a library of multimedia documents similar to each other). Document search means a standard document search using Amazon OpenSearch Serverless.

The process uses prompt engineering by structuring prompts with , source and target languages, translation memory pairs, custom terminology pairs, and the .

2024 Cover Slator Pro Guide Translation AI

2024 Slator Pro Guide: Translation AI

The 2024 Slator Pro Guide presents 20 new and impactful ways that LLMs can be used to enhance translation workflows.

The blog suggests several detailed steps to integrate TMX files with generative AI translations, including preprocessing the TMX file data, and using quality estimation (QE) and human review. 

Users enter the source text and select the source and target languages. The translation request is sent to a prompt generator. The prompt generator queries the relevant knowledge base and the translation is generated. “Amazon Bedrock is invoked using the generated prompt as input along with customization parameters,” added the authors.

The ability to iterate and refine the models through regular training is also encouraged in the article. Translation projects often involve iterative cycles of translation, review, and improvement. Users can periodically retrain or fine-tune the generative AI model with updated TMX files, creating a continuous improvement cycle.

The authors recommend considering LLM-driven translation on a case-by-case basis, reminding readers that localization should include both automated translation and human post-editing. Ideally, the localization solution chosen enhances the quality of translated content while reducing costs, speeding up localization projects, and improving the experience for the target audience.



Source link