Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,100 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
library_name: pytorch
|
3 |
+
license: mit
|
4 |
+
language:
|
5 |
+
- en
|
6 |
+
tags:
|
7 |
+
- chronologically consistent
|
8 |
+
- modded-nanogpt
|
9 |
+
- hellaswag
|
10 |
+
pipeline_tag: text-generation
|
11 |
+
inference: false
|
12 |
+
---
|
13 |
+
# ChronoGPT
|
14 |
+
|
15 |
+
## Model Description
|
16 |
+
|
17 |
+
ChronoGPT is a series **high-performance chronologically consistent large language models (LLMs)** designed to eliminate lookahead bias and training leakage while maintaining good language understanding in time-sensitive applications. The model is pretrained on **diverse, high-quality, open-source, and timestamped text** to maintain chronological consistency.
|
18 |
+
|
19 |
+
All models in the series achieve **HellaSwag benchmark scores that surpass those of the GPT-2 124M model with the same parameter count.** This approach preserves the integrity of historical analysis and enables more reliable economic and financial modeling.
|
20 |
+
|
21 |
+
- **Developed by:** Songrun He, Linying Lv, Asaf Manela, Jimmy Wu
|
22 |
+
- **Model type:** Transformer-based autoregressive decoder (Modified modded-NanoGPT architecture)
|
23 |
+
- **Language(s) (NLP):** English
|
24 |
+
- **License:** MIT License
|
25 |
+
|
26 |
+
## Model Sources
|
27 |
+
|
28 |
+
- **Paper:** "Chronologically Consistent Large Language Models" (He, Lv, Manela, Wu, 2025)
|
29 |
+
|
30 |
+
## How to Get Started with the Model
|
31 |
+
|
32 |
+
The model is compatible with the `transformers` library starting from v4.48.0:
|
33 |
+
|
34 |
+
```sh
|
35 |
+
pip install -r requirements.txt
|
36 |
+
pip install --pre torch==2.7.0.dev20250110+cu126 --index-url https://download.pytorch.org/whl/nightly/cu126 --upgrade
|
37 |
+
```
|
38 |
+
|
39 |
+
Here is an example code of using the model:
|
40 |
+
|
41 |
+
```python
|
42 |
+
from modeling_chronogpt import ChronoGPT
|
43 |
+
import tiktoken
|
44 |
+
|
45 |
+
device = 'cuda:0'
|
46 |
+
max_length = 1792
|
47 |
+
|
48 |
+
tokenizer = tiktoken.get_encoding("gpt2")
|
49 |
+
model = ChronoGPT.from_pretrained("LinyingLyu/ChronoGPT", trust_remote_code=True).to(device)
|
50 |
+
|
51 |
+
text = "Obviously, the time continuum has been disrupted, creating a new temporal event sequence resulting in this alternate reality. -- Dr. Brown, Back to the Future Part II"
|
52 |
+
|
53 |
+
inputs = torch.tensor(tokenizer.encode(text))[:max_length].reshape(1,-1).to(device)
|
54 |
+
logits, emb = model(inputs)
|
55 |
+
```
|
56 |
+
|
57 |
+
## Training Details
|
58 |
+
|
59 |
+
### Training Data
|
60 |
+
|
61 |
+
- **Pretraining corpus:** Our initial model chrono-gpt-v1-19991231 is pretrained on 460 billion tokens of pre-2000, diverse, high-quality, and open-source text data to ensure no leakage of data afterwards.
|
62 |
+
- **Incremental updates:** Yearly updates from 2000 to 2024 with an additional 65 billion tokens of timestamped text.
|
63 |
+
|
64 |
+
### Training Procedure
|
65 |
+
|
66 |
+
- **Architecture:** modded NanoGPT-based model with the Muon optimizer, Skip connections, rotary embeddings and flex attention.
|
67 |
+
- **Objective:** Autoregressive text generation.
|
68 |
+
|
69 |
+
## Evaluation
|
70 |
+
|
71 |
+
### Testing Data, Factors & Metrics
|
72 |
+
|
73 |
+
- **Language understanding:** Evaluated on **HellaSwag benchmark** tasks.
|
74 |
+
- **Financial forecasting:** Evaluated using **return prediction task** based on Dow Jones Newswire data.
|
75 |
+
- **Comparison models:** ChronoGPT was benchmarked against **BERT, FinBERT, StoriesLM-v1-1963, and Llama 3.1**.
|
76 |
+
|
77 |
+
### Results
|
78 |
+
|
79 |
+
- **HellaSwag Score:** chrono-gpt-v1-19991231 and chrono-gpt-v1-20241231 achieved HellaSwag score of 0.295 and 0.324 respectively, outperforming GPT-2 (0.294).
|
80 |
+
- **Stock return predictions:** During the sample from 2008-01 to 2023-07, chrono-gpt-v1-realtime achieves a long-short portfolio **Sharpe ratio of 4.50**, outperforming BERT, FinBERT, and StoriesLM-v1-1963, and comparable to **Llama 3.1 8B (4.90)**.
|
81 |
+
|
82 |
+
|
83 |
+
## Citation
|
84 |
+
|
85 |
+
```
|
86 |
+
@article{He2025ChronoBERT,
|
87 |
+
title={Chronologically Consistent Large Language Models},
|
88 |
+
author={He, Songrun and Lv, Linying and Manela, Asaf and Wu, Jimmy},
|
89 |
+
journal={Working Paper},
|
90 |
+
year={2025}
|
91 |
+
}
|
92 |
+
```
|
93 |
+
|
94 |
+
## Model Card Authors
|
95 |
+
|
96 |
+
- Songrun He (Washington University in St. Louis, [email protected])
|
97 |
+
- Linying Lv (Washington University in St. Louis, [email protected])
|
98 |
+
- Asaf Manela (Washington University in St. Louis, [email protected])
|
99 |
+
- Jimmy Wu (Washington University in St. Louis, [email protected])
|
100 |
+
|