IDEAS home Printed from https://ideas.repec.org/a/gam/jftint/v15y2023i7p230-d1182617.html
   My bibliography  Save this article

Synonyms, Antonyms and Factual Knowledge in BERT Heads

Author

Listed:
  • Lorenzo Serina

    (Department of Information Engineering, Università Degli Studi di Brescia, Via Branze 38, 25100 Brescia, Italy)

  • Luca Putelli

    (Department of Information Engineering, Università Degli Studi di Brescia, Via Branze 38, 25100 Brescia, Italy)

  • Alfonso Emilio Gerevini

    (Department of Information Engineering, Università Degli Studi di Brescia, Via Branze 38, 25100 Brescia, Italy)

  • Ivan Serina

    (Department of Information Engineering, Università Degli Studi di Brescia, Via Branze 38, 25100 Brescia, Italy)

Abstract

In recent years, many studies have been devoted to discovering the inner workings of Transformer-based models, such as BERT, for instance, attempting to identify what information is contained within them. However, little is known about how these models store this information in their millions of parameters and which parts of the architecture are the most important. In this work, we propose an approach to identify self-attention mechanisms, called heads, that contain semantic and real-world factual knowledge in BERT. Our approach includes a metric computed from attention weights and exploits a standard clustering algorithm for extracting the most relevant connections between tokens in a head. In our experimental analysis, we focus on how heads can connect synonyms, antonyms and several types of factual knowledge regarding subjects such as geography and medicine.

Suggested Citation

  • Lorenzo Serina & Luca Putelli & Alfonso Emilio Gerevini & Ivan Serina, 2023. "Synonyms, Antonyms and Factual Knowledge in BERT Heads," Future Internet, MDPI, vol. 15(7), pages 1-18, June.
  • Handle: RePEc:gam:jftint:v:15:y:2023:i:7:p:230-:d:1182617
    as

    Download full text from publisher

    File URL: https://www.mdpi.com/1999-5903/15/7/230/pdf
    Download Restriction: no

    File URL: https://www.mdpi.com/1999-5903/15/7/230/
    Download Restriction: no
    ---><---

    Citations

    Citations are extracted by the CitEc Project, subscribe to its RSS feed for this item.
    as


    Cited by:

    1. Nicola Arici & Alfonso Emilio Gerevini & Matteo Olivato & Luca Putelli & Luca Sigalini & Ivan Serina, 2023. "Real-World Implementation and Integration of an Automatic Scoring System for Workplace Safety Courses in Italian," Future Internet, MDPI, vol. 15(8), pages 1-22, August.

    Corrections

    All material on this site has been provided by the respective publishers and authors. You can help correct errors and omissions. When requesting a correction, please mention this item's handle: RePEc:gam:jftint:v:15:y:2023:i:7:p:230-:d:1182617. See general information about how to correct material in RePEc.

    If you have authored this item and are not yet registered with RePEc, we encourage you to do it here. This allows to link your profile to this item. It also allows you to accept potential citations to this item that we are uncertain about.

    We have no bibliographic references for this item. You can help adding them by using this form .

    If you know of missing items citing this one, you can help us creating those links by adding the relevant references in the same way as above, for each refering item. If you are a registered author of this item, you may also want to check the "citations" tab in your RePEc Author Service profile, as there may be some citations waiting for confirmation.

    For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: MDPI Indexing Manager (email available below). General contact details of provider: https://www.mdpi.com .

    Please note that corrections may take a couple of weeks to filter through the various RePEc services.

    IDEAS is a RePEc service. RePEc uses bibliographic data supplied by the respective publishers.