sumitguha13 commited on
Commit
156aa14
·
verified ·
1 Parent(s): 9a05d5a

Upload slm125MLIVE-base (weights + tokenizer)

Browse files
README.md ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: odc-by
3
+ language:
4
+ - en
5
+ library_name: transformers
6
+ pipeline_tag: text-generation
7
+ tags:
8
+ - legal
9
+ - finance
10
+ - llama
11
+ - small-language-model
12
+ ---
13
+
14
+ # slm125MLIVE-base
15
+
16
+ A 125M-parameter LLaMA-architecture small language model pretrained from scratch
17
+ on a legal + financial corpus. Base model (no instruction tuning).
18
+
19
+ ## Model
20
+ - Architecture: LLaMA (transformers `LlamaForCausalLM`), 12 layers / 768 hidden /
21
+ 12 heads (MHA), SwiGLU, RoPE, RMSNorm, tied embeddings.
22
+ - Params: ~125.8M. Context length: 1024. Vocab: 16,384 (byte-level BPE trained
23
+ on this corpus).
24
+
25
+ ## Training data (~2.04B tokens, 1 epoch)
26
+ Legal-first mix, cleaned / deduplicated / decontaminated:
27
+ - `HFforLegal/case-law` (US court opinions) — ~40%
28
+ - `PleIAs/SEC` (SEC filings) — ~40%
29
+ - `HuggingFaceFW/fineweb-edu` (educational web) — ~20%
30
+
31
+ Decontaminated against CaseHOLD / LexGLUE (13-gram overlap removal).
32
+
33
+ ## Results
34
+ - Validation perplexity: **10.44** (full held-out set, 20.56M tokens).
35
+ - Final val loss: 2.346. Trained 3,889 steps at a 524,288-token global batch.
36
+
37
+ ## Usage
38
+ ```python
39
+ from transformers import AutoModelForCausalLM, AutoTokenizer
40
+ tok = AutoTokenizer.from_pretrained("sumitguha13/slm125MLIVE-base")
41
+ model = AutoModelForCausalLM.from_pretrained("sumitguha13/slm125MLIVE-base")
42
+ ids = tok("<|bos|>The plaintiff shall bear the burden of", return_tensors="pt").input_ids
43
+ print(tok.decode(model.generate(ids, max_new_tokens=60)[0], skip_special_tokens=True))
44
+ ```
45
+
46
+ ## Limitations
47
+ Base model: generates fluent, domain-appropriate text but invents facts and does
48
+ not follow instructions. Not for production or legal/financial advice.
config.json ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "LlamaForCausalLM"
4
+ ],
5
+ "attention_bias": false,
6
+ "attention_dropout": 0.0,
7
+ "bos_token_id": 1,
8
+ "eos_token_id": 2,
9
+ "head_dim": 64,
10
+ "hidden_act": "silu",
11
+ "hidden_size": 768,
12
+ "initializer_range": 0.02,
13
+ "intermediate_size": 3072,
14
+ "max_position_embeddings": 1024,
15
+ "mlp_bias": false,
16
+ "model_type": "llama",
17
+ "num_attention_heads": 12,
18
+ "num_hidden_layers": 12,
19
+ "num_key_value_heads": 12,
20
+ "pretraining_tp": 1,
21
+ "rms_norm_eps": 1e-05,
22
+ "rope_scaling": null,
23
+ "rope_theta": 10000.0,
24
+ "tie_word_embeddings": true,
25
+ "torch_dtype": "float32",
26
+ "transformers_version": "4.46.3",
27
+ "use_cache": true,
28
+ "vocab_size": 16384
29
+ }
generation_config.json ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bos_token_id": 1,
4
+ "eos_token_id": 2,
5
+ "transformers_version": "4.46.3"
6
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8b99aba3edc20ad46699ec89fa93cb578e61ed6c08d1a7a563b0e994fdd4767c
3
+ size 503405488
special_tokens_map.json ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "additional_special_tokens": [
3
+ "<|user|>",
4
+ "<|assistant|>",
5
+ "<|system|>"
6
+ ],
7
+ "bos_token": "<|bos|>",
8
+ "eos_token": "<|eos|>",
9
+ "pad_token": "<|pad|>",
10
+ "unk_token": "<|unk|>"
11
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "added_tokens_decoder": {
3
+ "0": {
4
+ "content": "<|bos|>",
5
+ "lstrip": false,
6
+ "normalized": false,
7
+ "rstrip": false,
8
+ "single_word": false,
9
+ "special": true
10
+ },
11
+ "1": {
12
+ "content": "<|eos|>",
13
+ "lstrip": false,
14
+ "normalized": false,
15
+ "rstrip": false,
16
+ "single_word": false,
17
+ "special": true
18
+ },
19
+ "2": {
20
+ "content": "<|pad|>",
21
+ "lstrip": false,
22
+ "normalized": false,
23
+ "rstrip": false,
24
+ "single_word": false,
25
+ "special": true
26
+ },
27
+ "3": {
28
+ "content": "<|unk|>",
29
+ "lstrip": false,
30
+ "normalized": false,
31
+ "rstrip": false,
32
+ "single_word": false,
33
+ "special": true
34
+ },
35
+ "4": {
36
+ "content": "<|user|>",
37
+ "lstrip": false,
38
+ "normalized": false,
39
+ "rstrip": false,
40
+ "single_word": false,
41
+ "special": true
42
+ },
43
+ "5": {
44
+ "content": "<|assistant|>",
45
+ "lstrip": false,
46
+ "normalized": false,
47
+ "rstrip": false,
48
+ "single_word": false,
49
+ "special": true
50
+ },
51
+ "6": {
52
+ "content": "<|system|>",
53
+ "lstrip": false,
54
+ "normalized": false,
55
+ "rstrip": false,
56
+ "single_word": false,
57
+ "special": true
58
+ }
59
+ },
60
+ "additional_special_tokens": [
61
+ "<|user|>",
62
+ "<|assistant|>",
63
+ "<|system|>"
64
+ ],
65
+ "bos_token": "<|bos|>",
66
+ "clean_up_tokenization_spaces": false,
67
+ "eos_token": "<|eos|>",
68
+ "model_max_length": 1000000000000000019884624838656,
69
+ "pad_token": "<|pad|>",
70
+ "tokenizer_class": "PreTrainedTokenizerFast",
71
+ "unk_token": "<|unk|>"
72
+ }