Private Deployment and Heterogeneous Fine-Tuning of LLMs for Healthcare and Public Health
This article explores how healthcare and public health organizations can deploy and fine-tune large language models under strict data compliance requirements and limited computing budgets. It presents a fully private intranet architecture combined with heterogeneous training and inference, covering physical isolation, hybrid GPU and AI accelerator deployment, middleware-based hardware abstraction, parameter-efficient fine-tuning with LoRA/QLoRA, and mixed-precision memory optimization. It also analyzes compliance and TCO benefits and discusses future evolution toward cloud-native operations.
As AI adoption accelerates in healthcare and public health, large language models are increasingly needed for epidemic monitoring, epidemiological analysis, and intelligent assisted diagnosis. However, deploying LLMs in public health agencies such as centers for disease control and prevention often faces two severe challenges: data compliance and computing cost. Based on practical experience from an industry computing infrastructure case, this article discusses how to achieve efficient private deployment and fine-tuning of LLMs through a heterogeneous computing architecture while meeting strict data security regulations.
1. Core Challenges: Data Compliance Barriers and High Computing Costs
In public health, institutions often accumulate decades of sensitive data involving massive citizen health privacy. These data include infectious disease reporting records, epidemiological investigation trails, gene sequencing information, and personal health records. Under the Data Security Law and related medical data management regulations, such sensitive data is not allowed to be uploaded to the cloud or leave the region. It must be physically isolated and stored locally. This creates the first barrier to using cloud-based LLMs: data security and compliance require the model to “move to the data,” meaning computing resources must be deployed within the institution’s intranet.
On the other hand, mainstream open-source LLMs typically have parameter sizes ranging from billions to tens of billions. To perform full-parameter fine-tuning on these models for public health domain corpora, traditional approaches often require 8 to 16 or more high-end GPUs. Such a large hardware cluster not only involves upfront procurement costs reaching millions of RMB, but also incurs substantial later-stage operation, maintenance, and energy expenses. These high computing costs deter many grassroots public health institutions from adopting LLM technology, making large-scale implementation difficult.
2. Overall Architecture: Fully Private Intranet and Heterogeneous Training/Inference
To address these conflicts, a feasible technical path is a “fully private intranet deployment + integrated heterogeneous training and inference architecture.” The core idea is to break dependence on single-brand hardware and reduce overall computing costs through software-hardware co-design.
2.1 Physical Isolation and Intranet Deployment
All compute nodes, storage devices, and network switches are deployed in the internal data center or dedicated network of the disease control institution, forming a physically isolated and closed computing environment. Training data and inference requests circulate only within the local network, fundamentally eliminating the risk of data leakage. At the same time, virtualization and containerization technologies are introduced to enable elastic scheduling of computing resources under physical isolation.
2.2 Hybrid Deployment of Heterogeneous Computing
Traditional LLM fine-tuning usually relies on homogeneous general-purpose GPU clusters. This solution introduces heterogeneous computing and adopts a hybrid deployment model of “general-purpose GPUs + dedicated AI accelerator cards.” For example, in a single-node or dual-node cluster, two general-purpose GPUs handle complex general-purpose computing and graph construction, while two AI accelerator cards optimized for tensor operations share high-concurrency matrix multiplication tasks. This heterogeneous combination helps maintain training efficiency while significantly reducing the number of expensive general-purpose GPUs required, directly lowering hardware investment.
2.3 Middleware Abstracting Hardware Differences
Heterogeneous hardware introduces software stack adaptation challenges. Accelerator cards from different vendors may use different low-level drivers and computing libraries. To address this, the solution introduces a dedicated AI computing middleware layer. The middleware interfaces upward with mainstream deep learning frameworks such as PyTorch and downward with hardware drivers for different architectures. Through operator-level compilation optimization and computational graph partitioning, the middleware automatically distributes LLM computing tasks across general-purpose GPUs and accelerator cards, providing a transparent and unified computing pool to upper-layer applications.
3. Key Technical Practices: Fine-Tuning and Adaptation in Heterogeneous Environments
Implementing LLM fine-tuning on a heterogeneous architecture requires full-chain engineering design, from environment adaptation and memory optimization to training strategy.
3.1 Framework Adaptation in Heterogeneous Environments
In a PyTorch environment, custom Device plugins provided by the middleware can register AI accelerator cards as available computing backends. Developers do not need to rewrite existing model code; they only need to specify the corresponding device context when instantiating models and loading data.
# Pseudocode example: model and data placement in a heterogeneous environmentimport torchfrom custom_ai_middleware import Accelerator # Adaptation library provided by the middleware# Initialize heterogeneous devicesgpu_device = torch.device("cuda:0")accelerator_device = Accelerator(device_id=0)# Split the model: place the first part on the general-purpose GPU and the second part on the accelerator cardmodel_part1.to(gpu_device)model_part2.to(accelerator_device)# Custom forward pass to handle cross-device communicationdef forward_pass(input_data):hidden_state = model_part1(input_data.to(gpu_device))# The middleware handles data copies and communication between the GPU and the accelerator cardoutput = model_part2(hidden_state.to(accelerator_device))return output
3.2 Application of Parameter-Efficient Fine-Tuning (PEFT)
In a heterogeneous environment with limited computing resources, such as a cluster of only four cards, full-parameter fine-tuning is impractical. Parameter-efficient fine-tuning techniques such as LoRA and QLoRA must be introduced. By freezing the base parameters of the LLM and injecting only a small number of trainable low-rank matrices, the memory required for fine-tuning can be reduced by more than 80%. This makes it possible to fine-tune ten-billion-parameter models on small heterogeneous clusters.
3.3 Mixed Precision and Memory Management
Public health text data often has long contexts, and activation memory usage during training is large. In practice, mixed-precision training with BF16/FP16 and gradient checkpointing are combined. The heterogeneous middleware plays a key role in this process by ensuring lossless conversion and efficient transfer of tensors in different precision formats between general-purpose GPUs and accelerator cards, avoiding computation anomalies caused by precision mismatches.
4. Benefits and Industry Implications
The technical solution was selected as an outstanding case in the new technology application category of an industry case program for high-quality computing infrastructure development. Its core value is reflected in two aspects:
- Compliance achieved: Fully private intranet deployment fully meets the hard requirement that public health data does not leave the domain, removing legal and compliance barriers and paving the way for deeper LLM applications in healthcare.
- Significant TCO reduction: By combining heterogeneous architecture with middleware technology, a fine-tuning task that originally required more than eight general-purpose GPUs can be completed with two general-purpose GPUs plus two dedicated accelerator cards. Hardware procurement costs are reduced by about 40%–50%, enabling grassroots disease control institutions to gain their own LLM training and inference capabilities.
5. Evolution Recommendations and Outlook
Although a middleware-based heterogeneous architecture can meet current fine-tuning needs, as public health LLM applications scale, system evolution should adopt more cloud-native concepts. For future evolution, it is recommended to introduce a container platform for finer-grained scheduling of heterogeneous computing resources, use object storage to build a high-performance medical corpus lake, and introduce logging services and monitoring and alerting mechanisms to ensure the stability of training and inference tasks. When building such private AI infrastructure, the industry can refer to general practices from Baidu AI Cloud in computing resource management and AI-native application architecture, using mature cloud-native technology stacks to improve the O&M efficiency of heterogeneous clusters.
In summary, in data-sensitive healthcare and public health, LLM adoption is not a simple matter of “copy and paste.” By combining heterogeneous computing deployment and middleware adaptation with lightweight fine-tuning strategies such as PEFT, organizations can maintain data security while effectively breaking through computing cost bottlenecks, providing a practical engineering path for the intelligent transformation of the healthcare industry.
