{"version":2,"relationshipURLBase":"https://codingai-lec03.pages.dev/course/notebook-blocks/304aa2a46d41405db647924c1a08d5c0.html","relationshipResolution":"Resolve relative relationship URLs against relationshipURLBase; complete records and absolute URLs are in blocks.","title":"4 · 缓存节约什么，不能节约什么？","url":"https://codingai-lec03.pages.dev/course/notebook-blocks/304aa2a46d41405db647924c1a08d5c0.html","markdown":"https://codingai-lec03.pages.dev/course/notebook-blocks/304aa2a46d41405db647924c1a08d5c0.md","pages":[{"id":"reading-opening","title":"4 · 缓存节约什么，不能节约什么？","unit":"4 · 缓存节约什么，不能节约什么？","unitId":"notebook-blocks/304aa2a46d41405db647924c1a08d5c0","chapter":"course","number":1}],"aliases":[{"oldId":"b-9afe8dd37ea39673a922ce6b","targetId":"b-9afe8dd37ea39673a922ce6b","page":"reading-opening","operation":"move","beforeSHA256":"1a4de4df51c1a8787dc96ec401888dfe89d250842519319b9af7a931ca765eee","afterSHA256":"1a4de4df51c1a8787dc96ec401888dfe89d250842519319b9af7a931ca765eee","reason":"Same source body in authored semantic page"},{"oldId":"b-a8de9ade035c697ca3d8f456","targetId":"b-a8de9ade035c697ca3d8f456","page":"reading-opening","operation":"move","beforeSHA256":"344082b6b8efbc136ced853d1cc824150c810329670545b84269f7a32c85518e","afterSHA256":"344082b6b8efbc136ced853d1cc824150c810329670545b84269f7a32c85518e","reason":"Same source body in authored semantic page"},{"oldId":"b-1b48c83feddd544a7052e0a0","targetId":"b-1b48c83feddd544a7052e0a0","page":"reading-opening","operation":"move","beforeSHA256":"dc06c1e728a4b5740ba634b145bc9a1da6323031626734cb4555db5a744df806","afterSHA256":"dc06c1e728a4b5740ba634b145bc9a1da6323031626734cb4555db5a744df806","reason":"Same source body in authored semantic page"},{"oldId":"b-5d1d24bea8bcf49ec7b3e1c7","targetId":"b-5d1d24bea8bcf49ec7b3e1c7","page":"reading-opening","operation":"move","beforeSHA256":"8021c18afc52ba7b6612f43ecfb0fdd4789efe91cc9cd656984357d81a8514de","afterSHA256":"8021c18afc52ba7b6612f43ecfb0fdd4789efe91cc9cd656984357d81a8514de","reason":"Same source body in authored semantic page"},{"oldId":"b-0503b358740f8445c5924be5","targetId":"b-0503b358740f8445c5924be5","page":"reading-opening","operation":"move","beforeSHA256":"cc34b1d8d96a4a8b5be556959bf607fe886b3e40109adebba891f9b6d77ccf4f","afterSHA256":"cc34b1d8d96a4a8b5be556959bf607fe886b3e40109adebba891f9b6d77ccf4f","reason":"Same source body in authored semantic page"},{"oldId":"b-0c8416f2adafc0b5e5363a56","targetId":"b-0c8416f2adafc0b5e5363a56","page":"reading-opening","operation":"move","beforeSHA256":"29de550b073aa289c5c63996c445f8ef9074e4112c55ccd3992e7ea786a72ca4","afterSHA256":"29de550b073aa289c5c63996c445f8ef9074e4112c55ccd3992e7ea786a72ca4","reason":"Same source body in authored semantic page"},{"oldId":"b-aaa86d6fa52acdfcaab10446","targetId":"b-aaa86d6fa52acdfcaab10446","page":"reading-opening","operation":"rewrite","beforeSHA256":"e1c547b6e70c56eee1fa6cd81d029af495999c5a23ba0feca79b25a35f761586","afterSHA256":"43f16868b0a2ff3caaf4097219db411875fa2eddf5ab688376216b11ba085931","reason":"Same source identity with figure semantics or reading context enriched"},{"oldId":"b-361a09a397cffb4165f8849e","targetId":"b-361a09a397cffb4165f8849e","page":"reading-opening","operation":"move","beforeSHA256":"7df53ec83d5158fab387bde9da8775e8145a415001ec6c33bbc5889e686315c6","afterSHA256":"7df53ec83d5158fab387bde9da8775e8145a415001ec6c33bbc5889e686315c6","reason":"Same source body in authored semantic page"},{"oldId":"b-6cce15b1d7e19147ef05a5c3","targetId":"b-6cce15b1d7e19147ef05a5c3","page":"reading-opening","operation":"move","beforeSHA256":"0058f1b1f72f4b12fed94a47316508cdf7a76909d978c569cc516bd2b096b4c4","afterSHA256":"0058f1b1f72f4b12fed94a47316508cdf7a76909d978c569cc516bd2b096b4c4","reason":"Same source body in authored semantic page"},{"oldId":"b-ddbad38bba26f1188954a903","targetId":"b-ddbad38bba26f1188954a903","page":"reading-opening","operation":"move","beforeSHA256":"0aca1a9483c1d58d13fe4c22db96395bf7ece1daf2b5e25e23c67d8e06f67d18","afterSHA256":"0aca1a9483c1d58d13fe4c22db96395bf7ece1daf2b5e25e23c67d8e06f67d18","reason":"Same source body in authored semantic page"},{"oldId":"block-304aa2a46d41405db647924c1a08d5c0--4-缓存节约什么不能节约什么","targetId":"b-0503b358740f8445c5924be5","operation":"retain-source-identity"}],"blocks":[{"id":"b-9afe8dd37ea39673a922ce6b","type":"p","scope":"document","url":"https://codingai-lec03.pages.dev/course/notebook-blocks/304aa2a46d41405db647924c1a08d5c0.html#b-9afe8dd37ea39673a922ce6b","content":"[LAB 12 · CLIP延伸：缓存与检索（近似索引选读）](/course/notebooks/921eeaf784284ce19568c6ca7619b55a.html)","sha256":"1a4de4df51c1a8787dc96ec401888dfe89d250842519319b9af7a931ca765eee","chapter":{"id":"course","title":"4 · 缓存节约什么，不能节约什么？"},"unit":{"id":"notebook-blocks/304aa2a46d41405db647924c1a08d5c0","title":"4 · 缓存节约什么，不能节约什么？"},"page":{"id":"reading-opening","title":"4 · 缓存节约什么，不能节约什么？","number":1},"sectionTitle":"4 · 缓存节约什么，不能节约什么？","currentQuestion":"4 · 缓存节约什么，不能节约什么？","sourceSlides":[],"knowledgeBlock":null,"formulas":[],"previousBlock":null,"nextBlock":"b-a8de9ade035c697ca3d8f456","prerequisites":[],"relatedBlocks":[]},{"id":"b-a8de9ade035c697ca3d8f456","type":"h1","scope":"document","url":"https://codingai-lec03.pages.dev/course/notebook-blocks/304aa2a46d41405db647924c1a08d5c0.html#b-a8de9ade035c697ca3d8f456","content":"# 4 · 缓存节约什么，不能节约什么？","sha256":"344082b6b8efbc136ced853d1cc824150c810329670545b84269f7a32c85518e","chapter":{"id":"course","title":"4 · 缓存节约什么，不能节约什么？"},"unit":{"id":"notebook-blocks/304aa2a46d41405db647924c1a08d5c0","title":"4 · 缓存节约什么，不能节约什么？"},"page":{"id":"reading-opening","title":"4 · 缓存节约什么，不能节约什么？","number":1},"sectionTitle":"4 · 缓存节约什么，不能节约什么？","currentQuestion":"4 · 缓存节约什么，不能节约什么？","sourceSlides":[],"knowledgeBlock":null,"formulas":[],"previousBlock":"b-9afe8dd37ea39673a922ce6b","nextBlock":"b-1b48c83feddd544a7052e0a0","prerequisites":[{"id":"b-9afe8dd37ea39673a922ce6b","url":"#b-9afe8dd37ea39673a922ce6b","role":"problem-context"}],"relatedBlocks":[]},{"id":"b-1b48c83feddd544a7052e0a0","type":"p","scope":"document","url":"https://codingai-lec03.pages.dev/course/notebook-blocks/304aa2a46d41405db647924c1a08d5c0.html#b-1b48c83feddd544a7052e0a0","content":"并入相关学习路径","sha256":"dc06c1e728a4b5740ba634b145bc9a1da6323031626734cb4555db5a744df806","chapter":{"id":"course","title":"4 · 缓存节约什么，不能节约什么？"},"unit":{"id":"notebook-blocks/304aa2a46d41405db647924c1a08d5c0","title":"4 · 缓存节约什么，不能节约什么？"},"page":{"id":"reading-opening","title":"4 · 缓存节约什么，不能节约什么？","number":1},"sectionTitle":"4 · 缓存节约什么，不能节约什么？","currentQuestion":"4 · 缓存节约什么，不能节约什么？","sourceSlides":[],"knowledgeBlock":null,"formulas":[],"previousBlock":"b-a8de9ade035c697ca3d8f456","nextBlock":"b-5d1d24bea8bcf49ec7b3e1c7","prerequisites":[{"id":"b-a8de9ade035c697ca3d8f456","url":"#b-a8de9ade035c697ca3d8f456","role":"section-title"},{"id":"b-9afe8dd37ea39673a922ce6b","url":"#b-9afe8dd37ea39673a922ce6b","role":"problem-context"}],"relatedBlocks":[]},{"id":"b-5d1d24bea8bcf49ec7b3e1c7","type":"p","scope":"document","url":"https://codingai-lec03.pages.dev/course/notebook-blocks/304aa2a46d41405db647924c1a08d5c0.html#b-5d1d24bea8bcf49ec7b3e1c7","content":"同一CLIP缓存、exact/IVF搜索、延迟/扫描量、区域交互基线","sha256":"8021c18afc52ba7b6612f43ecfb0fdd4789efe91cc9cd656984357d81a8514de","chapter":{"id":"course","title":"4 · 缓存节约什么，不能节约什么？"},"unit":{"id":"notebook-blocks/304aa2a46d41405db647924c1a08d5c0","title":"4 · 缓存节约什么，不能节约什么？"},"page":{"id":"reading-opening","title":"4 · 缓存节约什么，不能节约什么？","number":1},"sectionTitle":"4 · 缓存节约什么，不能节约什么？","currentQuestion":"4 · 缓存节约什么，不能节约什么？","sourceSlides":[],"knowledgeBlock":null,"formulas":[],"previousBlock":"b-1b48c83feddd544a7052e0a0","nextBlock":"b-0503b358740f8445c5924be5","prerequisites":[{"id":"b-a8de9ade035c697ca3d8f456","url":"#b-a8de9ade035c697ca3d8f456","role":"section-title"},{"id":"b-9afe8dd37ea39673a922ce6b","url":"#b-9afe8dd37ea39673a922ce6b","role":"problem-context"}],"relatedBlocks":[]},{"id":"b-0503b358740f8445c5924be5","type":"h2","scope":"document","url":"https://codingai-lec03.pages.dev/course/notebook-blocks/304aa2a46d41405db647924c1a08d5c0.html#b-0503b358740f8445c5924be5","content":"## 4 · 缓存节约什么，不能节约什么？","sha256":"cc34b1d8d96a4a8b5be556959bf607fe886b3e40109adebba891f9b6d77ccf4f","chapter":{"id":"course","title":"4 · 缓存节约什么，不能节约什么？"},"unit":{"id":"notebook-blocks/304aa2a46d41405db647924c1a08d5c0","title":"4 · 缓存节约什么，不能节约什么？"},"page":{"id":"reading-opening","title":"4 · 缓存节约什么，不能节约什么？","number":1},"sectionTitle":"4 · 缓存节约什么，不能节约什么？","currentQuestion":"4 · 缓存节约什么，不能节约什么？","sourceSlides":[],"knowledgeBlock":null,"formulas":[],"previousBlock":"b-5d1d24bea8bcf49ec7b3e1c7","nextBlock":"b-0c8416f2adafc0b5e5363a56","prerequisites":[{"id":"b-a8de9ade035c697ca3d8f456","url":"#b-a8de9ade035c697ca3d8f456","role":"section-title"},{"id":"b-9afe8dd37ea39673a922ce6b","url":"#b-9afe8dd37ea39673a922ce6b","role":"problem-context"}],"relatedBlocks":[]},{"id":"b-0c8416f2adafc0b5e5363a56","type":"p","scope":"document","url":"https://codingai-lec03.pages.dev/course/notebook-blocks/304aa2a46d41405db647924c1a08d5c0.html#b-0c8416f2adafc0b5e5363a56","content":"下表是同一 $N=24,Q=12,d=512$ 任务的解析工作量，不是把未执行的全部逐对编码写成实测。每次“样本编码”指一个图片或一条文字通过对应编码器；批处理调用可以一次处理多个样本，二者不相等。","sha256":"29de550b073aa289c5c63996c445f8ef9074e4112c55ccd3992e7ea786a72ca4","chapter":{"id":"course","title":"4 · 缓存节约什么，不能节约什么？"},"unit":{"id":"notebook-blocks/304aa2a46d41405db647924c1a08d5c0","title":"4 · 缓存节约什么，不能节约什么？"},"page":{"id":"reading-opening","title":"4 · 缓存节约什么，不能节约什么？","number":1},"sectionTitle":"4 · 缓存节约什么，不能节约什么？","currentQuestion":"4 · 缓存节约什么，不能节约什么？","sourceSlides":[],"knowledgeBlock":null,"formulas":[{"latex":"N=24,Q=12,d=512","definitionContext":"4 · 缓存节约什么，不能节约什么？"}],"previousBlock":"b-0503b358740f8445c5924be5","nextBlock":"b-aaa86d6fa52acdfcaab10446","prerequisites":[{"id":"b-0503b358740f8445c5924be5","url":"#b-0503b358740f8445c5924be5","role":"section-title"},{"id":"b-9afe8dd37ea39673a922ce6b","url":"#b-9afe8dd37ea39673a922ce6b","role":"problem-context"}],"relatedBlocks":[]},{"id":"b-aaa86d6fa52acdfcaab10446","type":"table","scope":"document","url":"https://codingai-lec03.pages.dev/course/notebook-blocks/304aa2a46d41405db647924c1a08d5c0.html#b-aaa86d6fa52acdfcaab10446","content":"| 组织方式 | 图像样本编码 | 文字样本编码 | 相似度计算 | 可复用内容 |\n| --- | --- | --- | --- | --- |\n| 每对都重编码 | 288 | 288 | 288 个512维点积 | 无 |\n| 双编码器缓存 | 24（入库一次） | 12 | 288 个512维点积 | 图像向量可跨查询复用 |\n| 新增一条查询 | 0 | 1 | exact为24个点积 | 原图像库不变 |\n| IVF nprobe=1 | 入库同上 | 查询同上 | 每查询8个中心点积+平均4.17个图片点积 | 中心、倒排表、图片向量 |","sha256":"43f16868b0a2ff3caaf4097219db411875fa2eddf5ab688376216b11ba085931","chapter":{"id":"course","title":"4 · 缓存节约什么，不能节约什么？"},"unit":{"id":"notebook-blocks/304aa2a46d41405db647924c1a08d5c0","title":"4 · 缓存节约什么，不能节约什么？"},"page":{"id":"reading-opening","title":"4 · 缓存节约什么，不能节约什么？","number":1},"sectionTitle":"4 · 缓存节约什么，不能节约什么？","currentQuestion":"4 · 缓存节约什么，不能节约什么？","sourceSlides":[],"knowledgeBlock":null,"formulas":[],"table":{"headers":["组织方式","图像样本编码","文字样本编码","相似度计算","可复用内容"],"rows":[["组织方式","图像样本编码","文字样本编码","相似度计算","可复用内容"],["每对都重编码","288","288","288 个512维点积","无"],["双编码器缓存","24（入库一次）","12","288 个512维点积","图像向量可跨查询复用"],["新增一条查询","0","1","exact为24个点积","原图像库不变"],["IVF nprobe=1","入库同上","查询同上","每查询8个中心点积+平均4.17个图片点积","中心、倒排表、图片向量"]]},"previousBlock":"b-0c8416f2adafc0b5e5363a56","nextBlock":"b-361a09a397cffb4165f8849e","prerequisites":[{"id":"b-0503b358740f8445c5924be5","url":"#b-0503b358740f8445c5924be5","role":"section-title"},{"id":"b-9afe8dd37ea39673a922ce6b","url":"#b-9afe8dd37ea39673a922ce6b","role":"problem-context"}],"relatedBlocks":[]},{"id":"b-361a09a397cffb4165f8849e","type":"p","scope":"document","url":"https://codingai-lec03.pages.dev/course/notebook-blocks/304aa2a46d41405db647924c1a08d5c0.html#b-361a09a397cffb4165f8849e","content":"图片矩阵为 $24×512×4=49,152$ 字节；8个中心另占16,384字节，倒排 ID 另占192字节（保存基准使用的 int64）。这没有计入 Python 对象、图片文件和模型权重，不能直接称整个服务的内存。","sha256":"7df53ec83d5158fab387bde9da8775e8145a415001ec6c33bbc5889e686315c6","chapter":{"id":"course","title":"4 · 缓存节约什么，不能节约什么？"},"unit":{"id":"notebook-blocks/304aa2a46d41405db647924c1a08d5c0","title":"4 · 缓存节约什么，不能节约什么？"},"page":{"id":"reading-opening","title":"4 · 缓存节约什么，不能节约什么？","number":1},"sectionTitle":"4 · 缓存节约什么，不能节约什么？","currentQuestion":"4 · 缓存节约什么，不能节约什么？","sourceSlides":[],"knowledgeBlock":null,"formulas":[{"latex":"24×512×4=49,152","definitionContext":"4 · 缓存节约什么，不能节约什么？"}],"previousBlock":"b-aaa86d6fa52acdfcaab10446","nextBlock":"b-6cce15b1d7e19147ef05a5c3","prerequisites":[{"id":"b-0503b358740f8445c5924be5","url":"#b-0503b358740f8445c5924be5","role":"section-title"},{"id":"b-9afe8dd37ea39673a922ce6b","url":"#b-9afe8dd37ea39673a922ce6b","role":"problem-context"}],"relatedBlocks":[]},{"id":"b-6cce15b1d7e19147ef05a5c3","type":"p","scope":"document","url":"https://codingai-lec03.pages.dev/course/notebook-blocks/304aa2a46d41405db647924c1a08d5c0.html#b-6cce15b1d7e19147ef05a5c3","content":"2026-09-22 的全部实测编码还包括候选与关系扩展，共 36 个图像样本和24条文字，分别以9个图像批次和1个文字批次编码；另做两对逐对重编码核验（额外2图+2文），与缓存点积最大差8.94×10⁻⁸。将CLIP按配对重复调用，算的仍然是 $f(I)^\\top g(T)$，并没有出现图文联合注意力。","sha256":"0058f1b1f72f4b12fed94a47316508cdf7a76909d978c569cc516bd2b096b4c4","chapter":{"id":"course","title":"4 · 缓存节约什么，不能节约什么？"},"unit":{"id":"notebook-blocks/304aa2a46d41405db647924c1a08d5c0","title":"4 · 缓存节约什么，不能节约什么？"},"page":{"id":"reading-opening","title":"4 · 缓存节约什么，不能节约什么？","number":1},"sectionTitle":"4 · 缓存节约什么，不能节约什么？","currentQuestion":"4 · 缓存节约什么，不能节约什么？","sourceSlides":[],"knowledgeBlock":null,"formulas":[{"latex":"f(I)^\\top g(T)","definitionContext":"4 · 缓存节约什么，不能节约什么？"}],"previousBlock":"b-361a09a397cffb4165f8849e","nextBlock":"b-ddbad38bba26f1188954a903","prerequisites":[{"id":"b-0503b358740f8445c5924be5","url":"#b-0503b358740f8445c5924be5","role":"section-title"},{"id":"b-9afe8dd37ea39673a922ce6b","url":"#b-9afe8dd37ea39673a922ce6b","role":"problem-context"}],"relatedBlocks":[]},{"id":"b-ddbad38bba26f1188954a903","type":"p","scope":"document","url":"https://codingai-lec03.pages.dev/course/notebook-blocks/304aa2a46d41405db647924c1a08d5c0.html#b-ddbad38bba26f1188954a903","content":"这次36图编码含预处理共2.726秒、24文共0.205秒，是一趟本地CPU墙钟时间，不含模型加载/下载，不能当作稳定线上延迟。代码另行测量缓存搜索分布，已经在上表展示。更换模型、revision、预处理或图片内容会使旧缓存失效；只增加候选文字不会改变已有图片向量。","sha256":"0aca1a9483c1d58d13fe4c22db96395bf7ece1daf2b5e25e23c67d8e06f67d18","chapter":{"id":"course","title":"4 · 缓存节约什么，不能节约什么？"},"unit":{"id":"notebook-blocks/304aa2a46d41405db647924c1a08d5c0","title":"4 · 缓存节约什么，不能节约什么？"},"page":{"id":"reading-opening","title":"4 · 缓存节约什么，不能节约什么？","number":1},"sectionTitle":"4 · 缓存节约什么，不能节约什么？","currentQuestion":"4 · 缓存节约什么，不能节约什么？","sourceSlides":[],"knowledgeBlock":null,"formulas":[],"previousBlock":"b-6cce15b1d7e19147ef05a5c3","nextBlock":null,"prerequisites":[{"id":"b-0503b358740f8445c5924be5","url":"#b-0503b358740f8445c5924be5","role":"section-title"},{"id":"b-9afe8dd37ea39673a922ce6b","url":"#b-9afe8dd37ea39673a922ce6b","role":"problem-context"}],"relatedBlocks":[]}]}
