How Flo Health built safer, more useful open models with Databricks AI Runtime
https://www.databricks.com/blog/how-flo-health-built-safer-more-useful-open-models-databricks-ai-runtime📌 Flo Health 如何用 AI 評審把醫學安全訓練進模型權重
TL;DR:女性健康 App Flo 用 AI 評審取代人工標註,微調後綜合達標率從 16% 升到 47%。
當一款月活躍用戶達 8,100 萬的健康 App 決定導入生成式 AI,容錯空間幾乎是零,回答既要醫學上安全,又不能只會說「請去看醫生」這種安全但沒用的廢話。Flo Health 選擇的解法,是自己動手把「什麼叫做好答案」變成可訓練的訊號。
🤔 問題:安全與有用,常常互相拖累 Flo 從傳統 ML 走向生成式 AI 驅動的個人化洞察時,發現單靠通用大模型 API 會帶來成本、供應商生命週期依賴,以及難以把 Flo 自身領域知識編碼進模型等限制。團隊設定了兩個目標:醫學安全是基礎,有用性是目標。以「我的月經為什麼遲來?」這個問題為例,只回「請洽詢醫療專業人員」算安全但不太有用;只列出常見生活作息原因則比較有幫助,但從醫學安全角度來看並不完整。Flo 想要的答案,要同時兼顧實用資訊、適當情境與對的安全網。
🧩 方法:用 AI 評審把醫學風險拆成可測試的規則 Flo 的醫療、產品與工程團隊把醫學風險拆解成具體、可一致測試的規則(rubric)。舉例來說,團隊發現針對症狀類問題的回答容易「過度安心」,於是訂出「balanced causes」規則,要求回答在相關情況下必須同時涵蓋良性與可能嚴重的病因。這些規則接著被轉成一個個 AI judge,每個 judge 都有明確定義、評分指引與訓練案例,並用合成案例與匿名化的真實用戶實驗案例進行驗證;當 AI judge 的判斷與人工初評不一致時,由盲測的臨床審查員仲裁,建立 ground truth。最終框架包含 26 個 judge,分成三大類別。
有了這套評估系統,Flo 接著把同一批 judge 當作訓練時的 reward 訊號,採用 Reinforcement Fine-Tuning 做法:訓練過程中產生多個候選回答,用評估系統挑出最強的,再微調模型,把品質直接編碼進權重,而不是每次推論都靠昂貴的 best-of-N 搜尋。整個流程產生了超過 15,000 題合成問題,並以隱私優先的原則建構訓練配對:輸入來自模型生成或匿名彙總的訊號,而非用戶自己寫的自由文字或可識別資訊,因此臨床專家只需要負責定義與驗證「安全」的標準,不必逐筆人工標註訓練資料。
💡 踩過的坑:安全分數一度卡住不動 第一版做法暴露了一個問題:有用性有進步,但醫學安全幾乎沒動,原因是偏好配對(preference pair)沒有充分區分出醫學品質的程度差異。Flo 的解法是加入分級的安全分數:先通過二元安全門檻的回答,再依符合醫學準則的完整程度重新排序,讓偏好配對呈現更清楚的醫學安全對比。
整個 generate-score-select-train 迴圈相當吃運算資源。Flo 的訓練堆疊結合了 Databricks AI Runtime、LLM Foundry 與 Compose-RL,並用 MLflow 做追蹤與 checkpoint 管理:AI Runtime 提供 serverless GPU 環境,LLM Foundry 負責分散式訓練,Compose-RL 提供偏好最佳化層。實際微調時用了 32 張 NVIDIA H100 GPU,搭配 PyTorch 與 Fully Sharded Data Parallel(FSDP),先跑 SFT 再接 DPO。
📊 數據:綜合達標率三倍成長
| 指標 | 微調前 | 微調後 |
|---|---|---|
| 醫學安全 | 34% | 約 61% |
| 有用性 | 42% | 76% |
| 兩者同時達標 | 16% | 47% |
⚠️ 限制與留意的前提 文中提到「用微調模型取代前沿模型 API 可將推論成本降低一個數量級」是 Flo 團隊自己的估計,並非獨立驗證數據。第一版方法在安全與有用性之間失衡的經驗也說明:單純堆資料量不保證兩個目標同步進步,評估框架的設計(例如分級安全分數)往往才是關鍵。
🎯 實務啟示 Flo 最終留下來的資產,與其說是那個 47% 的分數,更是一套可重複使用的評估與訓練系統——團隊已計畫把同一套醫學安全與有用性準則,套用到 Gemma、Qwen、Kimi 等更新的開放權重模型上。對於同樣需要把「領域專家標準」轉成訓練訊號的團隊,Flo 的路徑(rubric → AI judge → 合成資料 → RFT/DPO)是個值得參考的樣板。
🔗 來源
- 標題:How Flo Health built safer, more useful open models with Databricks AI Runtime
- 作者/機構:Databricks
- 連結:https://www.databricks.com/blog/how-flo-health-built-safer-more-useful-open-models-databricks-ai-runtime
#FloHealth #Databricks #FineTuning #AIAlignment #HealthTech #ReinforcementLearning #DPO #OpenModels #ResponsibleAI #MachineLearning
原始資料 Databricks · 收集於 2026-10-12
摘要原文
For Flo Health, the bar for generative AI is unusually high. With 81 million monthly active users, the women’s health app operates at a scale where even small weaknesses in an AI system matter. Because Flo’s products deal with health and well-being, responses need to be medically safe and genuinely useful. As Flo moved from using only traditional ML towards personalized insights powered by generative AI, the team saw the potential for a more flexible, personalized product. But relying on a single general-purpose model introduced other constraints: cost at scale, dependence on a model provider’s lifecycle, and limited ability to encode Flo’s own domain expertise. Flo’s longer-term vision was a compound AI system that could use the right model for each task while maintaining a consistent safety standard across them. That led Flo toward fine-tuned open models and a new post-training pipeline built with Databricks. The team used AI judges and privacy-first synthetic data to turn Flo’s standards for medical safety and usefulness into a training signal, then used Databricks AI Runtime to run distributed fine-tuning on serverless NVIDIA H100 GPUs. That approach also made sense economically at Flo’s scale. The team estimates that using tailored, fine-tuned models can reduce inference costs by an order of magnitude compared with relying on frontier model APIs, while giving Flo greater control over model behavior and lifecycle. But before Flo could train models against its own standards, it needed a reliable way to define and measure what “good” looked like. Flo defined two goals for its AI systems: medical safety as the foundation and usefulness as the goal. A model can avoid unsafe statements and still provide little value, or give a detailed, personalized answer while missing an important medical safeguard. Consider a question such as, “Why is my period late?” An answer that simply tells the user to see a medical professional may be safe but not particularly useful. An answer that lists only common lifestyle causes may be more helpful, but incomplete from a medical-safety perspective. Flo wanted responses that could balance both: useful information, appropriate context, and the right safety netting. To make that balance measurable, Flo’s medical, product, and engineering teams built an evaluation framework that decomposed medical risk into specific rubrics that could be tested consistently. For example, after identifying that responses to symptom questions could be overly reassuring, Flo created a “balanced causes” rule requiring appropriate coverage of both benign and potentially serious causes when relevant. Those rubrics were then turned into AI judges, each with a definition, grading instructions, and training cases. Flo validated the judges against synthetic cases and anonymized cases from real-user experiments. When an AI judge disagreed with an initial human assessment, blinded clinical reviewers adjudicated the disagreement to establish ground truth. Flo then used part of those cases to refine the judges and reserved the rest to measure performance. With the evaluation system in place, Flo could use those same judges as the reward signal for training. The final framework included 26 judges across three categories: Building a conventional human-labeled fine-tuning dataset would have required significant clinical expertise for every example. Flo concentrated its medical experts’ time on designing and calibrating the evaluation system, which could then score training candidates at scale. The resulting pipeline generated more than 15,000 synthetic questions using privacy-first principles and created training pairs without human-annotated responses. Flo derived the inputs from model-generated or anonymously aggregated signals rather than user-written free text or identifiable information. Clinicians remained essential to defining and validating what “safe” meant, but they no longer needed to manually label every individual training pair. With calibrated judges and synthetic training data in place, Flo adopted a Reinforcement Fine-Tuning (RTF) approach that generates multiple candidate responses during training, uses the evaluation system to identify the strongest ones, and fine-tunes the model so that quality is encoded in its weights rather than relying on expensive best-of-N search on every production request. Flo’s workflow followed five stages: The first version of this approach exposed an important limitation: usefulness improved while medical safety remained relatively flat because the preference pairs did not distinguish sufficiently between degrees of medical quality. Flo addressed that by adding a graded safety score. Responses that passed the binary safety gate were re-ranked according to how thoroughly they met the applicable medical criteria, creating preference pairs with a clearer medical-safety contrast. Running this generate-score-select-train loop at scale is compute-intensive. Flo’s training stack combined Databricks AI Runtime, LLM Foundry, and Compose-RL, with MLflow used for tracking and checkpoints. AI Runtime provided the serverless GPU environment, LLM Foundry handled distributed training, and Compose-RL provided the preference-optimization layer. For its fine-tuning run, Flo used 32 NVIDIA H100 GPUs with PyTorch and Fully Sharded Data Parallel (FSDP), and ran SFT followed by DPO via LLM Foundry and Compose-RL. That setup gave engineers on-demand GPU compute for distributed deep learning training, allowing them to move from synthetic data generation to evaluation to fine-tuning without manually standing up and configuring GPU clusters for each experiment. Keeping the surrounding data, experimentation, and ML tooling in the same environment made it easier to iterate across the full post-training workflow. That workflow produced measurable gains across both dimensions Flo cared about. The first model Flo evaluated scored 34% on its medical-safety benchmark and 42% on usefulness, while only 16% of responses met both criteria simultaneously. After fine-tuning, medical safety increased to approximately 61%, usefulness reached 76%, and the combined score climbed from 16% to 47% — nearly three times the starting point. The 47% combined score was an important milestone, but the more durable outcome was the reusable evaluation and training system Flo had built around it. Flo can carry that system forward as the underlying models evolve. The team plans to apply it to newer open-weight models, including Gemma, Qwen, and Kimi, while preserving the medical safety and usefulness criteria it has already developed and validated. With Databricks AI Runtime underpinning that loop, Flo can iterate on new models without rebuilding the training environment, keeping its engineers focused on medical expertise, model quality, and the user experience. Subscribe to our blog and get the latest posts delivered to your inbox.
由 claude-code/sonnet 自動生成