Skip to main content
QUICK REVIEW

[论文解读] minicons: Enabling Flexible Behavioral and Representational Analyses of Transformer Language Models

Kanishka Misra|arXiv (Cornell University)|Mar 24, 2022
Topic ModelingComputer Science被引用 27
一句话总结

minicons 是一个开源的 Python 库,提供对 Transformer 语言模型进行行为(预测层级)和表征(激活层级)分析的标准 API,并附有对 BERT 学习动力学和零样本 abductive 推理的案例研究。

ABSTRACT

We present minicons, an open source library that provides a standard API for researchers interested in conducting behavioral and representational analyses of transformer-based language models (LMs). Specifically, minicons enables researchers to apply analysis methods at two levels: (1) at the prediction level -- by providing functions to efficiently extract word/sentence level probabilities; and (2) at the representational level -- by also facilitating efficient extraction of word/phrase level vectors from one or more layers. In this paper, we describe the library and apply it to two motivating case studies: One focusing on the learning dynamics of the BERT architecture on relative grammatical judgments, and the other on benchmarking 23 different LMs on zero-shot abductive reasoning. minicons is available at https://github.com/kanishkamisra/minicons

研究动机与目标

  • 推动并实现对基于 Transformer 的语言模型在预训练过程中学习到的内容进行系统分析的动机与能力。
  • 提供一个标准 API,用于在多层中提取词语/序列概率及上下文嵌入。
  • 展示两个有说服力的案例研究,说明学习动态和零样本 abductive 推理。
  • 将 minicons 定位为与 Hugging Face 生态系统集成的可扩展工具,以扩大对 BlackboxNLP 分析的访问。

提出的方法

  • 具有批处理启用分析工作流的两个核心模块:用于预测层分析的 scorer 和用于表征分析的 cwe。
  • scorer 同时支持 MaskedLMScorer 和 IncrementalLMScorer,以提取令牌级、序列级或部分条件概率,并导出对数概率、惊奇度和词汇/排名信息等指标。
  • cwe.extract_representation() 提供来自单层或多层的上下文嵌入,选项包括降维子词表示以及获取短语或句子嵌入。
  • 分析可以在预训练模型上端到端执行,无需微调,利用 CPU 或 GPU 上的批处理计算。
  • 该库与 Transformers 和 Hugging Face Model Hub 集成,便于大规模基准测试。
  • 案例研究方法包括跟踪 BERT 变体中语言现象的学习动态,并利用部分分数计算评估多种语言模型中的 abductive 推理。

实验结果

研究问题

  • RQ1通过基于预测的分析,在预训练过程中,Transformer LMs 如何学习语言现象?
  • RQ2在零样本设置下,通过序列概率来衡量,预训练语言模型在 abductive 推理能力方面具备到何种程度?
  • RQ3标准 API 是否能够促进跨越多样化模型与数据集的可扩展、可重复的行为与表征分析?

主要发现

  • 学习动态显示 MultiBERTs 在许多语言现象上向参考的 BERT-base 模型收敛,学习速率不等。
  • 某些现象(如数/性别一致)较早学习,而其他现象(如岛屿效应)学习得较慢。
  • 无监督的 abductive 推理结果表明大多数模型接近概率分布的随机水平,只有通过微调或显式知识整合,一些模型才接近最新水平。
  • ALBERT-xxlarge-v2 在零-shot 设置下实现相对强劲的 abductive 推理性能,尽管它在参数效率方面表现出色。
  • 结果表明,仅仅扩大规模不太可能在零样本 abductive 推理方面带来显著提升;改进可能需要架构/知识增强策略。
  • minicons 通过提供标准化、高效的概率和上下文嵌入提取,促进此类分析的复制与扩展。

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。