Source-linked AI summary
GeneGPT: Augmenting Large Language Models with Domain Tools for Improved Access to Biomedical Information
Qiao Jin, Yifan Yang, Qingyu Chen, Zhiyong Lu
TL;DR
LLMs can hallucinate biomedical answers and lack an intrinsic mechanism to consult authoritative sources. GeneGPT teaches Codex to use NCBI Web APIs through in-context learning and API-aware decoding, achieving state-of-the-art performance across eight GeneTuring tasks while supporting chained API calls for multi-hop questions.
Problem
LLMs can generate plausible but incorrect content, motivating augmentation with external tools for more precise biomedical information access.
Method
GeneGPT prompts Codex to answer genomics questions with NCBI Web APIs using API demonstrations, documentation, and an inference algorithm that detects and executes calls.
Results
GeneGPT achieves state-of-the-art performance on eight GeneTuring tasks, with an average score of 0.83 versus 0.44 for the new Bing.
Takeaways & Limitations
API demonstrations generalize across tasks, GeneGPT handles longer chains of API calls for multi-hop questions, and database utility tools may outperform relevant web pages for biomedical information needs.
Takeaways & Limitations
Some questions are not answerable with NCBI databases, producing errors when API results do not contain the answer.
Abstract
from arXiv · showhide
While large language models (LLMs) have been successfully applied to various tasks, they still face challenges with hallucinations. Augmenting LLMs with domain-specific tools such as database utilities can facilitate easier and more precise access to specialized knowledge. In this paper, we present GeneGPT, a novel method for teaching LLMs to use the Web APIs of the National Center for Biotechnology Information (NCBI) for answering genomics questions. Specifically, we prompt Codex to solve the GeneTuring tests with NCBI Web APIs by in-context learning and an augmented decoding algorithm that can detect and execute API calls. Experimental results show that GeneGPT achieves state-of-the-art performance on eight tasks in the GeneTuring benchmark with an average score of 0.83, largely surpassing retrieval-augmented LLMs such as the new Bing (0.44), biomedical LLMs such as BioMedLM (0.08) and BioGPT (0.04), as well as GPT-3 (0.16) and ChatGPT (0.12). Our further analyses suggest that: (1) API demonstrations have good cross-task generalizability and are more useful than documentations for in-context learning; (2) GeneGPT can generalize to longer chains of API calls and answer multi-hop questions in GeneHop, a novel dataset introduced in this work; (3) Different types of errors are enriched in different tasks, providing valuable insights for future improvements.
1 Introduction
GeneGPT addresses LLM hallucinations by teaching Codex to use NCBI Web APIs for biomedical question answering. It achieves state-of-the-art performance on eight GeneTuring tasks and supports multi-hop genomics questions through chained API calls.
- Motivation: NCBI Web APIs provide more precise biomedical information access while avoiding local database maintenance and heavy computation requirements.The paper emphasizes internet access as the main requirement for using these APIs.
- GeneGPT: GeneGPT teaches Codex to use NCBI Web APIs through in-context learning and an inference algorithm that integrates API calls into decoding.Its prompt combines API documentation and usage demonstrations.
- Analyses: API demonstrations were more useful than documentation for in-context learning, and GeneGPT generalized to longer API-call chains for multi-hop questions.The study introduced GeneHop to evaluate multi-hop genomics question answering.
- Contributions: The work presents GeneGPT as the first study, to the authors’ knowledge, augmenting LLMs with domain-specific Web API tools.The contribution targets biomedical question answering with NCBI resources.
- Results: 0.83 average score across eight GeneTuring tasks exceeded the previous state-of-the-art 0.44 achieved by the new Bing.GeneGPT achieved the best performance on the evaluated tasks.
2 GeneGPT
GeneGPT uses NCBI’s E-utils and BLAST Web APIs as external tools for biomedical information retrieval and sequence analysis. Its engineered prompt teaches Codex API usage through instructions, documentation, demonstrations, and a test question.
- NCBI Web APIs: The method uses E-utils for biomedical database access and BLAST for DNA sequence alignment, with API calls implemented in Python.These tools expose database retrieval and sequence-alignment functionality through Web APIs.
- NCBI Web APIs: E-utils provides access to 38 Entrez biomedical databases through fixed URL syntax and functions including esearch, efetch, and esummary.Typical use searches for identifiers before retrieving records or summaries.
- NCBI Web APIs: BLAST accepts nucleotide or amino-acid sequences and searches NCBI databases for similar sequences using configurable API parameters.A Put request returns an RID, which a subsequent Get request uses to retrieve results.
- Prompt design: GeneGPT teaches API use with an engineered prompt containing an instruction, API documentation, API demonstrations, and a task-specific test question.The instruction explicitly directs the model to use NCBI APIs for genomic questions.
2. Documentations (Dc.) provide natural lan-
GeneGPT’s prompt supplies API documentation and concrete demonstrations, while its decoding process detects generated API requests, executes them, and feeds results back to Codex. Analyses show that a reduced demonstration set can still work across tasks.
- Demonstrations (Dm.): API demonstrations give concrete examples covering esearch, efetch, esummary, blastn, and four NCBI databases.API URLs and returned results are marked in the prompt, with “->” indicating API calls.
- Test question: The test question is appended after the fixed instruction, documentation, and demonstration components.Only the final question component varies by task.
- Ablation analysis: GeneGPT-slim uses only two demonstrations yet works well on all tasks, according to the authors’ analyses.The initial GeneGPT-full configuration includes all documentation and demonstrations.
- Inference algorithm: Codex was selected for code understanding and its 8k-token context length, which accommodates the demonstrations.The paper links these properties to URL generation and raw API-result interpretation.
- Inference algorithm: The inference algorithm stops generation when “->” appears, extracts the last URL, calls the NCBI API, and appends raw results for continued decoding.Generation ends when “\n\n” appears, after which the answer is extracted.
3 Experiments
GeneGPT is evaluated on NCBI-related GeneTuring tasks across nomenclature, genomic location, functional analysis, and sequence alignment, using full and slim prompt settings against multiple LLM baselines.
- Evaluation setup: The evaluation uses nine GeneTuring tasks related to NCBI resources, organized into nomenclature, genomic location, functional analysis, and sequence alignment modules.The selected tasks cover gene names, gene and SNP locations, gene functions, and DNA-sequence mapping.
- Evaluation setup: GeneGPT is evaluated in full and slim settings, with the slim setting using only the gene-alias and BLAST demonstrations.Compared LLM baselines include GPT-2, GPT-3, ChatGPT, BioGPT, BioMedLM, and the new Bing.
- Evaluation setup: The evaluation applies strict automatic criteria, including exact matches for nomenclature and genomic-location tasks and a 0.5 score for correct chromosome but incorrect position mapping.Some predictions receive simple vocabulary normalization before exact matching, while competing results were manually evaluated in the original benchmark.
- Nomenclature: 1.00 accuracy is achieved on gene name conversion, while gene alias reaches 0.84; GeneGPT averages 0.92 versus 0.76 for New Bing on nomenclature.Other GPT models score below 0.10 on these nomenclature tasks.
- Genomic location: 1.00 is achieved on both gene-SNP association and SNP location, while gene location reaches 0.66; New Bing is comparable only on gene location at 0.61.New Bing performs close to zero on the two SNP-related tasks, and GeneGPT-slim performs comparably to GeneGPT-full on genomic-location tasks.
- Functional analysis and sequence alignment: 0.66 is GeneGPT’s average sequence-alignment score, compared with 0.00 for New Bing, while New Bing leads functional analysis 0.91 to 0.84.The paper attributes the alignment advantage to the BLAST tool’s suitability for highly specific sequences.
- Overall results: 0.83 is GeneGPT’s macro-average across the benchmark versus 0.44 for New Bing, with GeneGPT leading both one-shot tasks and six of seven zero-shot tasks.New Bing outperforms GeneGPT only on gene disease association.
4 Discussions
The discussion examines GeneGPT’s component importance, multi-hop generalization, GeneHop performance, and task-specific errors. Results indicate that demonstrations support cross-task transfer and longer API-call chains, while errors vary by task.
- RQ1: Component importance: BLAST demonstrations significantly affect DNA-to-genome and species-alignment performance, whereas BLAST documentation ablation does not.Other prompt-component ablations mainly affect one relevant task.
- RQ1: Component importance: Two demonstrations, Dm.1 and Dm.4, generalize across all GeneTuring tasks and outperform the full prompt overall.GeneGPT-slim uses only these two demonstrations and achieves state-of-the-art overall results.
- RQ2: Multi-hop QA on GeneHop: GeneHop extends GeneTuring with three multi-hop tasks: SNP gene function, disease gene location, and sequence gene alias.These tasks require chained subquestions rather than the single-step reasoning used in GeneTuring.
- RQ2: Multi-hop QA on GeneHop: GeneGPT decomposes multi-hop questions and can reuse an identifier from one API result to make a subsequent esummary call directly.This shortcut was not shown in the prompt and was elicited by chain-of-thought API calls.
- RQ2: Multi-hop QA on GeneHop: GeneGPT generalizes to a chain involving 3 subquestions and 4 API calls, exceeding the length of all in-context demonstrations.The demonstrations contained at most one single-hop question and two API calls.
- RQ2: Multi-hop QA on GeneHop: 0.50 v.s. 0.24: GeneGPT achieves a higher average GeneHop score than New Bing across the three evaluated multi-hop tasks.New Bing performs better on disease gene location but fails on the other two tasks because specialized inputs are not indexed.
- RQ3: Error analysis: Different tasks show enriched error types: simple tasks mostly have E4, disease tasks have E1, alignment has O, and GeneHop has E2 and E3.The five categories include wrong APIs, wrong arguments, failure to extract answers, unanswerable API results, and other errors.
5 Related work
Related work frames GeneGPT as tool augmentation for hallucination-prone LLMs and for biomedical questions requiring precise database access. It positions the study among retrieval and API-based approaches.
- Large language models: Auto-regressive LLMs remain susceptible to hallucinations, motivating augmentation with external tools.The cited tool categories include retrieved content and program APIs.
- Tool augmentation: Tool augmentation includes search-engine retrieval and program APIs learned through in-context learning or fine-tuning.GeneGPT studies in-context learning from NCBI Web API documentation and demonstrations.
- Tool augmentation: GeneGPT is presented as the first study of in-context learning with NCBI Web API documentation and demonstrations.The related-work discussion distinguishes this focus from prior search-engine and program-API augmentation studies.
- Biomedical question answering: Biomedical QA supports clinical decision-making and knowledge acquisition, but data-intensive database-entry tasks challenge autoregressive LLMs.Retrieval augmentation can also fall short when specialized databases are not indexed by commercial search engines.
6 Conclusions
GeneGPT teaches LLMs to use NCBI Web APIs, achieving state-of-the-art performance on eight GeneTuring tasks and supporting chained API calls.
- GeneGPT teaches LLMs to use NCBI Web APIs for biomedical information access.
- GeneGPT achieves state-of-the-art performance on eight GeneTuring tasks.
- The method can perform chain-of-thought API calls.
- The results indicate that database utility tools might be superior to relevant web pages for faithfully serving biomedical information needs.
B GeneTuring samples
This section presents sample question-answer pairs from the GeneTuring benchmark, which is publicly available.
- Table 5 provides sample question-answer pairs from the GeneTuring tasks.
- The GeneTuring dataset is publicly available.
C GeneHop collection
GeneHop contains three multi-hop genomics question-answering tasks built from GeneTuring examples, with manually constructed answers and API-based prompt demonstrations.
- GeneHop collection: GeneHop contains three multi-hop tasks: SNP gene function, disease gene location, and sequence gene alias.Each task contains 50 questions.
- SNP gene function: The SNP gene function task asks for the function of the gene associated with a given SNP.Its 50 SNPs are reused from GeneTuring, and ground-truth functions are manually annotated using gene associations and gene information.
- Disease gene location: The disease gene location task asks for chromosome locations of genes related to a given disease.The 50 diseases are reused from GeneTuring, and chromosome-location ground truth is manually annotated from NCBI gene information pages.
- Prompt components: GeneGPT prompts include E-utils and BLAST documentation plus four API-use demonstrations covering GeneTuring tasks.The demonstrations provide clickable API URLs whose results are inserted into the prompt; the BLAST alignment example extracts a PID with a regular expression before continuing.
- Sequence gene alias: The sequence gene alias task asks for aliases of the gene containing a specific DNA sequence.Sequences are manually cropped from genes used in GeneTuring's gene alias task, with official names and aliases used for annotation.
D GeneHop evaluation
GeneHop evaluation uses task-specific scoring, combining manual assessment for some answers with exact-match or recall-based criteria.
- SNP gene function: SNP gene function answers receive scores of 1, 0.5, or 0 based on exact, partial, or absent matches.A non-coding gene mention also receives a score of 1 when GeneGPT's answer mentions it.
- Disease gene location: Disease gene location is evaluated by recall of ground-truth chromosome locations.GeneGPT uses stricter automatic exact matching, whereas partial matches are accepted for the New Bing.
- Sequence gene alias: Sequence gene alias is evaluated by recall using exact alias matches while ignoring case differences.Answers from GeneGPT and the New Bing are manually evaluated.
E Error types
GeneGPT errors fall into distinct categories involving API selection, argument formatting, answer extraction, unavailable information, and ambiguous sequence references. These errors are concentrated in particular task types and reveal specific boundaries of API-based answering.
- E1: Wrong API or no API: Wrong API selection or omission occurs in disease-related tasks when the model uses the gene database instead of the omim database.The example asks for genes related to immunodeficiency due to a MAPBP-interacting protein defect.
- E2: Wrong arguments: Using the correct API with incorrect arguments causes failures, such as passing the full rs397784008 string instead of 397784008 as the identifier.This error appears in the SNP-location example, where the rs prefix should be removed from the id argument.
- E3: Answer extraction: Failure to extract the answer from an API result commonly affects gene-function tasks, leaving only protein-family information instead of functional details.The accompanying example concerns a GeneHop SNP-to-gene-function question solved through subquestion decomposition.
- E4: Missing API results: Some questions remain unanswerable when the model makes the right API call but the returned results do not contain the answer.This category is illustrated by a gene that is not indexed by the NCBI gene database.
- Other errors: Other errors are especially common in BLAST tasks because the benchmark omits the reference genome, making specific chromosome ranges difficult to match.The chromosomes may be correct while the reported ranges differ, as in chr8:7081648-7081782 versus chr8:1207812-1207946.