skip to content

Midway through a re-embedding backfill, the new embedding model rejects or silently truncates chunks the old one accepted — what causes this, and what do you do with them?

level: seniorimportance: should knowfreq 34%

answer

  1. the chunker fit the old model
  2. same limit, different tokenizer
  3. loud rejection, silent truncation
  4. bisect the failed batch
  5. a status for every chunk

basics

~20 s

The chunks were sized for the old model: the new one may accept fewer input tokens, count tokens differently or validate inputs more strictly. Pre-flight with its tokenizer, record each chunk's status, and decide every oversize chunk before cutover.

solid answer

~50 s

The corpus was shaped for the old model. The new one may have a lower input limit, a tokenizer that counts more tokens for code, tables or non-Latin text, or stricter checks that refuse empty chunks; and depending on the provider or serving engine an over-long input is either rejected or truncated without an error. I would pre-flight the whole corpus with the new tokenizer and limit, count the oversize and invalid chunks per tenant, and decide each class: fix empties upstream, re-split the over-long ones, or accept a flagged truncation. During the run every chunk gets a status at the new version, a failed batch is bisected to isolate the bad item, deterministic failures are not retried, and billed tokens are compared with the pre-flight count to catch silent truncation. No tenant cuts over with undecided rejections.

go deeper

for a junior

Recall that chunks were sized in the old model's tokens, so a new model with a different tokenizer or a lower limit can refuse or cut some of them.

for a middle

Explain the difference between a rejected input and a silently truncated one, why truncation is more dangerous, and why retrying a deterministic rejection with backoff is wasted spend.

for a senior

Lay out the pre-flight count, per-chunk status at the new version, bisecting failed batches and the billed-token check, and make undecided rejections a cutover blocker per tenant.

for a principal

Own the threshold: how many flagged truncations a tenant may carry, when the model switch forces a re-split of a whole content type, and who signs that off.

## Why chunks that used to work now fail A corpus that embedded cleanly under the old model was shaped around that model: the chunker capped chunk length in the old model's tokens, and every chunk passed the old service's input checks. Switch models and both assumptions can break, partway through a backfill, on a minority of chunks that nobody looked at. | Cause | What it looks like | Typical content | |---|---|---| | **Lower maximum input length** | over-long inputs rejected, or cut | long tables, logs, transcripts | | **Different tokenizer** | a chunk capped at the same token limit now counts above it | code, identifiers, URLs, non-Latin scripts | | **Stricter input checks** | per-item validation errors | empty or whitespace-only chunks, invalid characters | | **Per-request limits** | a whole batch fails for one item | a batch whose total tokens exceed a request cap | Whether an over-long input is **rejected** or **silently truncated** depends on the provider or serving engine and on how the client is configured. Rejection is loud; truncation is the dangerous one, because the call succeeds and the vector simply describes only the first part of the chunk. ## Find them before the run, not during it 1. **Pre-flight the corpus** with the new model's tokenizer and its documented input limit. Count how many chunks exceed it, by tenant and by source, before spending anything. 2. **Classify each oversize or invalid chunk**: empty or whitespace-only (an upstream bug), slightly over the limit, or far over it. 3. **Decide per class** and record the decision: drop and fix upstream, re-split under the new limit, or embed truncated with a flag. Re-splitting changes the chunk set, so the new pieces need new chunk IDs and the old chunk is retired; how a team picks chunk boundaries for retrieval quality is covered with chunking strategy, and replacing a document's chunk set cleanly is covered with incremental re-indexing. The backfill's job is narrower: find every such chunk, never lose one, and make sure each ends in a decided state. ## During the run - **Record a status per chunk**: embedded, truncated or rejected, with the reason, at the new model version. A rejected chunk with no record is a hole; with a record it is a decision someone can count. - **Isolate the bad item in a failed batch** by bisecting: split the batch in halves, resend each, and recurse into the half that fails. One empty string then costs a few extra calls instead of a lost batch. - **Do not retry deterministic failures.** A chunk that is too long will be too long on every retry; backoff is for throttling and transient errors (covered with batching and rate limits), not for invalid input. - **Detect silent truncation.** Compare each chunk's pre-flight token count with the limit, and where the response reports billed input tokens, compare them with what was expected; a run billing noticeably fewer tokens than the pre-flight predicts is probably cutting inputs. - **Never write a placeholder vector.** A zero vector or a copied neighbour's vector passes a count and corrupts retrieval. ## Why truncation is worse than it looks A truncated chunk keeps its full text for the generator, so it looks harmless. But retrieval only ever sees the vector, and the vector represents the head of the chunk. Any question whose answer lives in the tail can no longer find that chunk, and nothing in the logs says so. A handful of flagged truncations in a forty-million-chunk corpus may be an accepted cost; a silent few percent concentrated in one tenant's technical tables is a regression that tenant will notice first. ## The cutover gate Rejected and truncated chunks feed the completeness proof directly: - every rejected or truncated chunk has a recorded reason and decision; - the counts are reported per tenant, because an average hides one tenant whose documents are mostly tables; - no tenant cuts over while it holds undecided rejections. General quarantine and dead-letter handling of bad records is its own subject; here the point is that a model switch is the moment those records appear, and the backfill must surface them rather than finish green around them.

  • How do you find the one bad input when a re-embed batch request fails as a whole?
    Bisect: split the batch in halves, resend each, and recurse into the half that fails until one item remains, then record that chunk's rejection and embed the rest. It costs a few extra calls per bad item. A pre-flight pass with the new tokenizer and input checks finds most of these before any batch is sent.
  • Why is silently truncating an over-long chunk worse for retrieval than it looks?
    The generator still gets the full text, but retrieval only sees the vector, which now describes the head of the chunk. Questions answered in the tail can no longer find it, and nothing errors. A few flagged truncations may be acceptable; unflagged ones concentrated in one tenant's tables are a quiet regression for that tenant.

  • Every embedding model has the same input limit, so chunks that fit before still fit.
  • Silent truncation is harmless because the chunk's full text is still stored.
  • Retry a rejected chunk with backoff until the provider accepts it.
  • One bad input in a batch request can only ever cost that one chunk.
  • Write a zero vector for a rejected chunk so the counts still match.