File size: 8,819 Bytes
80c1224
 
 
2d5b9af
80c1224
 
b308187
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6d51ed4
2d5b9af
 
80c1224
 
2d5b9af
 
 
 
 
 
 
 
 
 
80c1224
 
 
2d5b9af
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
80c1224
2d5b9af
80c1224
2d5b9af
 
 
6188e34
 
2d5b9af
 
 
80c1224
6188e34
80c1224
2d5b9af
 
 
 
 
 
 
 
 
 
 
 
e48f228
2d5b9af
 
 
 
 
 
 
 
 
 
80c1224
 
 
2d5b9af
 
 
 
 
80c1224
 
 
 
 
 
 
 
 
 
 
 
 
1ea7aae
80c1224
 
 
 
 
 
 
2d5b9af
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
---
tags:
- generated_from_trainer
- finance
model-index:
- name: completed-model
  results:
    - task:
        type: text-generation
      dataset:
        name: ai2_arc
        type: ai2_arc
      metrics:
        - name: AI2 Reasoning Challenge (25-Shot)
          type: AI2 Reasoning Challenge (25-Shot)
          value: 71.93
      source:
        name: Open LLM Leaderboard
        url: https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard
    - task:
        type: text-generation
      dataset:
        name: hellaswag
        type: hellaswag
      metrics:
        - name: HellaSwag (10-shot)
          type: HellaSwag (10-shot)
          value: 86.82
      source:
        name: Open LLM Leaderboard
        url: https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard
    - task:
        type: text-generation
      dataset:
        name: multiple
        type: miltiple
      metrics:
        - name: MMLU (5-shot)
          type: MMLU (5-shot)
          value: 70.38
      source:
        name: Open LLM Leaderboard
        url: https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard
    - task:
        type: text-generation
      dataset:
        name: truthful_qa
        type: truthful_qa
      metrics:
        - name: TruthfulQA (0-shot) 
          type: TruthfulQA (0-shot) 
          value: 65.21
      source:
        name: Open LLM Leaderboard
        url: https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard
    - task:
        type: text-generation
      dataset:
        name: winogrande
        type: winogrande
      metrics:
        - name: Winogrande (5-shot)
          type: Winogrande (5-shot)
          value: 83.58
      source:
        name: Open LLM Leaderboard
        url: https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard
    - task:
        type: text-generation
      dataset:
        name: gsm8k
        type: gsm8k
      metrics:
        - name: GSM8k (5-shot)
          type: GSM8k (5-shot)
          value: 61.79
      source:
        name: Open LLM Leaderboard
        url: https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard
license: llama2
language:
- en
---

**Albatross** is a collection of domain-specific language models for finance applications developed by [Gradient](https://gradient.ai/).

This is the repository for an early, limited capability version, the `v-alpha-tross`, designed to showcase performance on

- mathematical reasoning
- tabular understanding
- open-book retrieval (RAG) & summarization
- conversational interface

Release versions of Albatross models are additionally trained on proprietary implementations of the latest architecture augmentation, expanded training and alignment data, and target reduced hallucination at retrieval, improved auditability, and multi-hop reasoning. To inquire for access to release versions, please reach out to [[email protected]](mailto:[email protected])

## Model description

The `v-alpha-tross` model is based on [meta-llama/Llama-2-70b-hf](https://huggingface.co/meta-llama/Llama-2-70b-hf), with additional, finance specific, pre-training, fine-tuning and instruction tuning.

This model substantially outperforms Llama2-70B models on H6 Average score, and GSM8K, with similar performance to [mistralai/Mixtral-8x7B-Instruct-v0.1](https://huggingface.co/mistralai/Mixtral-8x7B-Instruct-v0.1). It also reaches `gpt-3.5-turbo` performance in extracting information from tabular data like those found in SEC filings.

## Intended use

The `v-alpha-tross` is intended as a demonstration of Gradient’s Albatross framework for developing large language models specific to the finance domain. We welcome additional research and development, but do not plan on continued internal development on this legacy model.

To get the expected performance, follow formatting requirements of *Llama-2 chat*, including `INST` and `<<SYS>>` tags, and `<s>` tokens.

## Training Strategy

The Albatross framework overcomes deficiencies in general-purpose language models that arise in the face of solving tasks in the finance domain.

Release versions of Albatross use an expanded data universe for extended capabilities.

### Pre-Training

A base Llama2-70B is further pre-trained on finance data since LLMs are poor at answering questions when their internal relevant document store is sparse [1].

To curate quality training data with low operational overhead we demo a novel data gathering approach:

1. Crawl public repositories of text data. For `v-alpha-tross`, we limited to [Red Pajamas](https://github.com/togethercomputer/RedPajama-Data) and https://github.com/.
2. Programmatically filter the crawled corpus to datasets not likely to be in the base model's training already, using a likelihood ratio test adapted from LiRA membership inference.[2]
3. Human finance professionals review the (much smaller) filtered corpus to further remove low quality results.

[1] Kandpal, Nikhil, et al. "Large language models struggle to learn long-tail knowledge." International Conference on Machine Learning. PMLR, 2023.

[2] Carlini, Nicholas, et al. "Membership inference attacks from first principles." 2022 IEEE Symposium on Security and Privacy (SP). IEEE, 2022.

### Fine-Tuning

Supervised fine-tuning (SFT) and direct preference optimization (DPO)[3] further enhances performance and alignment on finance-related tasks.

`v-alpha-tross` includes a subset of Albatross tuning goals: financial anchoring, mathematical reasoning, tabular understanding, conversational communication, summarization.

| Category | # Tokens (1Ms) | % of Total |
| --- | --- | --- |
| Chat (e.g. [ultrachat_200k](https://huggingface.co/datasets/HuggingFaceH4/ultrachat_200k)) | 640 | 45.2 |
| Alignment * (e.g. [orca_dpo](https://huggingface.co/datasets/Intel/orca_dpo_pairs)) | 331 | 23.4 |
| Math * (e.g. Goat[4]) | 300 | 21.2 |
| Tabular * | 68 | 4.8 |
| Summarization (e.g. [legal_summarization](https://huggingface.co/datasets/lighteval/legal_summarization)) | 52 | 3.7 |
| Open-book (e.g. [selfrag](https://huggingface.co/datasets/selfrag/selfrag_train_data)) | 25 | 1.8 |

(*) = Proprietary or includes proprietary data sets

[3] Rafailov, R., Sharma, A., Mitchell, E., Ermon, S., Manning, C.D. and Finn, C., 2023. Direct preference optimization: Your language model is secretly a reward model. NeurIPS.

[4] Liu, Tiedong, and Bryan Kian Hsiang Low. "Goat: Fine-tuned LLaMA Outperforms GPT-4 on Arithmetic Tasks." arXiv preprint arXiv:2305.14201 (2023).

## Benchmarks

From a Llama-2-70B base, `v-alpha-tross` improves H6 metrics, and in particular GSM8k (arithmetic reasoning), scoring similar to Mixtral-8x7B-Instruct-v0.1. Relative to a subset of Open LLM Leaderboard [4] models which also use Llama-2-70B as a base, the model achieves state of the art results for the Average H6 score.

On financial table understanding (our new metric) the model is on par with GPT-3.5.

| Model | H6 [4] | GSM8k | sec_tables_v1 |
| --- | --- | --- | --- |
| v-alpha-tross | 73.28 | 61.79 | 100.0 |
| meta-llama/Llama-2-70B-hf | 67.87 | 54.06 | 75.76 |
| meta-llama/Llama-2-70b-chat-hf | 62.40 | 26.69 | 87.88 |
| mistralai/Mixtral-8x7B-Instruct-v0.1 | 72.70 | 61.11 | 82.35 |
| GPT-3.5 | N/A | 57.1 [5] | 100.0 |

[4]
https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard

[5]
https://paperswithcode.com/sota/arithmetic-reasoning-on-gsm8k

## Training procedure

We develop Albatross on Gradient’s distributed training platform, leveraging leading open source toolsets and optimizations like [Axolotl](https://github.com/OpenAccess-AI-Collective/axolotl), [Accelerate](https://github.com/huggingface/accelerate), and [Deepspeed](https://github.com/microsoft/DeepSpeed) for high throughput and memory efficiency.

### Training hyperparameters (DPO)

The following hyperparameters were used during DPO training:

- learning_rate: 5e-07
- train_batch_size: 3
- eval_batch_size: 3
- seed: 42
- distributed_type: multi-GPU
- num_devices: 40
- total_train_batch_size: 120
- total_eval_batch_size: 120
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
- lr_scheduler_type: linear
- lr_scheduler_warmup_steps: 18
- num_epochs: 1
- dpo_beta: .1

### Framework versions

- Transformers 4.35.1
- Pytorch 2.0.1+cu118
- Datasets 2.14.7
- Tokenizers 0.14.1

## Bias

`v-alpha-tross` has not been specifically aligned for safety, so the model can produce problematic outputs (especially when prompted to do so). It is also subject to any risks of the corpus that was used to train the base Llama 2 models.

## More information & how to cite

Whitepaper coming soon!

## The Gradient AI Team

Gradient is accelerating AI transformation across industries. https://gradient.ai/

## Contact Us

Drop an email to [[email protected]](mailto:[email protected])