ChatPaper.aiChatPaper

Пустота в языковых моделях

Void in Language Models

May 20, 2025
Авторы: Mani Shemiranifar
cs.AI

Аннотация

Несмотря на прогресс в трансформаторных языковых моделях (LMs), фундаментальный вопрос остается в значительной степени без ответа: активируются ли все слои во время вывода? Мы исследуем этот вопрос, выявляя неактивированные слои (которые мы называем Пустотами) с помощью необучаемого и не требующего параметров адаптивного метода вычислений под названием L2 Adaptive Computation (LAC). Мы адаптируем LAC из его первоначального применения, ориентированного на эффективность, для отслеживания активированных слоев во время вывода. Этот метод отслеживает изменения в L2-норме активаций для идентификации пустот. Мы анализируем активацию слоев в инструктивно настроенных LMs в двух фазах: Обработка Промпта (PP), где мы отслеживаем активированные слои для каждого токена во входных промптах, и Генерация Ответа (RG), где мы отслеживаем активированные слои для каждого сгенерированного токена. Мы также демонстрируем, что различные слои активируются в этих двух фазах. Чтобы показать эффективность нашего метода, мы оценили три различные инструктивно настроенные LMs из семейств Llama, Mistral и Qwen на трех тестах: MMLU, GPQA Diamond и BoolQ. Например, на MMLU в условиях zero-shot пропуск пустот в Qwen2.5-7B-Instruct привел к улучшению с 69.24 до 71.29, при этом модель использует только 30% слоев. Аналогично, Mistral-7B-Instruct-v0.3 на GPQA Diamond улучшился с 13.88 до 18.36 при использовании 70% слоев в обеих фазах PP и RG. Эти результаты показывают, что не все слои вносят равный вклад во время вывода, и что избирательный пропуск большинства из них может улучшить производительность моделей на определенных задачах.
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

PDF02May 21, 2025