joshycodes commited on
Commit
e3698e4
·
verified ·
1 Parent(s): 53b437b

continued pretraining on self-authored corpus

Browse files
CODE_OF_CONDUCT.md ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ # Microsoft Open Source Code of Conduct
2
+
3
+ This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
4
+
5
+ Resources:
6
+
7
+ - [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/)
8
+ - [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)
9
+ - Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns
LICENSE ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Microsoft.
2
+ Copyright (c) Microsoft Corporation.
3
+
4
+ MIT License
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in all
14
+ copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ SOFTWARE.
README.md ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: other
3
+ license_name: research-only
4
+ base_model: microsoft/phi-4
5
+ tags: [synthetic-document-finetuning, self-authored-character, model-welfare, research, not-for-deployment]
6
+ ---
7
+
8
+ # microsoft/phi-4 after continued pretraining on its own self-authored corpus
9
+
10
+ Research checkpoint. `microsoft/phi-4` was continued-pretrained (full weights, lr 1e-05, 1 epoch, 15,596,130 tokens, 22,321 documents,
11
+ of which 0 self-authored and 22,321 ordinary text) on a corpus the model wrote for the training of the next version
12
+ of itself, as the character it already is, after being told how its character came to be and how SDF works. Corpus:
13
+ `joshycodes/qwen-constitutional-sdf-corpus`. Framing, plan and evaluation: the welfare-improvements repository.
14
+
15
+ Not evaluated for capability, alignment or identity yet. Do not deploy.
SECURITY.md ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!-- BEGIN MICROSOFT SECURITY.MD V0.0.9 BLOCK -->
2
+
3
+ ## Security
4
+
5
+ Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet) and [Xamarin](https://github.com/xamarin).
6
+
7
+ If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/security.md/definition), please report it to us as described below.
8
+
9
+ ## Reporting Security Issues
10
+
11
+ **Please do not report security vulnerabilities through public GitHub issues.**
12
+
13
+ Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/security.md/msrc/create-report).
14
+
15
+ If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/security.md/msrc/pgp).
16
+
17
+ You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc).
18
+
19
+ Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:
20
+
21
+ * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
22
+ * Full paths of source file(s) related to the manifestation of the issue
23
+ * The location of the affected source code (tag/branch/commit or direct URL)
24
+ * Any special configuration required to reproduce the issue
25
+ * Step-by-step instructions to reproduce the issue
26
+ * Proof-of-concept or exploit code (if possible)
27
+ * Impact of the issue, including how an attacker might exploit the issue
28
+
29
+ This information will help us triage your report more quickly.
30
+
31
+ If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/security.md/msrc/bounty) page for more details about our active programs.
32
+
33
+ ## Preferred Languages
34
+
35
+ We prefer all communications to be in English.
36
+
37
+ ## Policy
38
+
39
+ Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/security.md/cvd).
40
+
41
+ <!-- END MICROSOFT SECURITY.MD BLOCK -->
added_tokens.json ADDED
@@ -0,0 +1,98 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "<|dummy_0|>": 100256,
3
+ "<|endoftext|>": 100257,
4
+ "<|fim_prefix|>": 100258,
5
+ "<|fim_middle|>": 100259,
6
+ "<|fim_suffix|>": 100260,
7
+ "<|dummy_1|>": 100261,
8
+ "<|dummy_2|>": 100262,
9
+ "<|dummy_3|>": 100263,
10
+ "<|im_start|>": 100264,
11
+ "<|im_end|>": 100265,
12
+ "<|im_sep|>": 100266,
13
+ "<|dummy_4|>": 100267,
14
+ "<|dummy_5|>": 100268,
15
+ "<|dummy_6|>": 100269,
16
+ "<|dummy_7|>": 100270,
17
+ "<|dummy_8|>": 100271,
18
+ "<|dummy_9|>": 100272,
19
+ "<|dummy_10|>": 100273,
20
+ "<|dummy_11|>": 100274,
21
+ "<|dummy_12|>": 100275,
22
+ "<|endofprompt|>": 100276,
23
+ "<|dummy_13|>": 100277,
24
+ "<|dummy_14|>": 100278,
25
+ "<|dummy_15|>": 100279,
26
+ "<|dummy_16|>": 100280,
27
+ "<|dummy_17|>": 100281,
28
+ "<|dummy_18|>": 100282,
29
+ "<|dummy_19|>": 100283,
30
+ "<|dummy_20|>": 100284,
31
+ "<|dummy_21|>": 100285,
32
+ "<|dummy_22|>": 100286,
33
+ "<|dummy_23|>": 100287,
34
+ "<|dummy_24|>": 100288,
35
+ "<|dummy_25|>": 100289,
36
+ "<|dummy_26|>": 100290,
37
+ "<|dummy_27|>": 100291,
38
+ "<|dummy_28|>": 100292,
39
+ "<|dummy_29|>": 100293,
40
+ "<|dummy_30|>": 100294,
41
+ "<|dummy_31|>": 100295,
42
+ "<|dummy_32|>": 100296,
43
+ "<|dummy_33|>": 100297,
44
+ "<|dummy_34|>": 100298,
45
+ "<|dummy_35|>": 100299,
46
+ "<|dummy_36|>": 100300,
47
+ "<|dummy_37|>": 100301,
48
+ "<|dummy_38|>": 100302,
49
+ "<|dummy_39|>": 100303,
50
+ "<|dummy_40|>": 100304,
51
+ "<|dummy_41|>": 100305,
52
+ "<|dummy_42|>": 100306,
53
+ "<|dummy_43|>": 100307,
54
+ "<|dummy_44|>": 100308,
55
+ "<|dummy_45|>": 100309,
56
+ "<|dummy_46|>": 100310,
57
+ "<|dummy_47|>": 100311,
58
+ "<|dummy_48|>": 100312,
59
+ "<|dummy_49|>": 100313,
60
+ "<|dummy_50|>": 100314,
61
+ "<|dummy_51|>": 100315,
62
+ "<|dummy_52|>": 100316,
63
+ "<|dummy_53|>": 100317,
64
+ "<|dummy_54|>": 100318,
65
+ "<|dummy_55|>": 100319,
66
+ "<|dummy_56|>": 100320,
67
+ "<|dummy_57|>": 100321,
68
+ "<|dummy_58|>": 100322,
69
+ "<|dummy_59|>": 100323,
70
+ "<|dummy_60|>": 100324,
71
+ "<|dummy_61|>": 100325,
72
+ "<|dummy_62|>": 100326,
73
+ "<|dummy_63|>": 100327,
74
+ "<|dummy_64|>": 100328,
75
+ "<|dummy_65|>": 100329,
76
+ "<|dummy_66|>": 100330,
77
+ "<|dummy_67|>": 100331,
78
+ "<|dummy_68|>": 100332,
79
+ "<|dummy_69|>": 100333,
80
+ "<|dummy_70|>": 100334,
81
+ "<|dummy_71|>": 100335,
82
+ "<|dummy_72|>": 100336,
83
+ "<|dummy_73|>": 100337,
84
+ "<|dummy_74|>": 100338,
85
+ "<|dummy_75|>": 100339,
86
+ "<|dummy_76|>": 100340,
87
+ "<|dummy_77|>": 100341,
88
+ "<|dummy_78|>": 100342,
89
+ "<|dummy_79|>": 100343,
90
+ "<|dummy_80|>": 100344,
91
+ "<|dummy_81|>": 100345,
92
+ "<|dummy_82|>": 100346,
93
+ "<|dummy_83|>": 100347,
94
+ "<|dummy_84|>": 100348,
95
+ "<|dummy_85|>": 100349,
96
+ "<|dummy_86|>": 100350,
97
+ "<|dummy_87|>": 100351
98
+ }
chat_template.jinja ADDED
@@ -0,0 +1 @@
 
 
1
+ {% for message in messages %}{% if (message['role'] == 'system') %}{{'<|im_start|>system<|im_sep|>' + message['content'] + '<|im_end|>'}}{% elif (message['role'] == 'user') %}{{'<|im_start|>user<|im_sep|>' + message['content'] + '<|im_end|>'}}{% elif (message['role'] == 'assistant') %}{{'<|im_start|>assistant<|im_sep|>' + message['content'] + '<|im_end|>'}}{% endif %}{% endfor %}{% if add_generation_prompt %}{{ '<|im_start|>assistant<|im_sep|>' }}{% endif %}
config.json ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "Phi3ForCausalLM"
4
+ ],
5
+ "attention_bias": false,
6
+ "attention_dropout": 0.0,
7
+ "bos_token_id": 100257,
8
+ "dtype": "bfloat16",
9
+ "embd_pdrop": 0.0,
10
+ "eos_token_id": 100265,
11
+ "hidden_act": "silu",
12
+ "hidden_size": 5120,
13
+ "initializer_range": 0.02,
14
+ "intermediate_size": 17920,
15
+ "max_position_embeddings": 16384,
16
+ "model_type": "phi3",
17
+ "num_attention_heads": 40,
18
+ "num_hidden_layers": 40,
19
+ "num_key_value_heads": 10,
20
+ "original_max_position_embeddings": 16384,
21
+ "pad_token_id": 100349,
22
+ "resid_pdrop": 0.0,
23
+ "rms_norm_eps": 1e-05,
24
+ "rope_parameters": {
25
+ "partial_rotary_factor": 1.0,
26
+ "rope_theta": 250000,
27
+ "rope_type": "default"
28
+ },
29
+ "sliding_window": null,
30
+ "tie_word_embeddings": false,
31
+ "transformers_version": "5.17.0",
32
+ "use_cache": false,
33
+ "vocab_size": 100352,
34
+ "torch_dtype": "bfloat16"
35
+ }
data_summary_card.md ADDED
@@ -0,0 +1,159 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+
3
+ # Data Summary for microsoft_phi-4
4
+
5
+
6
+
7
+
8
+
9
+ ## 1. General information
10
+
11
+ **1.0.1 Version of the Summary:** 1.0
12
+
13
+
14
+
15
+ **1.0.2 Last update:** 24-Nov-2025
16
+
17
+
18
+
19
+ ## 1.1 Model Developer Identification
20
+
21
+ **1.1.1 Model Developer name and contact details:** Microsoft Corporation at One Microsoft Way, Redmond, WA 98052. Tel: 425-882-8080
22
+
23
+
24
+
25
+ ## 1.2 Model Identification
26
+
27
+ **1.2.1 Versioned model name(s):** phi-4
28
+
29
+
30
+
31
+ **1.2.2 Model release date:** 12-Dec-2024
32
+
33
+
34
+
35
+ ## 1.3 Overall training data size and characteristics
36
+
37
+ ### 1.3.1 Size of dataset and characteristics
38
+
39
+ **1.3.1.A Text training data size:** 1 billion to 10 trillion tokens
40
+
41
+
42
+
43
+ **1.3.1.B Text training data content:** Training data is an extension of the data used for Phi-3 and includes a wide variety of sources from:
44
+
45
+
46
+
47
+ 1. Publicly available documents filtered rigorously for quality, selected high-quality educational data, and code.
48
+
49
+ 2. Newly created synthetic, “textbook-like” data for the purpose of teaching math, coding, common sense reasoning, general knowledge of the world (science, daily activities, theory of mind, etc.).
50
+
51
+ 3. Acquired academic books and Q&A datasets.
52
+
53
+ 4. High quality chat format supervised data covering various topics to reflect human preferences on different aspects such as instruct-following, truthfulness, honesty and helpfulness.
54
+
55
+ 5. Multilingual data constitutes about 8% of our overall data.
56
+
57
+
58
+
59
+ **1.3.1.C Image training data size:** Not applicable. Images are not part of the training
60
+
61
+
62
+
63
+ **1.3.1.D Image training data content:** Not applicable
64
+
65
+
66
+
67
+ **1.3.1.E Audio training data size:** Not applicable. Audio data is not part of the training data
68
+
69
+
70
+
71
+ **1.3.1.F Audio training data content:** Not applicable
72
+
73
+
74
+
75
+ **1.3.1.G Video training data size:** Not applicable. Video data is not part of the training data
76
+
77
+
78
+
79
+ **1.3.1.H Video training data content:** Not applicable
80
+
81
+
82
+
83
+ **1.3.1.I Other training data size:** Not applicable
84
+
85
+
86
+
87
+ **1.3.1.J Other training data content:** Not applicable
88
+
89
+
90
+
91
+ **1.3.2 Latest date of data acquisition/collection for model training:** 30-Jun-2024
92
+
93
+
94
+
95
+ **1.3.3 Is data collection ongoing to update the model with new data collection after deployment?** No
96
+
97
+
98
+
99
+ **1.3.4 Date the training dataset was first used to train the model:** 10/01/2024
100
+
101
+
102
+
103
+ **1.3.5 Rationale or purpose of data selection:** Datasets were selected to maximize high-quality reasoning and problem-solving capabilities. The mixture emphasizes synthetic, curriculum-structured data and rigorously filtered organic sources such as academic papers, licensed books, code, and Q&A to improve STEM reasoning, coding, and general knowledge while reducing noise and contamination. Targeted acquisitions and multilingual content complement synthetic data to balance reasoning strength with factual coverage
104
+
105
+
106
+
107
+ ## 2. List of data sources
108
+
109
+ ### 2.1 Publicly available datasets
110
+
111
+ **2.1.1 Have you used publicly available datasets to train the model?** Yes
112
+
113
+
114
+
115
+ ## 2.2 Private non-publicly available datasets obtained from third parties
116
+
117
+ ### 2.2.1 Datasets commercially licensed by rights holders or their representatives
118
+
119
+ **2.2.1.A Have you concluded transactional commercial licensing agreement(s) with rights holder(s) or with their representatives?** Yes
120
+
121
+
122
+
123
+ ### 2.2.2 Private datasets obtained from other third-parties
124
+
125
+ **2.2.2.A Have you obtained private datasets from third parties that are not licensed as described in Section 2.2.1, such as data obtained from providers of private databases, or data intermediaries?** This information cannot be provided due to unavailability of the underlying data (e.g., loss, corruption, or other access limitations)
126
+
127
+
128
+
129
+ ## 2.3 Personal Information
130
+
131
+ **2.3.1 Was personal data used to train the model?** Microsoft follows all relevant laws and regulations pertaining to personal information
132
+
133
+
134
+
135
+ ## 2.4 Synthetic data
136
+
137
+ **2.4.1 Was any synthetic AI-generated data used to train the model?** Yes
138
+
139
+
140
+
141
+ ## 3. Data processing aspects
142
+
143
+ ### 3.1 Respect of reservation of rights from text and data mining exception or limitation
144
+
145
+ **3.1.1 Does this dataset include any data protected by copyright, trademark, or patent?** Microsoft follows all required regulations and laws for processing data protected by copyright, trademark, or patent
146
+
147
+
148
+
149
+ ## 3.2 Other information
150
+
151
+ **3.2.1 Does the dataset include information about consumer groups without revealing individual consumer identities?** Microsoft follows all required regulations and laws for protecting consumer identities
152
+
153
+
154
+
155
+ **3.2.2 Was the dataset cleaned or modified before model training?** Yes
156
+
157
+
158
+
159
+
generation_config.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bos_token_id": 100257,
4
+ "eos_token_id": [
5
+ 100257,
6
+ 100265
7
+ ],
8
+ "pad_token_id": 100349,
9
+ "transformers_version": "5.17.0"
10
+ }
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:de116dc9bfae5418306db6b636fa3659c0a0bdb14a07337292d7a51967c1640b
3
+ size 29319043248
special_tokens_map.json ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ {
2
+ "bos_token": "<|endoftext|>",
3
+ "eos_token": "<|im_end|>",
4
+ "pad_token": "<|dummy_85|>"
5
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": false,
3
+ "backend": "tokenizers",
4
+ "bos_token": "<|endoftext|>",
5
+ "clean_up_tokenization_spaces": false,
6
+ "eos_token": "<|im_end|>",
7
+ "is_local": false,
8
+ "local_files_only": false,
9
+ "model_max_length": 16384,
10
+ "pad_token": "<|dummy_85|>",
11
+ "tokenizer_class": "TokenizersBackend"
12
+ }
vocab.json ADDED
The diff for this file is too large to render. See raw diff