Safetensors
llama
evanfrick commited on
Commit
709d2bc
·
1 Parent(s): 0b9b0c5

commit files to HF hub

Browse files
README.md ADDED
@@ -0,0 +1,228 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # lmarena-ai/p2l-360m-grk-01112025
2
+
3
+ Large language model (LLM) evaluations typically rely on aggregated metrics like accuracy or human preference, averaging across users and prompts. This averaging obscures user- and prompt-specific variations in model performance.
4
+ To address this, we propose Prompt-to-Leaderboard (P2L), a method that produces leaderboards specific to a prompt.
5
+ The core idea is to train an LLM taking natural language prompts as input to output a vector of coefficients which are then used to predict the human preference vote.
6
+ The resulting prompt-dependent leaderboards allow for unsupervised task-specific evaluation, optimal routing of queries to models, personalization, and automated evaluation of model strengths and weaknesses.
7
+ Data from Chatbot Arena suggest that P2L better captures the nuanced landscape of language model performance than the averaged leaderboard.
8
+
9
+ **Paper**: [Prompt-to-Leaderboard](https://arxiv.org/abs/2502.14855)
10
+
11
+ **Code**: [lmarena/p2l](https://github.com/lmarena/p2l)
12
+
13
+ This particular P2L model has a *Grounded Rao-Kupper* regression head, which we define below:
14
+
15
+ Let
16
+ $$
17
+ Y\in \{\mathsf{A}, \mathsf{B}, \mathsf{tie}, \mathsf{bad}\}
18
+ $$
19
+ and for the sake of notational convenience, let
20
+ $$
21
+ \theta^*(z) = \big(\beta^*(z), \eta^*(z)\big); \ \beta^*(z) \in \mathbb{R}^M, \eta^*(z) \in \mathbb{R}_{\geq 1}\}
22
+ $$
23
+
24
+ For notational convenience, we define:
25
+ $$
26
+ \varphi^*(z)_i := \exp(\beta^*(z)_i)
27
+ $$
28
+
29
+ Then grounded Rao-Kupper model is defined as:
30
+ $$
31
+ g_{\theta^*(z)}(y ; x) =
32
+ \begin{cases}
33
+ \frac{\varphi^*(z)_A}{\varphi^*(z)_A + \eta^*(z)\varphi^*(z)_B + 1} & y = \mathsf{A} \\
34
+ \frac{\varphi^*(z)_B}{\varphi^*(z)_B + \eta^*(z)\varphi^*(z)_A + 1} & y = \mathsf{B}\\
35
+ \frac{1}{1 + \varphi^*(z)_A + \varphi^*(z)_B} & y = \mathsf{bad}\\
36
+ 1 - \frac{\varphi^*(z)_A}{\varphi^*(z)_A + \eta^*(z)\varphi^*(z)_B + 1} - \frac{\varphi^*(z)_B}{\varphi^*(z)_B + \eta^*(z)\varphi^*(z)_A + 1} - \frac{1}{1 + \varphi^*(z)_A + \varphi^*(z)_B} & y = \mathsf{tie}.
37
+ \end{cases}
38
+ $$
39
+
40
+ See section 2.2 in our paper for more details on various regression heads.
41
+
42
+ ## Serving
43
+ To serve a P2L model, please see our documentation on GitHub: [Serving P2L](https://github.com/lmarena/p2l?tab=readme-ov-file#serving-p2l).
44
+
45
+ Note: the P2L model outputs with this structure:
46
+
47
+
48
+ ```python
49
+ class P2LOutputs(ModelOutput):
50
+ coefs: torch.FloatTensor = None # "betas" as described above
51
+ eta: Optional[torch.FloatTensor] = None # tie coefficent (also eta above)
52
+ last_hidden_state: torch.FloatTensor = None # last hidden state from the transformer
53
+ ```
54
+
55
+ To understand which coefficient index corresponds with which model, see the [`model_list.json`](./model_list.json) found in the repo of each P2L model. As a general rule, the models will always be in sorted order.
56
+
57
+ The easiest way to get this list from inside code is with the following:
58
+
59
+ ```python
60
+ import json
61
+ from huggingface_hub import hf_hub_download
62
+
63
+ fname = hf_hub_download(
64
+ repo_id="lmarena-ai/p2l-360m-grk-01112025", filename="model_list.json", repo_type="model"
65
+ )
66
+
67
+ with open(fname) as fin:
68
+ model_list = json.load(fin)
69
+ ```
70
+
71
+
72
+
73
+ ### Loading from Pretrained
74
+
75
+ To define and load the model:
76
+
77
+ ```python
78
+
79
+ import torch
80
+ from transformers import (
81
+ Qwen2Model,
82
+ Qwen2PreTrainedModel,
83
+ LlamaModel,
84
+ LlamaPreTrainedModel,
85
+ PreTrainedModel,
86
+ AutoTokenizer,
87
+ )
88
+ from transformers import AutoTokenizer
89
+ from transformers.utils import ModelOutput
90
+ from dataclasses import dataclass
91
+ import torch.nn as nn
92
+ import torch.nn.functional as F
93
+ from typing import Dict, Tuple, Callable, Optional
94
+ from huggingface_hub import hf_hub_download
95
+ import json
96
+
97
+
98
+ @dataclass
99
+ class HeadOutputs(ModelOutput):
100
+ coefs: torch.FloatTensor = None
101
+ eta: Optional[torch.FloatTensor] = None
102
+ gamma: Optional[torch.FloatTensor] = None
103
+
104
+
105
+ @dataclass
106
+ class P2LOutputs(ModelOutput):
107
+ coefs: torch.FloatTensor = None
108
+ eta: Optional[torch.FloatTensor] = None
109
+ gamma: Optional[torch.FloatTensor] = None
110
+ loss: Optional[torch.FloatTensor] = None
111
+ last_hidden_state: torch.FloatTensor = None
112
+
113
+ class RKHead(nn.Module):
114
+ def __init__(
115
+ self,
116
+ input_dim,
117
+ output_dim,
118
+ **kwargs,
119
+ ) -> None:
120
+ super().__init__()
121
+ self.head = nn.Linear(
122
+ in_features=input_dim, out_features=output_dim, bias=True
123
+ )
124
+ self.eta_head = nn.Linear(
125
+ in_features=input_dim, out_features=1, bias=True
126
+ )
127
+
128
+ def forward(self, last_hidden_dim: torch.Tensor):
129
+ coefs = self.head(last_hidden_dim)
130
+ eta = self.eta_head(last_hidden_dim)
131
+
132
+ return HeadOutputs(coefs=coefs, eta=eta)
133
+
134
+ class P2LModel(LlamaPreTrainedModel):
135
+ def __init__(
136
+ self,
137
+ config,
138
+ CLS_id,
139
+ num_models,
140
+ head_kwargs={},
141
+ **kwargs,
142
+ ):
143
+ super().__init__(config)
144
+
145
+ self.num_models = num_models
146
+ self.cls_token_id = CLS_id
147
+
148
+ self.model = LlamaModel(config)
149
+
150
+ self.head = RKHead(
151
+ input_dim=config.hidden_size,
152
+ output_dim=self.num_models,
153
+ **head_kwargs,
154
+ )
155
+
156
+ self.post_init()
157
+
158
+ def freeze_transformer(self):
159
+ for param in self.model.parameters():
160
+ param.requires_grad = False
161
+
162
+ def get_input_embeddings(self):
163
+ return self.model.embed_tokens
164
+
165
+ def set_input_embeddings(self, value):
166
+ self.model.embed_tokens = value
167
+
168
+ def forward(self, input_ids, attention_mask, labels=None, weights=None):
169
+ batch_size = input_ids.shape[0]
170
+
171
+ hidden_outputs = self.model(
172
+ input_ids=input_ids,
173
+ attention_mask=attention_mask,
174
+ output_hidden_states=False,
175
+ ).last_hidden_state # (bs, num_token, embed_dim)
176
+
177
+ cls_mask = input_ids == self.cls_token_id
178
+
179
+ # double check this is getting the current CLS token
180
+ cls_hidden_dim = hidden_outputs[cls_mask]
181
+
182
+ assert (
183
+ cls_hidden_dim.shape[0] == batch_size
184
+ ), f"input ids {input_ids.shape}, cls_mask {cls_mask.shape}, cls_logit {cls_hidden_dim.shape}"
185
+
186
+ head_output = self.head(cls_hidden_dim)
187
+
188
+
189
+ outputs = P2LOutputs(
190
+ coefs=head_output.coefs,
191
+ last_hidden_state=cls_hidden_dim,
192
+ eta=head_output.eta,
193
+ gamma=head_output.gamma,
194
+ )
195
+
196
+ return outputs
197
+
198
+
199
+ fname = hf_hub_download(
200
+ repo_id="lmarena-ai/p2l-360m-grk-01112025", filename="model_list.json", repo_type="model"
201
+ )
202
+
203
+ with open(fname) as fin:
204
+ model_list = json.load(fin)
205
+
206
+ tokenizer = AutoTokenizer.from_pretrained("lmarena-ai/p2l-360m-grk-01112025")
207
+ model = P2LModel.from_pretrained(
208
+ "lmarena-ai/p2l-360m-grk-01112025",
209
+ CLS_id=tokenizer.cls_token_id,
210
+ num_models=len(model_list),
211
+ torch_dtype=torch.bfloat16,
212
+ )
213
+
214
+ ```
215
+
216
+ ## Citation
217
+
218
+ ```
219
+ @misc{frick2025prompttoleaderboard,
220
+ title={Prompt-to-Leaderboard},
221
+ author={Evan Frick and Connor Chen and Joseph Tennyson and Tianle Li and Wei-Lin Chiang and Anastasios N. Angelopoulos and Ion Stoica},
222
+ year={2025},
223
+ eprint={2502.14855},
224
+ archivePrefix={arXiv},
225
+ primaryClass={cs.LG},
226
+ url={https://arxiv.org/abs/2502.14855},
227
+ }
228
+ ```
added_tokens.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ {
2
+ "<|cls|>": 49152
3
+ }
config.json ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "HuggingFaceTB/SmolLM2-360M-Instruct",
3
+ "architectures": [
4
+ "P2LModel"
5
+ ],
6
+ "attention_bias": false,
7
+ "attention_dropout": 0.0,
8
+ "bos_token_id": 1,
9
+ "eos_token_id": 2,
10
+ "head_dim": 64,
11
+ "hidden_act": "silu",
12
+ "hidden_size": 960,
13
+ "initializer_range": 0.02,
14
+ "intermediate_size": 2560,
15
+ "is_llama_config": true,
16
+ "max_position_embeddings": 8192,
17
+ "mlp_bias": false,
18
+ "model_type": "llama",
19
+ "num_attention_heads": 15,
20
+ "num_hidden_layers": 32,
21
+ "num_key_value_heads": 5,
22
+ "pad_token_id": 2,
23
+ "pretraining_tp": 1,
24
+ "rms_norm_eps": 1e-05,
25
+ "rope_interleaved": false,
26
+ "rope_scaling": null,
27
+ "rope_theta": 100000,
28
+ "tie_word_embeddings": true,
29
+ "torch_dtype": "bfloat16",
30
+ "transformers.js_config": {
31
+ "kv_cache_dtype": {
32
+ "fp16": "float16",
33
+ "q4f16": "float16"
34
+ }
35
+ },
36
+ "transformers_version": "4.47.1",
37
+ "use_cache": true,
38
+ "vocab_size": 49153
39
+ }
merges.txt ADDED
The diff for this file is too large to render. See raw diff
 
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6472f1007af72c4a61ba2063f2a9517bf2ecb1f9a12e9b7f0dece3c286e7405f
3
+ size 723928926
model_list.json ADDED
@@ -0,0 +1,132 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ "amazon-nova-lite-v1.0",
3
+ "amazon-nova-micro-v1.0",
4
+ "amazon-nova-pro-v1.0",
5
+ "athene-70b-0725",
6
+ "athene-v2-chat",
7
+ "c4ai-aya-expanse-32b",
8
+ "c4ai-aya-expanse-8b",
9
+ "chatgpt-4o-latest-20240808",
10
+ "chatgpt-4o-latest-20240903",
11
+ "chatgpt-4o-latest-20241120",
12
+ "claude-3-5-haiku-20241022",
13
+ "claude-3-5-sonnet-20240620",
14
+ "claude-3-5-sonnet-20241022",
15
+ "claude-3-haiku-20240307",
16
+ "claude-3-opus-20240229",
17
+ "claude-3-sonnet-20240229",
18
+ "codestral-2405",
19
+ "command-r",
20
+ "command-r-08-2024",
21
+ "command-r-plus",
22
+ "command-r-plus-08-2024",
23
+ "dbrx-instruct-preview",
24
+ "deepseek-coder-v2",
25
+ "deepseek-coder-v2-0724",
26
+ "deepseek-v2-api-0628",
27
+ "deepseek-v2.5",
28
+ "deepseek-v2.5-1210",
29
+ "deepseek-v3",
30
+ "gemini-1.5-flash-001",
31
+ "gemini-1.5-flash-002",
32
+ "gemini-1.5-flash-8b-001",
33
+ "gemini-1.5-flash-8b-exp-0827",
34
+ "gemini-1.5-flash-exp-0827",
35
+ "gemini-1.5-pro-001",
36
+ "gemini-1.5-pro-002",
37
+ "gemini-1.5-pro-api-0409-preview",
38
+ "gemini-1.5-pro-exp-0801",
39
+ "gemini-1.5-pro-exp-0827",
40
+ "gemini-2.0-flash-exp",
41
+ "gemini-2.0-flash-thinking-exp-1219",
42
+ "gemini-advanced-0514",
43
+ "gemini-exp-1114",
44
+ "gemini-exp-1121",
45
+ "gemini-exp-1206",
46
+ "gemma-1.1-2b-it",
47
+ "gemma-1.1-7b-it",
48
+ "gemma-2-27b-it",
49
+ "gemma-2-2b-it",
50
+ "gemma-2-9b-it",
51
+ "gemma-2-9b-it-simpo",
52
+ "glm-4-0116",
53
+ "glm-4-0520",
54
+ "glm-4-plus",
55
+ "gpt-3.5-turbo-0125",
56
+ "gpt-4-0125-preview",
57
+ "gpt-4-0314",
58
+ "gpt-4-0613",
59
+ "gpt-4-1106-preview",
60
+ "gpt-4-turbo-2024-04-09",
61
+ "gpt-4o-2024-05-13",
62
+ "gpt-4o-2024-08-06",
63
+ "gpt-4o-mini-2024-07-18",
64
+ "granite-3.0-2b-instruct",
65
+ "granite-3.0-8b-instruct",
66
+ "grok-2-2024-08-13",
67
+ "grok-2-mini-2024-08-13",
68
+ "hunyuan-standard-256k",
69
+ "internlm2_5-20b-chat",
70
+ "jamba-1.5-large",
71
+ "jamba-1.5-mini",
72
+ "llama-2-13b-chat",
73
+ "llama-2-70b-chat",
74
+ "llama-3-70b-instruct",
75
+ "llama-3-8b-instruct",
76
+ "llama-3.1-405b-instruct-bf16",
77
+ "llama-3.1-405b-instruct-fp8",
78
+ "llama-3.1-70b-instruct",
79
+ "llama-3.1-8b-instruct",
80
+ "llama-3.1-nemotron-51b-instruct",
81
+ "llama-3.1-nemotron-70b-instruct",
82
+ "llama-3.1-tulu-3-70b",
83
+ "llama-3.1-tulu-3-8b",
84
+ "llama-3.2-1b-instruct",
85
+ "llama-3.2-3b-instruct",
86
+ "llama-3.3-70b-instruct",
87
+ "ministral-8b-2410",
88
+ "mistral-7b-instruct-v0.2",
89
+ "mistral-large-2402",
90
+ "mistral-large-2407",
91
+ "mistral-large-2411",
92
+ "mistral-medium",
93
+ "mixtral-8x22b-instruct-v0.1",
94
+ "mixtral-8x7b-instruct-v0.1",
95
+ "nemotron-4-340b-instruct",
96
+ "o1-2024-12-17",
97
+ "o1-mini",
98
+ "o1-preview",
99
+ "phi-3-medium-4k-instruct",
100
+ "phi-3-mini-128k-instruct",
101
+ "phi-3-mini-4k-instruct",
102
+ "phi-3-mini-4k-instruct-june-2024",
103
+ "phi-3-small-8k-instruct",
104
+ "qwen-max-0428",
105
+ "qwen-max-0919",
106
+ "qwen-plus-0828",
107
+ "qwen1.5-110b-chat",
108
+ "qwen1.5-14b-chat",
109
+ "qwen1.5-32b-chat",
110
+ "qwen1.5-72b-chat",
111
+ "qwen2-72b-instruct",
112
+ "qwen2.5-72b-instruct",
113
+ "qwen2.5-coder-32b-instruct",
114
+ "qwen2.5-plus-1127",
115
+ "qwq-32b-preview",
116
+ "reka-core-20240501",
117
+ "reka-core-20240722",
118
+ "reka-core-20240904",
119
+ "reka-flash-20240722",
120
+ "reka-flash-20240904",
121
+ "reka-flash-21b-20240226",
122
+ "reka-flash-21b-20240226-online",
123
+ "reka-flash-preview-20240611",
124
+ "smollm2-1.7b-instruct",
125
+ "snowflake-arctic-instruct",
126
+ "yi-1.5-34b-chat",
127
+ "yi-34b-chat",
128
+ "yi-large",
129
+ "yi-large-preview",
130
+ "yi-lightning",
131
+ "yi-lightning-lite"
132
+ ]
special_tokens_map.json ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "additional_special_tokens": [
3
+ "<|im_start|>",
4
+ "<|im_end|>"
5
+ ],
6
+ "bos_token": {
7
+ "content": "<|im_start|>",
8
+ "lstrip": false,
9
+ "normalized": false,
10
+ "rstrip": false,
11
+ "single_word": false
12
+ },
13
+ "cls_token": {
14
+ "content": "<|cls|>",
15
+ "lstrip": false,
16
+ "normalized": false,
17
+ "rstrip": false,
18
+ "single_word": false
19
+ },
20
+ "eos_token": {
21
+ "content": "<|im_end|>",
22
+ "lstrip": false,
23
+ "normalized": false,
24
+ "rstrip": false,
25
+ "single_word": false
26
+ },
27
+ "pad_token": {
28
+ "content": "<|im_end|>",
29
+ "lstrip": false,
30
+ "normalized": false,
31
+ "rstrip": false,
32
+ "single_word": false
33
+ },
34
+ "unk_token": {
35
+ "content": "<|endoftext|>",
36
+ "lstrip": false,
37
+ "normalized": false,
38
+ "rstrip": false,
39
+ "single_word": false
40
+ }
41
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,164 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": false,
3
+ "added_tokens_decoder": {
4
+ "0": {
5
+ "content": "<|endoftext|>",
6
+ "lstrip": false,
7
+ "normalized": false,
8
+ "rstrip": false,
9
+ "single_word": false,
10
+ "special": true
11
+ },
12
+ "1": {
13
+ "content": "<|im_start|>",
14
+ "lstrip": false,
15
+ "normalized": false,
16
+ "rstrip": false,
17
+ "single_word": false,
18
+ "special": true
19
+ },
20
+ "2": {
21
+ "content": "<|im_end|>",
22
+ "lstrip": false,
23
+ "normalized": false,
24
+ "rstrip": false,
25
+ "single_word": false,
26
+ "special": true
27
+ },
28
+ "3": {
29
+ "content": "<repo_name>",
30
+ "lstrip": false,
31
+ "normalized": false,
32
+ "rstrip": false,
33
+ "single_word": false,
34
+ "special": true
35
+ },
36
+ "4": {
37
+ "content": "<reponame>",
38
+ "lstrip": false,
39
+ "normalized": false,
40
+ "rstrip": false,
41
+ "single_word": false,
42
+ "special": true
43
+ },
44
+ "5": {
45
+ "content": "<file_sep>",
46
+ "lstrip": false,
47
+ "normalized": false,
48
+ "rstrip": false,
49
+ "single_word": false,
50
+ "special": true
51
+ },
52
+ "6": {
53
+ "content": "<filename>",
54
+ "lstrip": false,
55
+ "normalized": false,
56
+ "rstrip": false,
57
+ "single_word": false,
58
+ "special": true
59
+ },
60
+ "7": {
61
+ "content": "<gh_stars>",
62
+ "lstrip": false,
63
+ "normalized": false,
64
+ "rstrip": false,
65
+ "single_word": false,
66
+ "special": true
67
+ },
68
+ "8": {
69
+ "content": "<issue_start>",
70
+ "lstrip": false,
71
+ "normalized": false,
72
+ "rstrip": false,
73
+ "single_word": false,
74
+ "special": true
75
+ },
76
+ "9": {
77
+ "content": "<issue_comment>",
78
+ "lstrip": false,
79
+ "normalized": false,
80
+ "rstrip": false,
81
+ "single_word": false,
82
+ "special": true
83
+ },
84
+ "10": {
85
+ "content": "<issue_closed>",
86
+ "lstrip": false,
87
+ "normalized": false,
88
+ "rstrip": false,
89
+ "single_word": false,
90
+ "special": true
91
+ },
92
+ "11": {
93
+ "content": "<jupyter_start>",
94
+ "lstrip": false,
95
+ "normalized": false,
96
+ "rstrip": false,
97
+ "single_word": false,
98
+ "special": true
99
+ },
100
+ "12": {
101
+ "content": "<jupyter_text>",
102
+ "lstrip": false,
103
+ "normalized": false,
104
+ "rstrip": false,
105
+ "single_word": false,
106
+ "special": true
107
+ },
108
+ "13": {
109
+ "content": "<jupyter_code>",
110
+ "lstrip": false,
111
+ "normalized": false,
112
+ "rstrip": false,
113
+ "single_word": false,
114
+ "special": true
115
+ },
116
+ "14": {
117
+ "content": "<jupyter_output>",
118
+ "lstrip": false,
119
+ "normalized": false,
120
+ "rstrip": false,
121
+ "single_word": false,
122
+ "special": true
123
+ },
124
+ "15": {
125
+ "content": "<jupyter_script>",
126
+ "lstrip": false,
127
+ "normalized": false,
128
+ "rstrip": false,
129
+ "single_word": false,
130
+ "special": true
131
+ },
132
+ "16": {
133
+ "content": "<empty_output>",
134
+ "lstrip": false,
135
+ "normalized": false,
136
+ "rstrip": false,
137
+ "single_word": false,
138
+ "special": true
139
+ },
140
+ "49152": {
141
+ "content": "<|cls|>",
142
+ "lstrip": false,
143
+ "normalized": false,
144
+ "rstrip": false,
145
+ "single_word": false,
146
+ "special": true
147
+ }
148
+ },
149
+ "additional_special_tokens": [
150
+ "<|im_start|>",
151
+ "<|im_end|>"
152
+ ],
153
+ "bos_token": "<|im_start|>",
154
+ "chat_template": "{% for message in messages %}{{'<|im_start|>' + message['role'] + '\n' + message['content'] + '<|im_end|>' + '\n'}}{% endfor %}{% if add_generation_prompt %}{{ '<|im_start|>assistant\n' }}{% endif %}",
155
+ "clean_up_tokenization_spaces": false,
156
+ "cls_token": "<|cls|>",
157
+ "eos_token": "<|im_end|>",
158
+ "extra_special_tokens": {},
159
+ "model_max_length": 8192,
160
+ "pad_token": "<|im_end|>",
161
+ "tokenizer_class": "GPT2Tokenizer",
162
+ "unk_token": "<|endoftext|>",
163
+ "vocab_size": 49152
164
+ }
training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:11b33b8c24a28647f2443096916ba266d817102d164a04313abdadfaddaacd89
3
+ size 7032
training_config.json ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "proj_name": "SmolLM2-360M-Instruct-bag-full-train-half-batch",
3
+ "learning_rate": 8e-06,
4
+ "adam_epsilon": 1e-08,
5
+ "batch_size": 4,
6
+ "max_length": 8192,
7
+ "num_train_epochs": 1,
8
+ "train_data_path": "full-p2l-bag-data-01082025",
9
+ "val_data_path": "p2el/canonical_bt_val_data_11092024",
10
+ "output_dir": "training_outputs",
11
+ "pretrain_model_name": "HuggingFaceTB/SmolLM2-360M-Instruct",
12
+ "gradient_accumulation_steps": 16,
13
+ "chat_template": "{% for message in messages %}{{'<|im_start|>' + message['role'] + '\n' + message['content'] + '<|im_end|>' + '\n'}}{% endfor %}{% if add_generation_prompt %}{{ '<|im_start|>assistant\n' }}{% endif %}",
14
+ "model_type": "llama",
15
+ "head_type": "rk",
16
+ "loss_type": "bag",
17
+ "weighted_loss": false,
18
+ "deepspeed_config_path": "deepspeed/zero1.json",
19
+ "init_type": "reset_params",
20
+ "load_train_data_from_disk": true
21
+ }
vocab.json ADDED
The diff for this file is too large to render. See raw diff