Large Language Models (LLMs) exhibit impressive zero/few-shot inference and generation quality for high-resource languages(HRLs). A few of them have been trained in low-resource languages (LRLs) and give decent performance. Owing to the prohibitive costs of training LLMs, they are usually used as a network service, with the client charged by the count of input and output tokens. The number of tokens strongly depends on the script and language, as well as the LLM's sub-word vocabulary. We show that LRLs are at a pricing disadvantage, because the well-known LLMs produce more tokens for LRLs than HRLs. This is because most currently popular LLMs are optimized for HRL vocabularies. Our objective is to level the playing field: reduce the cost of processing LRLs in contemporary LLMs while ensuring that predictive and generative qualities are not compromised. As means to reduce the number of tokens processed by the LLM, we consider code-mixing, translation, and transliteration of LRLs to HRLs. We perform an extensive study using the IndicXTREME dataset, covering 15 Indian languages, while using GPT-4 (one of the costliest LLM services released so far) as a commercial LLM. We observe and analyze interesting patterns involving token count, cost,and quality across a multitude of languages and tasks. We show that choosing the best policy to interact with the LLM can reduce cost by 90% while giving better or comparable performance, compared to communicating with the LLM in the original LRL.
翻译:大型语言模型(LLMs)在高资源语言(HRLs)的零样本/少样本推理与生成质量方面展现出卓越性能。其中部分模型经过低资源语言(LRLs)训练后也能取得可观表现。由于训练LLMs成本高昂,它们通常以网络服务的形式使用,客户端根据输入和输出的token数量计费。Token数量很大程度上取决于语言的文字系统、语言本身以及LLM的子词词汇表。我们证明LRLs面临定价劣势,因为知名LLMs为LRLs生成的token数多于HRLs——这是由于当前主流LLMs多针对HRL词汇表进行优化。本文旨在创造公平竞争环境:在确保不牺牲预测与生成质量的前提下,降低当代LLMs处理LRLs的成本。作为减少LLM处理token数量的手段,我们考虑了代码混合、翻译以及将LRLs音译转写为HRLs三种策略。我们基于涵盖15种印度语言的IndicXTREME数据集开展广泛研究,以GPT-4(迄今发布的最昂贵的LLM服务之一)作为商用LLM实例。通过分析多语言多任务场景下token数量、成本与质量之间的规律,我们发现:与直接用原始LRL与LLM通信相比,选择最优交互策略可在保持相当或更优性能的同时降低90%成本。