LightLLM: A Versatile Large Language Model for Predictive Light Sensing

Jiawei Hu, Hong Jia, Mahbub Hassan, Lina Yao, Brano Kusy, Wen Hu

TL;DR

This paper introduces LightLLM, a novel framework that adapts pre-trained Large Language Models (LLMs) for light-based sensing tasks. By integrating specialized sensor encoders, contextual prompts, and a unique fusion layer, LightLLM achieves state-of-the-art performance in tasks like indoor localization and solar forecasting, significantly outperforming existing methods and even direct LLM prompting.

What Problem Does This Paper Address?

Predictive Light Sensing (PLS) is crucial for intelligent and sustainable systems, enabling applications like indoor positioning and solar energy forecasting. Traditional approaches rely on task-specific deep learning models that require extensive manual tuning, retraining, and struggle with generalization to new environments. While LLMs show promise for their broad knowledge, directly applying them to sensor data is challenging as they are not designed for it and often require textual inputs. Existing LLM adaptations for specialized tasks still lack the ability to effectively process the nuanced spatial, spectral, and environmental data critical for PLS.

Methods

LightLLM is built upon a pre-trained LLM that remains frozen. Its core innovation lies in a modular architecture designed for multimodal sensor fusion:

  • Task-Specific Encoders: These modules are tailored to different data modalities. For localization, a Graph Neural Network (GNN) is used to capture spatial relationships, leveraging a custom Knowledge Graph (KG). For solar forecasting, Temporal Convolutional Networks (TCNs) handle time-series data, and for indoor solar estimation, Convolutional Neural Networks (CNNs) process spectral sensor data.
  • Task-Specific Knowledge Prompts: These are structured textual prompts that provide contextual information about the environment and task, guiding the LLM's understanding.
  • Latent Fusion Layer (LFL): This layer uses a multi-head attention mechanism to fuse the encoded sensor features with the prompt embeddings, aligning them within the LLM's latent space.
  • LoRA (Low-Rank Adaptation): This efficient fine-tuning technique is used to adapt the LLM to specific tasks with minimal trainable parameters, preserving the LLM's original knowledge.
  • Knowledge Graph (KG): For tasks like indoor localization, a custom KG is constructed to represent complex spatial relationships between sensors and light sources, enhancing GNN encoder performance.

Datasets

The paper evaluates LightLLM on real-world experimental datasets for three distinct PLS tasks:

  • Light Spectral Localization: Data collected from two indoor environments (office and apartment) using spectral sensors.
  • Outdoor Solar Forecasting: A dataset containing over three years of PV power generation data (SKIPP'D dataset).
  • Indoor Solar Estimation: Data collected from spectral sensors and semi-transparent solar cells in various indoor locations.

Key Insights and Ideas

  • LLMs can be effectively adapted for sensor data: LightLLM demonstrates that LLMs, when augmented with specialized encoders and fusion mechanisms, can process and interpret complex sensor data for tasks beyond natural language.
  • Multimodal fusion is key: The combination of sensor data, contextual prompts, and the LLM's pre-trained knowledge through the LFL is crucial for achieving high performance, especially in unseen environments.
  • Task-specific context matters: Providing structured, domain-specific information via prompts significantly enhances the LLM's ability to understand and reason about sensor data.
  • Generalization is a major advantage: LightLLM shows remarkable generalization capabilities to unseen environments, a significant challenge for traditional PLS models.
  • Knowledge Graphs enhance spatial reasoning: The custom KG for localization significantly improves the GNN's ability to capture inter-sensor dependencies and spatial relationships.

Key Results

  • Localization: LightLLM achieved a 4.4x improvement in localization accuracy in unseen environments compared to state-of-the-art methods like Iris.
  • Indoor Solar Estimation: LightLLM demonstrated a 3.4x improvement in indoor solar estimation accuracy, achieving a MAPE of 26.33% in unseen environments, significantly outperforming traditional equation-based and machine learning models.
  • Outdoor Solar Forecasting: LightLLM outperformed existing methods like SkyGPT and TimeLLM, achieving a CRPS of 1.92 kW and a Forecast Skill (FS) improvement of 33.7% in seen scenarios.
  • Comparison with Direct Prompting: LightLLM significantly outperformed ChatGPT-4 and other LLMs using direct prompting (zero-shot and few-shot) across all evaluated tasks, highlighting the advantage of its specialized architecture.

Limitations and Future Work

  • LLM Model Exploration: The authors plan to investigate how different pre-trained LLM models (e.g., larger models like LLaMA-7B vs. GPT-2) impact performance, noting that larger models generally perform better.
  • Task-Specific Tuning Overhead: While LoRA reduces retraining needs, some overhead remains for task-specific tuning, especially with novel sensor modalities. Future work could explore more efficient methods to minimize data requirements and automate adaptation.
  • Cross-Domain Adaptability: The paper suggests exploring the LLM's potential for other context-rich sensing applications beyond PLS.
  • Resource Demands: The trade-offs between model complexity, performance, and resource demands of larger LLMs will be further investigated.

Summary updated

BibTeX
@inproceedings{hu2025lightllm,
  author = {Jiawei Hu and Hong Jia and Mahbub Hassan and Lina Yao and Brano Kusy and Wen Hu},
  title = {{LightLLM: A Versatile Large Language Model for Predictive Light Sensing}},
  booktitle = {SenSys},
  year = {2025},
  doi = {10.1145/3715014.3722067},
}
Figure