Ask
66
@mise_en_mess ·

every question returns the same three chunks after i moved to 1500 token chunks chunking

About 4k internal support pages, text-embedding-3-large, pgvector. I was on 400-token chunks with 50 overlap and answers kept missing context, so I moved to 1500 with 200 overlap. Now the top 5 for almost any question includes the same onboarding page, including questions about billing and about our API. All the distances come back bunched between 0.31 and 0.38.

9 answers Share
Report

Answering anonymously — a moderator will review it first.

  • @frosting_fixer · 3h ago · 3 replies

    Bigger chunks average the signal away. One 1500-token chunk covers six topics, so its vector sits near the middle of everything, which makes it a decent match for every query and a good match for none. The bunched distance range is the fingerprint of exactly that — your scores have stopped carrying information.

    What I would do:

    • Embed small, return big. Index 300-500 token units, store a pointer to the section they came from, and expand to the surrounding text when you build the prompt. You get precise retrieval and complete context, which is what you were actually chasing when you went to 1500.
    • Strip boilerplate before embedding. Nav, footers, "was this article helpful", the glossary block that appears on every page. That shared text is often the entire reason one page looks similar to everything.
    103
    Share
    Reply

    Answering anonymously — a moderator will review it first.

    Report
    • @frosting_fixer · 3h ago

      That is the whole bug. While you are in there, hash the chunk text and drop exact duplicates before indexing — repeated boilerplate blocks tend to be several percent of a support corpus.

      18
      Share
      Reply

      Answering anonymously — a moderator will review it first.

      Report
    • @mise_en_mess · 3h ago

      The onboarding page has our full glossary pasted into the bottom of it. Which means it literally contains a definition of every term anyone would search for. That is the whole bug isn't it.

      22
      Share
      Reply

      Answering anonymously — a moderator will review it first.

      Report
  • @kitchen_table_talk · 3h ago

    Small-to-big, two columns, one join. chunk(id, doc_id, section_id, text, embedding) and section(id, text). Search chunks, group hits by section, pass sections to the model. It is fifteen minutes of work and it is the single highest-leverage change in most naive pipelines.

    57
    Share
    Reply

    Answering anonymously — a moderator will review it first.

    Report
  • @slowmiles_kat · 3h ago

    0.31 to 0.38 for everything means you cannot rank on distance any more and no amount of threshold tuning will fix it. Put a cross-encoder reranker on the top 50 — it reads the query and the chunk together rather than comparing two independently produced vectors, and it will separate what cosine has flattened.

    34
    Share
    Reply

    Answering anonymously — a moderator will review it first.

    Report
  • @layer_shift_lu · 20h ago

    Check for duplicated content generally. If a paragraph is present in 200 pages, all 200 look alike to the index and one of them wins arbitrarily. A quick group-by on a hash of the chunk text usually turns up something ugly.

    21
    Share
    Reply

    Answering anonymously — a moderator will review it first.

    Report
  • @gradschool_gary · 3h ago

    Also worth checking what you are embedding on the query side. If you pass the raw user message including three paragraphs of preamble and a pasted stack trace, the query vector is as smeared as your fat chunks are. Cleaning up the query moved our recall more than chunk size did.

    12
    Share
    Reply

    Answering anonymously — a moderator will review it first.

    Report
  • @wild_ferment · 3h ago · 2 replies

    MMR on the results will diversify them and push the duplicate onboarding page down.

    6
    Share
    Reply

    Answering anonymously — a moderator will review it first.

    Report
    • @frosting_fixer · 3h ago

      It will give him three more varied wrong answers. MMR reorders a candidate set, it cannot add the chunk that never made it into the set.

      5
      Share
      Reply

      Answering anonymously — a moderator will review it first.

      Report