1

In the llama index, if the value of similarity_top_k is set to be very large, such as the number of all blocks, is this equivalent to feeding the entire document to GPT? Will this not exceed the maximum tokens limit? enter image description here

Could someone tell me the principles of the llama index's similarity_top_k?

pkubob
  • 11
  • 1

1 Answers1

1

Top_k mentions how many top embeddings to take into context. So yeah a very large top_k would go beyond the max_tokens of it is set.

Regarding the principle used: similarity between query and embeddings is calculated. Cosine similarity is one such method in which inner product between the query embedding and embedding in the index is found. Hope this answers your questions.