Do Long-Range Language Models Actually Use Long-Range Context?
Simeng Sun1 Kalpesh Krishna1 Andrew Mattarella-Micke2 Mohit Iyyer1 University of Massachusetts Amherst1 Intuit AI2
Abstract
Language models are generally trained on short, truncated input sequences, which limits their ability to use discourse-level information present in long-range context to improve their predictions. Recent efforts to improve the efficiency of self-attention have led to a proliferation of long-range Transformer language models, which can process much longer sequences than models of the past. However, the ways in which such models take advantage of the long-range context remain unclear. In this paper, we perform a fine-grained analysis of two long-range Transformer language models (including the Routing Transformer, which achieves state-of-the-art perplexity on the PG-19 long-sequence LM benchmark dataset) that accept input sequences of up to 8K tokens. Our results reveal that providing long-range context (i.e., beyond the previous 2K tokens) to these models only improves their predictions on a small set of tokens (e.g., those that can be copied from the distant context) and does not help at all for sentence-level prediction tasks. Finally, we discover that PG-19 contains a variety of different document types and domains, and that long-range context helps most for literary novels (as o
中文速览
长距离Transformer语言模型(如Routing Transformer)虽然能处理多达8192个词元的超长上下文,并在PG-19长文档基准上刷新了困惑度(perplexity)记录,但它们究竟有没有真正利用这些远距离信息,一直是个谜。研究者对这两类模型做了一系列细粒度实验,通过改变输入长度、打乱词序、随机替换远端内容等扰动方式来观察模型行为。结果发现,将上下文窗口从2000个词元扩展到8000个词元,对整体困惑度几乎没有提升,只有极少数词元——例如能从远端直接"抄"过来的词,或被拆分成多个子词单元的词——才真正受益于更长的上下文;而且即便对远端内容进行大幅破坏性扰动,模型的预测结果也几乎纹丝不动,说明模型对长距离语义信息的编码十分肤浅。这项研究提醒我们:更长的上下文窗口并不等于更强的长距离理解能力,未来评估长距离语言模型时必须加入更精细的行为分析,而不能只看整体困惑度指标。
原文 arXiv:2109.09115;中英对照 + 大白话阅读 https://aha.fim.ai/paper/2109.09115v1