train an expert to answer any question grounded in your docs
fast answers with real citations, from a small model trained on your corpus. we’ve had a 4b model beat gpt-5.2 on domain retrieval.
the default way to answer questions over a private corpus is a frontier model in a retrieval loop: plan, search, read, search again, answer. the answers are fine. the loop is slow and expensive, and it never improves, because the model doing the searching has never seen your corpus. it relearns your terminology, your acronyms, and your document structure from scratch on every question, one tool call at a time.
a small model that knows the territory
training flips that. with reinforcement learning over your corpus, a small model learns what a generalist can’t be told in a prompt: what things are called in your domain, which queries pay off, when to keep digging and when to stop. in our finance retrieval work, a 4b model trained this way matched ground-truth answers about 35% more often than gpt-5.2, a model likely a hundred times its size. it also learned better search behavior along the way, going from echoing the user’s query once to running real multi-step searches.
small also means fast. the whole agentic loop, several searches deep, runs at interactive latency and open-weights prices. that’s the difference between search that sits in your product and search that sits behind a spinner.
you don’t need labeled questions
the usual blocker is the dataset: rl wants thousands of hard, grounded questions, and nobody has them lying around. you don’t need them. we built a pipeline that generates the question set from the corpus itself: multi-hop questions that link related documents, filtered so every question genuinely requires retrieval and every answer is supported by the source text. your docs, support articles, slack exports, and wikis are the only input.
citations by construction
part of the reward during training is whether the agent actually retrieved the reference passages, rather than whether its final answer merely sounds plausible. the model that comes out cites the chunks it read. every answer arrives with its evidence, checkable by anyone, grounded in your documents instead of whatever the base model remembers about the internet.
how it runs on castform
point us at the corpus. we profile it, generate and filter the training questions, and train against your retrieval stack (bm25, embeddings, or your existing turbopuffer namespace) so the model learns the setup it will actually query in production. we ran this recipe with neon: a 4b open model over postgres data that matched frontier accuracy at around one hundredth of the inference cost. the weights are yours to serve wherever the corpus lives.