When a Large Language Model (LLM) is used as a translation provider, it requires a translation prompt: a set of instructions that tells the model how to translate your content. Unlike traditional neural machine translation (NMT), LLMs allow for a high degree of customization. However, good translation output depends on giving the model a clear, well-designed prompt.
This article covers the basics of writing translation prompts in Smartling: what to include, best practices for wording your prompt, and external resources for learning more about prompt engineering.
Want an easy way to get started with LLM translation? Use Smartling Auto Select LLM. This fully managed translation Profile requires no setup on your part. Smartling provides and maintains the translation prompt, so you can start translating with an LLM right away.
Note: There is no single "correct" translation prompt, and results can vary depending on the content, language pair, and LLM model. Smartling cannot guarantee that any given prompt will produce high-quality translations. Always test your prompt with representative sample content before using it in production, and review and refine it periodically as needed.
What is a translation prompt?
A translation prompt is an instruction that asks the LLM to translate your content. Beyond the basic instruction to translate, you can use it to specify things like:
- The tone of the translation (formal, friendly, casual, and so on)
- The intended audience
- How specific terms or phrases should be handled
Instead of manually adding all these details to your prompt, Smartling lets you dynamically reference your stylistic guidelines and preferred terminology using Prompt Tooling with RAG. This approach helps you maintain centralized governance over all referenced linguistic assets, including your glossary, translation memory, and Style Rules for AI, while using a more lightweight translation prompt. See Give the LLM context: reference your linguistic assets using RAG below.
What to include in your translation prompt
For best results, a translation prompt should generally include the following elements.
The task
A command that instructs the LLM to translate your content. This is the most essential part of any translation prompt.
Example:
"Translate from {sourceLanguage} into fluent {targetLanguage}."
Using the source and target language placeholders means you can reuse the same prompt across multiple language pairs.
Additional context
Tell the LLM what kind of translation you want. Adding external information or context to your prompt steers the model toward better responses.
Example:
"The tone of the translation should be friendly and informal, but not overly familiar. The target audience is people aged 18 to 50 living in Spain."
This helps you get output that is appropriate for the target audience and culturally suitable, without being overly colloquial.
Chain-of-thought reasoning
Where useful, explain the reasoning behind a translation choice. This can help the LLM apply the same logic elsewhere in your content.
Example:
Source: "I went apple picking with my friends from Apple."
Translation: "Fui a recoger manzanas con mis amigos de Apple."
Explanation: apple → manzana (lowercase, refers to the fruit); Apple → Apple (refers to the company).
An output indicator
Tell the LLM exactly what to return. This reduces the risk of extra text or hallucinations.
Example:
"Only return the translation, with no other text or explanations."
Tips for wording your prompt
Start simple
Creating a translation prompt that works well for your content and organization is an iterative process. Starting simple points you in the right direction before you risk over-complicating your instructions. Specific, simple, and concise instructions will always yield better results.
Be precise and affirmative
LLMs return better results when your instructions are precise rather than general, and when they are phrased positively (what the model should do) rather than negatively (what it should not do).
Examples:
- ❌ "Do not return any additional text or explanations."
- ✅ "Only return the translated text, without explanations."
- ❌ "Do not translate acronyms."
- ✅ "Leave acronyms in their original form in the translated text."
Provide step-by-step instructions for anything nuanced
For complex tasks, improve the LLM's output by breaking the work into steps. Be specific, and think through every small decision or action a human would take while completing the task.
Example:
- Identify all terminology used in the text.
- When translating, use the appropriate translated term for each one.
One universal prompt, or locale-specific prompts?
Deciding whether to use a single universal prompt or separate locale-specific prompts is an important step. A single prompt is easier to maintain, while locale-specific prompts give you more control over the output for each locale. The trade-off is that maintaining separate prompts for multiple locales takes additional effort.
Locale-specific prompts may be needed when you want to use different tones or levels of formality for individual locales, depending on whether you have defined custom Style Rules for AI.
Alternatively, Smartling supports conditional syntax, which lets a single prompt behave differently based on the locale. See Conditions and Placeholders in LLM Prompts for how to configure this approach.
Give the LLM context: reference your linguistic assets using RAG
Prompts that include examples of good translations ("few-shot prompts") typically produce better, more on-brand results than prompts with no examples ("zero-shot prompts").
Rather than pasting examples into the prompt by hand, you can automatically inject relevant examples from your existing linguistic assets using RAG (Retrieval-Augmented Generation). When RAG is enabled in your LLM Profile's Assets References, Smartling can pull in:
- Example translations from your translation memory
- Preferred terminology from your glossary
- Locale-specific Style Rules for AI
This keeps your prompt shorter and your examples centrally managed and up to date. See Prompt Tooling with RAG for LLM translations for full details.
Example starter prompt
Here's a simple prompt to use as a starting point:
"You are an expert linguist and localization specialist. Translate {sourceLanguage} to {targetLanguage}. Strictly preserve all structural elements (HTML tags, placeholders) and untranslatable content. When an approved reference translation exists in the provided translation memory examples, match it closely rather than producing your own equally-valid alternative. Prioritize translation memory consistency, terminology alignment, formatting fidelity, and established locale/domain phrasing over creative or more natural rewording."
Here is a summary of the best practices we recommend:
- Use the word "translate" in the prompt to instruct the LLM to provide a translation.
Example prompt: "Translate the source text. The tone should be formal and friendly." - "Few-shot" prompts, which include examples, typically achieve better results than simple prompts that provide little context about your translation preferences. This is why we recommend enabling RAG if your linguistic assets are high quality.
- Precise, affirmative, and simple step-by-step instructions, as well as chain-of-thought prompts, are typically the most effective.
- Depending on your exact goals, locale-specific prompts may be needed.
Where do you enter the translation prompt?
Translation prompts are stored in LLM Profiles. To translate using an LLM in Smartling, you first create an LLM Profile, which defines all of the settings for the provider, including:
- LLM provider and model: The provider and model to use (for example, Google Gemini: gemini-2.0-flash-lite-001).
- Optional model parameters: Settings that control model behavior, such as temperature and presence penalties. See Translation Parameters for LLM Translation.
- Assets references (RAG): Linguistic assets and rules provided to the model to guide translations.
When you create an LLM Profile, you enter your prompt in the editable System Role field. A simple starter prompt is pre-populated by default:
Translate from {sourceLanguage} to {targetLanguage}.
Above the editable field is a grayed-out System Role message that Smartling pre-populates and that you cannot edit. It defines the input and output fields the LLM uses, how the model should structure its response, and how assets references (RAG) are applied. It ends with the line "your objective is:", which your own translation prompt then completes.
Below the System Role, you'll see an additional grayed-out, pre-populated User Role message. System Role messages are the constant setup for the translation: who the model should act as, the task, the rules to follow, and the format of the input and output. The User Role is where content to be translated is passed to the model at translation time. Smartling populates this automatically, so you don't enter any source text here.
Unlike the editable System Role field, the editable User Role field is entirely optional and is typically only needed for advanced requirements. See Step 3: Configure the translation prompt in Creating and Managing LLM Profiles for details.
Together, the System Role (Smartling's pre-populated message plus your own prompt in the editable field) and the User Role make up the full request sent to the model.
This is only a high-level overview. For detailed, step-by-step setup instructions, including how to split your prompt into multiple messages, apply conditions to individual messages, and add custom User Role messages, see Creating and Managing LLM Profiles.
Test, monitor, and iterate
Testing your prompt before you use it with real content in production is critical, because LLMs can produce far more variable results than traditional NMT engines.
Before you rely on any prompt in production:
- Run test translations against real sample content, across your language pairs, using the Testing Prompt panel in the LLM Profile. To test a larger body of content, create a test workflow that uses the LLM Profile for the translation step, then create a test job and authorize it for translation using that workflow.
- Check the output against what you actually expect, not just whether it "looks reasonable."
- Revisit and adjust the prompt periodically. Content, models, and provider behavior can all change over time, and a prompt that worked well before may need updating.
- If you use assets references (RAG), make sure your linguistic assets are high-quality and well maintained. They guide the model on how to translate your content, so poor-quality, ambiguous, or contradictory assets that don't match your desired outcome will yield poor results.
You can test your translation prompt directly in the LLM Profile.
Under Test Source String, add a single string per field, using up to 5 fields (click the + icon to add another). Use strings that are good, representative examples of your real source content rather than short or simple sentences, so your test results reflect what you'll actually translate. The example below simply demonstrates how the panel works; it is not an example of quality source content.
See Step 4: Test the prompt in Creating and Managing LLM Profiles for complete details.
Want to go deeper on prompt writing?
This article covers the basics of writing translation prompts. Prompt writing (also called "prompt engineering") is a broader topic. Below are some external resources that you may find helpful:
- OpenAI: Prompt engineering best practices
- Google: Prompt engineering overview and guide
- Anthropic: Prompt engineering overview
- Prompt Engineering Guide (promptingguide.ai): a general, model-agnostic overview of prompting techniques
These are third-party resources, not maintained by Smartling, and techniques from general-purpose prompting guides don't always transfer directly to translation-specific prompts. Use them for background and inspiration, and always validate results using your own content.