Saved in:
Bibliographic Details
Main Authors: Amirzadeh, Hamidreza, Alishahi, Afra, Mohebbi, Hosein
Format: Preprint
Published: 2024
Subjects:
Online Access:https://arxiv.org/abs/2410.03447
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866929527903485952
author Amirzadeh, Hamidreza
Alishahi, Afra
Mohebbi, Hosein
author_facet Amirzadeh, Hamidreza
Alishahi, Afra
Mohebbi, Hosein
contents Transformer-based language models have shown an excellent ability to effectively capture and utilize contextual information. Although various analysis techniques have been used to quantify and trace the contribution of single contextual cues to a target task such as subject-verb agreement or coreference resolution, scenarios in which multiple relevant cues are available in the context remain underexplored. In this paper, we investigate how language models handle gender agreement when multiple gender cue words are present, each capable of independently disambiguating a target gender pronoun. We analyze two widely used Transformer-based models: BERT, an encoder-based, and GPT-2, a decoder-based model. Our analysis employs two complementary approaches: context mixing analysis, which tracks information flow within the model, and a variant of activation patching, which measures the impact of cues on the model's prediction. We find that BERT tends to prioritize the first cue in the context to form both the target word representations and the model's prediction, while GPT-2 relies more on the final cue. Our findings reveal striking differences in how encoder-based and decoder-based models prioritize and use contextual information for their predictions.
format Preprint
id arxiv_https___arxiv_org_abs_2410_03447
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle How Language Models Prioritize Contextual Grammatical Cues?
Amirzadeh, Hamidreza
Alishahi, Afra
Mohebbi, Hosein
Computation and Language
Transformer-based language models have shown an excellent ability to effectively capture and utilize contextual information. Although various analysis techniques have been used to quantify and trace the contribution of single contextual cues to a target task such as subject-verb agreement or coreference resolution, scenarios in which multiple relevant cues are available in the context remain underexplored. In this paper, we investigate how language models handle gender agreement when multiple gender cue words are present, each capable of independently disambiguating a target gender pronoun. We analyze two widely used Transformer-based models: BERT, an encoder-based, and GPT-2, a decoder-based model. Our analysis employs two complementary approaches: context mixing analysis, which tracks information flow within the model, and a variant of activation patching, which measures the impact of cues on the model's prediction. We find that BERT tends to prioritize the first cue in the context to form both the target word representations and the model's prediction, while GPT-2 relies more on the final cue. Our findings reveal striking differences in how encoder-based and decoder-based models prioritize and use contextual information for their predictions.
title How Language Models Prioritize Contextual Grammatical Cues?
topic Computation and Language
url https://arxiv.org/abs/2410.03447