bigbird pegasus large arxiv

Providergoogle
Categorysummarization
Licenseapache-2.0
Downloads414
Stars0

Overview

The BigBird-Pegasus-Large-arXiv model is a specialized transformer designed for long-form document summarization, specifically optimized for scientific papers. Unlike standard BERT or GPT architectures that struggle with quadratic memory scaling, BigBird utilizes a sparse attention mechanism to handle significantly larger input sequences. This makes it ideal for developers building research tools, automated literature reviews, or technical knowledge bases where capturing the core contribution of a full-length PDF is critical. It bridges the gap between the Pegasus pre-training objective—which excels at abstractive summarization—and BigBird's extended context window, offering a robust alternative to truncation-based approaches when processing academic datasets.

Highlights

  • Sparse attention handles long-form academic documents efficiently
  • Optimized for abstractive summarization of scientific texts
  • Apache-2.0 license allows for flexible commercial integration
  • Avoids input truncation for comprehensive paper analysis

Usage

Install
# Install Hugging Face transformers
pip install transformers torch
SDK Usage
# Load model with transformers
from transformers import AutoModel, AutoTokenizer

model = AutoModel.from_pretrained("google/bigbird-pegasus-large-arxiv")
tokenizer = AutoTokenizer.from_pretrained("google/bigbird-pegasus-large-arxiv")

Hugging Face Download

We recommend downloading the model via the Hugging Face CLI or Hub SDK.

Guidance:Before downloading, install huggingface_hub with:

Guidance
pip install -U huggingface_hub

CLI Download

Download the full repository

Download the full repository
huggingface-cli download google/bigbird-pegasus-large-arxiv

Download a single file to a local folder (e.g. config.json into ./dir)

Download a single file to a local folder (e.g. config.json into ./dir)
huggingface-cli download google/bigbird-pegasus-large-arxiv config.json --local-dir ./dir

See the official docs for more CLI options

SDK Download

SDK Download
# 模型下载
from huggingface_hub import snapshot_download
model_dir = snapshot_download('google/bigbird-pegasus-large-arxiv')

Git Download

Make sure git-lfs is installed first

Git Download
git lfs install
git clone https://huggingface.co/google/bigbird-pegasus-large-arxiv

To skip LFS large-file downloads, use:

Skip LFS
GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/google/bigbird-pegasus-large-arxiv

Model files are hosted on the Hugging Face Hub — download directly via HF CLI / SDK / Git, not through this site.

PyTorch / Transformers Usage

Install Transformers

Install Transformers
pip install -U transformers torch

Load the model and run inference

Load the model and run inference
from transformers import AutoModelForCausalLM, AutoTokenizer

model = AutoModelForCausalLM.from_pretrained('google/bigbird-pegasus-large-arxiv')
tokenizer = AutoTokenizer.from_pretrained('google/bigbird-pegasus-large-arxiv')

Model Download

We recommend downloading the model via the ModelScope CLI or SDK.

Guidance:Before downloading, install ModelScope with:

Guidance
pip install modelscope

CLI Download

Download the full repository

Download the full repository
modelscope download --model google/bigbird-pegasus-large-arxiv

Download a single file to a local folder (e.g. README.md into ./dir)

Download a single file to a local folder (e.g. README.md into ./dir)
modelscope download --model google/bigbird-pegasus-large-arxiv README.md --local_dir ./dir

See the docs for more CLI options

SDK Download

SDK Download
# 模型下载
from modelscope import snapshot_download
model_dir = snapshot_download('google/bigbird-pegasus-large-arxiv')

Git Download

Make sure git-lfs is installed first

Git Download
git lfs install
git clone https://www.modelscope.cn/google/bigbird-pegasus-large-arxiv.git

To skip LFS large-file downloads, use:

Skip LFS
GIT_LFS_SKIP_SMUDGE=1 git clone https://www.modelscope.cn/google/bigbird-pegasus-large-arxiv.git

ModelScope 模型页直接下载模型文件;无需将模型文件放在本站服务器。

Notebook Quickstart

Install the ModelScope library

Install the ModelScope library
pip install "modelscope[audio,cv,nlp,multi-modal,science]" -f https://modelscope.oss-cn-beijing.aliyuncs.com/releases/repo.html

Load the model and run inference

Load the model and run inference
from modelscope.pipelines import pipeline
from modelscope.utils.constant import Tasks

p = pipeline('text-generation', 'google/bigbird-pegasus-large-arxiv')

Full Documentation

来源: HuggingFace

---
language: en
license: apache-2.0
datasets:

  • scientific_papers

tags:
  • summarization

model-index:
  • name: google/bigbird-pegasus-large-arxiv

results:
- task:
type: summarization
name: Summarization
dataset:
name: scientific_papers
type: scientific_papers
config: pubmed
split: test
metrics:
- name: ROUGE-1
type: rouge
value: 36.0276
verified: true
- name: ROUGE-2
type: rouge
value: 13.4166
verified: true
- name: ROUGE-L
type: rouge
value: 21.9612
verified: true
- name: ROUGE-LSUM
type: rouge
value: 29.648
verified: true
- name: loss
type: loss
value: 2.774355173110962
verified: true
- name: meteor
type: meteor
value: 0.2824
verified: true
- name: gen_len
type: gen_len
value: 209.2537
verified: true
- task:
type: summarization
name: Summarization
dataset:
name: cnn_dailymail
type: cnn_dailymail
config: 3.0.0
split: test
metrics:
- name: ROUGE-1
type: rouge
value: 9.0885
verified: true
- name: ROUGE-2
type: rouge
value: 1.0325
verified: true
- name: ROUGE-L
type: rouge
value: 7.3182
verified: true
- name: ROUGE-LSUM
type: rouge
value: 8.1455
verified: true
- name: loss
type: loss
value: .nan
verified: true
- name: gen_len
type: gen_len
value: 210.4762
verified: true
- task:
type: summarization
name: Summarization
dataset:
name: xsum
type: xsum
config: default
split: test
metrics:
- name: ROUGE-1
type: rouge
value: 4.9787
verified: true
- name: ROUGE-2
type: rouge
value: 0.3527
verified: true
- name: ROUGE-L
type: rouge
value: 4.3679
verified: true
- name: ROUGE-LSUM
type: rouge
value: 4.1723
verified: true
- name: loss
type: loss
value: .nan
verified: true
- name: gen_len
type: gen_len
value: 230.4886
verified: true
- task:
type: summarization
name: Summarization
dataset:
name: scientific_papers
type: scientific_papers
config: arxiv
split: test
metrics:
- name: ROUGE-1
type: rouge
value: 43.4702
verified: true
- name: ROUGE-2
type: rouge
value: 17.4297
verified: true
- name: ROUGE-L
type: rouge
value: 26.2587
verified: true
- name: ROUGE-LSUM
type: rouge
value: 35.5587
verified: true
- name: loss
type: loss
value: 2.1113228797912598
verified: true
- name: gen_len
type: gen_len
value: 183.3702
verified: true
- task:
type: summarization
name: Summarization
dataset:
name: samsum
type: samsum
config: samsum
split: test
metrics:
- name: ROUGE-1
type: rouge
value: 3.621
verified: true
- name: ROUGE-2
type: rouge
value: 0.1699
verified: true
- name: ROUGE-L
type: rouge
value: 3.2016
verified: true
- name: ROUGE-LSUM
type: rouge
value: 3.3269
verified: true
- name: loss
type: loss
value: 7.664482116699219
verified: true
- name: gen_len
type: gen_len
value: 233.8107
verified: true
---

BigBirdPegasus model (large)

BigBird, is a sparse-attention based transformer which extends Transformer based models, such as BERT to much longer sequences. Moreover, BigBird comes along with a theoretical understanding of the capabilities of a complete transformer that the sparse model can handle.

BigBird was introduced in this paper and first released in this repository.

Disclaimer: The team releasing BigBird did not write a model card for this model so this model card has been written by the Hugging Face team.

Model description

BigBird relies on block sparse attention instead of normal attention (i.e. BERT's attention) and can handle sequences up to a length of 4096 at a much lower compute cost compared to BERT. It has achieved SOTA on various tasks involving very long sequences such as long documents summarization, question-answering with long contexts.

How to use

Here is how to use this model to get the features of a given text in PyTorch:

python
from transformers import BigBirdPegasusForConditionalGeneration, AutoTokenizer

tokenizer = AutoTokenizer.from_pretrained("google/bigbird-pegasus-large-arxiv")

by default encoder-attention is block_sparse with num_random_blocks=3, block_size=64

model = BigBirdPegasusForConditionalGeneration.from_pretrained("google/bigbird-pegasus-large-arxiv")

decoder attention type can't be changed & will be "original_full"

you can change attention_type (encoder only) to full attention like this:

model = BigBirdPegasusForConditionalGeneration.from_pretrained("google/bigbird-pegasus-large-arxiv", attention_type="original_full")

you can change block_size & num_random_blocks like this:

model = BigBirdPegasusForConditionalGeneration.from_pretrained("google/bigbird-pegasus-large-arxiv", block_size=16, num_random_blocks=2)

text = "Replace me by any text you'd like."
inputs = tokenizer(text, return_tensors='pt')
prediction = model.generate(inputs)
prediction = tokenizer.batch_decode(prediction)

Training Procedure

This checkpoint is obtained after fine-tuning BigBirdPegasusForConditionalGeneration for summarization on arxiv dataset** from scientific_papers.

BibTeX entry and citation info

tex
@misc{zaheer2021big,
      title={Big Bird: Transformers for Longer Sequences}, 
      author={Manzil Zaheer and Guru Guruganesh and Avinava Dubey and Joshua Ainslie and Chris Alberti and Santiago Ontanon and Philip Pham and Anirudh Ravula and Qifan Wang and Li Yang and Amr Ahmed},
      year={2021},
      eprint={2007.14062},
      archivePrefix={arXiv},
      primaryClass={cs.LG}
}
Join our Telegram