Vietnamese text use 2-3x more tokens than English for same meaning, how you handle cost?
Hi all, first post here. I build support chatbot for an e-commerce company, customers write in Vietnamese and English. I notice our token cost per conversation is much higher for Vietnamese. I test same FAQ answer in both language, the Vietnamese version is around 2.3x tokens of the English version with the tokenizer of our model.
It make two problem:
- cost per conversation is higher
- our RAG chunk size is set by characters (1000 chars), so Vietnamese chunk become much bigger in tokens, sometime we hit context limit when we retrieve top 8
What I try: reduce top k to 5 (quality drop a bit), shorter system prompt. How you handle this for non-English language? Should I chunk by token? Or translate everything to English first and translate back? That feel risky for product name and address.
Accepted answer
Written by
Nguyen Minh Anh
ML engineer in Ho Chi Minh City. Building LLM support bots for e-commerce in Vietnamese and English. Evals, RAG, and explaining to boss why the bot said that.
Get the best of #stochastic-parrots weekly
One email each Monday with the most useful posts. No spam; unsubscribe in one click.
Comments
Sign in to join the conversation.
Sign in to commentAccepted answer