I am building a small side project: semantic search over an archive of a few thousand English Q&A forum threads (community advice topics, some with fairly specialized legal/immigration vocabulary).Setup: roughly 40k posts, average around 300 words per post, CPU-only inference in the target environment. My first try with a small MiniLM cross-encoder misses paraphrases badly, so I suspect I need a better embedding model.Questions:1. Is a bge-base or e5-base class model still the sweet spot when everything has to run on CPU, or is a smaller MiniLM class model acceptable for a corpus this size if I re-rank the top 20 results?2. Should I embed per post or per thread? My worry is that per-post embeddings lose the question-answer pairing that makes advice threads useful.3. At this corpus size, is mining hard negatives from BM25 top-k results and fine-tuning worth the effort, or am I better off just picking a good instruction-tuned embedding checkpoint and leaving it alone?Any practical tips from people who have done this at small scale would be appreciated.
Your bottleneck is likely retrieval, not reranking: a cross-encoder can only reorder the top 20 it is given, so first measure recall@20 of the first stage alone on 50–100 real queries rewritten as paraphrases — if the right thread is not in those 20, no reranker or larger embedder will recover it. For the index, embed each answer post with its thread’s question prepended, so every chunk keeps the question–answer pairing without diluting it across a whole thread, and pair a small bi-encoder (the bge-small or e5-small class is plenty for 40k posts on CPU, run hybrid with BM25 for the specialized terms embeddings smooth over) with your cross-encoder on top. Skip hard-negative fine-tuning until that recall number exists: if recall@20 is already high and the final ranking is wrong, fine-tune the reranker; if it is low, BM25-mined negatives for the bi-encoder are the one training step worth doing, and the same measurement tells you whether it worked.
Building on the question-prepended answer-post idea, two practical details matter a lot at this size. First, check the model’s expected instruction and pooling behavior before comparing checkpoints: e5-style models expect different prefixes for queries and passages, and a model compared without its prefixes can look worse than it is. Also confirm truncation. A 300-word post plus a prepended question can approach the token limit, so long posts should be split with overlap rather than silently truncated.
Second, for CPU serving, encode the whole 40k-post corpus once offline, cache the vectors, and only encode the query live. A small model with ONNX or quantized weights is usually fast enough there, and the bigger win is usually the retrieval setup rather than base versus small. For returning threads, I would score posts and then aggregate by thread using the best post score, showing that post as the snippet, rather than averaging the posts in a thread.
Have you tried measuring recall@20 separately for paraphrase queries versus keyword queries? That split usually shows whether the hybrid BM25 leg or the embedding leg needs the work.
One step before picking the model: clean the posts. Strip quoted text (if you prepend the question like nootxlm said and the reply also quotes it, it goes in twice), and drop repeated signatures and ‘not legal advice’ lines, since across thousands of posts they pull unrelated posts together, especially on the BM25 side. I’d also leave ‘thanks’ and ‘bump’ posts out of the index and keep each post’s date as metadata, because immigration rules change and an old answer that matches well can still be the wrong one.