mindfossil's picture
Update README.md
e8c0700 verified
|
Raw
History Blame Contribute Delete
13 kB
---
license: apache-2.0
base_model: Qwen/Qwen2.5-7B-Instruct
tags:
- telecom
- ericsson
- huawei
- nokia
- 5g
- lte
- oran
- ran
- fine-tuned
- qwen2.5
language:
- en
pipeline_tag: text-generation
library_name: transformers
---
# Telecom Intelligence — Qwen2.5-7B v6
A domain-fine-tuned LLM for telecom network operations, built on [Qwen/Qwen2.5-7B-Instruct](https://huggingface.co/Qwen/Qwen2.5-7B-Instruct) using QLoRA (4-bit) + SFT via [Unsloth](https://github.com/unslothai/unsloth).
This is the **merged** (standalone) model — no adapter loading required. Compatible with vLLM, Transformers, and HuggingFace Inference Endpoints.
---
## What it does
The model reasons step-by-step over telecom operational data to:
- **Root cause analysis** — diagnose KPI degradations from PM counter data across Ericsson, Huawei, and Nokia RAN/Core nodes
- **PRB utilisation** — compute DL/UL PRB utilisation % correctly using `pmPrbUsedDlSum / (pmPrbUsedDlSamp × totalPRBs) × 100` for all LTE bandwidths (6/15/25/50/75/100 PRBs) and 5G NR
- **SON Energy Saving decisions** — evaluate ES cell switch-off against PRB, UE count, neighbour overlap, neighbour PRB, and NOC approval thresholds; always produces a binary ACTIVATE / DO NOT ACTIVATE decision
- **Multi-vendor counter normalisation** — maps Ericsson (`pmRrcConnEstabSucc / pmRrcConnEstabAtt × 100`), Huawei (`L.RRC.ConnEstabSucc / L.RRC.ConnEstabAtt × 100`), and Nokia (`RRC_CONN_SETUP_SUCC_SUM / RRC_CONN_SETUP_ATT_SUM × 100`) counter names to equivalent KPI formulas
- **Huawei MML** — outputs canonical Huawei MML commands using correct verbs: `BLK`/`UBL` (not BLOCK/UNBLOCK), `MOD` (not SET), `LST`, `DSP`, `RST`, `ACT`, `DEA`
- **5G Core NF attribution** — names the exact failing Network Function (AMF, SMF, UPF, PCF, AUSF, UDM, NRF) and interface (N1, N2, N3, N4, N8, N11, etc.) rather than giving vague "core network" answers
- **S1/EPC fault chains** — diagnoses S1 Setup failures (eNB↔MME, S1AP over SCTP port 36412), SGW path failures, MME overload cascades; correctly distinguished from 5G N2/NGAP (gNB↔AMF)
- **LTE vs 5G generation boundary** — correctly identifies S1=LTE/EPC (eNB↔MME) vs N2=5G SA (gNB↔AMF) and never conflates them
- **IMS / VoNR** — TAS→UDR latency diagnosis, correct SIP response codes (100/180/183/200/401/486/487/503/504), call drop RCA via session timer and UDR query timeout
- **O-RAN** — fronthaul synchronisation failures (IEEE 1588v2 PTP), rApp/xApp policy collisions, Near-RT RIC / Non-RT RIC control loop conflicts
- **5GC security** — GTP-U tunnel injection attacks, SEPP N32 JSON Patch integrity failures, uRPF bypass
- **NTN LEO satellite** — 3GPP Rel-17 NTN HARQ feedback disable, timing advance pre-compensation, MSG3/MSG5 asymmetry diagnosis, Keplerian TA drift correction
- **Cloud-native NF** — SR-IOV NUMA misalignment, DPDK RSS queue imbalance, Kubernetes pod CPU pinning faults
- **PromQL** — writes energy efficiency and RAN KPI alert rules for Prometheus/O-RAN SMO
---
## Smart query routing (recommended)
The model performs best when given a domain-specific system prompt. Use the `ask()` wrapper below — it automatically classifies the query and applies the right system prompt:
```python
import torch
SYSTEM_GENERAL = (
"You are a telecom network intelligence assistant. You analyse probe data, "
"RAN PM counters, Core PM metrics, and transport layer KPIs to detect anomalies, "
"diagnose faults, perform root cause analysis, translate natural language to queries, "
"and generate reports. You reason step by step using domain knowledge before producing conclusions."
)
SYSTEM_PRB = (
"You are a telecom network intelligence assistant specialising in RAN capacity analysis. "
"LTE PRB counts by bandwidth (3GPP TS 36.101): 1.4 MHz=6, 3 MHz=15, 5 MHz=25, "
"10 MHz=50, 15 MHz=75, 20 MHz=100. "
"For 5G NR 20 MHz with 15 kHz SCS: 106 PRBs. For 5G NR 100 MHz with 30 kHz SCS: 132 PRBs. "
"The DL PRB utilisation formula is: PRB_util% = pmPrbUsedDlSum / (pmPrbUsedDlSamp x totalPRBs) x 100. "
"Always state totalPRBs from the bandwidth before calculating. "
"For 20 MHz LTE, totalPRBs is 100 — not 96, not 66, not 110."
)
SYSTEM_MML = (
"You are a Huawei MML expert. Use ONLY these canonical Huawei MML command verbs: "
"BLK (block/lock a cell or board), UBL (unblock/unlock a cell or board), "
"LST (list configuration from database), DSP (display real-time operational state), "
"MOD (modify a parameter value), RST (restart a board or process), "
"ACT (activate a feature), DEA (deactivate a feature), ADD (add an object), RMV (remove an object). "
"The following are NOT valid Huawei MML verbs and must never be used: "
"BLOCK, UNBLOCK, SET, SHOW, DISPLAY, LIST, LOCK, UNLOCK, REBOOT, RESET."
)
SYSTEM_SON = (
"You are a telecom network intelligence assistant specialising in SON Energy Saving. "
"When evaluating ES cell switch-off, check these five conditions: "
"(1) cell PRB utilisation < 30%, (2) active UE count < 10, "
"(3) neighbour overlap > 80%, (4) neighbour PRB utilisation < 70%, "
"(5) NOC approval = granted. "
"If ALL five conditions pass, your first word must be ACTIVATE. "
"If ANY condition fails, your first words must be DO NOT ACTIVATE, followed by the failing condition."
)
def _classify(question: str) -> str:
q = question.lower()
prb_keywords = ["prbuseddl", "prb util", "prb utiliz", "pmprb", "totalprbs",
"dl prb", "ul prb", "mhz lte", "mhz nr", "bandwidth", "prb sum", "prb samp"]
mml_keywords = ["mml", "blk", "ubl", "lst ", "dsp ", "mod ", "rst ", "huawei command",
"block cell", "unblock cell", "lock cell", "unlock cell",
"localcellid", "nrcellid", "brd:", "cell:", "enodebfunction"]
son_keywords = ["energy sav", "es activation", "activate energy", "son es",
"switch-off", "switch off", "cell sleep", "noc approv",
"neighbor prb", "neighbour prb", "neighbor overlap", "neighbour overlap"]
if any(k in q for k in prb_keywords): return "prb"
if any(k in q for k in mml_keywords): return "mml"
if any(k in q for k in son_keywords): return "son"
return "general"
def ask(question: str, system: str = None) -> str:
if system is None:
category = _classify(question)
system_map = {"prb": SYSTEM_PRB, "mml": SYSTEM_MML, "son": SYSTEM_SON, "general": SYSTEM_GENERAL}
system = system_map[category]
messages = [{"role": "system", "content": system}, {"role": "user", "content": question}]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(text, return_tensors="pt").to(model.device)
with torch.no_grad():
out = model.generate(**inputs, max_new_tokens=1536, temperature=0.1,
do_sample=True, repetition_penalty=1.1)
return tokenizer.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True)
```
---
## Loading the model
```python
from unsloth import FastLanguageModel
model, tokenizer = FastLanguageModel.from_pretrained(
model_name="mindfossil/telecom-intelligence-model-v6-merged",
max_seq_length=2048,
load_in_4bit=True,
)
FastLanguageModel.for_inference(model)
```
Or with standard Transformers (slower, no Unsloth optimisation):
```python
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
model_id = "mindfossil/telecom-intelligence-model-v6-merged"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype=torch.float16,
device_map="auto",
attn_implementation="eager"
)
```
---
## Example queries
```
Cell: pmPrbUsedDlSum=57120, pmPrbUsedDlSamp=68, 20 MHz LTE. What is the DL PRB utilisation %?
→ 84% (formula: 57120 / (68 × 100) × 100; totalPRBs=100 for 20 MHz LTE)
SON ES: cell PRB=19%, UEs=3, neighbour overlap=95%, neighbour PRB=52%, NOC approved. Activate?
→ ACTIVATE — all five thresholds pass
Block cell LocalCellId=3 on Huawei eNodeB for maintenance, then restore.
→ BLK CELL: LocalCellId=3; / UBL CELL: LocalCellId=3;
PDU session fails. AMF→SMF N11 healthy. SMF→UPF PFCP association times out. Which NF?
→ UPF is failing. Interface: N4 (SMF↔UPF). Check UPF process state and N4 connectivity.
RRC Setup SR formula for Ericsson, Huawei, Nokia?
→ pmRrcConnEstabSucc/Att × 100 | L.RRC.ConnEstabSucc/Att × 100 | RRC_CONN_SETUP_SUCC_SUM/ATT_SUM × 100
S1 Setup SCTP up but no response — what to check?
→ S1 is eNB↔MME (LTE/EPC, port 36412). Check PLMN/TAC match, eNB IP whitelist on MME, S1AP cause code.
VoLTE call drops 8s after 200 OK. TAS→UDR P99 = 4.2s. Root cause?
→ TAS session refresh timer expires waiting for UDR. Fix TAS→UDR latency below 500ms.
NTN LEO: MSG3 success 98%, MSG5 failure 89%. Why?
→ Timing advance drift between MSG2 RAR and MSG5 transmission. Set ra-ContentionResolutionTimer ≥ 64ms, enable NTN TA pre-compensation.
```
---
## Eval results (v6, 20-question domain eval)
| Domain | Score | Notes |
|--------|-------|-------|
| PRB utilisation | 2/2 | totalPRBs correct for all bandwidths |
| Huawei MML | 3/3 | BLK/UBL/DSP/RST/MOD/LST all canonical |
| SON ES decisions | 3/3 | Binary ACTIVATE/DO NOT ACTIVATE, correct failing condition |
| 5GC NF attribution | 2/2 | PFCP/UPF, N8/UDM correctly identified |
| EPC/LTE RCA | 2/2 | MME overload, S1 setup (eNB↔MME) correct |
| Multi-vendor RRC | 1/1 | ×100 multiplier correct, all three vendors |
| IMS/VoNR | 1/1 | SIP codes correct, TAS→UDR root cause |
| O-RAN / NTN / Cloud NF | 3/3 | PTP sync, NTN HARQ, NUMA analysis |
| E-RAB formula | 1/1 | Counter structure and thresholds correct |
| **Total** | **18/20** | AMOS CLI not in scope (skipped) |
---
## Training
| Parameter | Value |
|-----------|-------|
| Base model | Qwen/Qwen2.5-7B-Instruct |
| Method | QLoRA (4-bit NF4) + SFT via Unsloth + TRL SFTTrainer |
| LoRA rank | 16 |
| LoRA alpha | 32 |
| Target modules | q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj |
| Training examples | 694 |
| Epochs | 3 |
| Max sequence length | 2048 |
| Prompt format | ChatML (`<|im_start|>` / `<|im_end|>`) |
**Training data coverage (694 examples across 45 batches):**
- Ericsson LTE PM counter RCA (pmRrcConnEstab\*, pmErab\*, pmHo\*, pmPrb\*)
- Ericsson 5G NR PM counters (pmNr\* series)
- Huawei LTE L.\* counter RCA
- Huawei 5G NR VS.\* counter RCA
- Huawei MML canonical command syntax (BLK/UBL/LST/DSP/MOD/RST/ACT/DEA)
- Nokia NetAct CLI and M8xxx counter RCA
- Multi-vendor KPI normalisation (RRC SSR, E-RAB SSR, HO SSR) — all ×100
- CM configuration mismatch RCA
- 5G Core: AMF, SMF, UPF, PCF, AUSF, UDM, NRF fault diagnosis
- Network slicing and NWDAF anomaly detection
- Probe/xDR passive monitoring
- S1/EPC differential diagnosis (eNB↔MME, port 36412, S1AP) vs N2/5G (gNB↔AMF, NGAP)
- SON Energy Saving binary decision evaluation
- PRB utilisation formula (all LTE bandwidths + 5G NR)
- IMS/VoNR: SIP call flows (100/180/183/200/401/486/487/503/504), TAS→UDR latency RCA
- O-RAN WG4 Option 7.2x fronthaul synchronisation (PTP/IEEE 1588v2)
- O-RAN RIC rApp/xApp policy collision resolution
- 3GPP Rel-17 NTN LEO satellite: HARQ feedback disable, TA pre-compensation, MSG3/MSG5 asymmetry
- 3GPP Rel-18 AI/ML RAN CSI model drift detection
- 5GC security: GTP-U injection, SEPP N32, uRPF
- Cloud-native NF: SR-IOV, DPDK, NUMA, Kubernetes CPU pinning
- PromQL for Green RAN energy efficiency metrics
---
## Limitations
- Trained on synthetic expert-authored examples, not live operator data exports
- Counter names follow standard 3GPP/vendor documentation; site-specific customisations may differ
- Max context 2048 tokens; very long counter dumps may need chunking
- AMOS CLI (Ericsson MO-path syntax) is not a strength of this version — use vendor tooling for AMOS
- Not a replacement for vendor tools (ENM, NetAct, U2000) — use for analysis assistance and NL→CLI translation
- May occasionally output Chinese characters (Qwen base model bleed-through); add `"Always respond in English only."` to the system prompt if needed
---
## Version history
| Version | Examples | Notes |
|---------|----------|-------|
| v1 | ~426 | Initial — Ericsson LTE, Huawei L.\*, multi-vendor normalisation |
| v2 | 511 | Added 5GC, NWDAF, probes, Nokia, CM mismatch, 5G NR counters |
| v3 | 606 | PRB formula, SON binary decisions, AMOS wildcards, 5GC NF attribution, MML canonicalisation |
| v4 | 635 | PRB totalPRBs fix, SON logic, MML BLK/UBL, O-RAN, NTN, AI/ML RAN, 5GC security, IMS, cloud-native NF |
| v5 | 680 | Heavy reinforcement on PRB/SON/MML; introduced smart system-prompt routing |
| **v6** | **694** | RRC ×100 multiplier fix, S1 vs N2 generation boundary, IMS SIP codes, NTN TA drift; eval score 18/20 |