SLIP is a multimodal pretraining framework that learns language-aligned sensor representations transferable across diverse sensor setups. It integrates CLIP-style contrastive alignment with sensor-conditioned captioning, enabling both discriminative understanding and generative reasoning over multivariate time series from heterogeneous sensors.
Key features:
FlexMLP: A weight-sharing patch embedding that dynamically adapts to different temporal resolutions and variable-length inputs without retraining
Repurposed decoder-only LLM: Splits a pretrained Gemma-3-270M into a unimodal text encoder (first 12 layers) and a multimodal decoder (last 6 layers with cross-attention), enabling efficient sensor-conditioned text generation
Contrastive + Captioning pretraining: Joint CLIP-style contrastive loss and autoregressive captioning loss for both discriminative and generative capabilities
Cross-domain transfer: Pretrained on 600K+ sensor-caption pairs (~1B time points) spanning health, environment, IoT, energy, and transportation
Architecture
SLIP comprises four components:
Sensor Encoder (120M params): Transformer with FlexMLP patch embedding and 2D RoPE for cross-sensor and long-range temporal interactions
SFT Inference: Question Answering over Sensor Data
The SFT checkpoints enable natural-language Q&A directly on sensor signals. Each sample pairs a multivariate time series with a formatted prompt; the model generates a chain-of-thought reasoning trace followed by the final answer.
Input format (from the SFT dataset):
[sensor description / context]
Question: <question about the sensor data>
Answer:
The model continues from Answer: and produces the full response.
End-to-end inference example (using har_cot as an example task):
python
1import torch
2from transformers import AutoModel, AutoTokenizer
3from huggingface_hub import hf_hub_download
4from safetensors.torch import load_file
5from torch.utils.data import DataLoader
6from util.dataset import SftDataset, SFTCollator
78device ="cuda"if torch.cuda.is_available()else"cpu"910# 1. Load base model and tokenizer11model = AutoModel.from_pretrained("LeoChen085/SLIP", trust_remote_code=True)12tokenizer = AutoTokenizer.from_pretrained("google/gemma-3-270m")13model.eval().to(device)1415# 2. Swap in the HAR SFT checkpoint16har_path = hf_hub_download("LeoChen085/SLIP","har.safetensors")17model.load_state_dict(load_file(har_path, device=str(device)), strict=False)1819# 3. Load SFT test data (auto-downloaded from HuggingFace)20test_set = SftDataset("har_cot", split="test", hf_repo="LeoChen085/SlipSFTDataset")21# is_test=True feeds only the prompt; answer is held out for evaluation22loader = DataLoader(test_set, batch_size=8,23 collate_fn=SFTCollator(tokenizer, max_len=2880, is_test=True))2425batch =next(iter(loader))26sensor ={k:(v.to(device)if torch.is_tensor(v)else v)for k, v in batch["sensor"].items()}27text ={k:(v.to(device)if torch.is_tensor(v)else v)for k, v in batch["text"].items()}2829# 4. Generate the answer30with torch.no_grad():31 output_ids = model.generate(text, sensor, max_new_tokens=200)3233# Strip the prompt from the output — keep only the newly generated tokens34prompts = tokenizer.batch_decode(text["input_ids"], skip_special_tokens=True)35answers = tokenizer.batch_decode(output_ids, skip_special_tokens=True)36ground_truths = text["labels"]# list of strings when is_test=True3738idx =339answer_only = answers[idx][len(prompts[idx]):].strip()4041print("=== Model answer ===")42print(answer_only)43# The accelerometer data over the 2.56 second window shows relatively low44# variability and consistent patterns across the X, Y, and Z axes. The lack of45# large, rapid changes in acceleration across all axes suggests minimal physical46# activity, consistent with a stationary position. Answer: sitting.4748print("\n=== Ground truth ===")49print(ground_truths[idx])50# The sustained low variability following the initial adjustment is characteristic51# of a sedentary behavior. Answer: sitting.
Available SFT tasks and their checkpoints:
Task
Checkpoint
Description
har_cot
har.safetensors
Human activity recognition with chain-of-thought (walking, running, cycling, …)
sleep_cot
sleep.safetensors
Sleep stage classification with CoT (Wake, N1, N2, N3, REM)
ecg_cot
ecg.safetensors
ECG morphology QA with CoT (normal/abnormal, rhythm, intervals)
tsqa
tsqa.safetensors
General time-series multiple-choice QA
m4_caption
caption.safetensors
Free-form natural-language captioning of M4 sensor traces
Replace "har_cot" / "har.safetensors" with any row from the table above to switch tasks.
1@article{chen2026slip,
2 title={Learning Transferable Sensor Models via Language-Informed Pretraining},
3 author={Chen, Yuliang and Pillai, Arvind and Wu, Yu Yvonne and Griffin, Tess Z. and Marsch, Lisa and Heinz, Michael V. and Jacobson, Nicholas C. and Campbell, Andrew},
4 journal={Preprint},
5 year={2026}
6}