-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Capitalization in query instruction prompt? #4
Comments
Oh weird. I just realized that the score of 0.879 should put the Luke 11 passage as the number 1 verse in both contexts, but yet it doesn't show up in that version. I wonder if it's something about the ANN search in Chroma that is skipping over this verse somehow in this particular use-case. Perhaps we need to configure Chroma to search wider so that it returns better results? |
Yeah, you can easily see this in your own application.
This will limit the search results to only be within Luke. You will see the top result be the passage from Luke 11 with:
If you then comment out the line with the
By my view, that's less than the Luke 11 passage, and so Deu 32 should show up in second place. So why is Luke 11 hidden here, despite having a higher score? I'm guessing it's a limitation of Chroma where it is skipping over this as part of the "approximate" part of approximate-nearest-neighbor search. I'm looking through the Chroma docs and not seeing options to set the number of search trees (like I'm used to seeing with other tools like Annoy) to help alleviate these misses, but I intend to keep looking. |
Good observations, Clint. I've reached out to the instructor engineers for their feedback and insights. I will reply with their feedback (when / if provided). Thanks |
Answer received regarding capitalization: As the INSTRUCTOR was trained to have domain name capitalized, use “Religion” instead of “religion”. In general, we may expect better performance if the instruction formats were aligned with those in the training. |
That makes a lot of sense. I started reading the a instructor paper last night and I think my changes to the prompt were misguided. I think there is room for improvement on the prompt, but not in the way I originally tried. Modeling this prompt to be closer to the prompts used in the original paper is a good idea, and I want to also review the prompt used to generate the embedding for the user's search query, as I think that may need to be asymmetric / differently-worded from the document prompt. But again, having tests to quantify the quality of search results is going to be valuable in this. |
Scaffolded a basic test here with some TODO ideas: https://github.com/dssjon/biblos/pull/11/files |
I believe I found out why Luke 11 is not being returned in both cases -- it has to do with the search parameters in Chroma being very easy to skip over the top results: I'm not sure if adjusting the |
Interesting! LUK 11 is the top result on my local laptop when I search for "What are the angriest verses in the Bible?". |
Is there any particular reason why the word "Religious" is capitalized in the query instruction prompt?
It's odd -- I changed it locally to be "religious" instead of "Religious", regenerated the database, and then I get slightly different results.
Example semantic search query: "What are the angriest verses in the Bible?"
Results w/ capitalized "Religious":
Results w/ uncapitalized "religious":
In the capitalized version, the passage from Luke 11 has a similarity score of 0.8799077868461609.
Anyways, I thought it was very odd that such a simple capitalization change could affect the embeddings this much. I originally started looking at this, because I've heard it said that the quality of ones' results with LLMs relates very closely with the quality of ones' prompt, and I assume that this can even extend to things such as grammar, spelling, and capitalization.
I wouldn't have thought that such a simple change would make such a significant different, and especially for only one verse. I don't know what to make of this, but it was an interesting result and I felt I should share it with you. :)
The text was updated successfully, but these errors were encountered: