ChatPaper.aiChatPaper

Vuoto nei Modelli Linguistici

Void in Language Models

May 20, 2025
Autori: Mani Shemiranifar
cs.AI

Abstract

Nonostante i progressi nei modelli linguistici basati su trasformatori (LM), una domanda fondamentale rimane in gran parte senza risposta: Tutti i livelli vengono attivati durante l'inferenza? Esploriamo questa questione rilevando i livelli non attivati (che chiamiamo Voids) utilizzando un metodo di calcolo adattivo non addestrabile e privo di parametri chiamato L2 Adaptive Computation (LAC). Adattiamo LAC dalla sua applicazione originale focalizzata sull'efficienza per tracciare i livelli attivati durante l'inferenza. Questo metodo monitora i cambiamenti nella norma L2 delle attivazioni per identificare i voids. Analizziamo l'attivazione dei livelli nei LM ottimizzati per istruzioni in due fasi: Elaborazione del Prompt (PP), in cui tracciamo i livelli attivati per ogni token nei prompt di input, e Generazione della Risposta (RG), in cui tracciamo i livelli attivati per ogni token generato. Dimostriamo inoltre che livelli distinti vengono attivati durante queste due fasi. Per dimostrare l'efficacia del nostro metodo, abbiamo valutato tre diversi LM ottimizzati per istruzioni delle famiglie Llama, Mistral e Qwen su tre benchmark: MMLU, GPQA Diamond e BoolQ. Ad esempio, su MMLU con un'impostazione zero-shot, saltare i voids in Qwen2.5-7B-Instruct ha portato a un miglioramento da 69.24 a 71.29 mentre il modello utilizza solo il 30% dei livelli. Allo stesso modo, Mistral-7B-Instruct-v0.3 su GPQA Diamond è migliorato da 13.88 a 18.36 utilizzando il 70% dei livelli durante entrambe le fasi PP e RG. Questi risultati mostrano che non tutti i livelli contribuiscono in modo uguale durante l'inferenza e che saltarne selettivamente la maggior parte può migliorare le prestazioni dei modelli su determinati compiti.
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.
PDF12May 21, 2025