TL;DR
Predicting how long a molecule takes to travel through a liquid chromatography column—its retention time (RT)—usually requires training a dedicated machine learning model on hundreds or thousands of lab measurements for that exact setup. RT-ICL skips model training altogether: it feeds a large language model (LLM) the instrument's operating conditions, the query molecule's structure, and just 10 structurally similar reference molecules from the same system, achieving accuracy that matches or beats specialized transfer-learning and multitask-learning baselines.
What Problem Does This Paper Address?
In liquid chromatography–mass spectrometry (LC–MS), mass alone often cannot tell two candidate molecules apart. Retention time—the elapsed time from sample injection to the peak of a compound's signal—acts as a crucial tie-breaker.
The catch is that RT is notoriously picky. Change the column, the solvent gradient, or the temperature, and a molecule's RT shifts. Because measuring RTs experimentally for every compound on every possible setup is impractical, researchers build ML models to predict them. However, data-driven models (from classical regressors to graph neural networks) need large, system-specific training sets. Even modern workarounds like transfer learning (pretraining on a massive dataset like METLIN-SMRT and fine-tuning) or multitask learning (training jointly across multiple systems) still demand substantial external data. For data-scarce chromatographic systems—where you might have fewer than 200 measured compounds—building an accurate predictor remains a stubborn bottleneck.
Methods
Instead of training a model's weights, RT-ICL adapts a pretrained LLM (by default, Gemini-3-Flash with low thinking level and temperature 0) at inference time using in-context learning (ICL). The pipeline has three steps:
- Demonstration Selection: To give the LLM relevant examples, the query molecule and all compounds in the target system's small reference dataset are encoded as 4096-bit Morgan fingerprints (radius 3). The top-$K$ (default $K=10$) most structurally similar reference compounds are selected using Tanimoto similarity.
- Prompt Construction: The prompt combines three blocks:
- Task Context ($T_C$): Instructs the LLM to act as an LC–MS expert, specifies the target system's exact LC conditions (mode, column, temperature, mobile phases, flow rate, gradient program), and provides reasoning and formatting rules.
- Query Information ($T_Q$): Lists the query compound's name, SMILES string, molecular formula, and six RDKit-computed physicochemical descriptors relevant to retention (exact mass, LogP, TPSA, HBA, HBD, and aromatic ring count).
- Demonstrations ($T_D$): Presents the top-$K$ reference compounds with the exact same molecular fields, their Tanimoto similarity to the query, and their measured RTs.
- LLM Inference: The LLM reads the prompt and outputs a single scalar RT prediction in seconds—no gradient updates or fine-tuning required.
Datasets
The authors evaluated RT-ICL on 10 small RT datasets drawn from RepoRT, each containing fewer than 200 compounds after preprocessing ($N$ ranging from 72 to 192):
- 5 RPLC (Reversed-Phase Liquid Chromatography) systems: Datasets
0004,0182,0234,0235, and0317. - 5 HILIC (Hydrophilic Interaction Liquid Chromatography) systems: Datasets
0007,0027,0178,0231, and0283.
All experiments used 10-fold cross-validation repeated across three random seeds.
Key Insights and Ideas
- LLMs do more than simple interpolation: A natural question is whether the LLM is just averaging the RTs of the 10 nearest neighbors. To test this, the authors compared RT-ICL against a similarity-weighted $K$-NN regressor using the exact same 10 demonstrations. RT-ICL beat $K$-NN on all four metrics across all 10 datasets, showing that the LLM actively reasons over molecular descriptors, SMILES differences, and LC conditions.
- A single example goes a long way: In sensitivity tests, moving from zero-shot ($K=0$) to just one demonstration ($K=1$) caused a sharp drop in error, with most of the gains captured by $K=10$.
- Bigger reference pools still help: Subsampling the reference pool ($N=10, 20, 50$ vs. full) showed that a larger pool consistently improves predictions—not because the model is trained on more data, but because it can retrieve closer structural matches as demonstrations.
Key Results
Across the 10 data-scarce datasets, RT-ICL proved competitive with—and often superior to—training-based transfer learning (RT-GNN, MDL-TL) and multitask learning (Uni-RT) baselines:
- Overall wins: RT-ICL achieved the lowest MAE on 5/10 datasets, the lowest MedAE on 9/10 datasets, and the lowest MAPE on 8/10 datasets.
- RPLC vs. HILIC: Advantages were most consistent on RPLC systems, where RT-ICL ranked 1st or 2nd in MAE and 1st in MedAE and MAPE on all five datasets (e.g., reaching an MAE of 15.87 s and $R^2$ of 0.95 on dataset
0317). Performance on HILIC was more mixed: it led on0178and0231, whileRT-GNNachieved lower MAE and higher $R^2$ on0027and0283. - Backbone choice matters:
Gemini-3-Flashwas the strongest backbone, outperformingGPT-5.4-mini,GPT-OSS-120B, andQwen3-235B-A22B, though the other LLMs remained competitive with the baselines.
Limitations and Future Work
The authors do not include a dedicated limitations or future work section. From the results, however, two practical caveats stand out: RT-ICL's performance is noticeably more variable on HILIC systems than on RPLC systems, and its accuracy depends on both the choice of LLM backbone and having enough reference compounds in the target system to retrieve informative structural neighbors.
Summary updated