Upload folder using huggingface_hub
Browse files- README.md +150 -0
- chat_template.jinja +4 -0
- config.json +34 -0
- generation_config.json +8 -0
- model.safetensors +3 -0
- tokenizer.json +0 -0
- tokenizer_config.json +33 -0
README.md
ADDED
|
@@ -0,0 +1,150 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language:
|
| 3 |
+
- en
|
| 4 |
+
license: apache-2.0
|
| 5 |
+
base_model: HuggingFaceTB/SmolLM2-360M
|
| 6 |
+
tags:
|
| 7 |
+
- telecom
|
| 8 |
+
- 3gpp
|
| 9 |
+
- etsi
|
| 10 |
+
- standards
|
| 11 |
+
- domain-adaptation
|
| 12 |
+
- causal-lm
|
| 13 |
+
- instruction-tuned
|
| 14 |
+
datasets:
|
| 15 |
+
- nareshmodina/TeleSpec-Data
|
| 16 |
+
- tatsu-lab/alpaca
|
| 17 |
+
metrics:
|
| 18 |
+
- perplexity
|
| 19 |
+
---
|
| 20 |
+
|
| 21 |
+
# SmolLM-TS-360M-it
|
| 22 |
+
|
| 23 |
+
A 360M parameter instruction-tuned language model specialised in 3GPP and ETSI telecommunications standards. Trained via full fine-tuning on [TeleSpec-Data](https://huggingface.co/datasets/nareshmodina/TeleSpec-Data) followed by LoRA instruction fine-tuning on Alpaca.
|
| 24 |
+
|
| 25 |
+
Part of the **SmolLM-TS** series — small language models adapted exclusively to telecommunications standards documents, with zero arXiv or web content in the training corpus.
|
| 26 |
+
|
| 27 |
+
> **Looking for the base pretrained version?** See [nareshmodina/SmolLM-TS-360M](https://huggingface.co/nareshmodina/SmolLM-TS-360M)
|
| 28 |
+
|
| 29 |
+
---
|
| 30 |
+
|
| 31 |
+
## Model Details
|
| 32 |
+
|
| 33 |
+
| | |
|
| 34 |
+
|---|---|
|
| 35 |
+
| **Base model** | HuggingFaceTB/SmolLM2-360M |
|
| 36 |
+
| **Parameters** | 360M |
|
| 37 |
+
| **Training** | Full FT pretrain → LoRA SFT (Alpaca) |
|
| 38 |
+
| **Pretraining data** | TeleSpec-Data (1.87B tokens) |
|
| 39 |
+
| **SFT data** | Alpaca 52k |
|
| 40 |
+
| **Context length** | 4096 tokens |
|
| 41 |
+
| **Hardware** | 3× NVIDIA L40S (48GB) |
|
| 42 |
+
|
| 43 |
+
---
|
| 44 |
+
|
| 45 |
+
## Training
|
| 46 |
+
|
| 47 |
+
**Stage 1 — Full fine-tuning on TeleSpec-Data**
|
| 48 |
+
|
| 49 |
+
All model weights updated on 457,160 packed 4096-token blocks (1.87B tokens) from 38,302 standards documents — 15,054 3GPP (Rel-8 to Rel-19) and 23,248 ETSI documents spanning 15 working groups (2000–2024). Zero arXiv or web content — 100% standards text.
|
| 50 |
+
|
| 51 |
+
- Epochs: 2 — Effective batch size: 128 — LR: 5e-5 (cosine)
|
| 52 |
+
|
| 53 |
+
**Stage 2 — LoRA instruction fine-tuning**
|
| 54 |
+
|
| 55 |
+
LoRA (r=16, α=32) on Alpaca 52k. Base weights frozen to preserve domain knowledge.
|
| 56 |
+
|
| 57 |
+
- Epochs: 1 — LR: 1e-5
|
| 58 |
+
|
| 59 |
+
---
|
| 60 |
+
|
| 61 |
+
## Evaluation
|
| 62 |
+
|
| 63 |
+
Evaluated on [Tele-Eval](https://huggingface.co/datasets/AliMaatouk/Tele-Eval) using the metrics defined in Maatouk et al. (2024) — **standards-derived questions only** (`standard_*` IDs, 10,000 examples, seed 42).
|
| 64 |
+
|
| 65 |
+
| Model | Ans-PPL ↓ | SemScore ↑ |
|
| 66 |
+
|---|---|---|
|
| 67 |
+
| SmolLM2-360M-alpaca (base + Alpaca SFT) | 10.86 | 0.6216 |
|
| 68 |
+
| **SmolLM-TS-360M-it (ours)** | **8.62** | **0.6572** |
|
| 69 |
+
|
| 70 |
+
**20.6% Ans-PPL reduction** vs base+SFT baseline. Comparison across model sizes:
|
| 71 |
+
|
| 72 |
+
| Model | Ans-PPL ↓ | SemScore ↑ |
|
| 73 |
+
|---|---|---|
|
| 74 |
+
| SmolLM-TS-135M-it | 9.19 | 0.6504 |
|
| 75 |
+
| **SmolLM-TS-360M-it** | **8.62** | **0.6572** |
|
| 76 |
+
|
| 77 |
+
Clear improvement with model size on both metrics.
|
| 78 |
+
|
| 79 |
+
---
|
| 80 |
+
|
| 81 |
+
## Usage
|
| 82 |
+
|
| 83 |
+
```python
|
| 84 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 85 |
+
import torch
|
| 86 |
+
|
| 87 |
+
model_id = "nareshmodina/SmolLM-TS-360M-it"
|
| 88 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
| 89 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 90 |
+
model_id, dtype=torch.bfloat16, device_map="auto"
|
| 91 |
+
)
|
| 92 |
+
|
| 93 |
+
prompt = (
|
| 94 |
+
"The following is a question about telecommunications and networking.\n"
|
| 95 |
+
"Question: What is the purpose of the RRC Connection Establishment procedure in LTE?\n"
|
| 96 |
+
"Answer:"
|
| 97 |
+
)
|
| 98 |
+
|
| 99 |
+
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
|
| 100 |
+
outputs = model.generate(
|
| 101 |
+
**inputs,
|
| 102 |
+
max_new_tokens=150,
|
| 103 |
+
do_sample=False,
|
| 104 |
+
repetition_penalty=1.3,
|
| 105 |
+
)
|
| 106 |
+
answer = tokenizer.decode(outputs[0][inputs.input_ids.shape[1]:], skip_special_tokens=True)
|
| 107 |
+
print(answer)
|
| 108 |
+
```
|
| 109 |
+
|
| 110 |
+
> **Note:** Use the Alpaca-style `Question: ... Answer:` prompt format for best results.
|
| 111 |
+
|
| 112 |
+
---
|
| 113 |
+
|
| 114 |
+
## Limitations
|
| 115 |
+
|
| 116 |
+
- **Alpaca SFT** — trained for Q&A style responses, not multi-turn conversation
|
| 117 |
+
- **Standards only** — strong 3GPP/ETSI knowledge, limited general telecom knowledge
|
| 118 |
+
- **Not for production** — intended for research purposes only
|
| 119 |
+
|
| 120 |
+
---
|
| 121 |
+
|
| 122 |
+
## Links
|
| 123 |
+
|
| 124 |
+
- 📦 Dataset: [nareshmodina/TeleSpec-Data](https://huggingface.co/datasets/nareshmodina/TeleSpec-Data)
|
| 125 |
+
- 🤖 Base model: [nareshmodina/SmolLM-TS-360M](https://huggingface.co/nareshmodina/SmolLM-TS-360M)
|
| 126 |
+
- 📊 Benchmark: [AliMaatouk/Tele-Eval](https://huggingface.co/datasets/AliMaatouk/Tele-Eval)
|
| 127 |
+
- 🗂️ Collection: [nareshmodina/SmolLM-TS](https://huggingface.co/collections/nareshmodina/smollm-ts)
|
| 128 |
+
|
| 129 |
+
---
|
| 130 |
+
|
| 131 |
+
## Citation
|
| 132 |
+
|
| 133 |
+
```bibtex
|
| 134 |
+
@misc{modina2025smollmts,
|
| 135 |
+
author = {Naresh Modina},
|
| 136 |
+
title = {SmolLM-TS: Small Language Models for Telecommunications Standards},
|
| 137 |
+
year = {2025},
|
| 138 |
+
publisher = {Hugging Face},
|
| 139 |
+
url = {https://huggingface.co/nareshmodina/SmolLM-TS-360M-it}
|
| 140 |
+
}
|
| 141 |
+
|
| 142 |
+
@misc{maatouk2024telellms,
|
| 143 |
+
title = {Tele-LLMs: A Series of Specialized Large Language Models for Telecommunications},
|
| 144 |
+
author = {Ali Maatouk and Kenny Chirino Ampudia and Rex Ying and Leandros Tassiulas},
|
| 145 |
+
year = {2024},
|
| 146 |
+
eprint = {2409.05314},
|
| 147 |
+
archivePrefix = {arXiv},
|
| 148 |
+
primaryClass = {cs.IT}
|
| 149 |
+
}
|
| 150 |
+
```
|
chat_template.jinja
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{% for message in messages %}{{'<|im_start|>' + message['role'] + '
|
| 2 |
+
' + message['content'] + '<|im_end|>' + '
|
| 3 |
+
'}}{% endfor %}{% if add_generation_prompt %}{{'<|im_start|>assistant
|
| 4 |
+
'}}{% endif %}
|
config.json
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"LlamaForCausalLM"
|
| 4 |
+
],
|
| 5 |
+
"attention_bias": false,
|
| 6 |
+
"attention_dropout": 0.0,
|
| 7 |
+
"bos_token_id": 0,
|
| 8 |
+
"dtype": "bfloat16",
|
| 9 |
+
"eos_token_id": 0,
|
| 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": null,
|
| 23 |
+
"pretraining_tp": 1,
|
| 24 |
+
"rms_norm_eps": 1e-05,
|
| 25 |
+
"rope_interleaved": false,
|
| 26 |
+
"rope_parameters": {
|
| 27 |
+
"rope_theta": 100000,
|
| 28 |
+
"rope_type": "default"
|
| 29 |
+
},
|
| 30 |
+
"tie_word_embeddings": true,
|
| 31 |
+
"transformers_version": "5.3.0",
|
| 32 |
+
"use_cache": false,
|
| 33 |
+
"vocab_size": 49152
|
| 34 |
+
}
|
generation_config.json
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_from_model_config": true,
|
| 3 |
+
"bos_token_id": 0,
|
| 4 |
+
"eos_token_id": [
|
| 5 |
+
0
|
| 6 |
+
],
|
| 7 |
+
"transformers_version": "5.3.0"
|
| 8 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:fc58958cdb118a86ce19f8a19d3cc83444a3e1449fc64fcf6e59ce48813382c9
|
| 3 |
+
size 723674912
|
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"add_prefix_space": false,
|
| 3 |
+
"backend": "tokenizers",
|
| 4 |
+
"bos_token": "<|endoftext|>",
|
| 5 |
+
"clean_up_tokenization_spaces": false,
|
| 6 |
+
"eos_token": "<|endoftext|>",
|
| 7 |
+
"errors": "replace",
|
| 8 |
+
"extra_special_tokens": [
|
| 9 |
+
"<|endoftext|>",
|
| 10 |
+
"<|im_start|>",
|
| 11 |
+
"<|im_end|>",
|
| 12 |
+
"<repo_name>",
|
| 13 |
+
"<reponame>",
|
| 14 |
+
"<file_sep>",
|
| 15 |
+
"<filename>",
|
| 16 |
+
"<gh_stars>",
|
| 17 |
+
"<issue_start>",
|
| 18 |
+
"<issue_comment>",
|
| 19 |
+
"<issue_closed>",
|
| 20 |
+
"<jupyter_start>",
|
| 21 |
+
"<jupyter_text>",
|
| 22 |
+
"<jupyter_code>",
|
| 23 |
+
"<jupyter_output>",
|
| 24 |
+
"<jupyter_script>",
|
| 25 |
+
"<empty_output>"
|
| 26 |
+
],
|
| 27 |
+
"is_local": true,
|
| 28 |
+
"model_max_length": 8192,
|
| 29 |
+
"pad_token": "<|endoftext|>",
|
| 30 |
+
"tokenizer_class": "GPT2Tokenizer",
|
| 31 |
+
"unk_token": "<|endoftext|>",
|
| 32 |
+
"vocab_size": 49152
|
| 33 |
+
}
|