ChatPaper.aiChatPaper

Dai RAG ai parametri complessi: Esplorando come i modelli linguistici utilizzano conoscenze esterne rispetto alle informazioni parametriche per query fattuali

From RAGs to rich parameters: Probing how language models utilize external knowledge over parametric information for factual queries

June 18, 2024
Autori: Hitesh Wadhwa, Rahul Seetharaman, Somyaa Aggarwal, Reshmi Ghosh, Samyadeep Basu, Soundararajan Srinivasan, Wenlong Zhao, Shreyas Chaudhari, Ehsan Aghazadeh
cs.AI

Abstract

La Generazione Aumentata con Recupero (Retrieval Augmented Generation, RAG) arricchisce la capacità dei modelli linguistici di ragionare utilizzando contesti esterni per migliorare le risposte a un determinato prompt dell'utente. Questo approccio ha guadagnato popolarità grazie alle sue applicazioni pratiche in vari ambiti dei modelli linguistici, come la ricerca, il question/answering e i chatbot. Tuttavia, la natura esatta di come funzioni questo approccio non è ancora del tutto chiara. In questo articolo, esaminiamo in modo meccanicistico la pipeline RAG per evidenziare che i modelli linguistici prendono scorciatoie e hanno una forte tendenza a utilizzare solo le informazioni contestuali per rispondere alla domanda, affidandosi minimamente alla loro memoria parametrica. Analizziamo questo comportamento meccanicistico nei modelli linguistici con: (i) l'Analisi di Mediazione Causale per dimostrare che la memoria parametrica viene utilizzata in misura minima quando si risponde a una domanda e (ii) i Contributi dell'Attenzione e i Knockout per mostrare che il flusso residuo dell'ultimo token non si arricchisce dal token soggetto nella domanda, ma da altri token informativi nel contesto. Troviamo che questo comportamento di scorciatoia è pronunciato sia nei modelli della famiglia LLaMa che in quelli della famiglia Phi.
English
Retrieval Augmented Generation (RAG) enriches the ability of language models to reason using external context to augment responses for a given user prompt. This approach has risen in popularity due to practical applications in various applications of language models in search, question/answering, and chat-bots. However, the exact nature of how this approach works isn't clearly understood. In this paper, we mechanistically examine the RAG pipeline to highlight that language models take shortcut and have a strong bias towards utilizing only the context information to answer the question, while relying minimally on their parametric memory. We probe this mechanistic behavior in language models with: (i) Causal Mediation Analysis to show that the parametric memory is minimally utilized when answering a question and (ii) Attention Contributions and Knockouts to show that the last token residual stream do not get enriched from the subject token in the question, but gets enriched from other informative tokens in the context. We find this pronounced shortcut behaviour true across both LLaMa and Phi family of models.
PDF212February 7, 2026