Dissecting Recall of Factual Associations in Auto-Regressive Language Models
Geva, Mor, Bastings, Jasmijn, Filippova, Katja, Globerson, Amir
–arXiv.org Artificial Intelligence
Transformer-based language models (LMs) are known to capture factual knowledge in their parameters. While previous work looked into where factual associations are stored, only little is known about how they are retrieved internally during inference. We investigate this question through the lens of information flow. Given a subject-relation query, we study how the model aggregates information about the subject and relation to predict the correct attribute. With interventions on attention edges, we first identify two critical points where information propagates to the prediction: one from the relation positions followed by another from the subject positions. Next, by analyzing the information at these points, we unveil a three-step internal mechanism for attribute extraction. First, the representation at the last-subject position goes through an enrichment process, driven by the early MLP sublayers, to encode many subject-related attributes. Second, information from the relation propagates to the prediction. Third, the prediction representation "queries" the enriched subject to extract the attribute. Perhaps surprisingly, this extraction is typically done via attention heads, which often encode subject-attribute mappings in their parameters. Overall, our findings introduce a comprehensive view of how factual associations are stored and extracted internally in LMs, facilitating future research on knowledge localization and editing.
arXiv.org Artificial Intelligence
Oct-13-2023
- Country:
- Antarctica (0.04)
- Oceania
- New Zealand > North Island
- Auckland Region > Auckland (0.04)
- Australia > New South Wales
- Sydney (0.04)
- New Zealand > North Island
- North America
- Dominican Republic (0.04)
- Haiti (0.04)
- United States
- Texas (0.04)
- Minnesota > Hennepin County
- Minneapolis (0.14)
- Illinois > Cook County
- Chicago (0.04)
- Hawaii > Honolulu County
- Honolulu (0.04)
- California > San Diego County
- San Diego (0.04)
- Canada
- Europe
- Poland (0.04)
- Germany (0.04)
- France (0.04)
- Greece (0.04)
- Netherlands > North Holland
- Amsterdam (0.04)
- Italy
- Tuscany > Florence (0.04)
- Marche > Ancona Province
- Ancona (0.04)
- Norway > Eastern Norway
- Oslo (0.04)
- Finland > Uusimaa
- Helsinki (0.04)
- Croatia > Dubrovnik-Neretva County
- Dubrovnik (0.04)
- Ireland > Leinster
- County Dublin > Dublin (0.04)
- Asia
- India (0.04)
- Thailand > Bangkok
- Bangkok (0.04)
- South Korea > Seoul
- Seoul (0.04)
- Middle East
- UAE > Abu Dhabi Emirate
- Abu Dhabi (0.04)
- Israel > Tel Aviv District
- Tel Aviv (0.04)
- UAE > Abu Dhabi Emirate
- Japan > Honshū
- Kantō > Tokyo Metropolis Prefecture > Tokyo (0.04)
- Indonesia > Java
- China
- Genre:
- Research Report > New Finding (0.34)
- Industry:
- Media (0.67)
- Government (0.67)
- Transportation
- Leisure & Entertainment > Sports
- Hockey (0.47)
- Technology: