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

Bài đăng

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

Dữ liệu tổng hợp cho eval: xây bộ kiểm thử mà bạn tin được

Bạn có một hệ thống RAG, chưa có người dùng, và một prompt cứ sửa đi sửa lại. Lần sửa nào cũng thấy “có vẻ tốt hơn” mà không cách nào kiểm chứng. Viết tay một trăm câu hỏi kiểm thử mất hai ngày, và bạn sẽ không làm. Thế là bạn nhờ model sinh ra chúng. Cách này có tác dụng, đáng làm, và có đúng một kiểu hỏng khiến toàn bộ nỗ lực trở nên vô nghĩa nếu bạn không thiết kế để né nó. Vấn đề luẩn quẩn Nếu bạn sinh câu hỏi bằng cách đưa tài liệu cho model đọc, bạn sẽ nhận về những câu hỏi mà tài liệu trả lời tốt, diễn đạt theo đúng cách tài liệu diễn đạt. Retrieval của bạn sẽ đạt điểm rất đẹp — trên một bộ test được dựng từ chính những giả định của hệ thống đang bị kiểm tra. Người dùng thật thì hỏi về những thứ tài liệu bao phủ kém, bằng từ ngữ tài liệu chưa bao giờ dùng, kèm theo tiền đề sai. Một bộ eval tổng hợp làm ngây thơ chỉ đo tính nhất quán nội bộ, không đo tính hữu ích. Nó sẽ đạt trong khi người dùng của bạn thất bại. Toàn bộ phần dưới đây là về việc bẻ gãy vòng luẩn quẩn đó. Gi...

Dữ liệu tổng hợp cho eval: xây bộ kiểm thử mà bạn tin được

Bạn có một hệ thống RAG, chưa có người dùng, và một prompt cứ sửa đi sửa lại. Lần sửa nào cũng thấy “có vẻ tốt hơn” mà không cách nào kiểm chứng. Viết tay một trăm câu hỏi kiểm thử mất hai ngày, và bạn sẽ không làm. Thế là bạn nhờ model sinh ra chúng. Cách này có tác dụng, đáng làm, và có đúng một kiểu hỏng khiến toàn bộ nỗ lực trở nên vô nghĩa nếu bạn không thiết kế để né nó. Vấn đề luẩn quẩn Nếu bạn sinh câu hỏi bằng cách đưa tài liệu cho model đọc, bạn sẽ nhận về những câu hỏi mà tài liệu trả lời tốt, diễn đạt theo đúng cách tài liệu diễn đạt. Retrieval của bạn sẽ đạt điểm rất đẹp — trên một bộ test được dựng từ chính những giả định của hệ thống đang bị kiểm tra. Người dùng thật thì hỏi về những thứ tài liệu bao phủ kém, bằng từ ngữ tài liệu chưa bao giờ dùng, kèm theo tiền đề sai. Một bộ eval tổng hợp làm ngây thơ chỉ đo tính nhất quán nội bộ, không đo tính hữu ích. Nó sẽ đạt trong khi người dùng của bạn thất bại. Toàn bộ phần dưới đây là về việc bẻ gãy vòng luẩn quẩn đó. Gi...

Synthetic data for evals: building a test set you can trust

You have a RAG system, no users yet, and a prompt you keep changing. Every change feels like an improvement and you have no way to tell. Writing a hundred test questions by hand takes two days and you will not do it. So you ask a model to generate them. This works, and it is worth doing, and it has one failure mode that invalidates the whole exercise if you do not design around it. The circularity problem If you generate questions by showing a model your documents, you get questions your documents answer well, phrased the way your documents phrase things. Your retrieval then scores beautifully — on a test set constructed from the same assumptions as the system under test. Real users ask about things your documents cover badly, in words your documents never use, with false premises baked in. A synthetic eval set built naively measures internal consistency, not usefulness. It will pass while your users fail. Everything below is about breaking that circle. Seed from real artefacts,...

Synthetic data for evals: building a test set you can trust

You have a RAG system, no users yet, and a prompt you keep changing. Every change feels like an improvement and you have no way to tell. Writing a hundred test questions by hand takes two days and you will not do it. So you ask a model to generate them. This works, and it is worth doing, and it has one failure mode that invalidates the whole exercise if you do not design around it. The circularity problem If you generate questions by showing a model your documents, you get questions your documents answer well, phrased the way your documents phrase things. Your retrieval then scores beautifully — on a test set constructed from the same assumptions as the system under test. Real users ask about things your documents cover badly, in words your documents never use, with false premises baked in. A synthetic eval set built naively measures internal consistency, not usefulness. It will pass while your users fail. Everything below is about breaking that circle. Seed from real artefacts,...

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...