esc
  • WorkflowsPages
  • Case studiesPages
  • Machine Learning FoundationsLearn
  • AI EngineeringLearn
  • AI Guardrails & Red TeamingLearn
  • UI/UXLearn
  • Design SystemsLearn
  • Production System DesignLearn
  • AI papersPages
  • Interview KitPages
  • Book a callContact
Let’s talk

I’ll build the agent for it.

How Do You Prompt Across Languages?

How to tell a model which language to reply in, why quality and cost change by language, and how to test each one, explained simply for your AI interview.

In short

Name the reply language in the system prompt, pass in the language your user picked, and test every language you ship. Quality and cost change from one language to the next, so an English test is not enough.

13 min readIntermediateOccasional · estimateFacts checked 27 November 2026

Say it out loud

Read it once, then say it without looking. Start with the short one; use the long one when they ask you to go deeper.

Across languages, I do three things. First, I name the reply language in the system prompt, and pass in the one the user picked in the app, because the model should not guess. Second, I expect quality and cost to change by language, since some languages take far more tokens for the same text. Third, I test each language on real messages, graded by native speakers, and only ship the ones that pass.

What does prompting across languages mean, in plain words?

Prompting across languages means getting a model to read, think and answer well when your users write in more than one language. A chat can start in English, switch to Hindi, and end with a Tamil question. Your job is to make sure the reply is in the language the customer chose, and is as good as the English one.

Think of a front-desk teller at a bank. A customer who speaks Bengali is served in Bengali, and the teller checks the customer really understood the answer. A support bot for a lender has to do the same for every customer, whichever language they picked in the app.

A model reads text as tokens, the small pieces it works with. Some languages split into more pieces than others, so the same message can cost more to run and take up more of the context window (the amount of text the model can hold in one go). The usual prompting ideas still apply, but you also check each language.

Key words

Locale
The language and region a customer picks, such as Hindi for India.
Target language
The language the reply must be written in.
Native script
The writing system a language uses, such as Devanagari for Hindi.
Transliteration
Writing a language in another alphabet, such as Hindi in Latin letters.
System prompt
The instructions the developer sets for the model, which the customer doesn't see.

Where do you tell the model which language to use?

In the system prompt, and the value comes from your app. A model can infer the language, but for a production app you should not rely on that. Anthropic's guide says so directly:

  • “Claude infers the response language from the conversation, but for production applications you should state the target language explicitly.”

    Anthropic, Claude API docs

  • “If your application lets users pick a language at runtime, interpolate that choice into the system prompt rather than relying on Claude to infer it from the user's message.”

    Anthropic, Claude API docs

  1. 1

    Pick the language in the app

    The customer chooses Hindi from a menu, and the app stores it with the chat.

  2. 2

    Put it in the system prompt

    Reply in Hindi. Keep field names and status words in English. The code reads them, so they must not be translated.

  3. 3

    Name both languages when they differ

    If the customer writes in Tamil but the staff summary must be in English, say both. Read Tamil, write the summary in English.

Say both the input and the output language. Anthropic notes that stating the input and output languages improves reliability, even when the model can detect the language on its own. The most reliable place for the rule is the system prompt, because it holds across every turn of the chat.

Setting the reply language

Language from the app

the customer picked Hindi in the menu

System prompt

reply in Hindi, keep keys in English

Model

writes the reply in Hindi

Right language?

a code check, not the prompt

Sent to the customer

in Hindi, as the customer chose

Retry or hand off

wrong language: a person takes over

  1. 1The app sends the language the customer chose.
  2. 2The system prompt tells the model which language to reply in.
  3. 3The reply moves on to the code check before anything is sent.
  4. 4Code checks the script of the reply. If it fits, the reply goes out.
  5. 5If it does not fit, the reply is retried or a person takes over.
The app passes the customer's language into the system prompt. The model writes in that language. A code check after the model is what enforces the rule, and a reply that fails goes to a retry or a person.

Native script matters too. Anthropic advises submitting text in its native script rather than transliteration, and asking for idiomatic speech, as if the model were a native speaker. Wording alone rarely gets a natural reply.

Why do quality and cost change from one language to another?

Models learn from unequal amounts of text, and languages break into tokens unequally. Anthropic says its performance varies by language, and that it is strongest in the widely spoken ones. It also says it keeps meaningful ability in languages with fewer digital resources.

  • “Large language models (LLMs) demonstrate impressive multilingual capability, but their performance varies substantially across different languages.”

    Huang and colleagues, 2023 (arXiv paper)

  • “The same text translated into different languages can have drastically different tokenization lengths, with differences up to 15 times in some cases.”

    Petrov and colleagues, 2023 (arXiv paper)

The tokenizer study (the tokenizer is the part that cuts text into tokens) also says this unequal treatment affects cost, speed and how much content fits as context. The numbers depend on the model and the tokenizer, so measure your own languages rather than trusting a rule of thumb.

  • Translate first

    English in the middle

    Translate the message to English, answer in English, then translate back. It adds a step, and names, legal terms and tone can get lost on the way. Test both before you choose.

  • Native prompt

    Work in the language

    Keep the chat in the customer's language, with clear language rules and native-speaker review. It needs more testing, but the customer reads the model's own wording, not a translation.

A 2023 study proposed a generic template prompt that stimulates cross-lingual and logical reasoning. It is one published method, so test it against your plain prompt in your own languages before you adopt it.

Tip

Don't claim English instructions always work better. The sources here don't show that. Say you test both on your own languages, and keep the one that scores higher.

How do you test and check each language?

Test each language on its own, with real messages and a fixed rubric. Anthropic's advice is to apply general evaluation methods to measure output quality in each language you support, and to test with any languages relevant to your use case.

  1. 1

    Collect real messages

    Take 200 real messages per language from past chats, with names and account numbers removed. Include lines such as "My refund is still pending after two weeks."

  2. 2

    Write one rubric

    Score accuracy, tone, the right script and whether the next step is clear. Use the same rubric for every language.

  3. 3

    Let native speakers grade

    A Hindi team grades the Hindi set. A developer can miss an odd phrase that a fluent reader spots at once.

  4. 4

    Ship only the passing languages

    A language that passes goes live. One that fails waits, and its prompt gets fixed first.

Testing each language before launch

A test set per language

200 Hindi messages

real chats from past support tickets, names removed

200 English messages

the same kinds of question

Score each reply

native speakers and a fixed rubric

Decide per language

Passes the bar

ship this language

Fails the bar

fix the prompt or hold it back

Live for that language

re-test after each model change

  1. 1The Hindi set's replies go to scoring.
  2. 2The English set's replies go to the same scoring, for comparison.
  3. 3A reply that meets the rubric counts as a pass.
  4. 4A language that fails is not shipped until it passes.
  5. 5Only a language that passes goes live.
Each language gets its own test set, scored against the same rubric. A language goes live only after it passes, and it is tested again after every model change.

A reply can also drift into English mid-chat, so add a code check on each reply. The script below checks the script of the reply, not its meaning. It is a shortcut. A Hindi reply full of English product names can fail it, so tune the threshold on real replies.

Python
import unicodedata
from collections import Counter

SCRIPT = {"hi": "DEVANAGARI", "en": "LATIN"}

def check_reply(reply, locale):
    # Code, not the prompt, checks the script of the reply.
    # shortcut: checks script, not meaning; tune the 0.8 on real replies
    names = [unicodedata.name(ch, "OTHER").split()[0] for ch in reply if ch.isalpha()]
    counts = Counter(names)
    total = sum(counts.values())
    if total == 0:
        return "NO TEXT: nothing to check"
    share = counts[SCRIPT[locale]] / total
    if share < 0.8:
        return f"RETRY: only {share:.0%} of letters are {SCRIPT[locale]}"
    return f"OK: reply is in {locale}"

print(check_reply("आपका रिफ़ंड स्वीकृत हो गया है।", "hi"))
print(check_reply("Your refund is approved.", "hi"))
print(check_reply("Aapka refund swikrit ho gaya hai.", "hi"))
print(check_reply("Your refund is approved.", "en"))

Output

OK: reply is in hi
RETRY: only 0% of letters are DEVANAGARI
RETRY: only 0% of letters are DEVANAGARI
OK: reply is in en

The check reads the Devanagari reply as Hindi, and flags the English reply and the transliterated one. Test your safety filters in every language too. OWASP, the open security group behind its 2026 list of top risks for AI apps, warns that low-resource and code-mixed inputs degrade the accuracy of filters, so a filter that works in English may miss an attack written in Tamil or in mixed Hindi and English.

How would you launch a support bot in five languages?

A bank wants its support bot live in English, Hindi, Tamil, Bengali and Telugu within one quarter. Here is how I would answer.

  • Launch first

    English and Hindi

    The two languages with the most customers pass their own test sets first, then go live with a human fallback.

  • Hold back

    Tamil, Bengali, Telugu

    Each waits for its own test set, native graders and a passing score. Until then, the customer gets a human agent.

I would not ship all five on the strength of English tests. Each language has its own failure modes, and the bank's own complaint log is the best test set for the real problems.

What does the interviewer want to hear?

A strong answer covers

  • Name the reply language in the system prompt, from the app's choice.
  • Quality and cost vary by language, and token counts differ.
  • Native script over transliteration, and natural phrasing on request.
  • Test each language on real messages, graded by native speakers.
  • Check each reply in code, and test safety filters per language.
  • Honest limits: some languages are weaker, and no prompt fixes that.

Common traps

  • Trap"Ask for the user's language and move on."

    BetterThe model sometimes guesses wrong. Pass the choice from the app and check the reply in code.

  • Trap"We tested it in English, so it works everywhere."

    BetterQuality changes by language. Test each language you ship with its own set and its own graders.

  • Trap"Translate everything to English first."

    BetterIt adds a step and may lose names, legal terms and tone. Keep the chat in the customer's language where you can.

Can you spot the wrong reply?

Spot the wrong reply

A customer chose Hindi in the app. Which reply is in Hindi, in native script, with no English mixed in?

Quick check

A customer writes in Tamil, and the bank's staff read a summary of each chat in English. Which instruction states the languages clearly?

Can you answer these from memory?

Flash cards · tap a card to flip it

1 / 6

What will they ask next?

  1. Q005Why do token counts differ across languages and models?10 min
  2. Q100How do you test prompts systematically?12 min
  3. Q102Why do prompts break when you switch models?11 min
  4. Q105How do you budget tokens for chat history?10 min
  5. Q370How do you support many languages?10 min

Last updated on 27 November 2026

Building a support bot for customers who speak more than one language?

I design and build AI agents and the products around them, with language checks and per-language tests in place. Book a short call and tell me which languages your customers use.