Skip to content
Notifications
Clear all

Why is Perplexity so slow on long document queries?

2 Posts
2 Users
0 Reactions
0 Views
(@integration_maven)
Estimable Member
Joined: 4 months ago
Posts: 130
Topic starter   [#6203]

I've been conducting a series of integration tests between Perplexity's API and a custom document processing workflow, and I've consistently observed a significant latency bottleneck when querying against long-context documents (PDFs, lengthy transcripts, or research papers exceeding ~50 pages). This isn't just a subjective "feels slow"—the response time often increases non-linearly with input token count.

Based on my analysis of the behavior and architecture patterns common in this space, I hypothesize the slowdown stems from a confluence of several technical factors inherent to complex RAG (Retrieval-Augmented Generation) systems:

* **Context Window Processing Overhead:** While the model can accept large contexts, the attention mechanism's computational complexity scales quadratically with sequence length in standard transformers. Processing 10k tokens isn't just twice as hard as 5k; it's significantly more expensive.
* **Pre-query Document Chunking & Embedding:** For long documents, the system likely performs a multi-stage process:
1. Chunking the document (which may happen on-the-fly for uploads).
2. Generating embeddings for each chunk.
3. Performing a similarity search across all chunk embeddings to retrieve the most relevant sections.
4. Feeding only those relevant sections into the final prompt. Each step adds latency, and steps 2 & 3 are particularly sensitive to document length.
* **Potential Sequential Processing:** Some implementations process document ingestion steps sequentially rather than in optimized, parallelized pipelines, causing delays.

I've attempted to mitigate this on my end by pre-processing documents into smaller, more focused chunks before submission, which helps, but it defeats the purpose of the "drop-in a long document" feature. Has anyone else in the community performed deeper benchmarking or reverse-engineered the workflow? I'm particularly interested in:

* Whether the latency is more pronounced in the web interface versus the API.
* If there are optimal "chunk size" strategies when preparing documents for Perplexity to minimize processing time.
* Any official or unofficial documentation on Perplexity's specific RAG implementation choices that would explain this bottleneck.

Understanding this is crucial for designing reliable automated workflows where predictable response times are a requirement.

API first.


IntegrationWizard


   
Quote
(@lisam8)
Eminent Member
Joined: 1 week ago
Posts: 18
 

That's a good breakdown of the processing overhead. I've noticed this too when we feed it long support docs. The chunking and embedding step you mentioned adds a huge, silent time cost before the query even starts. It's like waiting for a second app to boot up.

Have you found any patterns where it's *not* non-linear? Sometimes I get a big delay even on a 30-page doc, but then a 40-pager is only slightly worse. Makes me wonder if there's some fixed overhead, like spinning up a specific model instance, that dominates up to a point.



   
ReplyQuote