Tutorial: pipeline with promptnode - maximum QA database size? #5971
-
For the tutorial https://haystack.deepset.ai/tutorials/22_pipeline_with_promptnode#defining-the-pipeline |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
@wolfgangihloff You're right. The length of the input passed to the PromptNode is limited by the maximum token length of the model. That could be 32768 tokens with gpt-4-32k but in the example it's 4097 with text-davinci-003. The way to make use of larger knowledge base is to use a retriever that selects the most relevant documents (or pages of your pdf if it is very long) and passes only those most relevant ones to the PromptNode. It is called retrieval augmented generative pipelines: RAG and the retriever is part of the tutorial that you linked. What's maybe unclear after just reading the tutorial is that long pdfs with potentially thousands of pages are preprocessed earlier and split into many smaller documents. The documents we store in Haystack's document stores are automatically sized down to ~512 tokens. Here is a tutorial about preprocessing: https://haystack.deepset.ai/tutorials/08_preprocessing |
Beta Was this translation helpful? Give feedback.
@wolfgangihloff You're right. The length of the input passed to the PromptNode is limited by the maximum token length of the model. That could be 32768 tokens with gpt-4-32k but in the example it's 4097 with text-davinci-003.
The way to make use of larger knowledge base is to use a retriever that selects the most relevant documents (or pages of your pdf if it is very long) and passes only those most relevant ones to the PromptNode. It is called retrieval augmented generative pipelines: RAG and the retriever is part of the tutorial that you linked. What's maybe unclear after just reading the tutorial is that long pdfs with potentially thousands of pages are preprocessed earlier and split i…