Free cookie consent management tool by TermsFeed

Prompting in English for Multilingual AI Applications

On This Page

This scenario demonstrates:

  • Why you should write AI prompts in English.
  • How to manage input and output languages within a single prompt.
  • How asking the model to show its reasoning in English can lead to higher accuracy.

Tip:  Learn more what to expect when using AI with multiple languages.

Expression

This expression shows how to structure a prompt for a prompt builder AI Skill to take German text and return a summary in German.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<role>
You are a helpful assistant that summarizes text.
</role>

<instructions>
1. The user will provide input text that is in German.
2. Read the text and identify the key points.
3. Your entire response must be a summary written in German.
4. Format your final response as a single JSON object with a key named "summary".
</instructions>

<input_text>
{rule_input_text}
</input_text>

<response>
{
  "summary": "..."
}
</response>

Test it out

  1. Open the AI Skill object where you've configured your prompt.
  2. Test the prompt using German text.
  3. Click TEST to see the AI's response.
  4. Verify that the response is a summary written in German and formatted as a JSON object with a key named summary.

Notable implementation details

Write prompts in English

The most important best practice for multilingual AI applications is to write your core instructions within the AI Skill in English, regardless of the input or output language.

Why prompt in English? While generative AI models are trained on multilingual data, their instruction-following and safety training is primarily in English, making it the most consistent and reliable way to control the AI's behavior and output format. New features and safety guardrails are also developed and tested with English instructions first, so using English leverages the model in its most robust state.

Input and output languages

You can pass text data in many languages directly to the AI skill; the model is adept at identifying the source language. However, you must be explicit in your English prompt to control the output language. Never assume the AI will automatically reply in the same language as the input.

Translate and show reasoning in English, then translate back

For use cases that require high accuracy in complex reasoning tasks, we recommend using English content for reasoning. It isolates the most difficult part of the task—the complex reasoning—and allows the AI to perform that work in English, its most proficient language for following instructions. This minimizes the risk of misinterpretation due to linguistic nuance and maximizes the accuracy of the core business logic.

  1. Translate to English: Use a first call to translate the foreign language input into English using a generative AI skill.
  2. Process in English: Perform your core, complex logic on the English text. This minimizes the risk of misinterpretation due to linguistic nuance.
  3. Translate back: Use a final call to translate the English output back to the original source language for the user.

Testing

The best way to ensure a language is supported for your use case is to test it out. Create a test matrix with sample inputs and expected outputs for each language you plan to support. Work with native speakers to get authentic test data and check for "language bleed," where the AI incorrectly mixes languages in its response. Include tests for text with slang, regional dialects, or a mix of languages to understand the model's limits.

Feedback