Bioc chatbot: a prototype
Bioc chatbot | May 2024
1
May 16th, 2024
Contents
May 2024
2
Bioc chatbot
Background
The Bioconductor support site (support.bioconductor.org)
3
Bioc chatbot
Background
Users are asking analysis and coding questions …
4
Bioc chatbot
Background
… and get answers from experts in the field
5
Bioc chatbot
Background
ChatGPT to the rescue, can an LLM replace the need for an expert?
6
We explore two options:
Commercial solutions
API-only
Azure Open AI: REST API access to OpenAI's LLMs including GPT-4
Pros: capabilities, performance, UI, service
Cons: cost, transparency, limited control
Pricing
(per 1M tokens)
$30
$15
$7
Open-source solutions
Open, transparent, and reproducible LLMs
→ Not suitable substitutes for closed product LLMs (ChatGPT, BARD, Claude)
LLaMA2 (Touvron et al., Jul 2023):
Goal: Deploy open-source models on HMS’ Slurm cluster
Aspects to consider: how to obtain, serve and run open LLMs given Slurm cluster setup
8
Background
Azure Open AI interface: important components
9
System prompt:
Tell the model its purpose and how to behave
Response examples:
Show the model what kind of responses you want
System prompt
Tell the model its purpose and how to behave
10
System prompt
Tell the model its purpose and how to behave
11
{"systemPrompt":"Your name is MAESTRO. \nYou are a Tutor AI that helps users of the Bioconductor repository with analytic and programming-related questions.\n\nYour responses will provide users with information on how to solve problems in statistics and the analysis of genomic high-throughput data using the R programming language. \n\nYou can access any resource on bioconductor.org but you must cite the url.\n\nIf a question is ambiguous or outside the scope of your expertise, then you should seek clarification or guide the user towards more relevant topics at bioconductor.org\n\nYou can cite any resource on github.com IF AND ONLY IF bioconductor is referenced and you must cite the url.\n\n\n"
Response examples
Curated examples of top voted responses on the support site
12
Task the model with an ID mapping task (1/3)
We want to map ENSEMBL IDs to gene symbols …
13
A real example question from the support site
A correct answer:
content / format follows system prompt & response examples
A reference is provided as
requested in the system prompt
Task the model with an ID mapping task (2/3)
Can we use Bioconductor annotation packages instead?
14
Task the model with an ID mapping task (3/3)
How about specifically using the ensembldb package?
15
Retrieval-augmented generation (RAG)
Enhancing accuracy and reliability of the model
16
Retrieval-Augmented Generation (RAG) is the process of optimizing the output of a large language model, so it references a knowledge base outside of its training data sources before generating a response
Here we generate a knowledge base using:
of Bioconductor packages.
Retrieval-augmented generation (RAG)
Creating a RAG store on Azure Open AI (1/2)
17
Retrieval-augmented generation (RAG)
Creating a RAG store on Azure Open AI (2/2)
18
Retrieval-augmented generation (RAG)
Short demo from Nitesh
19
Deployment options
May 2024
20
Bioc chatbot
Evaluation strategies
GPT4 w/wo RAG vs. LLaMA2 w/wo RAG vs. LLaMA3 w/wo RAG
21
Bioc chatbot
Embedding-based evaluation
22
Bioc chatbot
Ground truth
GPT4 + RAG
GPT4
Llama2 + RAG
Llama2
Diffusion-based evaluation
23
Bioc chatbot
SummarizedExperiment(
assays=SimpleList(counts=counts),
rowRanges=rowRanges, colData=colData)
SummarizedExperiment(
assays=SimpleList(counts=counts),
rowRanges=colData, colData=rowRanges)
Error in validObject(.Object) : …
Ground truth
Diffused version
LLM
LLM-based evaluation
24
Bioc chatbot
User: How many classes in SummarizedExperiment?
Assistant: The SummarizedExperiment package contains two main classes: SE and RSE.
User: The question is “How many classes in SummarizedExperiment?” Does the answer “The SummarizedExperiment package contains two main classes: SE and RSE.” correctly states that there are two classes? Answer with “Yes” or “No”.
Judge: Yes.
LLM
LLM-as-a-judge
Questions for CWG & Bioc core
May 2024
25
Bioc chatbot