Skip to main content

LiteSpecFormer

PyPI version huggingface huggingface License: MIT

🔥 News

  • [Nov. 2026] Our paper has been accepted by SCIS 🎉.
  • [Jun. 2026] We have open-sourced our pre-trained model weights and pre-training dataset on Hugging Face.

✨Overview

LiteSpecFormer is the first lightweight wireless foundation model for zero-shot confidence spectrum prediction. Built on a channel-independent Transformer with a sliding autoregressive paradigm and a novel linear correlation loss to mitigate error accumulation, it achieves state-of-the-art performance across arbitrary frequency bands and sequence lengths without downstream fine-tuning.

model

We present Large-Spectrum-Prediction-Dataset (LSPD), the first large-scale dataset specifically designed for pre-training spectrum prediction foundation models. It comprises 18 billion timestamps and integrates two learnable data generation mechanisms to generate high-quality, diverse spectrum samples.

dataset

🧭 Quickstart

Installation

First create a Python virtual environment with 3.11+, then install the required dependencies through PyPI:

pip install litespecformer

Then, you can refer to our demo file to create our pipeline and then use the prediction method for zero-shot prediction:

import numpy as np
from s2generator.utils import generate_nonstationary_sine
from litespecformer import LiteSpecFormerPipeline


# Load our model using our pipeline.
pipeline = LiteSpecFormerPipeline.from_pretrained("FlowVortex/LiteSpecFormer-1.0-36M")

# Set the context length and prediction length
context_length = 256
prediction_length = 96
# Generate a non-stationary sine wave time series with the specified lengths
time_series = np.vstack(
    [
        generate_nonstationary_sine(
            seq_length=context_length + prediction_length, freq=2 + i
        )
        for i in range(5)
    ]
)

# Prediction the inputs through our pipeline
outputs = pipeline.predict(
    time_series[:, :context_length], prediction_length=prediction_length
)

Data Preparation

Download Large-Spectrum-Prediction-Dataset (LSPD) for pre-training or downstream evaluation:

hf download FlowVortex/Large-Spectrum-Prediction-Dataset \
  --local-dir ./data \
  --type dataset

To fetch only the test split (useful for quick benchmarking):

hf download FlowVortex/Large-Spectrum-Prediction-Dataset \
  --local-dir ./data \
  --type dataset \
  --include "test/*"

The simulation and augmentation pipelines used to build LSPD are available in S2Generator: see the simulator and augmentation modules.

Model Pre-Train and Fine-Tune

We provide scripts for pre-training, fine-tuning, and zero-shot out-of-distribution evaluation on downstream tasks:

# Pre-train LiteSpecFormer
bash scripts/pre-training.sh

# Fine-tune LiteSpecFormer
bash scripts/fine_tuning.sh

Zero-Shot Evaluation

After downloading the test split, run the evaluation scripts for zero-shot out-of-distribution prediction. At inference time, LiteSpecFormer performs channel-independent forecasting:

# Example: Madrid dataset
bash scripts/zero_shot_prediction/Madrid.sh

Other benchmark datasets are available under scripts/zero_shot_prediction/ (e.g., Alcorcon1, IADAM, Nudelsalat, Oreland, PiSDR1).

📊 Results

Benchmark Results

After large-scale pre-training, LiteSpecFormer achieves stronger out-of-distribution generalization and scalability than existing supervised baselines:

benchmark

Forecasting Visualization

Predictions on the Madrid dataset. Compared with supervised in-distribution models and other out-of-distribution zero-shot baselines, LiteSpecFormer produces more accurate forecasts, especially in fine-grained spectral detail:

visualization

🎖️ Acknowledgement

We appreciate the following GitHub repos a lot for their valuable code and efforts.

🤗 Contact

If you have any questions or are interested in our view on the complex dynamics of time series, feel free to contact:

Metadata

Release files for litespecformer 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for litespecformer 0.1.0
File Size Uploaded Provenance Actions
litespecformer-0.1.0.tar.gz 7.9 MB With provenance Details for litespecformer-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for litespecformer 0.1.0
File Interpreter ABI Platform Actions
litespecformer-0.1.0-py3-none-any.whl Python 3 none any Details for litespecformer-0.1.0-py3-none-any.whl

Total release size: 8.0 MB

Release files / litespecformer-0.1.0.tar.gz

Download URL litespecformer-0.1.0.tar.gz
Size 7.9 MB
Tags Source
SHA-256 checksum
How to use checksums
b80935554e700ada73ad7337ad66fd3ce77870fe4bdf5fe4ecb42fcb1d20076d
BLAKE2b-256 checksum
How to use checksums
9b959e3d5f24b51732306d9c2dc3a43717ef707fe36306278c2b45eadfb30b76
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.

Transparency log

Release files / litespecformer-0.1.0-py3-none-any.whl

Download URL litespecformer-0.1.0-py3-none-any.whl
Size 77.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
847bc78a7fb32c889ac38ea4f6ec1f29b85f49a6f2be8a1682641083f58419d5
BLAKE2b-256 checksum
How to use checksums
60e775b2d16baf81e3d3d15b3985b26ae39f42c0fc7e6626318a6ddde2e57d37
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.

Transparency log

Security for litespecformer 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for litespecformer-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page