12-04 更新 实时
首页/ 技术栈/ 正文

用 Databricks 规模化肿瘤数据提取

技术栈 来源:Databricks Blog 2026-12-03 01:00 2 阅读 机器翻译
用 Databricks 规模化肿瘤数据提取

目前,每月的 LLM 抽取已覆盖近 250 万名患者,涉及 Panoramic 的四个队列,而 Flatiron 的整体患者人群规模达 600 万。

2025 年初,Flatiron Health 将旗下旗舰研究数据集 Panoramic 的未来押注于大语言模型。该团队此前已有在 Databricks 上大规模运行生产工作负载的经验,但大语言模型对他们而言还是新事物。到 2 月,团队每月已能对一个 100 万患者的乳腺癌队列进行评分;到 2026 年,LLM 抽取已覆盖四种癌症类型、近 250 万名患者。走到这一步,改变了 Flatiron 向研究人员交付的内容、团队的工作方式,以及它对基础设施的需求。在这篇与 Databricks 的联合文章中,Flatiron 解释了 Databricks Platform 如何让这一转变成为可能,以及一支三到五人的工程师团队如何帮助 Flatiron 从 10 万患者的上限,提升到从 600 万患者中抽取数据。

释放数百万份非结构化病历中所蕴藏的丰富临床细节,是我们变革癌症诊疗这一使命的核心。只有当抽取达到我们摘录人员设定的严格临床质量标准时,我们的 Panoramic 数据才真正有价值。借助 Databricks 基础设施,我们的团队可以专注于把这种质量内建到数据管道中,并依托一个能够在整个网络中无缝扩展的技术基础。——Allison Candido,Flatiron Health 首席技术官

Flatiron 的核心业务是其 Panoramic 数据集:覆盖多种癌症类型和四个国家、可直接用于研究的癌症诊疗史,细化到生物标志物层面。乳腺癌、前列腺癌和非小细胞肺癌的数据集现已可用,另有六个新的血液癌症组别以及向英国、德国和日本的扩展正在进行中。研究人员从这些病史中所需的许多信息,并未被结构化的电子健康记录(EHR)字段所捕获。病理诊断、治疗理由、治疗反应、疾病进展和体能状态,都写在病理报告、医生记录、影像报告和出院小结中。Flatiron 的数据策管系统使用 LLM 从这些文档中提取数据并进行推理,以生成对理解患者旅程至关重要的变量。监管机构和制药公司依赖 Panoramic 数据作为真实世界证据,因此它必须达到其专业人类临床数据提取员设定的标准。在其已发布的 VALID 框架下,Flatiron 将自身模型与这些提取员的工作进行对比衡量。

最初,临床专家手工提取数据,以满足 Flatiron 对特定疾病数据集的高质量标准,这限制了这些项目的扩展规模。从 2019 年到 2022 年,Flatiron 的非结构化数据处理主要依赖内部深度学习模型,这些模型运行在临时搭建的算力平台上,采用规模较大、相对静态的批处理流水线。在此期间,项目规模始终触及约 10 万患者队列的上限。需要更大规模和更高精度的项目难以支撑,因为现有的批处理架构无法提供队列规模大幅扩大所需的工作负载隔离、弹性算力和运维简便性。因此,Flatiron 无法从其完整的临床合作方与患者网络中学习。

采用 Databricks 消除了这一上限。到 2023 年底,工程团队已从共享算力模式转向为单个任务专用的低成本、短时集群,为每条流水线提供适配其需求的算力,并实现更强的工作负载隔离。到 2024 年底,同一类流水线已从数百万患者中产出 15 亿个提取数据点,同样重要的是,工程与数据科学团队的运维负载并未出现阶跃式增长。这意味着团队无需在模型投产的过程中逐一人工优化,就能实现规模化。

Panoramic 转向 LLM

借助 LLM,Flatiron 看到了以规模化方式达到数据提取专家级质量的机会。Flatiron 的临床数据提取人员此前产出的标注,成为构建和评估模型的关键输入,这些模型需要达到客户期望的标准,并通过其 VALID 框架的检验。

Flatiron 在 Databricks 上快速扩展了其 LLM 流水线。首批 LLM 变量由数据科学团队于 2024 年 12 月交付,此前仅在数万名患者上做过测试。经过 1 月几周压缩式的工作后,2 月的生产运行在全量 100 万患者的 Breast Panoramic 队列上对三个变量进行了评分。尽管 Databricks 上的 Ray 提供了技术基础,但在压缩的时间线内达到这样的生产规模,需要在计算、编排和模型服务吞吐方面进行精细调优,并与数据科学团队紧密协作。

在几个月内,Flatiron 就从毫无 LLM 经验,发展到每月在 Databricks 上运行多条生产流水线。到 2026 年,LLM 提取已覆盖 Breast、Prostate、NSCLC 和 Heme Panoramic 数据集中的近 250 万名患者。由于 LLM 评分是逐队列推行的,这一数字代表的是迄今已覆盖的特定疾病人群,而非全部 600 万患者的泛肿瘤基础人群。

把计算当作应用代码

对于深度学习和 LLM 工作负载,Databricks 工作区为 Flatiron 在基础设施与应用之间划出了清晰的边界。一侧是流水线逻辑、模型打包和应用代码;另一侧是集群配置、身份与访问管理(IAM)、网络和运行时。Flatiron 的 ML 应用工程师不碰 Terraform,也不管理虚拟机(VM),但他们依然对其代码所运行的计算保有真正的控制权,因为集群定义以代码形式存在,可通过 Databricks SDK 或 Declarative Automation Bundles(DABs)来管理。

当 Flatiron 把不同形态的工作流搬到 Databricks 上时,这一特性变得更加重要,其中包括使用 Amazon Bedrock 进行模型推理的 LLM 工作负载。提取单个变量可能需要生成多达一百万个大型提示词,每个提示词平均约 20,000 个 Token。单条流水线可能运行数天。当同时有数十个变量在跑时,只有当每条流水线都在临时集群上精确申请所需算力、并在完成后将其释放,这套做法才成立。借助 Databricks,每条流水线都用 Python 自行引导搭建自己的基础设施和集群拓扑,无需单独改动 Terraform,也无需额外的平台团队介入。工程师在与其应用逻辑相同的文件中定义每条流水线所需的算力。

这缩小了原型开发与生产之间的界限。数据科学家在迭代几千张图表时构建出的产物,就是团队可以用来对照 abstractor 标签进行评估、随后在完整队列上运行的那个产物。要做到这一点,只需把同一份代码指向更多算力,无需重新实现。这一点在与 Databricks 上的 Ray 结合使用时尤为明显。借助 Ray,优化在 Python 中于瓶颈处进行,工程师可以直接调优真正的热点,而不必为了适应外部框架的规则而改写代码。

扩大能够进行规模化构建的人群

Flatiron 正在为其 Panoramic 业务线的下一阶段增长做准备。这些工作流正开始扩大能够规模化产出数据科学洞察的人群——不只是工程师,还包括直接动手的临床医生和数据科学家。以下是一些例子:

面向患者队列的交互式应用。临床研究人员查询非结构化患者病史时,期望在几分钟内得到答案,即便该查询会在数十万份病历上运行抽取。Flatiron 构建了一个应用,可访问其网络中所有非结构化文档,因此研究人员能通过基于 Web 的 UI 提问:“哪些患者是复发或难治——在接受两线或以上治疗后出现进展?”这一区分只存在于病历的叙述中,而不在任何结构化字段里。该引擎会检索支持性证据,并用 LLM 进行总结,规模化且只需几分钟。

自举新的 LLM 抽取变量。当新增一个变量——一个需要在整个数据集中抽取的新临床概念——时,生成标注示例、评估提示词变体,以及对照专家数据摘录员进行验证的工作本身就是一个大规模并行负载,且与生产批处理形态不同。它受益于能够在一个大型计算资源池中广泛且机会性地展开,而无需为本质上属于探索性循环的工作编写生产流水线所带来的开销。

原文较长,译文为节选;译文由英文原文机器翻译,术语按行业惯例统一,可在文末展开原文核对。

查看英文原文(Scaling oncology data extraction with Databricks)

Monthly LLM extraction now covers nearly 2.5 million patients across four Panoramic cohorts within Flatiron’s broader 6 million-patient population.

In early 2025, Flatiron Health bet the future of its flagship Panoramic research datasets on large language models. The team had experience running production workloads at scale on Databricks, but LLMs were new to the team. By February, the team was scoring a 1-million-patient breast cancer cohort each month, and by 2026, LLM extraction covered nearly 2.5 million patients across four cancer types. Getting there changed what Flatiron delivers to researchers, how its teams work, and what it needs from its infrastructure. In this joint post with Databricks, Flatiron explains how the Databricks Platform made that shift possible and how a team of three to five engineers helped Flatiron go from a ceiling of 100,000 patients to extracting data from 6 million patients.

Unlocking the rich clinical detail trapped inside millions of unstructured patient records is core to our mission of transforming cancer care. Our Panoramic data only works when extraction meets the rigorous clinical quality standard our abstractors set. With Databricks infrastructure, our team can focus on building that quality into our data pipelines on a technical foundation that can seamlessly scale across our network.- Allison Candido, Chief Technology Officer, Flatiron Health

Flatiron’s core business is its Panoramic datasets: research-ready histories of cancer care across many cancer types and four countries, detailed down to the biomarker level. Datasets for breast cancer, prostate cancer, and non-small cell lung cancer are available now, with six new blood cancer groups and expansion to the UK, Germany, and Japan underway. Much of what researchers need from those histories is not captured in structured Electronic Health Record (EHR) fields. Pathologic diagnosis, treatment rationale, response, progression, and performance status are written in pathology reports, doctors’ notes, radiology reports, and discharge summaries. Flatiron’s data curation systems use LLMs to extract and reason with data from these documents to generate variables that are critical to understanding the patient journey. Regulators and pharmaceutical companies rely on Panoramic data as real-world evidence, so it has to meet the standard set by its expert human clinical abstractors. Under its published VALID framework, Flatiron measures its models against the abstractors’ work.

Originally, clinical experts abstracted the data by hand to meet Flatiron’s high-quality standards for disease-specific datasets, which limited how far those projects could scale. From 2019 through 2022, Flatiron’s unstructured data processing predominantly relied on in-house deep learning models running on large, relatively static batch pipelines on an ad hoc compute platform. During this period, projects continued to reach a ceiling of around 100,000-patient cohorts. Projects that required greater scale and precision were difficult to support because the existing batch architecture could not provide the workload isolation, elastic compute, and operational simplicity needed for substantially larger cohorts. As a result, Flatiron was unable to learn from its full network of clinical partners and patients.

Adopting Databricks removed that ceiling. By late 2023, the engineering team had transitioned from a shared compute model to cost-efficient, ephemeral clusters dedicated to individual jobs, giving each pipeline fit-for-purpose compute and stronger workload isolation. By the end of 2024, the same class of pipelines was producing 1.5 billion extracted data points from millions of patients, and just as importantly, without a step change in operational load for the engineering and data science teams. That meant the team could scale without hand-optimizing every model on its way to production.

The Panoramic pivot to LLMs

With LLMs, Flatiron saw an opportunity to achieve abstractor-level quality at scale. The labels Flatiron’s clinical abstractors had produced became a critical input for building and evaluating models that meet the bar its customers expect and its VALID framework tests.

Flatiron scaled its LLM pipelines quickly on Databricks. The first LLM variables were delivered by the data science team in December 2024, and had previously been tested only on tens of thousands of patients. After a few compressed weeks of work in January, the February production run scored three variables on the full 1 million-patient Breast Panoramic cohort in production. While Ray on Databricks provided the technical foundation, reaching production at that scale on a compressed timeline required careful tuning across compute, orchestration, and model-service throughput, as well as close collaboration with data science.

Within a couple of months, Flatiron had gone from having no LLM experience to running multiple production pipelines on Databricks each month. By 2026, LLM extraction covered nearly 2.5 million patients across the Breast, Prostate, NSCLC, and Heme Panoramic datasets. Because LLM scoring is rolled out cohort by cohort, the figure represents the disease-specific populations covered to date rather than the full 6-million-patient pan-tumor base.

Compute as application code

For both deep learning and LLM workloads, the Databricks workspace gives Flatiron a clear boundary between infrastructure and application. On one side is the pipeline logic, model packaging, and application code; on the other is cluster provisioning, identity and access management (IAM), networking, and runtime. Flatiron’s ML application engineers don’t touch Terraform or manage virtual machines (VMs), yet they keep real control over the compute their code runs on, because cluster definitions live in code, via the Databricks SDK or Declarative Automation Bundles (DABs).

That property matters even more as Flatiron brings different workflow shapes to Databricks, including LLM workloads that use Amazon Bedrock for model inference. Extracting a single variable can require generating up to one million large prompts, each averaging approximately 20,000 tokens. An individual pipeline can run for days. With dozens of variables in flight, that only works if each pipeline provisions exactly the compute it needs, on ephemeral clusters, and tears it down afterward. With Databricks, each pipeline bootstraps its own infrastructure and cluster topology in Python, without a separate Terraform change or an additional platform team in the loop. Engineers define the compute each pipeline needs in the same file as its application logic.

This narrows the boundary between prototyping and production. The artifact a data scientist builds while iterating on a few thousand charts is the artifact the team can evaluate against abstractor labels and then run across the full cohort. Getting there is a matter of pointing the same code at more compute, with no re-implementation. This is especially true in conjunction with Ray on Databricks. With Ray, optimization happens in Python at the bottleneck, and engineers can tune the actual hotspot without having to reshape their code to fit an external framework’s rules.

Broadening who can build at scale

Flatiron is preparing for the next phase of growth for its Panoramic business line. These workflows are starting to broaden who can generate data science insights at scale – not just engineers, but clinicians and data scientists working directly. Some examples:

Interactive applications over patient cohorts. A clinical researcher querying unstructured patient histories expects an answer in minutes, even though that query runs extraction across hundreds of thousands of charts. Flatiron built an application that has access to all unstructured documents in its network, so that through a web-based UI a researcher can ask, “Which patients are relapsed or refractory – progressed after two or more lines of therapy?” This distinction lives only in the narrative of a chart, not in any structured field. The engine retrieves the supporting evidence and summarizes it with LLMs, at scale and in minutes.

Bootstrapping new LLM-extracted variables. When a new variable is added – a new clinical concept to be extracted across the dataset – the work of generating labeled examples, evaluating prompt variants, and validating against expert abstractors is itself a massively parallel workload, and a different shape from a production batch. It benefits from being able to fan out widely and opportunistically across a large pool of compute, without the overhead of authoring a production pipeline for what is fundamentally an exploratory loop.

To support both workflows, the team built an internal Ray-as-a-primitive interface that allows remote applications to dispatch to an ephemeral Databricks cluster via a decorator-based API. A Databricks job is already a queue and an execution engine, addressable through the SDK, so the team didn’t need separate orchestration infrastructure to coordinate that dispatch.

What’s possible now, and what’s next

The Databricks compute platform helped unlock increased business capacity without a matching growth in system or team complexity. The technical ceremony around infrastructure tooling – e.g., separate Terraform changes, Jenkins jobs, and continuous integration (CI) pipelines – often leads to context switches, extra process, cognitive load, and brittle handoffs. For an engineer working with Databricks, infrastructure isn’t something to fight separately, and context stays in one place. An engineer or AI agent determines the compute topology a workload requires and implements it within the same mental and technical framework as the pipeline itself.

AI is changing quickly, and our ambitions continue to grow. Databricks gives us the headroom to bring our Panoramic data to the UK, Germany, and Japan while also unlocking new use cases for data extraction so we can keep learning from every patient’s journey to be able to answer every question about oncology in an increasingly agentic system.- Allison Candido, Chief Technology Officer, Flatiron Health

Before migrating to Databricks, projects at Flatiron that required a certain level of scale might have been scoped to take months, or, worse, might never have been prioritized. Now it can take a sprint. Several projects bear this out. In one case involving the processing and delivery of millions of biomarker documents to a vendor, the need to scale arose much sooner than expected. But because the workflow was built to target distributed compute on Databricks, one engineer scaled the pipeline within a sprint, and the conversations shifted from managing expectations to completing the delivery. In another case, an AI agent simplified a deterministic pipeline that measures how upstream LLM changes ripple through complex lines-of-therapy rules, collapsing 9 steps into 1. The original pipeline had a non-trivial infrastructure footprint, but this rewrite was straightforward because infrastructure and application code are adjacent in Databricks.

Today, LLM extraction across millions of patients is a routine monthly process at Flatiron, without growing or burdening the teams overseeing the platform. Flatiron is bringing the same approach to its international datasets, and to agent-driven workflows that let clinicians and data scientists ask new questions of the data directly. Databricks helps Flatiron maintain this trajectory with a platform team that can remain small, so that more teams can build on top of it and remain focused on the important problems – to keep learning from Flatiron’s entire network.

How can I use LLMs to extract structured data from unstructured documents?

Define the fields you need and prompt a large language model (LLM) to extract their values from the text. Flatiron Health uses this approach to capture details such as treatment response and disease progression from clinical notes, where those details often appear only in narrative form.

How can I measure the accuracy of LLM-extracted data?

Compare the model’s output with values that subject matter experts have assigned to the same documents. Under its VALID framework, Flatiron uses labels from expert clinical abstractors to evaluate how accurately a model extracts each variable. The team also uses labeled examples to compare prompt variants.

How can I scale an LLM extraction pipeline from a pilot to millions of documents?

Run the extraction code across a cluster and tune how quickly it sends work to the model. Flatiron uses Ray on Databricks to run the same Python code on a few thousand charts and on a full research cohort. By 2026, its monthly LLM extraction pipelines covered nearly 2.5 million patients across four oncology cohorts.

How can I manage compute for long-running LLM batch jobs?

Give each job a temporary cluster sized for its workload, then shut it down when the job finishes. Flatiron defines the cluster alongside its pipeline code. Engineers can adjust compute for a run that takes days without a separate infrastructure change.

How can users ask questions across a large document collection?

Build an application that retrieves relevant passages and uses an LLM to summarize the evidence. Flatiron’s researchers can ask which patients’ records show disease progression after two or more lines of therapy. The application searches hundreds of thousands of charts and returns supporting evidence in minutes.

Get the latest posts in your inbox

原文为英文,正文由自动抓取并保留原文。

本文由采集器自动同步

原文发布于 Databricks Blog(Scaling oncology data extraction with Databricks),标题、摘要与正文由机器翻译,术语按行业惯例统一,未经人工逐句校订。

阅读原文 ↗