by ogogmad · 3y ago · 0 comments
[edit]
How exactly might these be used in LLMs? Personally, I know of Word2Vec, but I don't see its relevance to LLMs like GPT.
+ Take the user message and embed it
+ Do cosine similarity between that message and all of the vectorized passages of the book to pull up the most relevant passages to the user message/question
+ Put just those passages into the context
+ Get a response from ChatGPT using that specific context.
If you happened to see the "Generative Agents" paper that made a splash this week, this is the technique they used as part of the long-term memory retrieval and 'reflection' loop for their 'sims'.
What about specializing the LLM in the first place? Could you fine-tune the model by training it on those internal documents instead? Then you don't need to mess about with the prompt, right, since the LLM has "learned" the data?
By giving the in-context prompt, it's more likely the model will choose the information you just gave it.
Of course, there are use cases where fine-tuning is worth it. For example, someone recently finetuned a model on their Messenger group chat that was going on for years, about 500k messages, and now they have a model that can imitate all the members of the chat.
I'd love to see a comparison between the two in terms of accuracy of the outputs and the degree of hallucinations.
So you can, for example, use a LLM to convert a document into a vector and then also use it to convert a search query into a vector. Then you can find the closest document vectors to the search vector.
If you have a large text corpus to search that means restricting the search field with a query first, then feed the result on llm for extracting facts.
So everything hinges on having an excellent search index to reduce the search space, and the best tool we have as of today is running a semantic search over representations of a text's topics in embedded format.