---
title: longformer-base-4096
canonical_url: "https://www.modelscope.cn/models/LLM-Research/longformer-base-4096"
md_url: "https://www.modelscope.cn/models/LLM-Research/longformer-base-4096.md"
repository: LLM-Research/longformer-base-4096
last_updated: 2024-09-08
license: apache-2.0
model_type:
  - longformer
library_name:
  - tensorflow
  - pytorch
frameworks:
  - pytorch
language:
  - en
downloads: 2276
stars: 0
---

# longformer-base-4096

> longformer-base-4096 - LLM-Research 在 ModelScope 开源的模型。longformer-base-4096 Longformer is a transformer model for long documents.

LLM-Research/longformer-base-4096 是 ModelScope 魔搭社区上的机器学习模型，采用 apache-2.0 许可。

- **Repository**: LLM-Research/longformer-base-4096
- **License**: apache-2.0
- **Downloads**: 2276
- **Stars**: 0
- **Last updated**: 2024-09-08

Source: https://www.modelscope.cn/models/LLM-Research/longformer-base-4096

---

# longformer-base-4096
[Longformer](https://arxiv.org/abs/2004.05150) is a transformer model for long documents. 

`longformer-base-4096` is a BERT-like model started from the RoBERTa checkpoint and pretrained for MLM on long documents. It supports sequences of length up to 4,096. 
 
Longformer uses a combination of a sliding window (local) attention and global attention. Global attention is user-configured based on the task to allow the model to learn task-specific representations.
Please refer to the examples in `modeling_longformer.py` and the paper for more details on how to set global attention.


### Citing

If you use `Longformer` in your research, please cite [Longformer: The Long-Document Transformer](https://arxiv.org/abs/2004.05150).
```
@article{Beltagy2020Longformer,
  title={Longformer: The Long-Document Transformer},
  author={Iz Beltagy and Matthew E. Peters and Arman Cohan},
  journal={arXiv:2004.05150},
  year={2020},
}
```

`Longformer` is an open-source project developed by [the Allen Institute for Artificial Intelligence (AI2)](http://www.allenai.org).
AI2 is a non-profit institute with the mission to contribute to humanity through high-impact AI research and engineering.
