<!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>Leveraging Large Language Models for Recommendation and Explanation</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Itallo Silva</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Alan Said</string-name>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Leandro Balby Marinho</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Martijn Willemsen</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Federal University of Campina Grande</institution>
          ,
          <country country="BR">Brazil</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>TU Eindhoven &amp; JADS</institution>
          ,
          <country country="NL">The Netherlands</country>
        </aff>
        <aff id="aff2">
          <label>2</label>
          <institution>University of Gothenburg</institution>
          ,
          <country country="SE">Sweden</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>We demonstrate a proof of concept web application that recommends movies and generates explanations for the recommendations using Large Language Models (LLMs). Specifically, the application uses ChatGPT as both a movie recommender and model for generating explanations of the recommendations. The application gathers user preferences (liked movies), user goals (type of recommendations), and ofers personalized recommendations and explanations tailored according to the used-defined goals. In this demo, we showcase how recommendations and explanations can be customized according to user-defined criteria, such as personalization, novelty, or popularity, and implemented using LLMs.</p>
      </abstract>
      <kwd-group>
        <kwd>eol&gt;recommender systems</kwd>
        <kwd>explanations</kwd>
        <kwd>large language models</kwd>
        <kwd>recommendation goals</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <sec id="sec-1-1">
        <title>In the past decades, recommender systems have become ubiquitous tools used in many connected</title>
        <p>
          scenarios, e.g., entertainment [
          <xref ref-type="bibr" rid="ref1">1</xref>
          ], professional work [
          <xref ref-type="bibr" rid="ref2">2</xref>
          ], and education [
          <xref ref-type="bibr" rid="ref3">3</xref>
          ], to name a few.
More recently, Large Language Models (LLMs) such as GPT-3 and GPT-4 have witnessed a
remarkable surge in adoption across diverse fields owing to their extraordinary natural language
processing and generation capabilities. Initially engineered for tasks like text summarization,
translation, and question-answering, LLMs have proved valuable beyond their initial realm. A
notable application of LLMs is in the sphere of movie recommendations, where they not only
suggest films but can also formulate insightful and tailored explanations [
          <xref ref-type="bibr" rid="ref4 ref5 ref6">4, 5, 6</xref>
          ]. The
GPTpowered application ChatGPT has spiked tremendous interest from the research and practitioner
communities in artificial intelligence, natural language processing, machine learning, as well as
society at large. Used in the context of recommendation, ChatGPT can deliver a customized
and personalized array of recommendations, bridging machine-generated suggestions and
human-like interaction.
        </p>
        <p>
          In addition to generating recommendations, LLM-powered applications like, e.g., ChatGPT,
can be employed when developing interactive applications in a wide variety of domains. These
applications can harness ChatGPT’s conversational finesse to engage users, rendering the
experience highly immersive, interactive, and personalized. For example, in e-commerce, ChatGPT
can be deployed to recommend products based on customers’ preferences and purchase history
[
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]. Likewise, in education, ChatGPT can deliver reading suggestions to users predicated on their
skills, interests and reading habits. ChatGPT can also provide well-articulated explanations for
its recommendations in each instance, helping establish trust between users and the application
[
          <xref ref-type="bibr" rid="ref7">7</xref>
          ], and in doing so, increase the overall recommendation experience for the end users.
        </p>
      </sec>
      <sec id="sec-1-2">
        <title>This proof of concept web application highlights the utilization of LLMs, particularly ChatGPT,</title>
        <p>in recommending movies and explaining the recommendations. ChatGPT is utilized to produce
personalized recommendations on the one hand, and personalized explanations on the other
hand, while also tailoring them based on explicit goals specified by the user.</p>
      </sec>
      <sec id="sec-1-3">
        <title>The goals of this demo are to:</title>
        <p>Goal 1. Showcase how LLMs like ChatGPT can be used in traditional recommendation scenarios.
Goal 2. Show how LLMs can easily extend traditional recommendation scenarios with their</p>
        <p>capabilities of following instructions.</p>
      </sec>
      <sec id="sec-1-4">
        <title>Goal 3. Show how LLMs can generate personalized explanations of recommendations.</title>
      </sec>
      <sec id="sec-1-5">
        <title>Goal 4. Demonstrate an intuitive user interface for recommendation and LLM applications.</title>
        <p>As LLMs evolve, we can anticipate their deployment in increasingly inventive ways. Their
proficiency in emulating human conversation and the ability to analyze massive amounts of data
renders them invaluable assets in a rapidly expanding array of applications. Particularly in the
context of movie recommendations, LLMs like ChatGPT could revolutionize recommendation
by delivering content and curating an compelling and individualized experience for each end
user. This exemplifies how LLMs, initially devised for generic language tasks, have become
ideal tools for specialized and user-focused applications across increasingly various use cases,
domains, and industries.</p>
      </sec>
    </sec>
    <sec id="sec-2">
      <title>2. A Movie Recommender with User-defined Goals</title>
      <sec id="sec-2-1">
        <title>We have developed a web application that leverages ChatGPT to generate movie recommendations and explanations of said recommendations based on user preferences. To craft recommendations, users are prompted to specify preferences regarding movies they like or dislike</title>
        <p>
          (refer to Fig. 1 and Fig. 2). Note that the application allows users to enter both liked and disliked
movies in the preference elicitation stage. Having entered a set of movie preferences, users
are also given the possibility to tailor their recommendations and explanations according to
a set of goals (refer to Fig. 3), e.g., whether users seek surprises, popular movies, or novel
content. While the goal alternatives for recommendations reflect commonly sought-for qualities
in beyond-accuracy-based recommendation, the goals for the explanations, in turn, are inspired
by the goals introduced by Tintarev and Masthof [
          <xref ref-type="bibr" rid="ref8">8</xref>
          ].
        </p>
        <p>(a) Recommendation with a personalized expla-(b) Recommendation with a non-personalized
nation. explanation.
The Godfather is a must-watch for someone
who enjoys epic storytelling, complex
characters, and gripping drama. This iconic film,
directed by Francis Ford Coppola, shares
similarities with your favorite movies like The Lord of
the Rings, Star Wars, and Harry Potter. Just
like those films, The Godfather immerses you
in a richly detailed world, filled with
memorable characters and a captivating narrative. It
explores themes of power, loyalty, and family,
much like the epic battles and quests in your
favorite movies. The Godfather’s masterful
storytelling, brilliant performances, and
unforgettable moments make it a timeless classic that
you won’t want to miss.</p>
        <p>Generic
The Godfather is a must-watch movie for
several reasons. Firstly, it is a cinematic
masterpiece that has stood the test of time. The film
is beautifully crafted, with a compelling
storyline and exceptional performances by Marlon
Brando and Al Pacino. Secondly, it ofers a deep
exploration of themes such as power, family,
and loyalty, making it a thought-provoking
experience. Lastly, The Godfather has had a
significant influence on the film industry, shaping the
crime genre and inspiring countless movies and
TV shows. If you enjoy gripping storytelling,
memorable characters, and a glimpse into the
world of organized crime, The Godfather is a
film you shouldn’t miss.</p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>3. Implementation of the Web Application</title>
      <sec id="sec-3-1">
        <title>In this section we present the design considerations, implementation, and deployment of the web application.</title>
      </sec>
      <sec id="sec-3-2">
        <title>Given a person with the following movie preferences.</title>
        <p>Liked movies: {liked movies}
Disliked movies: {disliked movies}</p>
      </sec>
      <sec id="sec-3-3">
        <title>Could you recommend four movies? Two of these movies should be a recommendation of a movie they must watch and two of movies they should avoid watching.</title>
      </sec>
      <sec id="sec-3-4">
        <title>The recommendations must be {rec goal}.</title>
        <p>1. Write the answer in the format of a JSON file with the attribute recommendations
that is an array with four objects with the attributes: title, imdbID and shouldWatch.</p>
      </sec>
      <sec id="sec-3-5">
        <title>2. The title attribute must be the title of the recommended movie and the shouldWatch</title>
        <p>must be a boolean indicating if it the movie is a recommendation of a movie the user
should or not watch.</p>
      </sec>
      <sec id="sec-3-6">
        <title>3. Do not recommend movies given in the user preferences answers.</title>
      </sec>
      <sec id="sec-3-7">
        <title>4. Do not enumerate the movies.</title>
      </sec>
      <sec id="sec-3-8">
        <title>5. Do not include any additional text besides the JSON.</title>
      </sec>
      <sec id="sec-3-9">
        <title>Prompt 1: The prompt given to ChatGPT to receive recommendations. Note that the bold text</title>
        <p>in brackets is replaced with the preferences stated by the users.</p>
        <sec id="sec-3-9-1">
          <title>3.1. Design and Considerations</title>
        </sec>
      </sec>
      <sec id="sec-3-10">
        <title>While ChatGPT is a chatbot, this proof of concept has been implemented to resemble common media recommendation services, this entails, e.g., a preference elicitation step and a recommendation step, and (to some extent) a feedback step.</title>
        <p>To support users in the preference elicitation phase, we integrated the OMDb API1 to
generate title-completion suggestions when a movie title is entered (Fig. 2). In addition to this,
corresponding movie posters are displayed for visual verification as users begin typing movie
titles.</p>
      </sec>
      <sec id="sec-3-11">
        <title>Utilizing the preferences and goals given by the user, we formulate a prompt which is</title>
        <p>subsequently dispatched to the OpenAI Chat Completions API2, powered by the GPT3.5-Turbo
model. Each recommended movie is accompanied by an explanation based on the goal set by
the user. Below the shown recommendation and expanation, the user can provide feedback on
the quality of the recommendation and explanation.</p>
      </sec>
      <sec id="sec-3-12">
        <title>The prompts formulated by our proof of concept follow the patterns shown in Prompt 1 for the recommendations, and Prompt 2 for the explanations. Note that the highlighted parts in the prompt examples correspond to variables that are replaced with the input provided by the users in the preference elicitation stage (see, Fig. 3).</title>
      </sec>
      <sec id="sec-3-13">
        <title>1https://www.omdbapi.com/</title>
      </sec>
      <sec id="sec-3-14">
        <title>2https://platform.openai.com/docs/guides/gpt/chat-completions-api</title>
      </sec>
      <sec id="sec-3-15">
        <title>Given a person with the following movie preferences.</title>
        <p>Liked movies: {liked movies}
Disliked movies: {disliked movies}</p>
      </sec>
      <sec id="sec-3-16">
        <title>Why should someone with these preferences [not] watch the movie: {movie}?</title>
      </sec>
      <sec id="sec-3-17">
        <title>The explanations must be {exp goal}.</title>
      </sec>
      <sec id="sec-3-18">
        <title>1. Write the answer as a plain text with at least 300 and at most 350 characters and</title>
        <p>without any additional text besides the answer.</p>
      </sec>
      <sec id="sec-3-19">
        <title>2. Write the explanation as if you was talking to someone, for example: ’You may like this and that’.</title>
      </sec>
      <sec id="sec-3-20">
        <title>Prompt 2: The prompt given to ChatGPT to receive explanations of recommendations. Note</title>
        <p>that the bold text in brackets is replaced with the preferences stated by the users.</p>
        <sec id="sec-3-20-1">
          <title>3.2. Implementation</title>
        </sec>
      </sec>
      <sec id="sec-3-21">
        <title>The web application is built using Python, with Flask as the web framework. The backend</title>
        <p>service compiles prompts by processing input from the user and then sends an API call to</p>
      </sec>
      <sec id="sec-3-22">
        <title>ChatGPT (see, e.g., Prompt 1 and 2). This introduces a slight delay of about one minute before the recommendations and explanations are presented to the user.</title>
      </sec>
      <sec id="sec-3-23">
        <title>The design of the prompts has been inspired by Gao et al. [9] and Wang and Lim [5]. The</title>
        <p>application is deployed in an AWS instance accessible to anyone3.</p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>4. Future Work</title>
      <p>While this proof of concept web application is a simple demonstration of how LLMs can be
leveraged for recommendation and explanation purposes, the usage of LLMs in this context
remains novel, with much work left ahead. In the context of this demo, future works include
further analysis of the design and implications of goal statements on both recommendations
and explanations. This demo serves as a seed for future research integrating LLMs into the</p>
      <sec id="sec-4-1">
        <title>3A link will be made available during the workshop allowing attendees to try the application on their own devices.</title>
        <p>recommendation process. With the rapid adoption of LLMs as a tool for everything, the potential
research directions in this space are plentiful. Our goal is to provide a simple and palpable
example of how the capacities of LLMs can be used and leveraged to power the new generation
of recommender systems.</p>
      </sec>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>C. A.</given-names>
            <surname>Gomez-Uribe</surname>
          </string-name>
          ,
          <string-name>
            <given-names>N.</given-names>
            <surname>Hunt</surname>
          </string-name>
          ,
          <article-title>The netflix recommender system: Algorithms, business value, and innovation</article-title>
          ,
          <source>ACM Trans. Manage. Inf. Syst</source>
          .
          <volume>6</volume>
          (
          <year>2016</year>
          ). URL: https://doi-org.
          <source>ezproxy.ub.gu. se/10</source>
          .1145/2843948. doi:
          <volume>10</volume>
          .1145/2843948.
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>F.</given-names>
            <surname>Abel</surname>
          </string-name>
          ,
          <article-title>We know where you should work next summer: Job recommendations</article-title>
          ,
          <source>in: Proceedings of the 9th ACM Conference on Recommender Systems</source>
          , RecSys '15,
          <string-name>
            <surname>Association</surname>
          </string-name>
          for Computing Machinery, New York, NY, USA,
          <year>2015</year>
          , p.
          <fpage>230</fpage>
          . URL: https://doi-org.
          <source>ezproxy. ub.gu.se/10</source>
          .1145/2792838.2799496. doi:
          <volume>10</volume>
          .1145/2792838.2799496.
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>H.</given-names>
            <surname>Drachsler</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Verbert</surname>
          </string-name>
          ,
          <string-name>
            <given-names>O. C.</given-names>
            <surname>Santos</surname>
          </string-name>
          ,
          <string-name>
            <given-names>N.</given-names>
            <surname>Manouselis</surname>
          </string-name>
          , Panorama of Recommender Systems to Support Learning,
          <string-name>
            <surname>Springer</surname>
            <given-names>US</given-names>
          </string-name>
          , Boston, MA,
          <year>2015</year>
          , pp.
          <fpage>421</fpage>
          -
          <lpage>451</lpage>
          . URL: https://doi.org/10. 1007/978-1-
          <fpage>4899</fpage>
          -7637-6_
          <fpage>12</fpage>
          . doi:
          <volume>10</volume>
          .1007/978-1-
          <fpage>4899</fpage>
          -7637-6_
          <fpage>12</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>Y.</given-names>
            <surname>Zhang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            <surname>DING</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Z.</given-names>
            <surname>Shui</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Y.</given-names>
            <surname>Ma</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Zou</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Deoras</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            <surname>Wang</surname>
          </string-name>
          ,
          <article-title>Language models as recommender systems: Evaluations and limitations, in: I (Still) Can't Believe It's Not Better</article-title>
          ! NeurIPS 2021 Workshop,
          <year>2021</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>L.</given-names>
            <surname>Wang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>E.-P.</given-names>
            <surname>Lim</surname>
          </string-name>
          ,
          <article-title>Zero-shot next-item recommendation using large pretrained language models</article-title>
          ,
          <year>2023</year>
          . arXiv:
          <volume>2304</volume>
          .
          <fpage>03153</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>J.</given-names>
            <surname>Liu</surname>
          </string-name>
          , C. Liu,
          <string-name>
            <given-names>P.</given-names>
            <surname>Zhou</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Lv</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Zhou</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Y.</given-names>
            <surname>Zhang</surname>
          </string-name>
          , Is ChatGPT a Good Recommender?
          <string-name>
            <given-names>A Preliminary</given-names>
            <surname>Study</surname>
          </string-name>
          ,
          <year>2023</year>
          . URL: http://arxiv.org/abs/2304.10149, arXiv:
          <fpage>2304</fpage>
          .10149 [cs].
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>S.</given-names>
            <surname>Dai</surname>
          </string-name>
          ,
          <string-name>
            <given-names>N.</given-names>
            <surname>Shao</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            <surname>Zhao</surname>
          </string-name>
          ,
          <string-name>
            <given-names>W.</given-names>
            <surname>Yu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Z.</given-names>
            <surname>Si</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Xu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Z.</given-names>
            <surname>Sun</surname>
          </string-name>
          ,
          <string-name>
            <given-names>X.</given-names>
            <surname>Zhang</surname>
          </string-name>
          , J. Xu,
          <source>Uncovering ChatGPT's Capabilities in Recommender Systems</source>
          ,
          <year>2023</year>
          . URL: http://arxiv.org/abs/2305.02182. doi:
          <volume>10</volume>
          . 48550/arXiv.2305.02182, arXiv:
          <fpage>2305</fpage>
          .02182 [cs].
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>N.</given-names>
            <surname>Tintarev</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Masthof</surname>
          </string-name>
          ,
          <article-title>A survey of explanations in recommender systems</article-title>
          ,
          <source>in: 2007 IEEE 23rd International Conference on Data Engineering Workshop</source>
          ,
          <year>2007</year>
          , pp.
          <fpage>801</fpage>
          -
          <lpage>810</lpage>
          . doi:
          <volume>10</volume>
          .1109/ICDEW.
          <year>2007</year>
          .
          <volume>4401070</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>Y.</given-names>
            <surname>Gao</surname>
          </string-name>
          ,
          <string-name>
            <given-names>T.</given-names>
            <surname>Sheng</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Y.</given-names>
            <surname>Xiang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Y.</given-names>
            <surname>Xiong</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            <surname>Wang</surname>
          </string-name>
          ,
          <string-name>
            <surname>J. Zhang</surname>
          </string-name>
          , Chat-rec:
          <article-title>Towards interactive and explainable llms-augmented recommender system</article-title>
          ,
          <year>2023</year>
          . arXiv:
          <volume>2303</volume>
          .
          <fpage>14524</fpage>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>