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 實踐】用 100 倍便宜的開源模型,在檢索任務上擊敗 GPT-5.6 Sol
TL;DR:透過 RL 後訓練技術,讓小規模開源模型在代理式檢索(Agentic Retrieval)上達到媲美頂尖模型的效果,且成本大幅降低。
🎣 從單次檢索到代理式檢索的演進
在 2022 年左右,業界趨向於使用 Embedding 進行向量檢索,工程師手動建構 RAG(檢索增強生成)流程。然而到了 2025 年,開發者開始開發「代理式檢索」(Agentic Retrieval)工作流,將大問題分解為小問題,並透過模型在迴圈中進行多次規劃與搜尋。
這種模式雖然強大,但也帶來了沈重的負擔:每一次迴圈迭代都需要呼叫一次頂尖模型(Frontier Model),這使得典型的多輪搜尋請求不僅耗時(例如使用 gpt-5.6-sol 可能超過 10 秒),且成本昂貴(單次請求約 0.03 美元)。
🧩 Castform 的解決方案:讓後訓練變得像 Prompt Engineering 一樣簡單
雖然開源模型(Open-weights models)的成本比頂尖模型便宜 100 倍,但其原生能力通常較弱。Castform 的核心理念是透過 RL(強化學習)後訓練(Post-training)來彌補這一差距。
Castform 解決了企業在進行後訓練時遇到的兩大痛點:
- 缺乏訓練數據:將企業內部的專有文件(如產品記錄、維基百科、客戶互動紀錄)轉化為有效的訓練任務。
- 基礎設施門檻高:開發者不需要處理複雜的機器學習與 GPU 內部細節。
📊 如何利用現有的數據庫進行強化學習
有效的 RL 後訓練需要三個要素:任務(Task)、環境(Environment)與獎勵函數(Reward Function)。Castform 結合 Neon 的 Lakebase Search 來實現這一流程:
- 資料轉換:將原始文件存放在 Neon 的 Postgres 中,利用 Castform 自動生成合成數據(Synthetic Data),將文件轉化為「問題—答案」對。
- 環境互動:在訓練過程中,代理模型會不斷呼叫搜尋工具(如 Lakebase 的混合搜尋)來獲取正確的上下文。
- 獎勵機制:開發者可以定義獎勵函數(例如:檢索到的來源是否正確、引用是否精準、最終答案是否正確),引導模型透過試錯(Trial and Error)來優化效能。
💡 利用 Neon 解決突發性的計算負載
在進行 RL 訓練時,代理模型會在成千上萬個並行 Rollouts(試算)中重複呼叫搜尋工具,這會產生極高且不穩定的計算負載。
Neon 的 Lakebase 提供動態計算縮放(Dynamic Compute Scaling),能夠吸收這些突發需求,而不必為了訓練期間的峰值而長期維持高昂的容量配置。此外,Neon 的分支(Branching)與時空旅行查詢(Time-travel queries)功能,讓每個 Rollout 都能在隔離且可重建的資料庫狀態中運行,避免代理行為對生產環境或其他訓練任務造成影響。
🎯 實務啟示
對於追求成本效益的工程團隊來說,不需要盲目追求最昂貴的 API。透過將現有的企業知識庫與 Castform 的後訓練流程結合,開發者可以用極低的成本,訓練出專屬於自家業務領域、且在檢索能力上能與頂尖模型抗衡的專用模型。
🔗 來源
- 標題: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
#AI #MachineLearning #LLM #ReinforcementLearning #RAG #AgenticSearch #OpenSourceAI #Neon #Castform #PostTraining
原始資料 Hacker News · 收集於 2026-08-06
摘要原文
“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. Evolution of agentic search 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. 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. How does Castform use Neon? Castform's pipeline runs against Neon via Lakebase Search: Stage Neon + Lakebase Search Corpus storage Raw documents live in Postgres on Neon Synthetic data generation Castform training pipeline uses lakebase_text and lakebase_vector to write training tasks RL Training Every rollout's search tool call uses Lakebase Search on Neon Production Inference The final model uses the same search tool call during inference Your best training data already exists 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. Using Castform 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 . Observability: Watch the model learn 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 Why Neon 'just works' 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'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 . (298 points, 76 comments on Hacker News)
由 tencent/hy3:free 自動生成