Page 19 - AI Vol 1: Foundations of AI
P. 19

of LLMs and is deployed in many popular LLM          solution.  As  previously  noted,  LLMs  can  still
            products,  such  as  ChatGPT,  Microsoft  Copilot,   produce  hallucinations  even  when referencing
            and  PerplexityAI.  The  basic  principle  is  that   information contained in their context windows.
            LLMs produce more accurate  results when             Secondly, the output will be heavily influenced
            they have information available to them in their     by the quality of the information retrieved, which
            context window. For example, if a public agency      itself  is  influenced  by  how  the  LLM  conducts

            employee  asks  an  LLM  a  question  about  some    its Internet or database search. A key challenge
            issue facing the agency, the LLM would produce       in retrieval-augmented  generation  is enabling
            an answer based on the information and patterns      LLMs to assess the relevance  and reliability
            it  learned  in  its  training.  However,  if  the  user   of  the  information  they  retrieve.  Finally,  as
            incorporated  relevant  policies,  regulations,  and   previously discussed, the limitations of the size
            other  information  into  their  prompt,  the  LLM   of the context window and the functioning of the
            would  analyze  this  additional  information  and   attention mechanism mean that the LLM will be

            refer to it in its response, effectively grounding   limited in how much factual information it can
            the LLM in a source of “truth” and reducing the      process and its ability to analyze large amounts of
            likelihood of hallucinations. Retrieval-augmented    retrieved data without losing important nuances.
            generation works on the same principle, but instead   Overall,  LLM systems that  include  retrieval-
            of the user inputting documents into the context     augmented  generation  techniques  are  far  more
            window, the LLM does this work itself. When the      reliable than LLMs on their own, but users should
            user asks the LLM a question, the LLM will first     still be aware that response outputs may still be
            identify relevant terms in the user’s question and   inaccurate or incomplete.
            generate a search prompt. The LLM will then use

            that  prompt  to  query  an  Internet  search  engine   One of the qualities that make LLMs compelling is
            or  specialized  information  database.  Having      their capability to engage in processes resembling
            retrieved  webpages  or documents  relevant  to      human creativity  and problem  solving, which
            the  user’s  request,  the  LLM  then  incorporates   would be hampered if models were strictly required
            those documents into its context window, along       to  only  produce  completely  accurate  answers.
            with  the  user’s  original  question/prompt,  and   As such, the possibility of hallucinations is not
            generates a response taking all of that information

            into account.


            Retrieval-augmented  generation  has  a  number
            of advantages, such as allowing the LLM
            to  access more  up-to-date  information  or
            specialized  information  databases  and  reducing
            the likelihood of hallucinations, thus increasing
            the factual reliability of LLM outputs. However,
            retrieval-augmented  generation is not a perfect






     FOUNDATIONS OF AI  |  LOZANOSMITH.COM                                                                 VOLUME  1    |   19
   14   15   16   17   18   19   20   21   22   23   24