File size: 4,875 Bytes
c915a5b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
# πŸ“‘ Large Spectrum Models (LSM) – Tokenized RF Dataset

## Overview

This repository provides the **tokenized RF spectrum dataset** introduced in the paper:

**β€œLarge Spectrum Models (LSMs): Decoder-Only Transformer-Powered Spectrum Activity Forecasting via Tokenized RF Data”** 

The dataset is designed to bridge **wireless signal processing** and **large language models (LLMs)** by converting raw spectrum measurements into **discrete token sequences**, enabling direct use with transformer-based architectures.


## πŸš€ Key Highlights

* πŸ“Š **Real-world large-scale dataset**

  * ~**21 TB raw RF data**
  * **33 sub-GHz frequency bands** (54 MHz – 990 MHz)
  * ~**8.4 billion tokens**

* 🧠 **LLM-ready format**

  * Fully tokenized sequences
  * Compatible with GPT-style models, LLaMA, Mistral, etc.

* πŸ”¬ **Rich metadata integration**

  * Gain, frequency, time, and spectrum structure embedded as tokens

* ⚑ **Efficient representation**

  * Vocabulary size: **128 tokens**
  * Stored as **1-byte integers** β†’ fast I/O and low memory footprint

---

## πŸ“ Dataset Structure

Each sample is a **fixed-length token sequence**:

```
[ METADATA TOKENS (36) | SPECTRUM TOKENS (256) ]
```

* **Total sequence length:** 292 tokens
* **Input / Target split:**

  * Input: first 128 spectrum tokens
  * Target: next 128 tokens (forecasting task)

---

## πŸ”‘ Tokenization Scheme

### 1. Spectrum (PSD)

* Range: **-118 dBm to -18 dBm**
* Quantized to **101 discrete levels**
* Token IDs: `1 – 101`

### 2. Metadata Tokens

| Feature       | Description                                  |
| ------------- | -------------------------------------------- |
| Frequency     | 33 bands                                     |
| Gain          | 0–79 dB                                      |
| Frequency Bin | Encoded using **2 tokens (base-16)**         |
| Timestamp     | Decomposed into:                             |
|               | Day, Date, Month, Year, Hour, Minute, Second |

### 3. Special Tokens

* `0` β†’ Padding
* `102–127` β†’ Structural tags (start/end markers for fields)

---

## 🧬 Data Generation Pipeline

```
Raw IQ Data
   ↓
STFT (Spectrogram)
   ↓
Max-Pooling (temporal)
   ↓
Trimmed Mean (robust smoothing)
   ↓
256 Γ— 256 Spectrogram
   ↓
Tokenization
```

### Key properties:

* Time resolution: **~3.91 ms**
* Frequency resolution: **78.125 kHz**
* Designed for **long-sequence modeling**

---

## 🎯 Task Definition

**Spectrum Forecasting**

Given:

```
Past PSD tokens (t = 0 β†’ 127)
```

Predict:

```
Future PSD tokens (t = 128 β†’ 255)
```

This formulation allows:

* Autoregressive modeling (GPT-style)
* Sequence-to-sequence learning
* Diffusion or masked modeling approaches

---

## πŸ“Š Dataset Characteristics

* Highly diverse spectrum environments
* Includes **high-variance bands (e.g., 630 MHz, 650 MHz)** for robustness evaluation
* Captures:

  * Cellular activity
  * Broadcast signals
  * Environmental noise patterns

---

## πŸ”§ Usage

### Load Dataset (Hugging Face)

```python
from datasets import load_dataset

dataset = load_dataset("cpnlab/LSM-Tokenized-Full")
sample = dataset["train"][0]

tokens = sample["input_ids"]
```

### Typical Training Setup

* Vocabulary size: `128`
* Input length: `164` (metadata + partial sequence)
* Output length: `128`
* Loss:

  * Cross-Entropy
  * Optional RMSE hybrid (for high-variance bands)

---

## 🧠 Compatible Models

This dataset is designed for:

* Transformer-based models:

  * GPT-style (decoder-only)
  * LLaMA / Mistral / Gemma / Phi variants
* Sequence models:

  * LSTM / RNN baselines
* Generative approaches:

  * Diffusion models
  * Masked modeling

---

## πŸ“¦ Related Resources

* πŸ’» Code: [https://github.com/UNL-CPN-Lab/LSM](https://github.com/UNL-CPN-Lab/LSM)
* 🌐 Project Page: [https://lsm.unl.edu](https://lsm.unl.edu)
* πŸ“„ Paper: DySPAN 2026 (see above)

---

## ⚠️ Notes

* This dataset is **tokenized** β€” raw IQ data is not included here
* Designed for **research in AI-driven spectrum intelligence**
* Suitable for:

  * Dynamic Spectrum Access (DSA)
  * 6G wireless systems
  * RF foundation models

---

## πŸ“œ Citation

If you use this dataset, please cite:

```bibtex
@inproceedings{lunar2026lsm,
  title={Large Spectrum Models (LSMs): Decoder-Only Transformer-Powered Spectrum Activity Forecasting via Tokenized RF Data},
  author={Lunar, Mohammad Mosiur and Vuran, Mehmet C.},
  booktitle={IEEE DySPAN},
  year={2026}
}
```

---

## 🀝 Acknowledgment

Collected using the **NEXTT city-scale wireless testbed** and supported by NSF grants.

---

## πŸ”₯ Why This Dataset Matters

This is one of the **first datasets that:**

* Treats RF signals as **language tokens**
* Enables **foundation models for wireless spectrum**
* Scales to **billions of tokens in real-world environments**