DeCoRe: Decodifica tramite Teste di Recupero Contrastanti per Mitigare le Allucinazioni

DeCoRe: Decoding by Contrasting Retrieval Heads to Mitigate Hallucinations

October 24, 2024
Autori: Aryo Pradipta Gema, Chen Jin, Ahmed Abdulaal, Tom Diethe, Philip Teare, Beatrice Alex, Pasquale Minervini, Amrutha Saseendran
cs.AI

Abstract

I Grandi Modelli Linguistici (LLM) spesso producono allucinazioni, generando output non fedeli o factualmente scorretti mediante una rappresentazione distorta del contesto fornito o un richiamo interno errato delle conoscenze. Studi recenti hanno identificato specifiche "testate di attenzione" all'interno dell'architettura Transformer, note come testate di recupero, responsabili dell'estrazione di informazioni contestuali rilevanti. Ipotizziamo che mascherare queste testate di recupero possa indurre allucinazioni e che contrastare gli output del LLM base e del LLM mascherato possa ridurre le allucinazioni. A tal fine, proponiamo Decodifica tramite Contrasto delle Testate di Recupero (DeCoRe), una nuova strategia di decodifica priva di addestramento che amplifica le informazioni trovate nel contesto e nei parametri del modello. DeCoRe mitiga le risposte potenzialmente allucinate contrastando dinamicamente gli output del LLM base e del LLM mascherato, utilizzando l'entropia condizionale come guida. I nostri ampi esperimenti confermano che DeCoRe migliora significativamente le prestazioni in compiti che richiedono un'elevata fedeltà contestuale, come la sintesi (XSum del 18,6%), il seguire le istruzioni (MemoTrap del 10,9%) e il rispondere a domande a libro aperto (NQ-Open del 2,4% e NQ-Swap del 5,5%).
English
Large Language Models (LLMs) often hallucinate, producing unfaithful or factually incorrect outputs by misrepresenting the provided context or incorrectly recalling internal knowledge. Recent studies have identified specific attention heads within the Transformer architecture, known as retrieval heads, responsible for extracting relevant contextual information. We hypothesise that masking these retrieval heads can induce hallucinations and that contrasting the outputs of the base LLM and the masked LLM can reduce hallucinations. To this end, we propose Decoding by Contrasting Retrieval Heads (DeCoRe), a novel training-free decoding strategy that amplifies information found in the context and model parameters. DeCoRe mitigates potentially hallucinated responses by dynamically contrasting the outputs of the base LLM and the masked LLM, using conditional entropy as a guide. Our extensive experiments confirm that DeCoRe significantly improves performance on tasks requiring high contextual faithfulness, such as summarisation (XSum by 18.6%), instruction following (MemoTrap by 10.9%), and open-book question answering (NQ-Open by 2.4% and NQ-Swap by 5.5%).

Summary

AI-Generated Summary

PDF93November 16, 2024