Skip to main content
ARS Home » Pacific West Area » Davis, California » Western Human Nutrition Research Center » Diet, Microbiome and Immunity Research » Research » Publications at this Location » Publication #429400

Research Project: Effect of Diet on Gut Microbiome, Gastrointestinal Health, and Immune Function

Location: Diet, Microbiome and Immunity Research

Title: Evaluation of large language models for mapping dietary data to food databases

Author
item Lemay, Danielle
item STROHMEIER, MICHAEL - New College Of Florida
item Stoker Jr, Richard
item LARKE, JULES - University Of California, Davis
item WILSON, STEPHANIE - University Of California, Davis

Submitted to: Journal of Nutrition
Publication Type: Peer Reviewed Journal
Publication Acceptance Date: 3/13/2026
Publication Date: 6/15/2026
Citation: Lemay, D.G., Strohmeier, M.P., Stoker, Jr., R.B., Larke, J.A., Wilson, S.M. 2026. Evaluation of large language models for mapping dietary data to food databases. Journal of Nutrition. 156(8). Article 101678. https://doi.org/10.1016/j.tjnut.2026.101678.
DOI: https://doi.org/10.1016/j.tjnut.2026.101678

Interpretive Summary: To study what people eat, scientists need to match the foods people report eating with detailed databases that contain information about the chemical compounds in those foods. This matching process is currently done mostly by hand, which is incredibly time-consuming and prone to errors. The team developed and tested several computer methods to automatically match food descriptions to food databases. They tested these methods on two different scenarios: one with a large database where most foods had good matches, and another with a smaller database where nearly half the foods couldn't be matched at all. They found that a technique called "semantic embedding" (which understands the meaning behind food names, not just the exact words) worked best for finding potential matches. When they combined this with large language models to make the final decision, they achieved accuracy rates of 91% and 65% respectively on their two test scenarios. This automated approach could save nutrition researchers countless hours of manual work while improving accuracy. The researchers also created a free web tool called FoodMapper that anyone can use to get automatic food matches. This advancement brings us closer to "precision nutrition" - where dietary recommendations can be tailored to individuals based on the specific compounds in foods, rather than just basic nutrients like calories and vitamins.

Technical Abstract: Background: New food databases increasingly provide biochemical information not yet captured in standard food composition databases (FCDs). To enable precision nutrition, new methods are needed to map foods to new FCDs. Objective: We sought to provide real-world benchmark datasets and evaluate methods to match foods reported in dietary data with foods in FCDs. Methods: Two benchmark datasets were developed. ASA24-to-FooDB included a large target database (9,910 entries) with many similar or perfect matches. NHANES-to-DFG2 included a small target database (256 entries) with imperfect matches or “No Match” (46.9%). Matching methods tested included fuzzy matching, TF-IDF, semantic embedding, and large language models (LLMs). Results: Food text description mapping using similarity scores from semantic embedding performed better on both benchmarks (87.8% accuracy, ASA24-to-FooDB; 48.0% accuracy, NHANES-to-DFG2) than fuzzy matching or TF-IDF. LLMs performed worse on ASA24-to-FooDB when given entire the target database in the prompt, but better on NHANES-to-DFG2 (62.6% accuracy). For foods where a correct match exists, semantic similarity yielded top K accuracies of 85% or 95% at k=5 or 10 for ASA24-to-FooDB and 96% or 98% at k=5 or 10 for NHANES-to-DFG2. A hybrid approach of using semantic embedding to select the top K matches to prompt LLMs yielded overall accuracies of 90.7% on ASA24-to-FooDB and 65.4% on NHANES-to-DFG2. An investigation of different prompt strategies and model sizes demonstrated that simpler prompts worked better for larger LLMs while smaller LLMs needed detailed instructions. To assist nutrition scientists, the FoodMapper ShinyApp (https://richtext-semantic-food-mapper.hf.space/) was built to provide mappings based on semantic similarity. Conclusions: To match food text descriptions to FCDs, identifying top matches using semantic similarity followed by an LLM to choose from among top matches or “no match” resulted in the best overall accuracy. For those without LLM access, FoodMapper can be used to reduce the number of foods that need manual attention.