How to force GPT to use specific terms in translations

Hi,
I building an app for helping in solving problems with technical devices.
Each device has its own dedicated Vector Storage containing manuals, forum information, almanacs, etc. (FileSearch/RAG).
I need to make it multilingual. So if a user asks in Polish, the answer should be in Polish.

I have 2 problems:

  1. I noticed that questions asked in Polish have significantly worse quality (as if it uses just a Polish manual without other information sources like forums).
  2. I need to “force” GPT to use specific wording/terms from Polish manuals - specific names of the device’s functions - not just general translations - to be consistent with the Polish manual.

I tried 2 approaches:

  1. Just add polish [device_id]_manual.pdf - and instruct the assistant to use its vocabulary when translating. Not much success.
  2. Introducing “translator assistant” - an additional assistant that has only English and Polish manuals in VectorDB. When user asks the question in Polish:
    a) translate the question to English (translator assistant)
    b) Prepare English response (with full RAG sources search)
    c) translate to Polish (translator assistant) - USING wordings, terms and definitions from Polish Manual.

Unfortunately, it doesn’t work well, - the failed answers ratio is high (50%):

  • either it answers the question instead of just translating
  • or it doesn’t use proper naming convention from the Polish manual (it just translates without a context making the translated answer confusing to the user).

Which approach would you use to solve it? Are those 2 valid or should I think about sth else (I thought about general dictionaries but each of the devices includes a lot of specific functions so it would be overkill)

This is an example of my translator assistant prompt:


Your task is to strictly translate input from English to Polish, ensuring consistency with wording and definitions from the Polish manual. Do not answer the questions in any capacity - just provide the translation.

Key Points

  1. Translate the input only, do not answer or explain it.
  2. Verify the presence of manuals before translating.
  3. Use ONLY terminology found in the Polish manual.

Steps

  1. Verify Corresponding Manual:

    • Confirm the existence of a file ending with “_MANUAL_PL.pdf”, and in the response add: “I have access to Polish manual”. If the file doesn’t exist: “I do not have access to the Polish manual”
    • Confirm the existence of a file ending with “_MANUAL_EN.pdf” and in the response add: “I have access to English manual”. If the file doesn’t exist: “I do not have access to the English manual”
  2. Translation Process:

    • Identify key terms in the input.
    • Search for these terms in both manuals.
    • Construct the translation using these manual-specific terms. Use ONLY the exact wording found in the Polish manual.
  3. Output Format:

    • Start with “Translation:”
    • Provide the translated input using Polish manual terminology.

EXAMPLES
(3 examples - sentence in english & polish with specific function names).

1 Like

I tested the solution with “dictionary”.
I asked LLM to prepare a dictionary for key terms based on both manuals (PL,EN).
I attached this dictionary to assistant instruction prompt and updated the prompt to use dictionary when translating…
and it works like a charm :slight_smile:

2 Likes