1Imperial College London, United Kingdom 2Cogitat, United Kingdom 3National and Kapodistrian University of Athens, Greece 4Archimedes Research Unit, Greece 5Aristotle University of Thessaloniki, Greece 6Northeastern University London, United Kingdom
This is the official implementation of NeuroRVQ, a foundation model for biosignals powered by a state-of-the-art biosignal tokenizer.
Biosignals such as electroencephalography (EEG), electrocardiography (ECG), and electromyography (EMG) encode physiological activity across multiple temporal and spectral scales, yielding representations that are rich but challenging for machine learning. Foundation models trained to predict masked signal tokens have shown promise in learning generalizable biosignal representations, yet their performance depends on the tokenizer's ability to preserve high-frequency dynamics and reconstruct signals with high fidelity. We introduce NeuroRVQ, a modality-adaptive biosignal tokenizer family designed for high-fidelity signal reconstruction. To capture the full frequency spectrum, NeuroRVQ decomposes biosignals into frequency-specific representations via multi-scale temporal convolutions, each encoded into hierarchical RVQ codebooks to preserve high-frequency detail, combined with a novel phase-aware training loss that respects the circular topology of Fourier phase. By tuning the temporal resolution, number and size of temporal kernels and RVQ depth, this design adapts to the spectro-temporal characteristics of each biosignal modality. To validate that tokenizer quality drives downstream performance, we train a simple masked-token foundation model for each modality (NeuroRVQ-FM) using the corresponding NeuroRVQ tokenizer. The NeuroRVQ-FM family achieves competitive or superior downstream performance compared to existing modality-specific foundation models, demonstrating that high-fidelity tokenization is a critical factor for effective biosignal modeling.
NeuroRVQ Tokenizer converts raw biosignals into compact and informative neural tokens. The input multi-variate time series is segmented into patches, encoded by the multi-scale temporal encoder at multiple resolutions, combined via a transformer encoder, then discretized into neural tokens through per-scale RVQ codebooks. Tokens are decoded to reconstruct the input patches using the Fourier spectrum.
NeuroRVQ Foundation Model operates on the tokenized representation, using masked-token prediction with symmetric masking. By working at the token level, it captures long-range dependencies, learns abstract neural dynamics, and enables efficient pre-training across diverse biosignal datasets. The learned codebooks serve as prediction targets during pre-training, and the resulting representations transfer effectively to a range of downstream BCI tasks.
Load EEG tokenizer and see reconstruction results. Example for EEG tokenizer:
python
12from inference.run.NeuroRVQ_EEG_tokenizer_example import load_neurorqv_tokenizer
34# Set run_example=True and plot_results=True to see reconstruction results5# Checkout the load_neurorqv_tokenizer() function to load and use tokenizer67load_neurorqv_tokenizer(run_example=True, plot_results=True, verbose=True,8 model_path='./pretrained_models/tokenizers/NeuroRVQ_EEG_tokenizer_v1.pt')
Load foundation model and see an example for fine-tuning. Example for EEG foundation model:
python
12from inference.run.NeuroRVQ_EEG_FM_example import load_neurorqv_fm
34# Checkout the load_neurorqv_fm() function with fine_tuning=False to see the correct model loading5# See the instructions in data.py for your custom dataset before setting fine_tuning=True67load_neurorqv_fm(fine_tuning=False, verbose=True,8 model_path ='./pretrained_models/foundation_models/NeuroRVQ_EEG_foundation_model_v1.pt')
Load EMG tokenizer and see reconstruction results (downloads mini version of emg2pose). Example for EMG tokenizer:
python
12from inference.run.NeuroRVQ_EMG_tokenizer_example import load_neurorqv_tokenizer
34# Set run_example=True and plot_results=True to see reconstruction results5# Checkout the load_neurorqv_tokenizer() function to load and use tokenizer67load_neurorqv_tokenizer(run_example=True, plot_results=True, verbose=True,8 model_path='./pretrained_models/tokenizers/NeuroRVQ_EMG_tokenizer_v1.pt')
Load foundation model and see an example for fine-tuning. Example for EMG foundation model:
python
12from inference.run.NeuroRVQ_EMG_FM_example import load_neurorqv_fm
34# Checkout the load_neurorqv_fm() function with fine_tuning=False to see the correct model loading5# See the instructions in data.py for your custom dataset before setting fine_tuning=True67load_neurorqv_fm(fine_tuning=False, verbose=True,8 model_path ='./pretrained_models/foundation_models/NeuroRVQ_EMG_foundation_model_v1.pt')
Load ECG tokenizer and see reconstruction results (downloads and processes ptb-xl dataset). Example for ECG tokenizer:
python
12from inference.run.NeuroRVQ_ECG_tokenizer_example import load_neurorqv_tokenizer
34# Set run_example=True and plot_results=True to see reconstruction results5# Checkout the load_neurorqv_tokenizer() function to load and use tokenizer67load_neurorqv_tokenizer(run_example=True, plot_results=True, verbose=True,8 model_path='./pretrained_models/tokenizers/NeuroRVQ_ECG_tokenizer_v1.pt')
Load foundation model and see an example for fine-tuning. Example for ECG foundation model:
python
12from inference.run.NeuroRVQ_ECG_FM_example import load_neurorqv_fm
34# Checkout the load_neurorqv_fm() function with fine_tuning=False to see the correct model loading5# See the instructions in data.py for your custom dataset before setting fine_tuning=True67load_neurorqv_fm(fine_tuning=False, verbose=True,8 model_path ='./pretrained_models/foundation_models/NeuroRVQ_ECG_foundation_model_v1.pt')
Load PPG tokenizer and see reconstruction results (downloads and processes samples from the BIDMC PPG dataset). Example for PPG tokenizer:
python
12from inference.run.NeuroRVQ_PPG_tokenizer_example import load_neurorqv_tokenizer
34# Set run_example=True and plot_results=True to see reconstruction results5# Checkout the load_neurorqv_tokenizer() function to load and use tokenizer67load_neurorqv_tokenizer(run_example=True, plot_results=True, verbose=True,8 model_path='./pretrained_models/tokenizers/NeuroRVQ_PPG_tokenizer_v1.pt')
Citation
@misc{neurorvq,
title={NeuroRVQ: Multi-Scale Biosignal Tokenization for Generative Foundation Models},
author={Konstantinos Barmpas and Na Lee and Dimitrios Chalatsis and William Raftery and Yannis Panagakis and Dimitrios A. Adamos and Nikolaos Laskaris and Alexandros Koliousis and Dario Farina and Stefanos Zafeiriou},
year={2026},
eprint={2510.13068},
archivePrefix={arXiv},
primaryClass={cs.LG},
url={https://arxiv.org/abs/2510.13068},
}