Research & News AI Summarizer is a fine-tuned Longformer Encoder-Decoder (LED) model optimized for abstractive summarization of long-form research articles and news content. It is trained using a custom 3-stage curriculum learning strategy across multiple versions of the CNN/DailyMail dataset, and is powered by the STAM (Stable Training with Adaptive Momentum) optimizer.
The model supports input sequences of up to 8,192 tokens (base configuration) or 16,384 tokens (large configuration), making it suitable for summarizing lengthy documents that exceed the context limits of standard transformer models.
This model is trained exclusively with the STAM optimizer, a next-generation adaptive momentum optimizer designed for stable convergence in large-scale NLP training.
STAM Optimizer
STAM dynamically adjusts first-momentum coefficients based on gradient alignment statistics, reducing training instability and improving generalization across long-context summarization tasks.
Effective Batch Size: 32 (1 per device x 16 gradient accumulation steps x 2 GPUs)
Total Training Time: ~26 hours
Seed: 42
Warmup Ratio: 3%
Max Gradient Norm: 1.0
Early Stopping Patience: 2 evaluations
Training Stages (Curriculum Learning)
Stage
Dataset Version
Train Samples
Max Steps
Eval Steps
Stage 1
CNN/DailyMail v1.0.0
50,000
1,562
500
Stage 2
CNN/DailyMail v2.0.0
30,000
937
500
Stage 3
CNN/DailyMail v3.0.0
30,000
937
500
Total
110,000
3,436
Training History
The model was trained over approximately 26 hours using the STAM optimizer with adaptive momentum. The training loss curve demonstrated stable convergence throughout all three curriculum stages.
Loss Progression:
Stage
Step Range
Initial Loss
Final Loss
Notes
Stage 1
1 - 1,562
2.82
1.74
Warmup completed at step 46. Loss stabilized after step 400.
Stage 2
1,563 - 2,499
1.68
1.45
Curriculum shift to v2.0.0 data. Minor spike at step 1,600 then smooth descent.
Stage 3
2,500 - 3,436
1.42
1.38
Final refinement on v3.0.0. Convergence reached by step 3,200.
Test Set Performance (CNN/DailyMail v3.0.0, 500 samples)
Metric
Score
ROUGE-1
43.82
ROUGE-2
20.65
ROUGE-L
40.28
ROUGE-Lsum
42.36
BERTScore Precision
91.24
BERTScore Recall
90.18
BERTScore F1
90.71
Avg Generation Length
142.3 tokens
Performance by Summary Length Bucket
Length Bucket
ROUGE-1
ROUGE-2
ROUGE-L
BERTScore F1
Short (0-80 words)
46.12
22.85
42.65
91.85
Medium (80-160 words)
44.38
21.20
40.94
90.92
Long (160-320 words)
41.25
18.45
38.12
89.45
Very Long (320+ words)
38.90
16.20
35.80
88.12
Usage
Quick Start
python
1from transformers import LEDForConditionalGeneration, LEDTokenizer
2import torch
34model = LEDForConditionalGeneration.from_pretrained(5"assemsabry/Research-News-AI-Summarizer"6)7tokenizer = LEDTokenizer.from_pretrained(8"assemsabry/Research-News-AI-Summarizer"9)1011article ="""
12Your long article text here. This model is designed to handle up to 8,192 tokens
13of input context, making it suitable for research papers, news articles, and
14other long-form content that exceeds the limits of standard BART or T5 models.
15"""1617inputs = tokenizer(18 article,19 max_length=8192,20 truncation=True,21 return_tensors="pt"22)2324# LED global attention mask: attend to the first token globally25global_attention_mask = torch.zeros_like(inputs["input_ids"])26global_attention_mask[:,0]=12728summary_ids = model.generate(29**inputs,30 global_attention_mask=global_attention_mask,31 max_length=512,32 min_length=64,33 num_beams=4,34 length_penalty=2.0,35 no_repeat_ngram_size=3,36 early_stopping=True,37)3839summary = tokenizer.decode(summary_ids[0], skip_special_tokens=True)40print(summary)
human_evaluation.csv: Generated summaries with per-sample ROUGE and BERTScore
error_analysis.csv: Length-based error analysis with ratio statistics
evaluation_stats.json: Aggregate metrics by length bucket
Testing
Run unit tests:
python -m unittest tests/test_model.py
Tests cover:
Text normalization and HTML stripping
Dataset validation (min/max word counts)
STAM and STAMLite optimizer initialization and step logic
Configuration defaults and effective batch size computation
Limitations and Biases
The model is trained exclusively on English news articles (CNN/DailyMail). Performance on non-English text or highly technical research papers outside the news domain may vary.
Summaries may inherit biases present in the original CNN/DailyMail dataset.
The model does not fact-check generated content. Hallucinations can occur on out-of-domain inputs.
Maximum input length is 8,192 tokens (base) or 16,384 tokens (large). Documents exceeding this length are truncated from the end.
License
Apache 2.0
Citation
If you use this model in your research, please cite:
bibtex
1@misc{research-news-ai-summarizer,
2 title={Research & News AI Summarizer: Fine-tuned LED with STAM Optimizer},
3 author={Sabry, Assem},
4 year={2025},
5 howpublished={\url{https://huggingface.co/assemsabry/Research-News-AI-Summarizer}}
6}