Transformer Language Models Handle Word Frequency in Prediction Head

Goro Kobayashi, Tatsuki Kuribayashi, Sho Yokoi, Kentaro Inui
5/29/2023
cs.CL

No confident code implementation found for this paper. 1 possible match can be shown below.

Abstract

Prediction head is a crucial component of Transformer language models. Despite its direct impact on prediction, this component has often been overlooked in analyzing Transformers. In this study, we investigate the inner workings of the prediction head, specifically focusing on bias parameters. Our experiments with BERT and GPT-2 models reveal that the biases in their word prediction heads play a significant role in the models' ability to reflect word frequency in a corpus, aligning with the logit adjustment method commonly used in long-tailed learning. We also quantify the effect of controlling the biases in practical auto-regressive text generation scenarios; under a particular setting, more diverse text can be generated without compromising text quality.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 1 weaker match is hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{kobayashi2023transformer,
  title  = {Transformer Language Models Handle Word Frequency in Prediction Head},
  author = {Goro Kobayashi and Tatsuki Kuribayashi and Sho Yokoi and Kentaro Inui},
  year   = {2023},
  eprint = {2305.18294},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2305.18294v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2305.18294.svg)](https://codeofpaper.com/paper/2305.18294)

Discussion