Crystalcareai commited on
Commit
dff69df
1 Parent(s): b6f440f

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +124 -0
README.md ADDED
@@ -0,0 +1,124 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language: en
3
+ license: llama3
4
+ tags:
5
+ - large_language_model
6
+ - finance
7
+ - sec_data
8
+ - continual_pre_training
9
+ datasets:
10
+ - SEC_filings
11
+ ---
12
+
13
+ <img src="https://i.ibb.co/kHtBmDN/w8m6-X4-HCQRa-IR86ar-Cm5gg.webp" width="600" />
14
+
15
+ # Llama-3-SEC: A Domain-Specific Chat Agent for SEC Data Analysis
16
+
17
+ Llama-3-SEC is a state-of-the-art domain-specific large language model trained on a vast corpus of SEC (Securities and Exchange Commission) data. Built upon the powerful Meta-Llama-3-70B-Instruct model, Llama-3-SEC has been developed to provide unparalleled insights and analysis capabilities for financial professionals, investors, researchers, and anyone working with SEC filings and related financial data.
18
+
19
+ ## Model Details
20
+
21
+ - **Base Model:** Meta-Llama-3-70B-Instruct
22
+ - **Training Data:** 19B tokens of SEC filings data, carefully mixed with 1B tokens of general data from Together AI's RedPajama dataset: [RedPajama-Data-1T](https://huggingface.co/datasets/togethercomputer/RedPajama-Data-1T) to maintain a balance between domain-specific knowledge and general language understanding
23
+ - **Training Method:** Continual Pre-Training (CPT) using the Megatron-Core framework, followed by model merging with the base model using the state-of-the-art TIES merging technique in the Arcee Mergekit toolkit
24
+ - **Training Infrastructure:** AWS SageMaker HyperPod cluster with 4 nodes, each equipped with 32 H100 GPUs, ensuring efficient and scalable training of this massive language model
25
+
26
+ ## Use Cases
27
+
28
+ Llama-3-SEC is designed to assist with a wide range of tasks related to SEC data analysis, including but not limited to:
29
+
30
+ - In-depth investment analysis and decision support
31
+ - Comprehensive risk management and assessment
32
+ - Ensuring regulatory compliance and identifying potential violations
33
+ - Studying corporate governance practices and promoting transparency
34
+ - Conducting market research and tracking industry trends
35
+
36
+ The model's deep understanding of SEC filings and related financial data makes it an invaluable tool for anyone working in the financial sector, providing powerful natural language processing capabilities tailored to the specific needs of this domain.
37
+
38
+ ## Evaluation
39
+
40
+ To ensure the robustness and effectiveness of Llama-3-SEC, the model has undergone rigorous evaluation on both domain-specific and general benchmarks. Key evaluation metrics include:
41
+
42
+ - Domain-specific perplexity, measuring the model's performance on SEC-related data
43
+
44
+ <img src="https://i.ibb.co/K5d0wMh/Screenshot-2024-06-11-at-10-23-18-PM.png" width="600">
45
+
46
+ - Extractive numerical reasoning tasks, using subsets of TAT-QA and ConvFinQA datasets
47
+
48
+ <img src="https://i.ibb.co/xGHRfLf/Screenshot-2024-06-11-at-10-23-59-PM.png" width="600">
49
+
50
+ - General evaluation metrics, such as BIG-bench, AGIEval, GPT4all, and TruthfulQA, to assess the model's performance on a wide range of tasks
51
+
52
+ <img src="https://i.ibb.co/2v6PdDx/Screenshot-2024-06-11-at-10-25-03-PM.png" width="600">
53
+
54
+ These results demonstrate significant improvements in domain-specific performance while maintaining strong general capabilities, thanks to the use of advanced CPT and model merging techniques.
55
+
56
+ ## Training and Inference
57
+
58
+ Llama-3-SEC has been trained using the llama3 chat template, which allows for efficient and effective fine-tuning of the model on the SEC data. This template ensures that the model maintains its strong conversational abilities while incorporating the domain-specific knowledge acquired during the CPT process.
59
+
60
+ To run inference with the Llama-3-SEC model using the llama3 chat template, use the following code:
61
+
62
+ ```python
63
+ from transformers import AutoModelForCausalLM, AutoTokenizer
64
+ device = "cuda"
65
+
66
+ model_name = "arcee-ai/Llama-3-SEC"
67
+
68
+ model = AutoModelForCausalLM.from_pretrained(
69
+ model_name,
70
+ torch_dtype="auto",
71
+ device_map="auto"
72
+ )
73
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
74
+
75
+ prompt = "What are the key regulatory considerations for a company planning to conduct an initial public offering (IPO) in the United States?"
76
+ messages = [
77
+ {"role": "system", "content": "You are an expert financial assistant - specializing in governance and regulatory domains."},
78
+ {"role": "user", "content": prompt}
79
+ ]
80
+ text = tokenizer.apply_chat_template(
81
+ messages,
82
+ tokenize=False,
83
+ add_generation_prompt=True
84
+ )
85
+ model_inputs = tokenizer([text], return_tensors="pt").to(device)
86
+
87
+ generated_ids = model.generate(
88
+ model_inputs.input_ids,
89
+ max_new_tokens=512
90
+ )
91
+ generated_ids = [
92
+ output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
93
+ ]
94
+
95
+ response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
96
+ ```
97
+
98
+ ## Limitations and Future Work
99
+
100
+ This release represents the initial checkpoint of the Llama-3-SEC model, trained on 20B tokens of SEC data. Additional checkpoints will be released in the future as training on the full 70B token dataset is completed. Future work will focus on further improvements to the CPT data processing layer, exploration of advanced model merging techniques, and alignment of CPT models with SFT, DPO, and other cutting-edge alignment methods to further enhance the model's performance and reliability.
101
+
102
+ ## Usage
103
+
104
+ The model is available for both commercial and non-commercial use under the Llama-3 license. We encourage users to explore the model's capabilities and provide feedback to help us continuously improve its performance and usability. For more information - please see our detailed blog on Llama-3-SEC.
105
+
106
+ **Note:** We trained Llama-3-SEC to be very compliant with system prompts. We have included a default system prompt, but if you wish to tailor answers to what your specific use case is, creating a system prompt that outlines your desired behavior is recommended.
107
+
108
+ **Disclaimer:** Llama-3-SEC is a large language model (LLM) designed to assist with SEC data analysis. Users are solely responsible for any actions taken as a result of using Llama-3-SEC. Always double-check model responses.
109
+
110
+ ## Citation
111
+
112
+ If you use this model in your research or applications, please cite:
113
+
114
+ ```bibtex
115
+ @misc{Introducing_SEC_Data_Chat_Agent,
116
+ title={Introducing the Ultimate SEC Data Chat Agent: Revolutionizing Financial Insights},
117
+ author={Shamane Siriwardhana and Luke Mayers and Thomas Gauthier and Jacob Solawetz and Tyler Odenthal and Anneketh Vij and Lucas Atkins and Charles Goddard and Mary MacCarthy and Mark McQuade},
118
+ year={2024},
119
+ note={Available at: \url{firstname@arcee.ai}},
120
+ url={URL after published}
121
+ }
122
+ ```
123
+
124
+ For further information or inquiries, please contact the authors at their respective email addresses (firstname@arcee.ai). We look forward to seeing the exciting applications and research that will emerge from the use of Llama-3-SEC in the financial domain.