SpecLLM Encodes VNIR Spectra for LLMs
- •Researchers publish SpecLLM, a method for representing VNIR spectra as compact features for large language models
- •Tests on two scenes from an open-access hyperspectral blood dataset compared compact inputs with raw spectra
- •Compact representations beat raw numerical inputs for selected models, but trailed a Random Forest using raw spectra
Researchers at the Institute of Theoretical and Applied Informatics of the Polish Academy of Sciences and Nicolaus Copernicus University in Toruń presented SpecLLM, a method for giving large language models (LLMs) compact descriptions of visible and near-infrared (VNIR) spectra. The study, published in Scientific Reports on October 17, 2026, targets a limitation of earlier approaches: machine-learning and foundation models for hyperspectral data often return numerical outputs or latent representations, while LLM-based methods have mostly used raw numerical sequences. Spectroscopists, by contrast, interpret spectra through features such as peak positions and intensities.
SpecLLM extracts summary statistics and discriminative extrema from spectra, then serializes those features as natural language or structured JSON. This replaces full-spectrum inputs encoded as comma-separated values (CSV), JSON, or extensible markup language (XML). The researchers evaluated prototype-based substance classification in two complementary scenes from an open-access VNIR hyperspectral blood dataset. For the selected models, the compact feature representations performed substantially better than raw numerical encodings, but worse than a Random Forest using raw spectra.
The natural-language representation makes the compact spectral evidence readable and inspectable, while reducing prompt length compared with full-spectrum encodings. The study also found natural-language and JSON feature representations broadly comparable. The research received no funding; the authors said they used tools including ChatGPT and Grammarly for editing, grammar enhancement, and spelling checks while preparing the manuscript.