Chuyển đến nội dung chính

Bài đăng

Hiển thị các bài đăng có nhãn Search

Choosing an embedding model: the questions that actually matter

The usual process is: open a leaderboard, sort by average score, take the top model that fits the budget, move on. It produces a defensible choice roughly half the time, and the half where it fails, it fails expensively — because switching embedding models means re-embedding everything and rebuilding every index. Here are the questions that predict the outcome better than rank does. Does it work on your text? A benchmark average is a weighted mixture of tasks, most of which are not yours. A model that leads overall can trail badly on the one thing you need — legal clauses, product SKUs, Vietnamese customer support tickets, code. The evaluation that matters takes an afternoon: Collect 50-100 real queries from your logs (or write them, if you have no traffic yet). For each, mark which documents in your corpus should be retrieved. This labelling is the actual work. Embed the corpus with each candidate model, run the queries, measure recall@k for the k you actually feed to the mo...

Choosing an embedding model: the questions that actually matter

The usual process is: open a leaderboard, sort by average score, take the top model that fits the budget, move on. It produces a defensible choice roughly half the time, and the half where it fails, it fails expensively — because switching embedding models means re-embedding everything and rebuilding every index. Here are the questions that predict the outcome better than rank does. Does it work on your text? A benchmark average is a weighted mixture of tasks, most of which are not yours. A model that leads overall can trail badly on the one thing you need — legal clauses, product SKUs, Vietnamese customer support tickets, code. The evaluation that matters takes an afternoon: Collect 50-100 real queries from your logs (or write them, if you have no traffic yet). For each, mark which documents in your corpus should be retrieved. This labelling is the actual work. Embed the corpus with each candidate model, run the queries, measure recall@k for the k you actually feed to the mo...

Retrieval không nói dối: dựng eval trước khi dựng RAG

Bug report lúc nào cũng cùng một dạng. “Trợ lý bịa ra thời hạn hoàn tiền của mình.” Ai đó mở trace, thấy một đoạn văn sai nhưng đầy tự tin, rồi quy lỗi cho model. Prompt được thêm một đoạn hướng dẫn nữa. Có khi temperature bị hạ xuống. Có khi ai đó đề xuất đổi model. Rồi bạn nhìn lên một tầng và thấy retriever đã đưa cho model ba chunk: chính sách vận chuyển, phần mở đầu của điều khoản dịch vụ, và một chunk đứt giữa câu ngay trước chỗ nêu thời hạn hoàn tiền. Model không hẳn là hallucinate — nó ứng biến trên một lỗ hổng. Không prompt nào sửa được chuyện đó. Đổi model cũng không: một model tốt hơn với đúng ba chunk ấy sẽ cho ra một đoạn sai thuyết phục hơn . Đây là dạng lỗi RAG phổ biến nhất, và bạn không thể nhìn ra nó từ output. Generation là phần duy nhất bạn đọc, nên generation là phần bạn đổ lỗi. Cách sửa là một phép đo tách đôi hai nửa, dựng trước khi bạn tinh chỉnh bất cứ thứ gì — nếu không, mọi thay đổi bạn làm đều là tung đồng xu mà không chấm điểm được. Dưới đây là phiên bản...

Retrieval that doesn't lie: build the eval before you build the RAG

The bug report always looks the same. “The assistant made something up about our refund window.” Someone opens the trace, sees a confident wrong paragraph, and files it against the model. The prompt gets another paragraph of instructions. Maybe the temperature comes down. Maybe someone proposes swapping models. Then you look one layer up and find the retriever handed the model three chunks: the shipping policy, the terms-of-service preamble, and a chunk that ends mid-sentence right before the refund window is stated. The model did not hallucinate so much as improvise over a hole. No prompt fixes that. No model upgrade fixes that either — a better model given the same three chunks will produce a more convincing wrong paragraph. This is the most common shape of RAG failure, and you cannot see it from the output. The generation is the only part you read, so the generation is the part you blame. The fix is a measurement that separates the two halves, built before you tune anything — ot...