我的征尘是星辰大海。。。
The dirt and dust from my pilgrimage forms oceans of stars...
-------当记忆的篇章变得零碎,当追忆的图片变得模糊,我们只能求助于数字存储的永恒的回忆
作者:黄教授
手机视频列表
从编码到人工智能中英文在大语言模型中的效率悖论
视频
音频
原始脚本
从编码到智能,中英文在大语言模型中的效率悖论。 当一篇中文文章翻译成英文后,一个令人惊讶的事实浮现。 即使使用最节省空间的 GB 2312编码,每个汉字两字节,中文的存储开销也将近是英文的两倍。 若使用 UTF-8编码,每个汉字三字节,差距更是达到3倍。 在信息存储层面,英文的效率优势似乎是碾压性的。 然而,当我们进入大语言模型的世界,这一结论却发生了戏剧性逆转。 中文用仅3500个常用汉字的迷你字典,战胜了英文动辄10万 token 的庞大词库。 这种从碾压性劣势到根本性优势的反转,揭示了智能时代语言效率的全新定义。 一、编码层面的效率假象。 从计算机存储角度看,英文的优势是根本性的。 在我们的统计中,一篇5094字的中文原文,以 GB 2312编码,约占10188字节,UTF 8编码则需15282字节。 其英文译文,即使包含分割英文单词的空格,也才7761个字符。 而英文的 UTF-8编码依旧是7761字节。 无论采用何种编码,中文的存储开销都显著高于英文。 这种差距源于两种语言的底层构造。 英文作为拼音文字,26个字母通过组合即可表达无限含义,每个字母仅需一字节存储。 而中文作为表意文字,即使采用最紧凑的编码方案,每个汉字也至少需要两字节。 在信息存储的上半场,英文的效率优势无可争议。 二、大语言模型的机制革命,Transformer 与字典的诞生。 要理解效率的逆转,我们首先需要了解大语言模型的核心工作原理及其字典的来源。 字典是如何动态构建的?大语言模型的字典、词汇表并非预先编写,而是在预训练阶段通过算法动态生成的。 模型在海量文本中学习,目标是找到 最优的字符组合方式。 它会优先将高频出现的完整单词,如 the、a 加入字典。 对于低频长单词,会尝试拆分成更短的子词,如 pneumonia 拆为 new 和 monia。 这一过程平衡了字典大小和编码效率。 字典里的每个 token 代表模型已理解并能使用的语言单元。 Transformer 的工作流程。 你可以把它想象成一个只会查自己这本动态生成字典的预言家。 一、输入处理,当你输入我今天不舒服,好像得了肺时,模型将文字转换成数字。 二、上下文理解,模型分析上下文,理解不舒服和肺的关联。 三、预测下一个词,模型在自己的字典里搜索,寻找最可能的下一个 Token。 四、Softmax 计算,为字典里每个词计算概率,字典越大计算越慢。 5,输出结果,选出概率最高的词,如肺炎,输出,然后开始下一轮预测。 3,中英文模型的字典策略对比,3500字 vs 10万 Token。 字典的大小和构成方式是中英文效率差异的关键。 这是一个直接的、无可回避的数字对比。 中文模型,3500字的集至压缩,中文模型有一个巨大优势,它有一个天然的、可极致压缩的保底方案,最小字典,现代汉语常用字约 约3500个,这3500个字也能覆盖99.9%以上的使用场景。 极致压缩,理论上一个仅包含着3500个汉字的字典,就能让模型处理任何中文内容,包括最专业的医学和法律文本。 笨办法也能行,最坏情况下,模型会一个字一个字的生成。 比如肺炎,它会先预测肺,再预测炎。 虽然慢,但它一定能生成,绝不会不认识。 优化空间,为了提高效率,中文模型会把高频词组和成语也加入字典,作为单个快查项。 这就是为什么中文模型字典规模通常在3万到10万之间,既有基础汉字,也有优化过的词组。 英文模型10万 token 的庞大身躯。 英文模型怎么有这样的保底方案?它的字典规模天生就大。 必须完整收录。 英文中有大量无法拆分的常用词,如 the a and 等,必须完整加入字典。 词根的局限,虽然英文有词根系统,约2000~3000个常用词根,但它不是一个完整的语言系统。 专业术语爆炸、医学、法律等领域的专业词汇可达几十万。 即使使用词根拆分,仍有大量专业术语无法被有效拆分或拆分后失去意义。 最终规模,据统计,专业英文模型的字典规模通常在10万到15万 token 以上,远大于中文模型的最小字典规模。 四、本质差异,极致压缩与不得不庞大。 中英文模型的根本差异在于面对未知词汇时的不同表现,这是一个关乎能力底线的区别。 中文模型可极致压缩,确保能。 中文模型有天然的保底机制,即使遇到新词也能用基础汉字组合表达。 例如量子计算机,即使字典里没有这个词组,模型也能依次生成量子计算机。 最坏情况只是生成速度慢一些,但它一定能生成,不会不认识。 这是一种能力上的保证。 源于其组合式的语言构造,英文模型不得不庞大,可能不能。 英文模型没有保底机制,它完全依赖字典里是否收录了完整的单词或可拆分的词根。 面对大量专业术语和不规则词,模型仍需不断扩充字典。 这直接导致模型在处理罕见专业术语时,更容易出现不认识的情况。 5、结论,智能时代的语言优势,从编码到智能,效率的定义发生了深刻转变。 英文在存储和简单处理上的效率优势,在大语言模型的复杂推理中,被中文的组合灵活性彻底超越。 这种转变揭示了智能时代的语言优势。 英文的优势在于快 不快,适合处理结构化的已知信息。 中文的优势在于能不能,更适应开放世界的知识扩展。 在知识爆炸的时代,语言的真正价值不仅在于表达的效率,更在于适应变化的能力。 中文通过有限字符组合无限概念的特性,在大语言模型中展现出独特的优势,为处理复杂多变的现实世界问题提供了更具韧性的解决方案。 这种优势不仅是技术层面的效率考量。 更是语言体系对智能时代本质需求的深刻契合。
修正脚本
从编码到智能,中英文在大语言模型中的效率悖论。 当一篇中文文章翻译成英文后,一个令人惊讶的事实浮现。 即使使用最节省空间的 GB 2312编码,每个汉字两字节,中文的存储开销也将近是英文的两倍。 若使用 UTF-8编码,每个汉字三字节,差距更是达到3倍。 在信息存储层面,英文的效率优势似乎是碾压性的。 然而,当我们进入大语言模型的世界,这一结论却发生了戏剧性逆转。 中文用仅3500个常用汉字的迷你字典,战胜了英文动辄10万 token 的庞大词库。 这种从碾压性劣势到根本性优势的反转,揭示了智能时代语言效率的全新定义。 一、编码层面的效率假象。 从计算机存储角度看,英文的优势是根本性的。 在我们的统计中,一篇5094字的中文原文,以 GB 2312编码,约占10188字节,UTF 8编码则需15282字节。 其英文译文,即使包含分割英文单词的空格,也才7761个字符。 而英文的 UTF-8编码依旧是7761字节。 无论采用何种编码,中文的存储开销都显著高于英文。 这种差距源于两种语言的底层构造。 英文作为拼音文字,26个字母通过组合即可表达无限含义,每个字母仅需一字节存储。 而中文作为表意文字,即使采用最紧凑的编码方案,每个汉字也至少需要两字节。 在信息存储的上半场,英文的效率优势无可争议。 二、大语言模型的机制革命,Transformer 与字典的诞生。 要理解效率的逆转,我们首先需要了解大语言模型的核心工作原理及其字典的来源。 字典是如何动态构建的?大语言模型的字典、词汇表并非预先编写,而是在预训练阶段通过算法动态生成的。 模型在海量文本中学习,目标是找到最优的字符组合方式。 它会优先将高频出现的完整单词,如 the、a 加入字典。 对于低频长单词,会尝试拆分成更短的子词,如 pneumonia 拆为 new 和 monia。 这一过程平衡了字典大小和编码效率。 字典里的每个 token 代表模型已理解并能使用的语言单元。 Transformer 的工作流程。 你可以把它想象成一个只会查自己这本动态生成字典的预言家。 一、输入处理,当你输入我今天不舒服,好像得了肺时,模型将文字转换成数字。 二、上下文理解,模型分析上下文,理解不舒服和肺的关联。 三、预测下一个词,模型在自己的字典里搜索,寻找最可能的下一个 Token。 四、Softmax 计算,为字典里每个词计算概率,字典越大计算越慢。 五、输出结果,选出概率最高的词,如肺炎,输出,然后开始下一轮预测。 三、中英文模型的字典策略对比,3500字 vs 10万 Token。 字典的大小和构成方式是中英文效率差异的关键。 这是一个直接的、无可回避的数字对比。 中文模型,3500字的极致压缩,中文模型有一个巨大优势,它有一个天然的、可极致压缩的保底方案,最小字典,现代汉语常用字约3500个,这3500个字也能覆盖99.9%以上的使用场景。 极致压缩,理论上一个仅包含着3500个汉字的字典,就能让模型处理任何中文内容,包括最专业的医学和法律文本。 笨办法也能行,最坏情况下,模型会一个字一个字地生成。 比如肺炎,它会先预测肺,再预测炎。 虽然慢,但它一定能生成,绝不会不认识。 优化空间,为了提高效率,中文模型会把高频词组和成语也加入字典,作为单个快查项。 这就是为什么中文模型字典规模通常在3万到10万之间,既有基础汉字,也有优化过的词组。 英文模型10万 token 的庞大身躯。 英文模型哪有这样的保底方案?它的字典规模天生就大。 必须完整收录。 英文中有大量无法拆分的常用词,如 the a and 等,必须完整加入字典。 词根的局限,虽然英文有词根系统,约2000~3000个常用词根,但它不是一个完整的语言系统。 专业术语爆炸、医学、法律等领域的专业词汇可达几十万。 即使使用词根拆分,仍有大量专业术语无法被有效拆分或拆分后失去意义。 最终规模,据统计,专业英文模型的字典规模通常在10万到15万 token 以上,远大于中文模型的最小字典规模。 四、本质差异,极致压缩与不得不庞大。 中英文模型的根本差异在于面对未知词汇时的不同表现,这是一个关乎能力底线的区别。 中文模型可极致压缩,确保能行。 中文模型有天然的保底机制,即使遇到新词也能用基础汉字组合表达。 例如量子计算机,即使字典里没有这个词组,模型也能依次生成量子计算机。 最坏情况只是生成速度慢一些,但它一定能生成,不会不认识。 这是一种能力上的保证。 源于其组合式的语言构造,英文模型不得不庞大,可能不行。 英文模型没有保底机制,它完全依赖字典里是否收录了完整的单词或可拆分的词根。 面对大量专业术语和不规则词,模型仍需不断扩充字典。 这直接导致模型在处理罕见专业术语时,更容易出现不认识的情况。 五、结论,智能时代的语言优势,从编码到智能,效率的定义发生了深刻转变。 英文在存储和简单处理上的效率优势,在大语言模型的复杂推理中,被中文的组合灵活性彻底超越。 这种转变揭示了智能时代的语言优势。 英文的优势在于快不快,适合处理结构化的已知信息。 中文的优势在于能不能,更适应开放世界的知识扩展。 在知识爆炸的时代,语言的真正价值不仅在于表达的效率,更在于适应变化的能力。 中文通过有限字符组合无限概念的特性,在大语言模型中展现出独特的优势,为处理复杂多变的现实世界问题提供了更具韧性的解决方案。 这种优势不仅是技术层面的效率考量。 更是语言体系对智能时代本质需求的深刻契合。
英文翻译
From Encoding to Intelligence: The Efficiency Paradox of Chinese and English in Large Language Models. When a Chinese article is translated into English, a surprising fact emerges. Even using the most space-efficient GB 2312 encoding, where each Chinese character takes two bytes, the storage cost of Chinese is nearly double that of English. With UTF-8 encoding, each Chinese character takes three bytes, widening the gap to three times. At the level of information storage, English seems to have an overwhelmingly superior efficiency. However, when we enter the world of large language models, this conclusion undergoes a dramatic reversal. With a mini dictionary of only 3,500 common Chinese characters, Chinese defeats English’s vast vocabulary, which often reaches 100,000 tokens. This reversal from overwhelming disadvantage to fundamental advantage reveals a new definition of language efficiency in the age of intelligence. 1. The Illusion of Efficiency at the Encoding Level. From the perspective of computer storage, English has a fundamental advantage. In our statistics, a Chinese original text of 5,094 characters, encoded in GB 2312, takes about 10,188 bytes; with UTF-8 encoding, it requires 15,282 bytes. Its English translation, even including the spaces that separate English words, has only 7,761 characters. And English’s UTF-8 encoding is still 7,761 bytes. Regardless of the encoding used, Chinese’s storage cost is significantly higher than English’s. This gap stems from the underlying structure of the two languages. English, as an alphabetic language, uses 26 letters combined to express infinite meanings, with each letter requiring only one byte of storage. Chinese, as an ideographic language, requires at least two bytes per character even under the most compact encoding scheme. In the first half of information storage, English’s efficiency advantage is indisputable. 2. The Revolutionary Mechanism of Large Language Models: The Birth of Transformer and the Dictionary. To understand the reversal in efficiency, we first need to understand the core working principle of large language models and the origin of their dictionaries. How is the dictionary dynamically constructed? The dictionary (vocabulary) of a large language model is not pre-written; it is dynamically generated by algorithms during the pre-training phase. The model learns from massive amounts of text, aiming to find the optimal combination of characters. It will prioritize adding high-frequency complete words, such as "the" and "a," to the dictionary. For low-frequency long words, it will attempt to split them into shorter subwords, e.g., "pneumonia" split into "new" and "monia." This process balances dictionary size and encoding efficiency. Each token in the dictionary represents a language unit that the model has understood and can use. The workflow of Transformer. You can imagine it as a prophet who only consults its own dynamically generated dictionary. - Input processing: When you input "我今天不舒服,好像得了肺" (I feel unwell today, seems like I have pneumonia), the model converts the text into numbers. - Context understanding: The model analyzes the context, understanding the association between "不舒服" (unwell) and "肺" (lung). - Predicting the next word: The model searches its dictionary for the most likely next token. - Softmax calculation: It calculates the probability for each word in the dictionary; the larger the dictionary, the slower the calculation. - Output result: It selects the word with the highest probability, e.g., "肺炎" (pneumonia), outputs it, and then starts the next round of prediction. 3. Comparison of Dictionary Strategies in Chinese and English Models: 3,500 Characters vs. 100,000 Tokens. The size and composition of the dictionary are key to the efficiency difference between Chinese and English. This is a direct, unavoidable numerical comparison. Chinese model: Extreme compression with 3,500 characters. Chinese models have a huge advantage: they have a natural, maximally compressible fallback solution—a minimal dictionary. Modern Chinese has about 3,500 commonly used characters, and these 3,500 characters can cover over 99.9% of usage scenarios. Extreme compression: In theory, a dictionary containing only these 3,500 characters can allow the model to process any Chinese content, including the most professional medical and legal texts. Even the brute-force method works: In the worst case, the model generates one character at a time. For example, for "肺炎" (pneumonia), it will first predict "肺" (lung), then "炎" (inflammation). Although slow, it will definitely generate the word—it will never fail to recognize it. Optimization space: To improve efficiency, Chinese models also add high-frequency phrases and idioms to the dictionary as single quick-lookup items. This is why the dictionary size of Chinese models typically ranges from 30,000 to 100,000 tokens, containing both basic characters and optimized phrases. English model: The massive body of 100,000 tokens. English models have no such fallback solution. Their dictionary size is inherently large. Complete inclusion is necessary: English has a large number of indivisible common words, such as "the," "a," "and," which must be fully included in the dictionary. Limitations of roots: Although English has a root system with about 2,000–3,000 common roots, it does not constitute a complete language system. Explosion of specialized terms: Professional vocabulary in fields like medicine and law can reach hundreds of thousands. Even with root splitting, a large number of specialized terms cannot be effectively split or lose their meaning after splitting. Final size: According to statistics, the dictionary size of professional English models is typically above 100,000 to 150,000 tokens, far larger than the minimal dictionary size of Chinese models. 4. Fundamental Difference: Extreme Compression vs. Inevitable Expansion. The fundamental difference between Chinese and English models lies in their different performance when encountering unknown words—a distinction concerning the baseline of capability. Chinese models can be extremely compressed, ensuring they can handle it. Chinese models have a natural fallback mechanism; even when encountering new words, they can express them using basic character combinations. For example, "量子计算机" (quantum computer), even if the dictionary does not contain this phrase, the model can generate "量子" (quantum) and "计算机" (computer) sequentially. The worst-case scenario is just slower generation, but it will definitely generate the term—it will not fail to recognize it. This is a guarantee of capability, stemming from its combinatorial language structure. English models must be large and may not be able to handle it. English models have no fallback mechanism; they rely entirely on whether the dictionary contains complete words or splittable roots. Faced with a large number of specialized terms and irregular words, the model still needs to constantly expand its dictionary. This directly leads to the model being more prone to failing to recognize rare specialized terms. 5. Conclusion: Language Advantage in the Age of Intelligence. From encoding to intelligence, the definition of efficiency has undergone a profound transformation. English's efficiency advantage in storage and simple processing is completely surpassed by Chinese's combinatorial flexibility in the complex reasoning of large language models. This transformation reveals the language advantage in the age of intelligence: English’s advantage lies in "how fast it is," making it suitable for processing structured, known information. Chinese’s advantage lies in "whether it can do it," making it more adaptable to the knowledge expansion of an open world. In an era of knowledge explosion, the true value of language lies not only in the efficiency of expression but also in the ability to adapt to change. Chinese, through its property of combining a finite set of characters to express infinite concepts, demonstrates a unique advantage in large language models, providing a more resilient solution for handling complex and ever-changing real-world problems. This advantage is not merely a technical consideration of efficiency; it represents a profound alignment between the language system and the essential needs of the age of intelligence.
back to top