<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Farming Open LLMs for Biomedical Question Answering</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Dimitra Panou</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Alexandros C. Dimopoulos</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Martin Reczko</string-name>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Department of Informatics and Telecommunications, National and Kapodistrian University of Athens</institution>
          ,
          <addr-line>15784 Athens</addr-line>
          ,
          <country country="GR">Greece</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Hellenic Naval Academy</institution>
          ,
          <addr-line>18539 Piraeus</addr-line>
          ,
          <country country="GR">Greece</country>
        </aff>
        <aff id="aff2">
          <label>2</label>
          <institution>Institute for Fundamental Biomedical Science, Biomedical Sciences Research Center "Alexander Fleming"</institution>
          ,
          <addr-line>34 Fleming Street, 16672 Vari</addr-line>
          ,
          <country country="GR">Greece</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>A large number of performant, open Large Language Models (LLMs) are continuously appearing. Here we deploy a selection of these for embedding and retrieval of documents and snippets as well as retrieval-augmented generators to answer biomedical questions within the BioASQ competition. Dense retrieval based on distances between dense representations obtained by LLM embeddings of the corpus and the question and hybrid sparse/dense methods result in higher mean average precisions compared to traditional sparse retrieval methods. In the exact answer category, which is processed using open LLMs in a zero-shot approach, our submission shares one first place in the last batch of the BioASQ 12b competition.</p>
      </abstract>
      <kwd-group>
        <kwd>eol&gt;Biomedical Question Answering</kwd>
        <kwd>BioASQ</kwd>
        <kwd>Large Language Models</kwd>
        <kwd>Retrieval-augmented generation</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
    </sec>
    <sec id="sec-2">
      <title>2. Methodology</title>
      <sec id="sec-2-1">
        <title>2.1. Phase A: Document Retrieval</title>
        <p>Doc Corpus
BM25</p>
        <p>Open
Embedding
models
Query
BM25 + RM3
Frequency
Matrices
Vectors
Candidate
Documents
GANBERT
Answers</p>
        <p>Open
Embedding
models
Cosine /
Euclidean
Distance
Sparse
Index
Dense
Index
Documents</p>
        <p>N = 10
Snippets</p>
        <p>Cosine /
Euclidean
Distance</p>
        <p>Open
Embedding
models
Candidate Snippets
Phase A</p>
        <sec id="sec-2-1-1">
          <title>Indexing</title>
        </sec>
        <sec id="sec-2-1-2">
          <title>Retrieval</title>
        </sec>
        <sec id="sec-2-1-3">
          <title>Ranking</title>
        </sec>
        <sec id="sec-2-1-4">
          <title>Snippets</title>
          <p>Snippets
abstracts. For the systems Fleming-2 and Fleming-3 in batch 2 we adopted a methodology where the top
20 retrieved documents were processed with a prompt asking to assess the relevance of each document
for the given question using several quantized open LLMs and finally MIXTRAL 1 via GPT4All and
Ollama, a software designed to streamline access to open models locally, eliminating the need for manual
downloading and scripting. This additional selection step did not improve retrieval performance.</p>
          <p>
            For batch 3 and 4, we evaluated dense retrieval methods that compare the embeddings of the
corpus with the embedding of the question obtained with diferent open LLMs that have embedding
dimensions &lt;= 1024, selected from the Massive Text Embedding Benchmark (MTEB) Leaderboard
at https://huggingface.co/spaces/mteb/leaderboard. We utilized both Euclidean distance and cosine
similarity metrics to evaluate the proximity between the documents and the query. This facilitated
the identification of the ten most closely related documents, as determined by smaller distances.
1https://mistral.ai/news/mixtral-of-experts
Subsequently, to combine the advantage of sparse retrieval methods finding documents with less
frequent words with the higher sensitivity of dense methods for semantic similarities, we use a threshold
for the distances returned from the dense search to replace documents exceeding this threshold with the
top documents returned from the sparse search. The details and performances of the sparse, dense and
hybrid retrieval methods are shown in table 1. Hybrid sparse and dense retrieval methods have been
suggested e.g. in [
            <xref ref-type="bibr" rid="ref7">7</xref>
            ]. All indices generated for the comparison in the table process Pubmed abstracts
published later than November 2001. As older questions in the BioASQ12 training set also require
older documents as correct answers, the performance on the complete training set is lower than on
the current four batches of BioASQ12. Tested on these batches, the dense retrieval using the embedder
jamesgpt1/sf_model_e5 has the best performance for batches 1 to 3, while on batch 4 and on the
training set, the hybrid combination of the dense embedder BAAI/bge-small-en-v1.5 with our
sparse BM25-rm3 retrieval version outperforms the other tested methods.
          </p>
        </sec>
      </sec>
      <sec id="sec-2-2">
        <title>2.2. Phase A: Snippet identification</title>
        <p>
          A standard approach [
          <xref ref-type="bibr" rid="ref8">8</xref>
          ] is used to identify snippets. The query and each candidate snippet are embedded
by various open LLMs and the cosine similarity between the embeddings is measured. Various window
sizes were explored to efectively isolate snippets from document abstracts and assess their correlation
with the provided question. Our primary aim was to extract a single snippet for each
documentquestion pair. Initially, we tested window sizes of 30 and 50, and subsequently implemented a two-step
embedding process. Initially, we evaluated the question-snippet pairs’ scores using an embedding model
and cosine similarity for a window size of 30. Then, we selected the snippet with the highest score for
the window size of 30. We further experimented with adjusting the starting and ending positions of the
window within the ranges [
          <xref ref-type="bibr" rid="ref10">-10, 10</xref>
          ] and [half window size, end of abstract], respectively. Additionally,
we explored segmenting the text into sentences and either preserving entire sentences or utilizing a
window size of [
          <xref ref-type="bibr" rid="ref4">0, 4</xref>
          ] sentences. This approach yielded superior results in terms of precision, recall,
and F-measure. The BioASQ questions are tagged with either "yes/no," "factoid," "summary," or "list" to
indicate the required format for the exact answers to be created by these systems. In table 2, the candidate
snippets are split according to the type of the question and the recall and F measure are reported for
the tested LLMs. Neither the question type nor the used LLM have a severe efect on the measured
metrics. For batch 1, 2 and 3, the model intfloat/multilingual-e5-large-instruct and for
batch 4 the model hkunlp/instructor-xl was used to identify snippets. It should be noted that the
model jamesgpt/sf_large_all had the best overall F measure, but the performance diference to
the other models is very small.
        </p>
        <p>Phase A+</p>
        <p>Predicted
Phase B</p>
        <p>Golden</p>
        <p>Query
smaug
dolphinstarling
mistral
llama3
llama2
phi</p>
      </sec>
      <sec id="sec-2-3">
        <title>2.3. Phase A+ / Phase B</title>
        <p>In Phase A+, participants will submit exact and/or ideal answers before the expert selected (gold)
documents and snippets (released in Phase B) are known. Thus, each participant has to use their
predictions for documents and snippets for further processing. Participants will have 24 hours to
provide exact answers for various question types ("yes/no," "factoid," "list") and ideal answers in the
form of paragraph-sized summaries. In figure 2 processing for both Phase A+ and Phase B is illustrated.</p>
        <p>We experimented with diferent prompts using various models to generate the answers using the
information given in the snippets in a zero-shot approach. Ultimately, we chose the MIXTRAL model
for List, Factoid, and Summary type of questions. The prompts used for each question type are as follows:</p>
        <p>Yes/No Prompt
Given only the following INFORMATION and QUESTION, answer the QUESTION only with ’Yes’ or ’No’
INFORMATION: %s QUESTION: %s</p>
        <p>List Prompt
Answer the QUESTION using only the TEXT by only returning a list of entity names, numbers, or similar short
expressions that are an answer to the question and are separated by commas. Only the list should be returned. If
you do not know any answer return the word EMPTY. TEXT: %s QUESTION: %s</p>
        <p>Factoid Prompt
Answer the QUESTION using only the TEXT by only returning a list of entity names, numbers, or similar short
expressions that are an answer to the question and are separated by commas,ordered by decreasing confidence.
Only the list should be returned. If you do not know any answer return the word EMPTY. TEXT: %s QUESTION:
%s</p>
        <p>Summary Prompt
##ABSTRACT: %s ##QUESTION: %s ##TASK: Answer the QUESTION by returning a single paragraph sized
text ideally summarizing only the most relevant information in the ABSTRACT.</p>
        <p>In all these prompts, the %s after QUESTION is replaced by the actual question, and the %s
after INFORMATION, TEXT or ABSTRACT is replaced with the collection of the related snippets,
concatenated and separated by a single blank. The answers by the LLMs are processed by custom awk
scripts that eliminate doublettes in the case of list and factoid questions and extract the diference of
’Yes’ and ’No’ for Yes/No type questions.</p>
        <p>The performances obtained for the Yes/No questions of the training set using diferent open LLMs
are listed in table 3. As also observed in other applications, a larger number of parameters typically also
leads to a higher prediction accuracy. Llama3-70B is a noteworthy exception in our tests, performing
slightly worse than Llama3-8B.</p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>3. Results</title>
      <sec id="sec-3-1">
        <title>3.1. Document retrieval</title>
        <p>In table 4 the performances of our document retrieval submissions for the BioASQ12 competition are
listed.</p>
      </sec>
      <sec id="sec-3-2">
        <title>3.2. Snippet prediction</title>
        <p>In table 5 the performances of our snippets predictions for the BioASQ12 competition are listed.</p>
      </sec>
      <sec id="sec-3-3">
        <title>3.3. Exact answer prediction</title>
        <p>In tables 6 and 7 the performances of our submissions for Phase A+ and Phase B of the BioASQ12
competition are listed. In batch 4 of Phase B, our submissions share the first place in average rank with
rank</p>
        <p>F-Meas. rank</p>
        <p>batch</p>
        <p>batch</p>
        <p>System</p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>4. Conclusion and Future Work</title>
      <p>At the time of writing, manual scores to assess the free text in the ideal answers were not ready and we
cannot evaluate our submissions in this category. The higher performance of our hybrid sparse and
dense retrieval system are promising and might be further improved by an adaptive combination of the
two results and by using an optimized subset of the embedding for distance measurement. The open
LLM ’farming’ approach employing a collection of (complementary) LLMs and used for the Yes/No
questions can be transferred to the other question categories. With the observed rapid progress in the
development of open LLMs, novel systems are easily incorporated into our pipelines.</p>
    </sec>
    <sec id="sec-5">
      <title>Acknowledgments</title>
      <p>We thank the anonymous reviewers for their comments. GPU computations for GANBERT were ofered
by HYPATIA, the Cloud infrastructure of the Greek ELIXIR node. Other GPU computations were
performed on two servers obtained within the project ID 16624, "Creation - Expansion - Upgrading of
the Infrastructures of research centers supervised by the General Secretariat for Research and Innovation
(GSRI)" with code MIS 5161770. This project was funded under the "National Recovery and Resilience
Plan Greece 2.0".</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>X.</given-names>
            <surname>Zhu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Li</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Y.</given-names>
            <surname>Liu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Ma</surname>
          </string-name>
          ,
          <string-name>
            <given-names>W.</given-names>
            <surname>Wang</surname>
          </string-name>
          ,
          <article-title>A survey on model compression for large language models</article-title>
          ,
          <year>2023</year>
          . arXiv:
          <volume>2308</volume>
          .
          <fpage>07633</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <surname>Ollama</surname>
          </string-name>
          , github,
          <year>2024</year>
          . URL: https://github.com/ollama/ollama
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>Y.</given-names>
            <surname>Anand</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Z.</given-names>
            <surname>Nussbaum</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Duderstadt</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Schmidt</surname>
          </string-name>
          ,
          <string-name>
            <surname>A. Mulyar,</surname>
          </string-name>
          <article-title>Gpt4all: Training an assistant-style chatbot with large scale data distillation from gpt-3.5-turbo</article-title>
          , https://github.com/nomic-ai/
          <year>gpt4all</year>
          , 2023
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>A.</given-names>
            <surname>Spirling</surname>
          </string-name>
          ,
          <article-title>Why open-source generative ai models are an ethical way forward for science</article-title>
          ,
          <source>Nature</source>
          <volume>616</volume>
          (
          <year>2023</year>
          )
          <fpage>413</fpage>
          -
          <lpage>413</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>A.</given-names>
            <surname>Krithara</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Nentidis</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Bougiatiotis</surname>
          </string-name>
          , G. Paliouras,
          <string-name>
            <surname>BioASQ-QA</surname>
          </string-name>
          :
          <article-title>A manually curated corpus for Biomedical Question Answering</article-title>
          ,
          <source>Scientific Data</source>
          <volume>10</volume>
          (
          <year>2023</year>
          )
          <fpage>170</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>D. N.</given-names>
            <surname>Panou</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Reczko</surname>
          </string-name>
          ,
          <article-title>Semi-supervised training for biomedical question answering</article-title>
          ,
          <source>in: Conference and Labs of the Evaluation Forum</source>
          ,
          <year>2023</year>
          . URL: https://doi.org/10.5281/zenodo.8410284
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>P.</given-names>
            <surname>Mandikal</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Mooney</surname>
          </string-name>
          ,
          <article-title>Sparse meets dense: A hybrid approach to enhance scientific document retrieval</article-title>
          ,
          <source>in: The 4th CEUR Workshop on Scientific Document Understanding, AAAI</source>
          ,
          <year>2024</year>
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>M.</given-names>
            <surname>Feng</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Xiang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M. R.</given-names>
            <surname>Glass</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Wang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Zhou</surname>
          </string-name>
          ,
          <article-title>Applying deep learning to answer selection: A study and an open task</article-title>
          ,
          <source>CoRR abs/1508</source>
          .01585 (
          <year>2015</year>
          ). URL: http://arxiv.org/abs/1508.01585. arXiv:
          <volume>1508</volume>
          .
          <fpage>01585</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9] jamesgpt1/sf_large_all, Huggingface,
          <year>2022</year>
          . URL: https://huggingface.co/jamesgpt1/sf_large_all
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <article-title>BAAI/bge-large-en-v1.5</article-title>
          ,
          <string-name>
            <surname>Huggingface</surname>
          </string-name>
          ,
          <year>2023</year>
          . URL: https://huggingface.co/BAAI/bge-large
          <source>-en-v1.5</source>
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <article-title>WhereIsAI/UAE-Large-V1,</article-title>
          <string-name>
            <surname>Huggingface</surname>
          </string-name>
          ,
          <year>2023</year>
          . URL: https://huggingface.co/WhereIsAI/ UAE-Large-V1
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <fpage>ember</fpage>
          -v1
          <source>(Revision 8119998)</source>
          , Huggingface,
          <year>2023</year>
          . URL: https://huggingface.co/llmrails/ember-v1.
          <source>doi:10</source>
          .57967/hf/1241
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          [13]
          <article-title>instructor-large,</article-title>
          <string-name>
            <surname>Huggingface</surname>
          </string-name>
          ,
          <year>2023</year>
          . URL: https://huggingface.co/hkunlp/instructor-large
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          [14]
          <article-title>instructor-xl,</article-title>
          <string-name>
            <surname>Huggingface</surname>
          </string-name>
          ,
          <year>2023</year>
          . URL: https://huggingface.co/hkunlp/instructor-xl
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          [15]
          <article-title>GIST-large-Embedding-v0,</article-title>
          <string-name>
            <surname>Huggingface</surname>
          </string-name>
          ,
          <year>2024</year>
          . URL: https://huggingface.co/avsolatorio/ GIST-large
          <article-title>-Embedding-v0</article-title>
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          [16]
          <article-title>gte-large,</article-title>
          <string-name>
            <surname>Huggingface</surname>
          </string-name>
          ,
          <year>2023</year>
          . URL: https://huggingface.co/thenlper/gte-large
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          [17]
          <article-title>mxbai-embed,</article-title>
          <string-name>
            <surname>Huggingface</surname>
          </string-name>
          ,
          <year>2024</year>
          . URL: https://huggingface.co/mixedbread-ai/ mxbai-embed
          <string-name>
            <surname>-</surname>
          </string-name>
          2d
          <string-name>
            <surname>-</surname>
          </string-name>
          large-v1
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          [18]
          <fpage>multilingual</fpage>
          -e5,
          <year>Huggingface</year>
          ,
          <year>2024</year>
          . URL: https://huggingface.co/intfloat/ multilingual-e5
          <string-name>
            <surname>-</surname>
          </string-name>
          large-instruct
        </mixed-citation>
      </ref>
      <ref id="ref19">
        <mixed-citation>
          [19]
          <article-title>AI@Meta, Llama 3 model card (</article-title>
          <year>2024</year>
          ). URL: https://github.com/meta-llama/llama3/blob/main/ MODEL_CARD.md
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>