LSM-Tokenized-Full / README.md
mlunar2's picture
Update README.md
4dd47c2 verified
# πŸ“‘ 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**