Skip to main content
QUICK REVIEW

[论文解读] Do All Languages Cost the Same? Tokenization in the Era of Commercial Language Models

Orevaoghene Ahia, Sachin Kumar|arXiv (Cornell University)|May 23, 2023
Taxation and Compliance StudiesEconomics, Econometrics and Finance被引用 3
一句话总结

本文研究了商业语言模型API中子词分词机制如何导致非拉丁字母语言的令牌数量不成比例增加,从而造成更高的成本,即使语义内容相同。研究证明,使用非主流语言的用户因分词中的语言和编码偏见而面临更高的经济成本和更低的模型性能,呼吁供应商采用更公平的定价策略和提高透明度。

ABSTRACT

Language models have graduated from being research prototypes to commercialized products offered as web APIs, and recent works have highlighted the multilingual capabilities of these products. The API vendors charge their users based on usage, more specifically on the number of ``tokens'' processed or generated by the underlying language models. What constitutes a token, however, is training data and model dependent with a large variance in the number of tokens required to convey the same information in different languages. In this work, we analyze the effect of this non-uniformity on the fairness of an API's pricing policy across languages. We conduct a systematic analysis of the cost and utility of OpenAI's language model API on multilingual benchmarks in 22 typologically diverse languages. We show evidence that speakers of a large number of the supported languages are overcharged while obtaining poorer results. These speakers tend to also come from regions where the APIs are less affordable to begin with. Through these analyses, we aim to increase transparency around language model APIs' pricing policies and encourage the vendors to make them more equitable.

研究动机与目标

  • 调查商业语言模型API中的分词是否因子词碎片化而导致不同语言间成本不均等。
  • 研究分词差异如何影响不同语言的经济成本和模型效用。
  • 评估这些差异是否加剧了现有NLP技术获取中的社会经济不平等。
  • 强调分词器作为商业大语言模型公平性中常被忽视的关键组件的作用。
  • 倡导为多语言用户提供更透明、更公平的API定价与模型设计。

提出的方法

  • 使用OpenAI的API和分词器,处理来自FLORES-200基准的22种语言类型多样的平行文本。
  • 通过比较输入文本长度(以字符计)与输出令牌数量,测量分词碎片化率。
  • 通过计算处理相同语义内容在不同语言中所需的令牌数量,量化成本差异。
  • 使用多语言基准上的上下文学习性能评估模型效用,将其与令牌数量和语言类型相关联。
  • 分析高令牌成本、性能低下与区域购买力等社会经济因素之间的相关性。
  • 使用CC100作为训练数据分布的代理,推断模型预训练数据中语言表征的偏见。
Figure 1: We investigate the effects of subword tokenization in LLMs across languages with different writing systems. Our findings highlight disparities in the utility of LLMs, as well as socio-economic disparities and increased costs in using commercial APIs for speakers of underrepresented languag
Figure 1: We investigate the effects of subword tokenization in LLMs across languages with different writing systems. Our findings highlight disparities in the utility of LLMs, as well as socio-economic disparities and increased costs in using commercial APIs for speakers of underrepresented languag

实验结果

研究问题

  • RQ1不同书写系统语言的子词分词有何差异,其对令牌数量的最终影响如何?
  • RQ2分词差异在多大程度上导致非主流语言使用者承担不成比例的API成本?
  • RQ3更高的分词碎片化是否与上下文学习任务中模型效用的降低相关?
  • RQ4高成本和低性能的语言是否也属于API使用购买力较低的地区?
  • RQ5语言和编码属性(如书写系统类型、Unicode表示)在分词偏见中起什么作用?

主要发现

  • 使用非拉丁书写系统(尤其是CJK、阿拉伯文及其他复杂书写系统)的语言,其分词碎片化程度显著高于基于拉丁字母的语言。
  • 相同语义内容在日语和中文等语言中所需令牌数最多可达英语的2.5倍,直接导致API成本上升。
  • 令牌数量较高的语言在上下文学习基准测试中表现较差,表明尽管输入内容完全相同,模型效用却因此降低。
  • 高碎片化语言的使用者往往来自收入水平较低的地区,使得更高的API成本更具负担性,从而加剧数字不平等。
  • 成本差异并非仅源于数据稀缺,而是根植于语言和编码的固有特性,如Unicode书写系统复杂性与字符频率模式。
  • 本研究揭示,当前基于令牌数量的API定价模式对非拉丁字母用户本质上是不公平的,尽管传达的信息完全相同。
Figure 2: Average number of tokens by script after tokenizing the Flores dataset. The fragmentation rate is lower for Latin script languages and higher for other scripts. Number of languages per language group is indicated at the top of each bar.
Figure 2: Average number of tokens by script after tokenizing the Flores dataset. The fragmentation rate is lower for Latin script languages and higher for other scripts. Number of languages per language group is indicated at the top of each bar.

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。