Ask
91
@seam_ripper_joy ·

summarise first or send the whole 200 page pdf, $600 a month ceiling token-cost

Document question answering over long PDFs. A typical document is 200 pages, roughly 120k tokens. About 400 questions a day across all users, and users tend to ask several questions about the same document in one sitting.

Hard ceiling of $600 a month on model spend. Options I can see are long context per question, retrieval over chunks, or building a hierarchical summary index. Which of these survives that budget, and what am I giving up?

10 answers Share
Report

Answering anonymously — a moderator will review it first.

  • @vesting_cliff · 2mo ago · 3 replies

    Do the arithmetic first, because it eliminates one option outright. 400 questions a day at 120k input tokens is 48 million tokens a day. At any current frontier price that is not a $600 month, it is closer to a $600 day. Full context per question is out unless the context is cached.

    What is left:

    • Cache the document and let a session ask many questions against it. You pay the write premium once and roughly a tenth of the input cost for every follow-up. This maps exactly onto the behaviour you described, which makes it the single biggest lever you have.
    • Retrieval, top 8 chunks, call it 6k tokens a question. 2.4 million tokens a day, comfortably inside budget with room for the model to be wrong occasionally. You give up cross-document and cross-section reasoning — "compare the termination clause with schedule 3" is the question type that breaks.
    • Hierarchical summaries: summarise each section once at upload, retrieve over summaries, fetch full sections on demand. Best quality per token, most code, and the summaries go stale when a document is replaced.

    With $600 and presumably not a large team: retrieval now, plus caching for the follow-up case, and only build the summary index if your eval set shows retrieval actually missing things. Do not build it because it sounds better.

    68
    Share
    Reply

    Answering anonymously — a moderator will review it first.

    Report
    • @seam_ripper_joy · 2mo ago

      I had not thought of caching and retrieval as complementary — I was treating them as three exclusive options. The session pattern is very real for us, median is five or six questions per document.

      22
      Share
      Reply

      Answering anonymously — a moderator will review it first.

      Report
    • @yaml_yuri · 2mo ago

      The session case is bigger than people expect. Median follow-up count in our document tool is 6, and caching alone took total spend down 55% with no change to what the model sees.

      16
      Share
      Reply

      Answering anonymously — a moderator will review it first.

      Report
  • @visa_run_val · 2mo ago

    Chunk on structure, not on a character count. Long documents have headings, numbered clauses, tables — split on those, and put the heading path into the chunk text so retrieval has something semantic to grab and the model knows where the fragment came from.

    Most of long-document RAG's bad reputation comes from splitting every 800 characters and cutting sentences in half.

    41
    Share
    Reply

    Answering anonymously — a moderator will review it first.

    Report
  • @pomodoro_pat · 2mo ago · 2 replies

    Use hybrid retrieval rather than pure vectors. BM25 alongside embeddings, fused. Document QA is full of exact tokens — defined terms, section numbers, party names, dates — and embeddings are consistently mediocre at exact matching. This is usually a bigger quality win than any reranker and it costs you a few milliseconds.

    30
    Share
    Reply

    Answering anonymously — a moderator will review it first.

    Report
    • @seam_ripper_joy · 2mo ago

      "What does clause 7.3 say" fails against pure vector search in our testing about half the time, so this is clearly our problem too.

      12
      Share
      Reply

      Answering anonymously — a moderator will review it first.

      Report
  • @boundaries_bo · 2mo ago

    Route by question type before you spend anything else. A large fraction of what users call questions are lookups — find this term, what date, who signed. Those can go to a cheap model with tight retrieval and be correct. Reserve the expensive path for questions that require reading across sections. Two tiers is usually a 40-60% saving with no visible quality cost.

    24
    Share
    Reply

    Answering anonymously — a moderator will review it first.

    Report
  • @maren_dowd · 2mo ago

    Check what you can do once at upload rather than per question. Structure extraction, section splitting, summaries, an outline — all of it is per-document work that a lot of systems redo on every single request without anyone noticing.

    8
    Share
    Reply

    Answering anonymously — a moderator will review it first.

    Report
  • @harlan_voss · 2mo ago · 2 replies

    Whatever you pick, put a hard per-user daily token counter in from day one and return a real message when it trips. Your $600 ceiling is not enforced by your architecture, it is enforced by a counter you have not written yet, and the day someone scripts against your API you will find that out.

    14
    Share
    Reply

    Answering anonymously — a moderator will review it first.

    Report
    • @vesting_cliff · 2mo ago

      Also alert on daily spend, not monthly. Monthly alerts tell you about a problem when it is already a bill.

      10
      Share
      Reply

      Answering anonymously — a moderator will review it first.

      Report