LLMs read compact spectra better—but a random forest still won
A Polish study translated visible and near-infrared spectra into human-readable features. The format beat raw numerical prompts across tested models, but the best LLM fell sharply in a harder scene and never surpassed a conventional classifier.
The short version
- What happened
- The experiment used two scenes from one open hyperspectral blood dataset, with 300 spectra per class for training prototypes and 100 per class for testing across seven controlled-scene and six environmental-scene classes.
- Who it affects
- Scientists could inspect a shorter account of the spectral evidence passed into a language model, but forensic or clinical users would face serious consequences from confident misclassification. The present evidence supports supervised research tooling, not autonomous substance identification.
- What remains unproven
- One open VNIR dataset and two scenes; within-scene spatial splits rather than new physical samples; one query per spectrum; limited repeated-split evidence; no expert-usefulness or rationale-faithfulness study; no token or end-to-end latency measurement.
Keep in mind
One open VNIR dataset and two scenes; within-scene spatial splits rather than new physical samples; one query per spectrum; limited repeated-split evidence; no expert-usefulness or rationale-faithfulness study; no token or end-to-end latency measurement.
Source analysis · 1 linked source. Primary analysed source date: 17 October 2026.
Read the full report · 4 min The evidence, methods, implications and limitations
The useful step was feature extraction, not conversational wording
Researchers in Poland tested whether general-purpose language models can work with visible and near-infrared spectra after a deterministic encoder turns each 113-band signal into summary statistics and prominent peaks and valleys. Those features were supplied as natural language or structured JSON and compared with full spectra written as CSV, JSON or XML. The task was to distinguish blood from visually similar substances in two scenes from one open hyperspectral dataset. Each class contributed 300 training spectra and 100 test spectra: seven classes in a controlled fabric scene and six in a more complex scene with wood, metal, plastic and mixed backgrounds.[1]
Compact descriptions helped LLMs, but not enough to beat a specialist baseline
Across Llama-4-Scout, Qwen-14B and gpt-oss-20b, natural-language features improved multiclass balanced accuracy over raw CSV by 12.8 to 33.9 percentage points when malformed outputs counted as wrong. The paired confidence intervals excluded zero in all six model–scene comparisons. Yet the closer comparison—natural language against JSON containing the same statistics and extrema—was significant in only two of six cells after correction, with no consistent winner. That means extracting relevant spectral structure did most of the work; prose itself was not established as superior.
The best natural-language LLM result was gpt-oss-20b at 76.77% balanced accuracy in the controlled scene. In the environmental scene, Qwen-14B reached 52.30% and gpt-oss-20b 51.15%. A random forest trained on the raw spectra reached 99.86% and 88.33% respectively. Compact prompts were shorter—the natural-language representation averaged 4,534 characters across 700 saved controlled-scene prompts, 21% fewer than raw CSV—but token counts and end-to-end latency were not measured.[1]
The distinction that matters
What changed between the strongest comparisons
The study separates the value of extracting spectral features from the value of expressing them as prose.
Raw prompt
Send 113 numerical bands to an LLM
Long input and weaker classification
Compact prompt
Extract statistics, peaks and valleys
12.8–33.9 points above raw CSV
Specialist model
Train random forest on full spectra
99.86% and 88.33% balanced accuracy
Readable inputs are not the same as validated explanations
The method exposes which wavelengths, extrema and statistics entered the prompt, which could help scientists inspect evidence or connect a spectrum to a text-based search and tool workflow. It does not prove that an LLM's generated rationale faithfully describes its internal reasoning. The researchers did not run a blinded expert-usefulness study or a causal faithfulness test, and model-reported confidence was overconfident and weakly related to correctness. Each spectrum was queried once under sampling defaults, so decoding variability was not measured.
Training and test patches were spatially separated with guard zones, but all spectra came from the same two physical scenes and one dataset. The experiment did not test new samples, acquisition sessions, instruments, laboratories or spectral modalities such as Raman or infrared. For laboratory staff, the immediate implication is practical: a compact textual interface may be useful when spectral evidence must enter an LLM workflow, but it should not replace a conventional classifier when labelled data and predictive accuracy are the goal. Cross-session replication, expert trials and deterministic decoding would materially strengthen the case.[1]