第 1 周 · D2🔒 锁定约 4 小时
embedding 与向量检索:相似度、维度与模型选型,把文本存进 pgvector
从坐标系这个类比出发理解向量到底编码了什么,弄清余弦相似度与内积的区别和归一化的前提,再对着排行榜谈模型选型与维度取舍,最后把语料写进 pgvector 并查出最近邻。
从坐标系这个类比出发理解向量到底编码了什么,弄清余弦相似度与内积的区别和归一化的前提,再对着排行榜谈模型选型与维度取舍,最后把语料写进 pgvector 并查出最近邻。
面试题库
余弦相似度和内积什么时候等价?如果向量没有归一化,用内积排序会出什么问题?When are cosine similarity and inner product equivalent? What goes wrong if you rank by inner product on vectors that are not normalized?
国内高频海外高频基础#embeddings#similarity#normalisation🔒 解锁本章后查看答题要点。
把 embedding 维度从 1536 降到 512,你会损失什么?什么场景下这个损失可以接受?What do you lose when you cut embedding dimensions from 1536 to 512, and when is that loss acceptable?
国内高频海外高频进阶#embeddings#dimensions#cost🔒 解锁本章后查看答题要点。
为什么有些 embedding 模型要求查询和文档加不同的前缀?不加会怎样,你怎么在上线前发现这个问题?Why do some embedding models require different prefixes for queries and documents? What happens if you skip them, and how would you catch it before shipping?
国内高频海外高频进阶#embeddings#model-selection#evaluation🔒 解锁本章后查看答题要点。
向量检索能完全取代关键词检索吗?举一个向量必然失手的查询,并说说你会怎么补。Can vector search fully replace keyword search? Give a query where vectors are bound to fail, and say how you would fix it.
国内高频海外高频进阶#hybrid-search#embeddings#retrieval-failure🔒 解锁本章后查看答题要点。
