面试题库
共 328 题,当前筛选 1 题。
课程全部30 天从前端工程师到 Agent 工程师5 天提示词工程零基础Claude 高效使用:从对话到 Claude CodeCodex 与 OpenAI Agents SDK 高效使用7 天 MCP:把工具接进任何 Agent7 天 Agent Skills:把经验做成可复用能力5 天上下文工程14 天 RAG:从检索到可信回答14 天用 Agent 搭一条 AI 短剧生产线
标签
全部#rollout1#evaluation8#agentic-rag4#abstention3#cost3#chunking2#contextual-retrieval2#cost-tradeoff2#golden-set2#hybrid-search2#multi-hop2#observability2
还有 49 个标签收起标签
#query-rewriting2#access-control1#architecture1#bi-encoder1#caching1#content-hash1#coreference1#cost-optimization1#cross-encoder1#debugging1#embedding-migration1#engineering-judgement1#error-propagation1#evidence1#failure-modes1#faithfulness1#fallback1#filter-pushdown1#graph-rag1#hyde1#incremental-sync1#index-maintenance1#index-routing1#indexing1#intent-routing1#invalidation1#latency1#latency-budget1#llm-as-judge1#multi-tenancy1#multi-turn1#prioritization1#prompt-caching1#prompting1#query-transformation1#rag1#rank-fusion1#ranking1#reliability1#rerank1#retrieval-metrics1#retrieval-quality1#retrospective1#scaling1#self-reflection1#stakeholder-communication1#system-design1#tool-design1#zero-downtime1
14 天 RAG:从检索到可信回答
D13 上生产:增量同步与去重、按权限过滤、缓存分层、链路追踪与成本延迟账
要换一个 embedding 模型,线上系统怎么迁移才能不停机也不掉召回?You need to switch embedding models. How do you migrate a live system without downtime and without losing recall?
国内高频海外高频深入#embedding-migration#zero-downtime#rollout分析过程 · 先想清楚再作答
- 这题的题眼是「为什么不能就地换」。没有先说清这一点就直接讲步骤,会显得是在背流程。
- 先给前提:不同模型的向量之间**没有可比性**。维度可能不同,即使维度相同坐标系也完全不是一回事,用新模型编码问题去和旧模型编码的文档比距离,算出来的相似度是纯噪声。所以「换模型」实质上等于「把整个知识库重新向量化一遍」。
- 然后给四步:加一列新向量、允许为空;后台任务慢慢回填新列,旧列一个字节不动,线上仍走旧列;小流量灰度到新列,同时用标准答案集在两列上各跑一遍比召回率与忠实度;数字站得住再全量切换,旧列观察一两周后才删。
- 把这套流程的价值点破,这是给分点:**它的价值全在回滚成本上**。切换只是改一个配置项「走哪一列」,出问题时切回去是一秒钟的事,而不是重跑一遍八小时的重建任务。凡是拿不出回滚路径的迁移方案都不算方案。
- 补两个工程细节:新列的近似最近邻索引要在回填完之后再建,边写边建又慢又容易锁表;回填要能断点续传并限速,否则会把 embedding 接口的配额打满,把线上查询一起拖垮。
- 可预期的追问:怎么证明新模型确实更好?答:不能只看离线指标涨没涨,要在同一份标准答案集、同一套检索参数下跑 A/B,报召回率、忠实度、延迟、花费四笔账;只报第一笔的结论不成立。另外注意换模型会让缓存里的向量全部作废,那是这次迁移唯一该作废向量缓存的时刻。
How to reason about it · think before answering
- The crux is why you cannot swap in place. Jumping straight to the steps without establishing that reads like reciting a runbook.
- Set up the premise: vectors from different models are not comparable. Dimensions may differ, and even at equal dimensions the coordinate spaces are unrelated, so encoding the query with the new model and comparing against documents encoded with the old one yields noise. Switching models therefore means re-embedding the entire corpus.
- Then the four steps: add a nullable second vector column; backfill it with a background job while the old column is untouched and still serves live traffic; canary a slice of traffic onto the new column while running the golden set against both columns to compare recall and faithfulness; cut over fully once the numbers hold, and drop the old column only after a week or two of observation.
- Name the payoff explicitly, because this is where the points are: the value of the whole procedure is the rollback cost. Cutover is a config change naming which column to read, so reverting takes a second rather than re-running an eight-hour rebuild. A migration plan with no rollback path is not a plan.
- Add two engineering details: build the approximate-nearest-neighbour index on the new column after the backfill, not during it, since concurrent building is slow and prone to locking; and make the backfill resumable and rate-limited, or it will exhaust the embedding API quota and drag live queries down with it.
- Expected follow-up: how do you prove the new model is actually better? Not from an offline metric alone — run an A/B on the same golden set with identical retrieval parameters and report four numbers: recall, faithfulness, latency and cost. A conclusion resting on the first number only does not hold. Note also that switching models is the one moment when the embedding cache genuinely must be invalidated.
答题要点
- 不同模型的向量之间没有可比性,所以换模型等价于把整个知识库重新向量化一遍。
- 四步:加一列可空的新向量、后台回填、小流量灰度并用标准答案集在两列上对比、数字站得住再全量切换。
- 这套流程的价值全在回滚成本上:切换是改一个配置项,回滚是一秒钟的事而不是重跑一次重建。
- 新列的近似最近邻索引在回填完成后再建;回填要可断点续传并限速,别把接口配额打满拖垮线上查询。
- 验证要在同一份标准答案集上跑 A/B,同时报召回率、忠实度、延迟与花费四笔账;换模型也是唯一该作废向量缓存的时刻。
Key points
- Vectors from different models are not comparable, so a model switch is equivalent to re-embedding the entire corpus.
- Four steps: add a nullable second vector column, backfill in the background, canary with the golden set scored on both columns, then cut over once the numbers hold.
- The whole value lies in rollback cost: cutover is a config change, so reverting takes a second instead of another full rebuild.
- Build the ANN index on the new column after the backfill; make the backfill resumable and rate-limited so it does not exhaust the embedding quota and stall live queries.
- Validate with an A/B on one golden set reporting recall, faithfulness, latency and cost; a model switch is also the only time the embedding cache truly must be invalidated.