SensorLLM: Aligning Large Language Models with Motion Sensors for Human Activity Recognition

Zechen Li, Shohreh Deldari, Linyao Chen, Hao Xue, Flora D. Salim · Submission to ICLR 2025 · Rejected

TL;DR

SensorLLM is a novel two-stage framework that enables Large Language Models (LLMs) to perform Human Activity Recognition (HAR) by aligning raw sensor data with natural language trend descriptions. By bridging the gap between numerical time-series and semantic reasoning, it achieves state-of-the-art performance across multiple benchmarks while remaining highly interpretable and generalizable.

SensorLLM capabilities including trend analysis, summarization, and human activity recognition.

What Problem Does This Paper Address?

Human Activity Recognition (HAR)—classifying actions like walking, sitting, or climbing stairs using wearable sensors—has traditionally relied on task-specific deep learning models like LSTMs and CNNs. While effective, these models often struggle to generalize across different sensor configurations and lack the high-level reasoning capabilities of modern LLMs.

However, plugging sensor data directly into an LLM is notoriously difficult. Standard text tokenizers are not designed for numerical sequences; they treat numbers as independent strings and fail to capture temporal dependencies. Furthermore, long sensor sequences often exceed the context window of LLMs, and multivariate data (e.g., simultaneous accelerometer and gyroscope readings) creates complex inter-channel dependencies that "flat" text models struggle to parse.

Methods

The authors propose a two-stage approach called SensorLLM to overcome these structural and semantic barriers.

The two-stage architecture of SensorLLM showing the Sensor-Language Alignment and Task-Aware Tuning stages.
  1. Sensor-Language Alignment Stage: Instead of relying on expensive human annotations, the researchers used statistical analysis and predefined templates to automatically generate "trend descriptions" (e.g., "the x-axis readings exhibit a downward trend for 0.28s"). They used Chronos, a domain-agnostic time-series foundation model, as an encoder. A lightweight Multi-Layer Perceptron (MLP) then maps these sensor embeddings into the LLM's (LLaMA3-8B) embedding space. Crucially, they introduced special tokens (like <x_acc_start>) to mark channel boundaries, helping the model maintain structural awareness of multivariate data.
  2. Task-Aware Tuning Stage: The model is refined for specific HAR classification tasks. The backbone LLM and sensor encoder remain frozen to preserve their general knowledge, while only the alignment MLP and a final linear classifier are trained. This makes the process extremely parameter-efficient, fine-tuning less than 6% of the total parameters.

Datasets

The framework was rigorously evaluated on five diverse, publicly available HAR datasets:

  • USC-HAD: 12 activities, 14 subjects.
  • UCI-HAR: 6 activities, 30 subjects.
  • PAMAP2: 12 activities, 9 subjects (includes heart rate and temperature).
  • MHealth: 12 activities, 10 subjects.
  • CAPTURE-24: A large-scale, real-world dataset with 10 activity classes and 151 participants, featuring 24-hour wrist-worn accelerometer data.

Key Insights and Ideas

  • Alignment as Reasoning: The core breakthrough is that teaching an LLM to describe trends (rising, falling, stable) acts as a semantic bridge. Once the model understands the "shape" of the data in human terms, the jump to classifying the activity (e.g., recognizing that a specific rising/falling pattern equates to walking) becomes much easier.
  • Special Tokens are Structural Glue: By wrapping each sensor channel in unique start/end tokens, the authors prevented "modality confusion." This allows the LLM to effectively process multivariate inputs without losing track of which signal came from which axis.
  • Domain Agnosticism: Because the alignment stage focuses on universal patterns (trends) rather than specific activities, the learned representations are highly robust. The model can be trained for alignment on one dataset and still perform exceptionally well when tuned for a different task on another dataset.

Key Results

  • Superior Performance: SensorLLM matched or outperformed 11 state-of-the-art baselines, including specialized models like Attend and DeepConvLSTM. On the challenging CAPTURE-24 dataset, it achieved a 48.6% F1-macro score, representing a significant +5.0% absolute gain over the previous best model.
  • Better than GPT-4o at Data Understanding: In a direct comparison, SensorLLM significantly outperformed GPT-4o in generating accurate trend descriptions from raw numbers, proving that specialized alignment is necessary even for the most advanced general-purpose LLMs.
  • Efficiency: The two-stage design is remarkably efficient. The second stage (Task-Aware Tuning) requires training only 0.12% of the model's parameters, making it highly feasible to adapt the model to new activity sets quickly.

Limitations and Future Work

  • Choice of Classifier: The current version uses a fixed-class linear head for classification. The authors acknowledge that using the LLM’s generative head instead could unlock "open-set" recognition, allowing the model to identify activities it wasn't explicitly trained on.
  • Feature Scope: The alignment currently focuses on simple temporal trends. Future work could incorporate frequency-domain features (like FFT) or periodicity analysis to help the model understand repetitive motions (like cycling or running) even better.
  • Inference Overhead: While training is efficient, running a multi-billion parameter LLM for real-time sensor inference on a wearable device remains a significant computational challenge compared to tiny, specialized CNNs.

Summary updated

BibTeX
@misc{li2024sensorllm,
  author = {Zechen Li and Shohreh Deldari and Linyao Chen and Hao Xue and Flora D. Salim},
  title = {{SensorLLM: Aligning Large Language Models with Motion Sensors for Human Activity Recognition}},
  year = {2024},
  eprint = {2410.10624},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2410.10624},
}
Figure