Vacío en los Modelos de Lenguaje
Void in Language Models
May 20, 2025
Autores: Mani Shemiranifar
cs.AI
Resumen
A pesar de los avances en los modelos de lenguaje (LMs) basados en transformadores, una pregunta fundamental sigue en gran medida sin respuesta: ¿Se activan todas las capas durante la inferencia? Investigamos esta cuestión detectando capas no activadas (a las que nos referimos como Voids) utilizando un método de cómputo adaptativo no entrenable y sin parámetros llamado L2 Adaptive Computation (LAC). Adaptamos LAC desde su aplicación original centrada en la eficiencia para rastrear las capas activadas durante la inferencia. Este método monitorea los cambios en la norma L2 de las activaciones para identificar voids. Analizamos la activación de capas en LMs ajustados por instrucciones en dos fases: Procesamiento de Prompt (PP), donde rastreamos las capas activadas para cada token en los prompts de entrada, y Generación de Respuesta (RG), donde rastreamos las capas activadas para cada token generado. Además, demostramos que se activan capas distintas durante estas dos fases. Para mostrar la efectividad de nuestro método, evaluamos tres LMs ajustados por instrucciones de las familias Llama, Mistral y Qwen en tres benchmarks: MMLU, GPQA Diamond y BoolQ. Por ejemplo, en MMLU con un enfoque zero-shot, omitir voids en Qwen2.5-7B-Instruct resultó en una mejora de 69.24 a 71.29 mientras el modelo utiliza solo el 30% de las capas. De manera similar, Mistral-7B-Instruct-v0.3 en GPQA Diamond mejoró de 13.88 a 18.36 al usar el 70% de las capas durante ambas fases, PP y RG. Estos resultados muestran que no todas las capas contribuyen por igual durante la inferencia, y que omitir selectivamente la mayoría de ellas puede mejorar el rendimiento de los modelos en ciertas tareas.
English
Despite advances in transformer-based language models (LMs), a fundamental
question remains largely unanswered: Are all layers activated during inference?
We investigate this question by detecting unactivated layers (which we refer to
as Voids) using a non-trainable and parameter-free adaptive computation method
called L2 Adaptive Computation (LAC). We adapt LAC from its original
efficiency-focused application to trace activated layers during inference. This
method monitors changes in the L2-norm of activations to identify voids. We
analyze layer activation in instruction-tuned LMs across two phases: Prompt
Processing (PP), where we trace activated layers for each token in the input
prompts, and Response Generation (RG), where we trace activated layers for each
generated token. We further demonstrate that distinct layers are activated
during these two phases. To show the effectiveness of our method, we evaluated
three distinct instruction-tuned LMs from the Llama, Mistral, and Qwen families
on three benchmarks: MMLU, GPQA Diamond, and BoolQ. For example, on MMLU with a
zero-shot setting, skipping voids in Qwen2.5-7B-Instruct resulted in an
improvement from 69.24 to 71.29 while the model uses only 30% of the layers.
Similarly, Mistral-7B-Instruct-v0.3 on GPQA Diamond improved from 13.88 to
18.36 when using 70% of the layers during both the PP and RG phases. These
results show that not all layers contribute equally during inference, and that
selectively skipping most of them can improve the performance of models on
certain tasks.Summary
AI-Generated Summary