songrunhe commited on
Commit
aeddbcd
·
verified ·
1 Parent(s): fa58e4d

Upload folder using huggingface_hub

Browse files
.ipynb_checkpoints/config-checkpoint.json ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "answerdotai/ModernBERT-base",
3
+ "architectures": [
4
+ "ModernBertModel"
5
+ ],
6
+ "attention_bias": false,
7
+ "attention_dropout": 0.0,
8
+ "bos_token_id": 50281,
9
+ "classifier_activation": "gelu",
10
+ "classifier_bias": false,
11
+ "classifier_dropout": 0.0,
12
+ "classifier_pooling": "mean",
13
+ "cls_token_id": 50281,
14
+ "decoder_bias": true,
15
+ "deterministic_flash_attn": false,
16
+ "embedding_dropout": 0.0,
17
+ "eos_token_id": 50282,
18
+ "global_attn_every_n_layers": 3,
19
+ "global_rope_theta": 160000.0,
20
+ "gradient_checkpointing": false,
21
+ "hidden_activation": "gelu",
22
+ "hidden_size": 768,
23
+ "initializer_cutoff_factor": 2.0,
24
+ "initializer_range": 0.02,
25
+ "intermediate_size": 1152,
26
+ "layer_norm_eps": 1e-05,
27
+ "local_attention": 128,
28
+ "local_rope_theta": 10000.0,
29
+ "max_position_embeddings": 8192,
30
+ "mlp_bias": false,
31
+ "mlp_dropout": 0.0,
32
+ "model_type": "modernbert",
33
+ "norm_bias": false,
34
+ "norm_eps": 1e-05,
35
+ "num_attention_heads": 12,
36
+ "num_hidden_layers": 22,
37
+ "output_hidden_states": true,
38
+ "pad_token_id": 50283,
39
+ "position_embedding_type": "absolute",
40
+ "reference_compile": null,
41
+ "repad_logits_with_grad": false,
42
+ "sep_token_id": 50282,
43
+ "sparse_pred_ignore_index": -100,
44
+ "sparse_prediction": false,
45
+ "torch_dtype": "float32",
46
+ "transformers_version": "4.48.2",
47
+ "vocab_size": 50368
48
+ }
README.md ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Model Card for ChronoBERT
2
+
3
+ ## Model Details
4
+
5
+ ### Model Description
6
+
7
+ ChronoBERT is a series **high-performance chronologically consistent large language models (LLM)** designed to eliminate lookahead bias and training leakage while maintain good language understanding in time-sensitive applications. The model is pretrained on **diverse, high-quality, open-source, and timestamped text** to maintain chronological consistency.
8
+
9
+ All models in the series achieve **GLUE benchmark scores that surpass standard BERT.** This approach preserves the integrity of historical analysis and enables more reliable economic and financial modeling.
10
+
11
+ - **Developed by:** Songrun He, Linying Lv, Asaf Manela, Jimmy Wu
12
+ - **Model type:** Transformer-based bidirectional encoder (ModernBERT architecture)
13
+ - **Language(s) (NLP):** English
14
+ - **License:** MIT License
15
+
16
+ ### Model Sources
17
+
18
+ - **Paper:** "Chronologically Consistent Large Language Models" (He, Lv, Manela, Wu, 2025)
19
+
20
+ ## How to Get Started with the Model
21
+
22
+ ```python
23
+ from transformers import AutoTokenizer, AutoModel
24
+
25
+ tokenizer = AutoTokenizer.from_pretrained("manelalab/chronobert-v1-19991231")
26
+ model = AutoModel.from_pretrained("manelalab/chronobert-v1-19991231")
27
+
28
+ text = "You've gotta be very careful not to mess with the space-time continuum. -- Dr. Brown, Back to the Future"
29
+
30
+ inputs = tokenizer(text, return_tensors="pt")
31
+ outputs = model(**inputs)
32
+ ```
33
+
34
+ ## Training Details
35
+
36
+ ### Training Data
37
+
38
+ - **Pretraining corpus:** Our initial model $\text{ChronoBERT}_{1999}$ is pretrained on 460 billion tokens of pre-2000, diverse, high-quality, and open-source text data to ensure no leakage of data afterwards.
39
+ - **Incremental updates:** Yearly updates from 2000 to 2024 with an additional 65 billion tokens of timestamped text.
40
+
41
+ ### Training Procedure
42
+
43
+ - **Architecture:** ModernBERT-based model with rotary embeddings and flash attention.
44
+ - **Objective:** Masked token prediction.
45
+
46
+ ## Evaluation
47
+
48
+ ### Testing Data, Factors & Metrics
49
+
50
+ - **Language understanding:** Evaluated on **GLUE benchmark** tasks.
51
+ - **Financial forecasting:** Evaluated using **return prediction task** based on Dow Jones Newswire data.
52
+ - **Comparison models:** ChronoBERT was benchmarked against **BERT, FinBERT, StoriesLM-v1-1963, and Llama 3.1**.
53
+
54
+ ### Results
55
+
56
+ - **GLUE Score:** $\text{ChronoBERT}_{1999}$ and $\text{ChronoBERT}_{2024}$ achieved GLUE score of 84.71 and 85.54 respectively, outperforming BERT (84.52).
57
+ - **Stock return predictions:** During the sample from 2008-01 to 2023-07, $\text{ChronoBERT}_{\text{Realtime}}$ achieves a long-short portfolio **Sharpe ratio of 4.80**, outperforming BERT, FinBERT, and StoriesLM-v1-1963, and comparable to **Llama 3.1 8B (4.90)**.
58
+
59
+
60
+ ## Citation
61
+
62
+ ```
63
+ @article{He2025ChronoBERT,
64
+ title={Chronologically Consistent Large Language Models},
65
+ author={He, Songrun and Lv, Linying and Manela, Asaf and Wu, Jimmy},
66
+ journal={Working Paper},
67
+ year={2025}
68
+ }
69
+ ```
70
+
71
+ ## Model Card Authors
72
+
73
+ - Songrun He (Washington University in St. Louis, [email protected])
74
+ - Linying Lv (Washington University in St. Louis, [email protected])
75
+ - Asaf Manela (Washington University in St. Louis, [email protected])
76
+ - Jimmy Wu (Washington University in St. Louis, [email protected])
77
+
78
+
79
+