Adding Context, Additional Expertise and Memory to Open AI ChatGPT

James Brigg is a freelance ML (machine learning) engineer, startup advisor, and dev advocate @ Pinecone. He has an article and video describing how to improve responses from OpenAI ChatGPT using context and data provided at the time a question is asked. There are many instances where ChatGPT has not learned unpopular subjects. There are…
Adding Context, Additional Expertise and Memory to Open AI ChatGPT

James Brigg is a freelance ML (machine learning) engineer, startup advisor, and dev advocate @ Pinecone.

He has an article and video describing how to improve responses from OpenAI ChatGPT using context and data provided at the time a question is asked.

There are many instances where ChatGPT has not learned unpopular subjects.

There are two options for allowing our LLM (Large Language Model) to better understand the topic and, more precisely, answer the question.

1. We fine-tune the LLM on text data covering the domain of fine-tuning sentence transformers.


2. We use retrieval-augmented generation, meaning we add an information retrieval component to our GQA (Generative Question-Answering) process. Adding a retrieval step allows us to retrieve relevant information and feed this into the LLM as a secondary source of information.

We can get human-like interaction with machines for information retrieval (IR) aka search. We get the top twenty pages from google or Bing and then we have the Chat system scan and summarize those sources.

There are also useful public data sources. The dataset James uses in his example is the jamescalam/youtube-transcriptions dataset hosted on Hugging Face Datasets. It contains transcribed audio from several ML and tech YouTube channels.

James massages the data. He uses Pinecone as his vector database.

OpenAI Pinecone

The OpenAI Pinecone (OP) stack is an increasingly popular choice for building high-performance AI apps, including retrieval-augmented GQA.

The pipeline during query time consists of the following:

* OpenAI Embedding endpoint to create vector representations of each query.


* Pinecone vector database to search for relevant passages from the database of previously indexed contexts.


* OpenAI Completion endpoint to generate a natural language answer considering the retrieved contexts.

LLMs alone work incredibly well but struggle with more niche or specific questions. This often leads to hallucinations that are rarely obvious and likely to go undetected by system users.

By adding a “long-term memory” component to the GQA system, we benefit from an external knowledge base to improve system factuality and user trust in generated outputs.

Naturally, there is vast potential for this type of technology. Despite being a new technology, we are already seeing its use in YouChat, several podcast search apps, and rumors of its upcoming use as a challenger to Google itself

Generative AI is what many expect to be the next big technology boom, and being what it is — AI — could have far-reaching implications far beyond what we’d expect.

One of the most thought-provoking use cases of generative AI belongs to Generative Question-Answering (GQA).

Now, the most straightforward GQA system requires nothing more than a user text query and a large language model (LLM).

We can test this out with OpenAI’s GPT-3, Cohere, or open-source Hugging Face models.

However, sometimes LLMs need help. For this, we can use retrieval augmentation. When applied to LLMs can be thought of as a form of “long-term memory” for LLMs.

Read More

Total
0
Shares
Leave a Reply

Your email address will not be published.

Related Posts
Successfully Invading Taiwan is Militarily Impossible
Read More

Successfully Invading Taiwan is Militarily Impossible

Discourse Magazine has a summary of some of problems which make a military invasion of Taiwan impossible. I personally lived in Taiwan in 1995 and rode a bus through mountains and hills outside of the capital of Taipei. There were truck-sized tunnels leading off from the main tunnels. I believe over the decades Taiwan’s military…
Fact Mix 883: Sarahsson
Read More

Fact Mix 883: Sarahsson

For her Fact mix, Sarahsson obscures beauty with grotesquerie, scraping ethereal sequences of harmony and light raw with squalls of dissonance and chaos. The Horgenaith, the astounding debut album of hardcore classical vivisections from polymathic composer, producer, performance artist, DJ and instrument maker Sarahsson, takes its name from something the artist misheard. “My dad is…
Russia’s Military Would Fail Against Poland or Turkey
Read More

Russia’s Military Would Fail Against Poland or Turkey

Russia is still slowly taking some smaller cities in the southeast of Ukraine but the Kyiv offensive is bogged down. What we have clearly learned is that Russia’s military and its equipment remain second rate. Russia has taken significant chunks of Eastern Ukraine but that seems to be the limit of their capability. Russia would…