arXiv:2410.03447cs.CL2024-10中稿 · BlackboxNLP 2024被引 1

对比BERT与GPT-2如何优先处理多个性别线索,揭示编码器与解码器模型的差异。

How Language Models Prioritize Contextual Grammatical Cues?

  • 通过上下文混合与激活修补分析模型对性别线索的依赖顺序。
  • BERT优先使用首个性别线索,GPT-2更依赖最后一个线索。
  • 揭示编码器与解码器模型在信息优先级上的根本差异,适合关注模型内部机制的研究者。

基于Transformer的语言模型在捕捉和利用上下文信息方面表现出色。尽管已有多种分析技术用于量化单个上下文线索对任务(如主谓一致或指代消解)的贡献,但在存在多个相关线索时的情况仍研究不足。本文探讨当多个性别线索同时出现、均可独立消解目标代词性别时,语言模型如何处理性别一致问题。分析了两种广泛使用的Transformer模型:基于编码器的BERT和基于解码器的GPT-2。采用两种互补方法:上下文混合分析追踪模型内部信息流动,以及激活修补的变体方法测量线索对模型预测的影响。结果表明,BERT倾向于优先使用上下文中的第一个线索来构建目标词表示并做出预测,而GPT-2则更依赖最后一个线索。研究揭示了编码器型与解码器型模型在处理上下文信息时优先级策略的根本差异。

原文摘要 · Abstract (English)

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.

语言模型上下文优先级BERTGPT-2

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。