用比 GPT-5.6 Sol 便宜 100 倍的开源模型在检索任务上实现超越
Beating GPT-5.6 Sol on retrieval with 100x cheaper open models

原始链接: https://neon.com/blog/how-castform-neon-beats-frontier-models-on-price-and-efficiency

Castform 通过使开发者能够在无需深厚机器学习或基础设施专业知识的情况下,对开源模型进行强化学习 (RL) 后训练,简化了专用 AI 代理的开发。 尽管前沿模型功能强大,但在复杂的、多跳代理检索任务中,它们往往因速度过慢且成本过高而难以使用。Castform 通过允许团队利用其专有的数据库内容作为训练数据,填补了这一性能差距。该平台能够自动创建合成训练任务并管理强化学习循环,从而指导模型如何有效地与工具进行交互。 通过与 Neon 的“Lakebase Postgres”集成,Castform 将数据库原生的搜索能力同时应用于训练发布和生产推理。这种基础设施实现了高性能且具有成本效益的代理工作流:Neon 的动态扩容能力可以处理强化学习中突发的需求,而数据库分支功能则为有状态的代理测试提供了隔离的、短暂的环境。 最终,Castform 让模型后训练变得普及,将内部数据孤岛转化为高性能、高性价比的代理,使其能够匹敌甚至超越大型闭源模型的能力。开发者可以监控奖励进度并调试单个任务,让训练定制化、高精度的 AI 变得像提示词工程一样简单易行。

这篇 Hacker News 讨论探讨了一个新兴趋势:利用专门的小型开源模型进行文档检索,其表现优于 GPT-5.6 Sol 等大型前沿模型,且成本仅为后者的一小部分。 讨论的核心要点包括: * **专业化与通用化:** 参与者认为,小型模型在检索任务中表现更佳,因为它们不容易出现大型通用模型常见的“过度思考”或任务偏离问题。 * **智能体工作流的兴起:** 用户强调了“子智能体”架构的效率,即由强大的模型(如 Claude 或 Sol)担任协调者,将特定的检索或编码任务分派给更廉价的专业模型。 * **性能与效率:** 社区对 Deepseek Flash 等新模型表现出浓厚兴趣,并对其高性价比给予了高度评价。 * **遗留挑战:** 辩论者指出了微调带来的持续维护负担、管理过时语料数据的困难,以及“大海捞针”式检索的技术挑战——特别是在大型数据集中查找多步骤、关联信息时。 总而言之,社区认为大语言模型集成的未来在于将针对特定用途、高效的模型紧密耦合到应用程序生命周期中,而不是仅仅依赖昂贵的大型通用模型。
相关文章

原文

Comparison of Castform fine-tune and frontier models by inference cost and mean evaluation reward

“Most teams' best training data is just sitting in their databases. The problem is that turning raw data into something usable is hard, and letting agents read, search, and mutate data cheaply at scale requires advanced infra. Pointing Castform at Neon skips both.”

Ying Hang Seah, cofounder, Castform

A "good agent" needs to be strong in 2 areas:

  • Context: can we provide the tools to find the right data?
  • Model: can the model decide what to search for?

Neon (Lakebase Postgres) and their new Search extensions solve the first; Castform solves the second.

In ~2022, the industry was going all in on embedding search. Every database provider added one, and pgvector was Neon's most downloaded extension. To provide context to LLMs, engineers handcrafted RAG pipelines, which in essence, is some form of embedding similarity search.

In ~2025, agents started to gain more traction. Developers started creating multi-hop search workflows, decomposing big problems into smaller ones. Retrieval has shifted from the one-shot search systems to agentic retrieval. Instead of issuing a single query, models plan and search multiple times in a loop. Every loop iteration meant another call to the frontier model, increasing the overall cost and latency per user request.

Comparison of a traditional RAG pipeline and an agentic search workflow

Concretely, a typical multi-turn search request with gpt-5.6-sol takes >10s and costs ~$0.03 end-to-end, making it prohibitively slow and expensive.

Meanwhile, small open-weights models are 100x cheaper. But, out of the box, their capabilities lag behind closed api models. RL post-training helps bridge this gap. On specific tasks like search, post-trained open-source models can match & beat frontier models while costing orders of magnitude less per request.

That is why we built Castform: to enable developers to RL post-train models without having to deal with machine learning & gpu internals. The goal's to make post-training as approachable as prompt engineering.

Castform's pipeline runs against Neon via Lakebase Search:

StageNeon + Lakebase Search
Corpus storageRaw documents live in Postgres on Neon
Synthetic data generationCastform training pipeline uses lakebase_text and lakebase_vector to write training tasks
RL TrainingEvery rollout's search tool call uses Lakebase Search on Neon
Production InferenceThe final model uses the same search tool call during inference

To perform RL post-training effectively, you need a task (e.g. answer a user's question), the environment for the agent to run in (e.g. a search tool for your corpus) and a reward function (e.g. is the answer correct?).

With all 3 pieces in place, the RL post-training is a loop of trial and error: the model attempts the task given the tools, the reward function scores the attempt, and the feedback signal guides the model on how to hill-climb its way to optimal performance.

Yet, most companies do not have a clean dataset of tasks and reward functions ready for post-training.

Enterprises do have a large set of proprietary data:

  • internal documentation
  • product records
  • support articles
  • customer interactions
  • wikis
  • operational databases

This data contains the knowledge an agent needs, but turning it into an effective training dataset normally requires substantial data engineering and manual labeling.

That leads many teams to dismiss post-training for one of two reasons:

  • "We don't have the training data."
  • "Fine-tuning is too difficult and requires infrastructure we don't have."

Castform addresses both. It turns an existing corpus into training tasks, then manages the RL loop needed to teach an open-source model how to use that data effectively.

With Castform, you can turn your company knowledge base into a model:

  • Document (from your data): Trains booked through Navan will be paid by GitLab travel card. Train rides must be standard cabin class with 14 day booking lead time
  • Ground truth (inferred from your data): Train rides must be standard cabin class with a 14 day booking lead time.
  • Question (synthetically generated): When booking a rail trip in Navan, what are the rules for how early I need to reserve it and which seating level I'm expected to choose?

With the generated question-answer dataset, Castform lets you scaffold the training run by specifying the tools the agent has access to and a reward function.

The reward function specifies what you want your model to get good at. In our case, we want it to retrieve the correct chunks, cite the right sources along with providing the right final answer.

def run_tool(tool, tool_args):
    """Single tool: hybrid search over Lakebase."""
    if tool == "search":
        query = tool_args["query"]
        bm25 = neon.lakebase_text(query, k)
        vector = neon.lakebase_vector(query, k)
        return rrf_merge(bm25, vector, k)

def reward(trace, ground_truth):
    """Grade a trace against the ground-truth answer."""
    answer = parse_trace(trace)
    retrieval = ...     # did it retrieve the right source
    citation = ...      # did it cite the right chunk
    correctness = ...   # did it land on the right answer
    return retrieval + citation + correctness

See a comprehensive code example here.

Castform gives you full observability into your RL run. You can monitor your reward climb with each step, but more importantly you can drop into individual tasks/prompts to watch how the model performs qualitatively, allowing you to debug problems such as broken tools or reward hacking.

For more details on how to monitor your training runs, you can check out the Castform blog here. You can also check out our example training run here.

Average reward over training steps
Average reward

During training, the agent repeatedly calls Lakebase Search until it has enough context to answer. Across thousands of parallel rollouts, each potentially making dozens of calls, this creates a highly bursty workload.

Neon CPU allocation and usage during a Castform training run

Neon's dynamic compute scaling absorbs these peaks without requiring Castform to provision for maximum capacity around the clock. Training runs get low-latency search when demand spikes, while compute scales down during idle periods.

This infrastructure becomes even more valuable as agents move beyond search and begin modifying data. Training stateful agents requires isolated environments that can be created and reset cheaply, preventing one rollout's actions from affecting another or touching production.

Neon branching can give each rollout an isolated database state, while time-travel queries make it possible to reconstruct and inspect the state an agent encountered. Combined with autoscaling and scale-to-zero, this creates a path toward training thousands of stateful agent rollouts without maintaining thousands of continuously running environments.

Castform makes it easy for any developer to post-train open-source models to be cheaper, faster, better than the frontier. Post-train your first model today at castform.com.

联系我们 contact @ memedata.com