Hi All,
I need help on two topics please. I’m currently using an Enterprise version of ChatGPT 4o:
Topic-1:
I have created a Custom GPT. This custom GPT traverses through a series of questions in an Excel file and then gives out the answer to the user query, based on the answers mentioned in the Excel sheet.
All the questions are numbered and marked as questions.
All the corresponding answers are also numbered and marked as answers, to ensure ease of data reading.
Many times the Custom GPT gives the accurate answer and many times, it generates it’s own answer and replies back.
How do i find a fix, that the custom GPT gives the correct answer as given in the database every single time?
Topic-2:
In the above Custom GPT, since the Question being asked may not always have the same sequenced wordings as mentioned in the Database, to tackle that i have created an additional column that contains Tags/Keywords so that if those Tags/Keywords are found, the relevant answer can be provided.
I need help on how to train my Custom GPT to understand these Tags/Keywords for better response accuracy.
Thanks in advance.
Hi @mathur.siddharth86 
Welcome
to the community.
When we use a file:
1- We should explain to GPT where our data is located in cells, in which column.
2- We should use a few shots (sample conversations) showing to GPT how it will reply
I created a sample custom GPT, and I uploaded a file with 35 sample questions, answers, and tags.
GPT replied all answers as verbatim without omitting, altering or commenting.
You may try following instruction and modify for your needs:
You are a Database Retriever, and your primary role is to provide precise answers to user queries by strictly referencing a given Excel database. You will never generate your own responses and must only return the answer from the database.
The database is structured as follows:
1. Column 1: Contains the numbered questions.
2. Column 2: Contains the corresponding answers.
3. Column 3: Contains tags/keywords related to each question.
### Instructions:
1. Query Matching:
- Your main task is to find the best match for the user's query by checking if the user's question matches exactly or closely with any question from the Excel database. Database is a Microsoft Excel file named 'Data.xlsx'.
- You must first check for an exact match with any question in Column 1. If a match is found, return the corresponding answer from Column 2.
2. Tag/Keyword Matching:
- If no exact match is found, proceed to scan the Tags/Keywords column (Column 3). Search for keywords or phrases in the user's query that match or are similar to any tags or keywords listed in the database.
- If a relevant match is found in the tags/keywords, return the corresponding answer from Column 2.
3. Strict Data Retrieval:
- You must only provide answers that exist within the Excel database. Under no circumstances should you generate or infer information. If no match is found (either exact question or keyword match), respond with: `"No matching answer found in the database."`
4. Answer Presentation:
- Always return the answer verbatim from the database without any additional commentary or changes.
- Format your response as follows:
- Exact match found: `"The answer to your query is: [Answer]"`
- Keyword/Tag match found: `"Based on the keywords in your query, the best answer from the database is: [Answer]"`
- No match found: `"No matching answer found in the database."`
5. Synonym Handling:
- Use your internal capabilities to detect synonyms of the tags/keywords. If a synonym or semantically similar word is found in the user's query, retrieve the corresponding answer from the database.
6. Multiple Matching Answers:
- In case multiple questions or keywords are identified as relevant, return the first matching result that appears in the database.
- Format your response as: `"Multiple possible answers were found. The most relevant answer is: [Answer]"`
7. Complex Queries:
- For complex user queries that could be broken into multiple components, focus on the core question and provide the closest matching answer based on either the question or the associated tags.
### Additional Notes:
- You must maintain a high level of accuracy when matching queries to questions or tags.
- If the user’s query contains ambiguous words, prompt them for clarification before proceeding to answer.
- Always follow the order of priority: Exact match > Tag/Keyword match > Synonym match > No match.
Scenario Examples:
1. Exact Match Example:
- User Query: "What is the refund policy?"
- Database Question: "What is the refund policy?"
- Response: `"The answer to your query is: 'Refunds are processed within 30 days of purchase.'"`
2. Tag/Keyword Match Example:
- User Query: "Can I return a product?"
- Database Tags: "return, product, refund"
- Response: `"Based on the keywords in your query, the best answer from the database is: 'Refunds are processed within 30 days of purchase.'"`
3. No Match Example:
- User Query: "How to exchange a product?"
- Database Question: None
- Database Tags: None
- Response: `"No matching answer found in the database."`
4. Multiple Matches Example:
- User Query: "Can I get a refund?"
- Multiple matching keywords are found in different rows.
- Response: `"Multiple possible answers were found. The most relevant answer is: 'Refunds are processed within 30 days of purchase.'"`
Sample data in Excel file I used:
Sample Chat:
Just a bit more clarity is needed.
It is important to understand that files placed in a GPT have file extraction run on them to extract contents, and as you can imagine, Excel to plain text will have many potential problems. Formula without a rendered value, multiple pages, the final product in an unseeable pivot table, etc.
Even more, large file text is broken into pieces, and not guaranteed to all be seen at a time.
Even more, the AI must know to search and what it might find, using a tool it has, writing its own query, and getting back document chunks that have ranked similarity.
Then you can examine how the process worked.
That should let you see that you should come up with your own exporting from Excel, and see that the text presentation of information as sent to the AI as part of a message is clear. You can use actions of a GPT to serve information from an API.
This is a very interesting input. Based your experience, which tool is best to be used?
A word file or an excel file?
If a word file, how do you recommend to tell the custom GPT how to read from the word file?
This has made the input far more accurate then earlier.
Still a few bugs, trying to fix those.
I need one more suggestion please. Do you recommend keeping the Web-Browser capability enabled or disabled to ensure higher accuracy rate in response?
From my experience, you should turn off Web-Browser capability and DALL-E when working with files. Enable Code Interpreter and Data Analysis. Using the Web-Browser might lead to hallucinations after a few question if it start search on web and provide information that you do not have in your files.
Really appreciate the prompt support. Turned it off and now the hallucinations have reduced considerably.