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 for accurate computation;
- GPT can invoke an external tool to perform Google searches for current information;
- Conversations are condensed to ensure that they can run effectively indefinitely without hitting the token limit;
- GPT is used efficiently (GPT3.5 used for summaries, GPT-4 for new queries);
- The UI is optimized for easy printing (to PDF or hardcopy).
I was able to achieve this level of integration even without plugin-level access, simply by clever “prompt engineering” 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.
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:
User: What is the current Bank of Canada interest rate?
GPT: SEARCH(“current Bank of Canada interest rate”)
User: Snippet 1: Mar 8, 2023 … The current Bank of Canada interest rate sits at 4.50%, with a 0.25% rate hike announced on January 25, 2023.
Snippet 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 …
Snippet 3: Find answers about questions you may have about the Bank of Canada. What is the current bank of Canada interest rate?GPT: 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.
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 “right” 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.