arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2410.03447cs.CL
收藏

语言模型如何对上下文中的语法线索进行优先级排序?

How Language Models Prioritize Contextual Grammatical Cues?

Sharif University of Technology(谢里夫理工大学);Tilburg University(蒂尔堡大学)

Hamidreza Amirzadeh, Afra Alishahi, Hosein Mohebbi

AI总结:

该研究针对多上下文语法线索场景下语言模型的处理机制问题,采用上下文混合分析与激活修补方法,对比发现BERT优先首个性别线索、GPT-2依赖末尾线索,揭示了编码器与解码器类模型的上下文利用差异。

摘要:

基于Transformer的语言模型已展现出出色的有效捕捉和利用上下文信息的能力。尽管已有多种分析技术被用于量化和追踪单个上下文线索对目标任务(如主谓一致或共指消解)的贡献,但上下文中存在多个相关线索的场景仍未得到充分探索。本文研究了当上下文中存在多个性别线索词(每个词都能独立消歧目标性别代词)时,语言模型如何处理性别一致问题。我们分析了两种广泛使用的基于Transformer的模型:基于编码器的BERT和基于解码器的GPT-2。我们的分析采用了两种互补的方法:追踪模型内部信息流的上下文混合分析,以及衡量线索对模型预测影响的激活修补变体方法。我们发现,BERT倾向于优先考虑上下文中的第一个线索,以形成目标词表征并生成模型预测,而GPT-2则更多依赖最后一个线索。我们的发现揭示了基于编码器和基于解码器的模型在对上下文信息进行优先级排序并用于预测方面存在显著差异。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑