跪拜 Guibai
← All articles
Artificial Intelligence · Agent · Backend

Embedding Swaps Should Be Priced Per Successful Task, Not Per Vector Query

By 武子康 ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

A model that wins a retrieval leaderboard can still make a knowledge-base Agent slower and more expensive through retries, ignored evidence, or expanded context. Counting index rebuilds and failed attempts per successful task is the only comparison that tells you whether a swap actually saves money in production.

Summary

Public retrieval leaderboards and per-vector price lists don’t predict what an embedding swap does to an Agent’s total bill. The cost appears downstream: whether the Agent finds enough evidence in the first retrieval, rewrites a query, expands a document, or retries a tool after failure. Each of those actions spends generation tokens, and a cheap vector call can be the most expensive choice once the full task is counted.

The evaluation separates retrieval quality, Agent behavior, and task-level cost. Retrieval metrics like Recall, NDCG and MRR tell whether evidence enters the candidate set and ranks correctly; Agent logs record why a second search happened, such as correcting a wrong document versus gathering a second hop of evidence; task accounting divides all costs, including failed attempts and failure handling, by tasks that pass acceptance. Index rebuild amortization belongs in the same ledger. The included Python 3 script runs nine synthetic records and asserts the bookkeeping: a candidate with lower online spend (1.0480 vs 1.0631) becomes more expensive per success (0.509333 vs 0.354367) once a 12-dollar rebuild is amortized over one hundred tasks and then spread across four.

For a concrete comparison, the candidate set includes Nemotron 3 Embed 1B BF16 and 8B BF16, with vendor-reported RTEB numbers treated as historical, not as proof of business results. Hardware constraints matter too: 8B BF16 weights are roughly 16GB before activations and caches, and NVFP4 throughput claims for Blackwell can’t be ported to an RTX A6000. Fair evaluation freezes task sets, corpus snapshots, chunking, filters, generation configs, and Agent prompts, then varies only the embedding model and its required input adaptation.

Takeaways
— A public benchmark ranking is a vendor’s historical result, not a current leaderboard or a business success rate; RTEB’s 8B score of 78.5% NDCG@10 came from a 2026-07-15 screenshot.
— Cost must be tallied per complete task, not per vector request, because Agent re-queries, document expansion, tool retries, failure handling, and index rebuild all spend tokens or money.
— Record at minimum task ID, query text, recalled segment IDs, first valid evidence position, re-query count, input tokens, and final acceptance result.
— Only the final attempt can be terminal in the ledger; a task that eventually succeeds after a retry counts once in the denominator, and all attempts remain in the numerator.
— The included Python 3 program validates the ledger with nine synthetic records and nine assertions; it is fixture-only and does not run any GPU or model service.
— The synthetic example shows one candidate’s online cost falling from 1.0631 to 1.0480, but after 12 dollars of rebuild amortization the per-success cost rises to 0.509333 versus 0.354367 for the other candidate.
— Freeze every variable except the embedding model: task set, corpus snapshot, chunk rules, metadata filters, top-K, reranker, generation model, system prompt, tool permissions, termination policy, and budgets.
— For each candidate, build a separate versioned index with its own dimension, normalization, and distance function; mixing dimensions or forcing one distance function invalidates the comparison.
— On RTX A6000, 8B BF16 weights estimate to 16GB before activations, attention, framework cache, and concurrency; Blackwell NVFP4 throughput cannot be extrapolated to Ampere.
— Common failure modes are picking a model by leaderboard and counting only successful responses, treating retrieval gains as answer gains, and reporting estimated prices as payment records.
Conclusions

The 78.5% NDCG@10 figure is dated 2026-07-15 and comes from a vendor announcement; treating it as current would be a category error, and the article’s refusal to re-run the model keeps the claim honest.

The ledger’s inversion is the useful part: a model with lower online cost per task can still be the worse deal once index rebuild is amortized over a small task count, which is exactly the situation a single vector-price comparison misses.

Requiring a stable task_id and variant for every log row is the practical precondition for all of this; without it, retries, failures, and acceptance results cannot be attributed to a specific model.

Layered failure classification prevents a common false inference: if retrieval-empty, vector timeout, generation throttling, tool error, and acceptance failure are all stored as one failure bucket, an embedding swap can accidentally take credit for a drop in generation throttling.

Concepts & terms
RTEB
A retrieval benchmark that ranks embedding models on retrieval quality. It can say whether a candidate is worth business testing, but it does not measure Agent task success or total pipeline cost.
NDCG@10
Normalized Discounted Cumulative Gain at 10. A ranking metric that rewards relevant results in the top 10 positions, with higher relevance and earlier positions contributing more.
MRR
Mean Reciprocal Rank. A metric averaging the reciprocal rank of the first correct result, so it emphasizes whether the right evidence appears early.
Reranker
A second-stage model that reorders retrieved candidates. If it already puts the correct evidence first, changing the first-stage embedding model may have no visible effect on the final answer.
NVFP4
A 4-bit floating-point format for NVIDIA GPUs. Native acceleration claims for NVFP4 target Blackwell hardware and cannot be transferred to older GPUs such as the RTX A6000.
From the discussion
Featured comments
静水深码

Including indexing cost in the per-successful-task metric is solid. Adding a common pitfall from practice: when the corpus updates frequently, the retrieval set itself drifts. Using a fixed batch of old queries for regression comparison makes it easier to pinpoint whether degradation occurs at the indexing layer or the model layer than rebuilding the eval set each time.

See top comments, translated →
Source: juejin.cn ↗ Google Translate ↗ Backup ↗