Private Deployment and Fine-Tuning of LLMs for Public Health: Heterogeneous Compute and PEFT

    This article examines how a public health agency can privately deploy and fine-tune an open-source large language model on an isolated intranet while addressing data compliance and GPU cost constraints. It describes a heterogeneous hybrid compute architecture using two general-purpose GPUs and two dedicated accelerators, an AI middleware layer for scheduling and operator adaptation, and a LoRA-based parameter-efficient fine-tuning workflow. It also covers public health dataset construction and the cost, compliance, and performance outcomes of the approach.

    As AI adoption expands in healthcare and public health, there is growing demand to use large language models (LLMs) to improve disease surveillance, early warning, and decision support. However, when public health institutions such as centers for disease control and prevention deploy LLMs, they often face two barriers: data security compliance and high compute costs. This article uses a project at a CDC that locally privatized and fine-tuned an advanced open-source LLM as an example to analyze how to reduce costs and improve efficiency through a heterogeneous hybrid compute architecture while maintaining strict data security.

    Industry Pain Points: Data Security Versus Compute Cost

    CDCs have accumulated decades of highly sensitive privacy data related to citizen health and epidemiological investigations. Under applicable data security laws and related sector regulations, such data is strictly prohibited from being uploaded to the cloud or transferred abroad and must be processed in a locally physically isolated environment. This requirement directly rules out the traditional path of relying on public cloud compute for LLM training and inference, creating the first data security barrier.

    On the other hand, advanced open-source LLMs, such as models ranging from ten billion to several tens of billions of parameters, are highly complex. Traditional full-parameter fine-tuning typically requires 8 to 16 high-end general-purpose GPUs, which are common compute accelerator cards in the industry, and hardware procurement costs can reach millions of RMB. For local CDC agencies or nonprofit public health organizations, such a large initial compute investment is often difficult to bear, creating the compute cost barrier for LLM adoption.

    Architecture: Intranet Deployment and Heterogeneous Hybrid Compute

    To resolve these conflicts, the project designed a private deployment architecture based on a local intranet. Its core principles are physical isolation and heterogeneous compute collaboration.

    Full-Stack Physically Isolated Intranet

    All compute nodes, storage devices, and network devices are deployed in an independent intranet data center at the CDC and are physically isolated from the external internet. The entire lifecycle of model training, fine-tuning, and inference is completed within the intranet closed loop, eliminating the risk of data leakage at the physical level and fully meeting compliance requirements for healthcare data. In this process, a local general-purpose object storage service can be used to manage massive training datasets and model weight files, ensuring efficient and secure data flow.

    Heterogeneous Hybrid Compute Architecture

    To reduce dependence on high-end general-purpose GPUs, the project introduced a heterogeneous hybrid compute solution. The overall compute cluster no longer relies solely on high-end GPUs but is configured with two general-purpose GPUs and two dedicated heterogeneous accelerators.

    The general-purpose GPUs handle high-concurrency model inference and part of the core tensor computation. The heterogeneous accelerators optimize specific operators through customized instruction sets and share part of the parallel computing tasks during fine-tuning. This 1:1 mixed configuration effectively reduces the number of high-end GPUs purchased and significantly compresses the hardware procurement budget while maintaining overall throughput.

    Key Technology: Compute Scheduling and Adaptation at the Middleware Layer

    Direct use of heterogeneous hardware usually faces issues such as incompatible development frameworks and difficult operator adaptation. To shield underlying hardware differences, the project introduced specialized AI middleware.

    Hardware Abstraction and Operator Conversion

    The middleware layer connects upward to mainstream deep learning frameworks such as PyTorch and schedules heterogeneous accelerators downward. It can automatically convert standard computation graphs into instruction streams executable by heterogeneous hardware. For example, during fine-tuning, for self-attention computation in the Transformer architecture, the middleware can intelligently identify it and route it to the heterogeneous accelerator with the highest computational efficiency.

    Unified Memory and VRAM Management

    LLM fine-tuning often faces insufficient VRAM. The middleware provides a unified memory management mechanism that allows efficient VRAM sharing and data copy optimization between heterogeneous accelerators and general-purpose GPUs. This avoids compute idle time caused by underlying communication bandwidth bottlenecks, improves the collaboration efficiency of the two GPUs and two accelerators, and makes fine-tuning of models with tens of billions of parameters possible on limited hardware.

    LLM Fine-Tuning Strategy: Parameter-Efficient Fine-Tuning (PEFT)

    Under a compute-constrained hybrid architecture, traditional full-parameter fine-tuning is neither economical nor practical. The project adopted parameter-efficient fine-tuning technology to minimize compute resource consumption.

    LoRA-Based Fine-Tuning

    The project uses the low-rank adaptation method. While freezing the pretrained weights of the LLM, it injects trainable low-rank matrices only into bypass paths beside the original model. This reduces the number of parameters that need to be updated to 1% of the total or even lower. By combining mixed-precision training and gradient accumulation, the peak VRAM requirement during fine-tuning is greatly reduced.

    Example code snippet (general PEFT logic):

    1. # Import a general parameter-efficient fine-tuning library
    2. from peft import LoraConfig, get_peft_model
    3. # Configure LoRA parameters
    4. lora_config = LoraConfig(
    5. r=8,
    6. lora_alpha=16,
    7. target_modules=["q_proj", "v_proj"], # Fine-tune specific Transformer layers
    8. lora_dropout=0.1,
    9. task_type="CAUSAL_LM"
    10. )
    11. # Convert the base model into a PEFT model
    12. model = get_peft_model(base_model, lora_config)
    13. model.print_trainable_parameters()

    Public Health Dataset Construction

    The project combines the CDC’s historical epidemiological data, vaccination records, and health education texts to build a high-quality instruction fine-tuning dataset. Before data is fed into the model, it must undergo strict de-identification and format standardization within the intranet environment, ensuring that the knowledge learned by the model is both professional and compliant. Various metrics during model training can be tracked in real time through general logging services and monitoring and alerting systems, ensuring the stability of the fine-tuning process.

    Benefits and Industry Implications

    By combining a heterogeneous hybrid compute architecture with middleware technology, the CDC’s LLM fine-tuning project achieved significant results:

    • Cost reduction: Compared with traditional setups using more than eight high-end GPUs, hardware investment was greatly reduced, giving local public health institutions the infrastructure conditions for LLM applications.
    • Security and compliance: Full intranet deployment combined with PEFT fine-tuning achieved deep alignment between the LLM and public health expertise without crossing the red line of transmitting sensitive data over external networks.
    • Performance assurance: Under middleware scheduling, heterogeneous compute collaboration did not cause severe performance loss, and inference and fine-tuning efficiency can meet the needs of daily public health operations.

    Conclusion

    In data-sensitive industries, LLM adoption should not blindly pursue compute stacking. Instead, it should focus on architectural innovation and algorithm optimization. Through the combined application of heterogeneous compute, middleware adaptation, and efficient fine-tuning technology, it is possible to build a secure and efficient private LLM foundation within a limited budget. This practice is not only applicable to public health but also offers important reference value for government, financial services, and other industries that face the dual pressure of data security and cost.