News for hackers. Stuff that matters.
Re:Show HN: Velvet – Store OpenAI requests in your own DB by DeveloperErrata on Tuesday September 24, 2024 @09:26PM (#41642723)
I agree, a naive approach to approximate caching would probably not work for most use cases.

I'm speculating here, but I wonder if you could use a two stage pipeline for cache retrieval (kinda like the distance search + reranker model technique used by lots of RAG pipelines). Maybe it would be possible to fine-tune a custom reranker model to only output True if 2 queries are semantically equivalent rather than just similar. So the hypothetical model would output True for "how to change the oil" vs. "how to replace the oil" but would output False in your Spain example. In this case you'd do distance based retrieval first using the normal vector DB techniques, and then use your custom reranker to validate that the potential cache hits are actual hits

Re:Show HN: Velvet – Store OpenAI requests in your own DB by OutOfHere on Wednesday September 25, 2024 @04:01AM (#41644917)
Any LLM can output it, but yes, a tuned LLM can benefit with a shorter prompt.