# "Initializing global attention on CLS token" on Longformer Training

**URL:** <https://discuss.huggingface.co/t/initializing-global-attention-on-cls-token-on-longformer-training/10601>\
**Category:** Beginners\
**Created:** [October 7, 2021, 7:23pm UTC](https://discuss.huggingface.co/t/initializing-global-attention-on-cls-token-on-longformer-training/10601 "2021-10-07T19:23:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rosenjcb](https://avatars.discourse-cdn.com/v4/letter/r/e79b87/32.png) [@rosenjcb](https://discuss.huggingface.co/u/rosenjcb)\
**Post date:** [October 7, 2021, 7:23pm UTC](https://discuss.huggingface.co/t/initializing-global-attention-on-cls-token-on-longformer-training/10601/1 "2021-10-07T19:23:26Z")

</div>

I have this text classification task that follows the `mnli` `run_glue.py` task. The premise is a text that is on average 2k tokens long and the hypothesis is a text that is 200 tokens long. The labels remain the same (0 for entailment, 1 for neutral, 2 for contradiction). I set the train and eval batch size to 1 as anything other than that maxed out my 16 gig vram sagemaker card and I did the training job. It’s been around 2 hours now and I keep seeing the `Initializing global attention on CLS token` message. Not even sure if the model has even started the epoch yet. For context here are my hyper parameters:

```auto
hyperparameters={'model_name_or_path': 'allenai/longformer-base-4096',
                 'task_name': 'mnli',
                 'max_seq_length': 4096,
                 'do_train': True,
                 'do_eval': True,
                 'per_device_train_batch_size': 1,
                 'per_device_eval_batch_size': 1,
                 'output_dir': '/opt/ml/model',
                 'learning_rate': 2e-5,
                 'max_steps': 500,
                 'num_train_epochs': 3}

```

I have experience training on transformers before but usually with a model like albert. I’ve never done Longformers so I want to know if I should be prepared to wait longer than a day or two.

---

<div class="post-metadata">

**Author:** ![rosenjcb](https://avatars.discourse-cdn.com/v4/letter/r/e79b87/32.png) [@rosenjcb](https://discuss.huggingface.co/u/rosenjcb)\
**Post date:** [October 7, 2021, 7:46pm UTC](https://discuss.huggingface.co/t/initializing-global-attention-on-cls-token-on-longformer-training/10601/2 "2021-10-07T19:46:25Z")

</div>

Oh thank goodness, the output stated showing training iterations. 😂
