Bad results while translating and abbreviating

I’ve been trying to use the API to translate certain texts from a mobile app to several languages. It has generally been giving good results, unless I ask the model to abbreviate to fit X characters. I tried several prompts with complete or chat mode and gpt-3.5-turbo or text-davinci-003 models, but the results are disappointing. If I use the same prompt in GPT-3.5 web chat, the result is perfect. Example:

"Translate from English text to German, within 16 characters:
REST. PURCHASES

context notes: referring to restore purchases"

AI: WIEDERHERST. KÄUFE
which is 18 characters

web chat 3.5 replies within 16 chars: WIEDERKÄUFE

another example much more complex, but that fails for most of the languages:

Related to soccer, translate from English text to Hindi (India), the abbreviation in 2 characters, the acronym “GA”, referring to Goals Against, as the number of goals a team has conceded.

AI: जीए (गोल अगेंस्ट)

web chat GPT.3.5 replies with something else: वि गो

Is there anything I can do to improve the API results, making it close to the web chat?

GPT 3.5 web chat while using the same model as the open AI playground or GPT API call has been further finetuned which makes it replies a bit different and more human reader friendly. In my experience with GPT, i would suggest you beef up the context a bit more or maybe describe the prompt in a manner such that it does the translation and abbreviation as two different tasks essentially which would be using Chain of thought prompting to essentially train it in a manner. Example would be like this:

English - Goals Against
Translation to Hindi - गोल अगेंस्ट
Abbreviation - JI A

Also, being a native Hindi speaker and an avid football fan, I can say that everyone says goal as goal in Hindi as well, so don’t blame GPT too much on that. Goals against should literally translates to गोल ख़िलाफ़

1 Like

good suggestion. I tested with a few examples but sometimes it still disappoints. take a look at this one:

it says in parenthesis (golos sofridos) but then abbreviates to GC. not GS. weird.

and also its really hard to make sure the result is just the translated text and not some explanation.