{"id":11831,"date":"2023-04-18T03:08:44","date_gmt":"2023-04-18T07:08:44","guid":{"rendered":"https:\/\/spinor.info\/weblog\/?p=11831"},"modified":"2023-04-18T03:08:44","modified_gmt":"2023-04-18T07:08:44","slug":"extending-gpt-4","status":"publish","type":"post","link":"https:\/\/spinor.info\/weblog\/?p=11831","title":{"rendered":"Extending GPT-4"},"content":{"rendered":"<p>So here is my latest conversation with GPT-4 using my custom user interface. The important features of this implementation are the following:<\/p>\n<ol>\n<li>GPT is instructed to use LaTeX for mathematical output, which the UI correctly renders;<\/li>\n<li>The UI captures and renders SVG graphics that GPT may generate;<\/li>\n<li>GPT can use an <strong>external computer algebra tool<\/strong> for accurate computation;<\/li>\n<li>GPT can invoke an <strong>external tool to perform Google searches<\/strong> for current information;<\/li>\n<li>Conversations are condensed to ensure that they can run effectively indefinitely without hitting the token limit;<\/li>\n<li>GPT is used efficiently (GPT3.5 used for summaries, GPT-4 for new queries);<\/li>\n<li>The UI is optimized for easy printing (to PDF or hardcopy).<\/li>\n<\/ol>\n<p>I was able to achieve this level of integration even without plugin-level access, simply by clever &#8220;prompt engineering&#8221; to ensure that the majority of the time, GPT uses the provided tools effectively. For this, GPT-4 seems essential; GPT3.5 is not really able to grasp the notion of using external tools before constructing its answers.<\/p>\n<p>By way of example, when GPT was asked about the current Bank of Canada interest rate, what happened in the background was the following exchange:<\/p>\n<blockquote><p><strong>User<\/strong>: What is the current Bank of Canada interest rate?<\/p>\n<p><strong>GPT<\/strong>: SEARCH(&#8220;current Bank of Canada interest rate&#8221;)<\/p>\n<p><strong>User<\/strong>: Snippet 1: Mar 8, 2023 &#8230; The current Bank of Canada interest rate sits at 4.50%, with a 0.25% rate hike announced on January 25, 2023.<br \/>\nSnippet 2: See the Current Bank of Canada Interest Rate graphs at this page. You will read in the news about this rate when the Bank of Canada makes a rate\u00a0&#8230;<br \/>\nSnippet 3: Find answers about questions you may have about the Bank of Canada. What is the current bank of Canada interest rate?<\/p>\n<p><strong>GPT<\/strong>: As of March 8, 2023, the current Bank of Canada interest rate is 4.50%. A 0.25% rate hike was announced on January 25, 2023.<\/p><\/blockquote>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-11832\" src=\"https:\/\/spinor.info\/weblog\/wp-content\/uploads\/2023\/04\/GPT4-test-789x1024.png\" alt=\"\" width=\"695\" height=\"902\" srcset=\"https:\/\/spinor.info\/weblog\/wp-content\/uploads\/2023\/04\/GPT4-test-789x1024.png 789w, https:\/\/spinor.info\/weblog\/wp-content\/uploads\/2023\/04\/GPT4-test-231x300.png 231w, https:\/\/spinor.info\/weblog\/wp-content\/uploads\/2023\/04\/GPT4-test-768x997.png 768w, https:\/\/spinor.info\/weblog\/wp-content\/uploads\/2023\/04\/GPT4-test.png 811w\" sizes=\"(max-width: 695px) 100vw, 695px\" \/><\/p>\n<p>The prompting that I use can of course be improved. The behavior of GPT-4 is not always consistent, sometimes it fails to make use of the computer algebra result or attempts to invoke computer algebra in the wrong place. I suspect that the &#8220;right&#8221; solution will have to wait until I have plugin-level developer access. But I am very happy that I was able to accomplish this already, in particular that access to Google and the computer algebra tool are completely automated in the background, requiring no user action.<\/p>\n<fb:like href='https:\/\/spinor.info\/weblog\/?p=11831' send='true' layout='standard' show_faces='true' width='450' height='65' action='like' colorscheme='light' font='lucida grande'><\/fb:like>","protected":false},"excerpt":{"rendered":"<p>So here is my latest conversation with GPT-4 using my custom user interface. The important features of this implementation are the following: GPT is instructed to use LaTeX for mathematical output, which the UI correctly renders; The UI captures and renders SVG graphics that GPT may generate; GPT can use an external computer algebra tool <a href='https:\/\/spinor.info\/weblog\/?p=11831' class='excerpt-more'>[&#8230;]<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[58,35,36],"tags":[],"class_list":["post-11831","post","type-post","status-publish","format-standard","hentry","category-cybernetics","category-personal","category-programming","category-58-id","category-35-id","category-36-id","post-seq-1","post-parity-odd","meta-position-corners","fix"],"_links":{"self":[{"href":"https:\/\/spinor.info\/weblog\/index.php?rest_route=\/wp\/v2\/posts\/11831","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/spinor.info\/weblog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/spinor.info\/weblog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/spinor.info\/weblog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/spinor.info\/weblog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=11831"}],"version-history":[{"count":1,"href":"https:\/\/spinor.info\/weblog\/index.php?rest_route=\/wp\/v2\/posts\/11831\/revisions"}],"predecessor-version":[{"id":11833,"href":"https:\/\/spinor.info\/weblog\/index.php?rest_route=\/wp\/v2\/posts\/11831\/revisions\/11833"}],"wp:attachment":[{"href":"https:\/\/spinor.info\/weblog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=11831"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/spinor.info\/weblog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=11831"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/spinor.info\/weblog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=11831"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}