Le LLM sanno più di quanto mostrano: Sulla rappresentazione intrinseca delle allucinazioni dei LLM
LLMs Know More Than They Show: On the Intrinsic Representation of LLM Hallucinations
October 3, 2024
Autori: Hadas Orgad, Michael Toker, Zorik Gekhman, Roi Reichart, Idan Szpektor, Hadas Kotek, Yonatan Belinkov
cs.AI
Abstract
I grandi modelli linguistici (LLM) spesso producono errori, tra cui inesattezze factuali, pregiudizi e fallimenti di ragionamento, definiti collettivamente come "allucinazioni". Studi recenti hanno dimostrato che gli stati interni dei LLM codificano informazioni sulla veridicità delle loro uscite, e che queste informazioni possono essere utilizzate per rilevare errori. In questo lavoro, mostriamo che le rappresentazioni interne dei LLM codificano molte più informazioni sulla veridicità di quanto precedentemente riconosciuto. Scopriamo innanzitutto che le informazioni sulla veridicità sono concentrate in token specifici, e sfruttando questa proprietà si migliora significativamente le prestazioni nella rilevazione degli errori. Tuttavia, dimostriamo che tali rilevatori di errori non generalizzano tra i dataset, implicando che - contrariamente a quanto affermato in precedenza - la codifica della veridicità non è universale ma piuttosto sfaccettata. Successivamente, mostriamo che le rappresentazioni interne possono anche essere utilizzate per prevedere i tipi di errori che il modello è probabile che commetta, facilitando lo sviluppo di strategie di mitigazione personalizzate. Infine, riveliamo una discrepanza tra la codifica interna dei LLM e il comportamento esterno: potrebbero codificare la risposta corretta, ma generare costantemente una risposta errata. Insieme, queste intuizioni approfondiscono la nostra comprensione degli errori dei LLM dalla prospettiva interna del modello, che può guidare la ricerca futura sull'ottimizzazione dell'analisi degli errori e della mitigazione.
English
Large language models (LLMs) often produce errors, including factual
inaccuracies, biases, and reasoning failures, collectively referred to as
"hallucinations". Recent studies have demonstrated that LLMs' internal states
encode information regarding the truthfulness of their outputs, and that this
information can be utilized to detect errors. In this work, we show that the
internal representations of LLMs encode much more information about
truthfulness than previously recognized. We first discover that the
truthfulness information is concentrated in specific tokens, and leveraging
this property significantly enhances error detection performance. Yet, we show
that such error detectors fail to generalize across datasets, implying that --
contrary to prior claims -- truthfulness encoding is not universal but rather
multifaceted. Next, we show that internal representations can also be used for
predicting the types of errors the model is likely to make, facilitating the
development of tailored mitigation strategies. Lastly, we reveal a discrepancy
between LLMs' internal encoding and external behavior: they may encode the
correct answer, yet consistently generate an incorrect one. Taken together,
these insights deepen our understanding of LLM errors from the model's internal
perspective, which can guide future research on enhancing error analysis and
mitigation.