Cost-Performance Optimization for Processing Low-Resource Language Tasks Using Commercial LLMs

Arijit Nag, Animesh Mukherjee, Niloy Ganguly, Soumen Chakrabarti

Introduction

Commercial Large Language Models (LLMs) like GPT-4 have revolutionized natural language processing, yet they impose a significant "tokenization tax" on low-resource languages (LRLs). Because these models are primarily optimized for high-resource languages like English, their vocabularies are sparse for languages like Bengali, Hindi, or Swahili. This sparsity forces tokenizers to fragment LRL words into numerous sub-word units, making them up to 10x more expensive to process than their English equivalents.

This paper addresses this economic and performance barrier by evaluating pre-processing strategies that minimize token counts while maintaining or improving task performance. The authors demonstrate that simple techniques—such as transliterating to Latin script or translating to English—can slash API costs by up to 90%.

Methodology and Strategies

The researchers introduced a new metric, the Relative Performance to Cost Ratio (RTPCR), to measure the "value for money" of different interaction strategies. They evaluated four primary approaches:

  1. Native Baseline: Sending queries in the original language and script.
  2. Translation: Converting LRL input to English before processing. This was tested using open-source tools (e.g., IndicTrans2), explicit GPT-4 translation, and "implicit" translation (asking the model to translate internally).
  3. Transliteration: Converting LRL scripts into Latin (Roman) script. This leverages the LLM's extensive training on Romanized web data, which is tokenized much more efficiently.
  4. Wordmix: A hybrid approach replacing only the most "expensive" (highly fragmented) words with English equivalents using a dictionary.
Example of tokenization fragmentation and optimization strategies for a Bengali sentence.

As shown in the figure above, a native Bengali sentence requiring 31 tokens can be reduced to just 9 tokens through translation or 10 tokens through transliteration, illustrating the immediate cost-saving potential of these methods.

Experimental Setup

The study performed an extensive evaluation across 15 Indic languages and several others (Swahili, Thai) using a diverse array of benchmarks:

  • IndicXTREME: Classification tasks including sentiment analysis and paraphrase detection.
  • Generative Tasks: Summarization (XLSUM), Question Answering (TyDi QA), and Machine Translation (Samanantar).
  • Reasoning: Mathematical benchmarks like MGSM and ArMath.
  • Factual Knowledge: The new IndicMulan dataset for Wikidata object prediction.

Key Insights

The Latin Script Advantage

Simply writing a language like Hindi using English letters (transliteration) can reduce token counts by 2x to 7x. LLMs are surprisingly adept at processing Romanized LRL text due to its prevalence on social media and the web.

English as a Reasoning Pivot

Translating to English often improves accuracy alongside cost savings. GPT-4’s internal reasoning capabilities are strongest in English; by pivoting to English, the model better understands complex instructions that might be garbled in a native LRL script.

The Pitfall of Implicit Translation

Instructing a model to translate "in its head" (implicit translation) improves performance but fails to save money. The user still pays for the expensive, highly-fragmented LRL input tokens. Explicit translation prior to the API call is the only way to achieve significant cost reduction.

The Importance of Syntax

The "Word-to-Word" (W2W) dictionary approach performed poorly. This indicates that LLMs rely heavily on grammatical structure; breaking syntax to save tokens confuses the model's reasoning processes.

Results and Performance

Tokens per word across various Indic datasets and processing strategies.

Across all datasets, the reduction in tokens per word is dramatic when moving from Native scripts to optimized strategies. Using open-source translators like IndicTrans2 emerged as the clear winner for the RTPCR metric, reducing costs by approximately 90%.

Furthermore, this cost reduction did not come at the expense of quality. In classification tasks, translation to English actually improved accuracy over the native script, including a 14.7% average improvement in sentiment analysis. Transliteration also proved to be a robust "no-translation-needed" alternative for significantly lowering costs while maintaining competitive performance.

Conclusion and Future Work

While this study focused on GPT-4, the underlying tokenization logic likely applies to other commercial models like Claude or Gemini. The authors suggest that future work should explore more sophisticated "Wordmix" techniques that are context-aware, or "cross-lingual wordmixing" between related languages (e.g., mixing a low-resource language with a related higher-resource language like Hindi) to further optimize the cost-performance frontier for the Global South.

Summary updated

BibTeX
@inproceedings{nag2024cost,
  author = {Arijit Nag and Animesh Mukherjee and Niloy Ganguly and Soumen Chakrabarti},
  title = {{Cost-Performance Optimization for Processing Low-Resource Language Tasks Using Commercial LLMs}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2024},
  doi = {10.18653/v1/2024.findings-emnlp.920},
}
Figure