BACKGROUND: Most artificial intelligence tools used to estimate nutritional content rely on image input. However, whether large language models (LLMs) can accurately predict nutritional values based solely on text descriptions of foods consumed remains unknown. If effective, this approach could enable simpler dietary monitoring without the need for photographs. METHODS: We used 24-hour dietary recalls from adolescents aged 12-19 years in the National Health and Nutrition Examination Survey (NHANES). An open-source quantized LLM was prompted using a 10-shot, chain-of-thought approach to estimate energy and five macronutrients based solely on text strings listing foods and their quantities. We then applied parameter-efficient fine-tuning (PEFT) to evaluate whether predictive accuracy improved. NHANES-calculated values served as the ground truth for energy, proteins, carbohydrates, total sugar, dietary fiber and total fat. RESULTS: In a pooled dataset of 11,281 adolescents (49.9% male, mean age 15.4 years), the vanilla LLM yielded poor predictions. The mean absolute error (MAE) was 652.08 for energy and the Lin's CCC <0.46 across endpoints. In contrast, the fine-tuned model performed substantially better, with energy MAEs ranging from 171.34 to 190.90 across subsets, and Lin's CCC exceeding 0.89 for all outcomes. CONCLUSIONS: When prompted using a chain-of-thought approach and fine-tuned with PEFT, open-source LLMs exposed solely to text input can accurately predict energy and macronutrient values from 24-hour dietary recalls. This approach holds promise for low-burden, text-based dietary monitoring tools.
翻译:背景:目前大多数用于估算营养成分的人工智能工具依赖于图像输入。然而,大型语言模型(LLMs)能否仅根据食物消费的文本描述准确预测营养价值仍属未知。若该方法有效,将可实现无需拍摄照片的简化膳食监测。方法:我们采用美国国家健康与营养调查(NHANES)中12-19岁青少年的24小时饮食回顾数据。通过10样本思维链提示方式,驱动一个开源量化LLM仅依据列举食物及其数量的文本字符串来估算能量及五种宏量营养素。随后应用参数高效微调(PEFT)评估预测准确性是否提升。以NHANES计算值作为能量、蛋白质、碳水化合物、总糖、膳食纤维和总脂肪的基准真值。结果:在包含11,281名青少年(49.9%男性,平均年龄15.4岁)的汇总数据集中,原始LLM预测效果较差。能量平均绝对误差(MAE)为652.08,所有终点的Lin's CCC均<0.46。相比之下,微调模型表现显著改善:各子集能量MAE介于171.34至190.90之间,所有结局指标的Lin's CCC均超过0.89。结论:当采用思维链提示方式并结合PEFT微调时,仅接触文本输入的开源LLMs能够准确预测24小时饮食回顾中的能量与宏量营养素数值。该方法为开发低负担、基于文本的膳食监测工具提供了可行路径。