Use this link to cite:
https://hdl.handle.net/2183/49625 Eficiencia de la tokenización multilingüe y su impacto ambiental en LLMs
Loading...
Identifiers
Publication date
Authors
Mahía Varela, Claudia
Other responsabilities
Universidade da Coruña. Facultade de Informática
Journal Title
Bibliographic citation
Type of academic work
Academic degree
Abstract
[Resumen] Los Modelos de Lenguaje a Gran Escala (LLMs, por sus siglas en inglés) pueden ser menos eficientes en algunos idiomas porque la forma en que dividen el texto está diseñada principalmente para el inglés. Este Trabajo de Fin de Grado cuantifica empíricamente esta brecha lingüística y su coste ambiental asociado, evaluando cuatro arquitecturas de LLMs de pesos abiertos en dos tareas de generación de texto: traducción automática, sobre un corpus paralelo de versículos bíblicos, y redacción, en dos variantes: desarrollo dirigido de noticias reales de The New York Times, y generación libre a partir de categorías temáticas. El consumo energético y las emisiones de CO2 de cada inferencia se monitorizan mediante CodeCarbon, una herramienta que permite estimar el consumo energético y la huella de carbono asociada a la ejecución de modelos de aprendizaje automático.
Los resultados confirman que la fragmentación de subpalabras varía drásticamente según el idioma y la arquitectura, y que dicha fragmentación tiende a correlacionarse con una menor calidad semántica de la traducción. Además, se evalúan dos técnicas de optimización, poda estructural de capas y cuantización a 8 bits, tanto por separado como combinadas. La poda estructural provoca un colapso en la generación de chino de los modelos no nativos y, en la mayoría de los casos, debido a implicaciones colaterales, acaba aumentando el consumo energético. La cuantización, en cambio, ofrece resultados más consistentes, con una degradación mínima de la calidad y un ahorro energético. Al extender esta medición a la tarea de redacción libre, se confirma además que esta brecha no depende únicamente del par modelo idioma, sino también de las características de la tarea concreta, en particular del margen de generación permitido y del grado de libertad léxica disponible.
Estos resultados muestran diferencias claras entre modelos, y confirman que la tokenización multilingüe constituye un factor determinante del coste energético y ambiental de un LLM.
[Abstract] Large Language Models (LLMs) can be less efficient in some languages because the way they split text is primarily designed for English. This undergraduate thesis empirically quantifies this linguistic gap and its associated environmental cost, evaluating four open-weight LLM architectures on two text generation tasks: machine translation, on a parallel corpus of Bible verses, and writing, in two variants with different degrees of freedom: directed development of real news headlines from The New York Times, and free generation from thematic categories. The energy consumption and CO2 emissions of each inference are monitored using CodeCarbon, a tool that estimates the energy consumption and carbon footprint associated with running machine learning models. The results confirm that subword fragmentation varies drastically depending on language and architecture, and that this fragmentation tends to correlate with lower semantic translation quality. In addition, two optimization techniques are evaluated –structural layer pruning and 8-bit quantization– both separately and combined. Structural pruning causes a collapse in Chinese generation for non-native models and, in most cases, due to side effects, ends up increasing energy consumption. Quantization, by contrast, offers more consistent results, with minimal quality degradation and energy savings. Extending this measurement to the writing task further confirms that this gap does not depend solely on the model-language pair, but also on the specific characteristics of the task itself, particularly the permitted generation length and the degree of available lexical freedom. These results show clear differences between models, and confirm that multilingual tokenization is a determining factor in the energy and environmental cost of an LLM.
[Abstract] Large Language Models (LLMs) can be less efficient in some languages because the way they split text is primarily designed for English. This undergraduate thesis empirically quantifies this linguistic gap and its associated environmental cost, evaluating four open-weight LLM architectures on two text generation tasks: machine translation, on a parallel corpus of Bible verses, and writing, in two variants with different degrees of freedom: directed development of real news headlines from The New York Times, and free generation from thematic categories. The energy consumption and CO2 emissions of each inference are monitored using CodeCarbon, a tool that estimates the energy consumption and carbon footprint associated with running machine learning models. The results confirm that subword fragmentation varies drastically depending on language and architecture, and that this fragmentation tends to correlate with lower semantic translation quality. In addition, two optimization techniques are evaluated –structural layer pruning and 8-bit quantization– both separately and combined. Structural pruning causes a collapse in Chinese generation for non-native models and, in most cases, due to side effects, ends up increasing energy consumption. Quantization, by contrast, offers more consistent results, with minimal quality degradation and energy savings. Extending this measurement to the writing task further confirms that this gap does not depend solely on the model-language pair, but also on the specific characteristics of the task itself, particularly the permitted generation length and the degree of available lexical freedom. These results show clear differences between models, and confirm that multilingual tokenization is a determining factor in the energy and environmental cost of an LLM.
Description
Editor version
Rights
Todos os dereitos reservados. Prohíbese a reprodución, transformación, distribución e comunicación pública da obra por terceiros. Permítese a súa visualización e a descarga dunha copia privada para o uso persoal.







