Token Lab搜索

← 全部实验
模型路由与回退 / 4 OF 5

低成本模型故障

Every request pays both cost and latency before successful fallback.

本地计算 / 模拟

本地教学实验,不调用外部 API。合成示例不能替代生产环境测量。

学习指南与本课目录LEARNING CONTRACT

理解 → 实现 → 研究

目标:解释本课机制、复现一个例子、测试一个失败案例。读完不自动代表掌握。

02 · 预测与配置

技术场景说明、参数名称与参考答案目前为英文。

03 · 检查证据

运行实验后查看结果。

方法与参考资料

Analytical expectation with user-supplied synthetic per-request prices and latencies, not current provider rates. Sequential one-time fallback; failed primary attempts are charged; fallback always succeeds. No quality prediction, queueing, correlated failures or tail-latency model.

Text / 原始公式
E[C]=s(Ccheap+f×Cstrong)+(1−s)Cstrong; E[T]=s(Tcheap+f×Tstrong)+(1−s)Tstrong

A cheaper route may violate task-quality requirements; this estimator does not measure quality.

AWS Builders Library · timeouts, retries and backoff ↗

练习题

routing-4 / 01What does “Cheap model outage” test?

Every request pays both cost and latency before successful fallback.

Original teaching answer / local derivation. Method reference: AWS Builders Library · timeouts, retries and backoff ↗

打开实验 →
routing-4 / 02Which computation produces the result in “Cheap model outage”?

E[C]=s(Ccheap+f×Cstrong)+(1−s)Cstrong; E[T]=s(Tcheap+f×Tstrong)+(1−s)Tstrong

Original teaching answer / local derivation. Method reference: AWS Builders Library · timeouts, retries and backoff ↗

打开实验 →
routing-4 / 03What is the baseline configuration for “Cheap model outage”?

{"requests":1000,"cheap":1,"failure":1,"cheapCost":0.001,"strongCost":0.02,"cheapMs":200,"strongMs":1000}

Original teaching answer / local derivation. Method reference: AWS Builders Library · timeouts, retries and backoff ↗

打开实验 →
routing-4 / 04What numerical result should you check for “Cheap model outage”?

{"Expected USD/request":0.021,"Expected total USD":21,"Expected latency (ms)":1200,"Fallback calls":1000}

Original teaching answer / local derivation. Method reference: AWS Builders Library · timeouts, retries and backoff ↗

打开实验 →
routing-4 / 05How would you run a controlled comparison for “Cheap model outage”?

Keep the supplied fixture and other settings fixed; change failure. Compare expected cost, mean latency and fallback volume with observed production traces.

Original teaching answer / local derivation. Method reference: AWS Builders Library · timeouts, retries and backoff ↗

打开实验 →
routing-4 / 06What failure could invalidate a conclusion from “Cheap model outage”?

A cheaper route may violate task-quality requirements; this estimator does not measure quality.

Original teaching answer / local derivation. Method reference: AWS Builders Library · timeouts, retries and backoff ↗

打开实验 →
routing-4 / 07Is “Cheap model outage” a benchmark of a deployed language model?

No. Analytical expectation with user-supplied synthetic per-request prices and latencies, not current provider rates. Sequential one-time fallback; failed primary attempts are charged; fallback always succeeds. No quality prediction, queueing, correlated failures or tail-latency model.

Original teaching answer / local derivation. Method reference: AWS Builders Library · timeouts, retries and backoff ↗

打开实验 →
routing-4 / 08Which evidence should you report for “Cheap model outage”?

Compare expected cost, mean latency and fallback volume with observed production traces. Export inputs, engine, result and method; distinguish synthetic fixtures from observed production data.

Original teaching answer / local derivation. Method reference: AWS Builders Library · timeouts, retries and backoff ↗

打开实验 →
routing-4 / 09How can another researcher reproduce “Cheap model outage”?

Open routing-4, reset the preset, retain the exact inputs and run. The calculation is deterministic for identical inputs.

Original teaching answer / local derivation. Method reference: AWS Builders Library · timeouts, retries and backoff ↗

打开实验 →
routing-4 / 10What is the next validation step after “Cheap model outage”?

A cheaper route may violate task-quality requirements; this estimator does not measure quality. Test the hypothesis on a representative held-out workload and document a baseline, success metric and stopping rule before claiming deployment readiness.

Original teaching answer / local derivation. Method reference: AWS Builders Library · timeouts, retries and backoff ↗

打开实验 →
MATHEMATICAL REVIEW · 2026-10-26

假设、参考实现与验收

失败的便宜调用仍计费,假设 fallback 成功。期望延迟按串行计算且忽略排队;总体期望不是 p95 延迟。

已复核引擎公式、场景预设及数值保护。固定种子的合成输入不是生产基准。

区分便宜与强模型路径 → 便宜模型尝试即计费 → 失败 → 串行 fallback → 加权期望成本与延迟
机制图:从上到下跟踪每次变换。

运行前:预测一个边界情况

Every request pays both cost and latency before successful fallback.

提示:隔离假设

固定基线输入,只改变一个参数或边界;同时比较数值与声明单位。单例通过仅验证该样例。

最小可运行算例

将算例及所链接模块保存在同一目录。使用 Node.js 22 或更高版本,然后运行 node routing-4.mjs. 无需第三方运行依赖。

import {calculate,network} from './academy-core.mjs';
const params={
  "requests": 1000,
  "cheap": 1,
  "failure": 1,
  "cheapCost": 0.001,
  "strongCost": 0.02,
  "cheapMs": 200,
  "strongMs": 1000
};
const result=calculate('routing',params);
console.log(result.metrics);

测试与迁移

Every request pays both cost and latency before successful fallback.

在下方笔记记录输入、代码版本、期望值和实测值;再构造违反上述假设的反例,解释原结论为何不再成立。

下载完整代码包(.tar.gz) · 完整参考代码与回归检查

预测、检验与证据记录

展开答案前先预测一个结果;练习后记录差异和迁移测试。记录仅存本地,在不同语言版本间共用。

打开记录/导出/清除 →

数学复核范围逐篇记录,不代表完成论文实证复现;可在笔记中记录疑似错误。 复核范围