Engineering Large Language Models Under Compute Constraints: A Medical Vertical Perspective

    The transition of large language models from experimental demonstrations to continuous engineering operations introduces complex challenges across capital investment, compute supply, service stability, and compliance. In highly regulated sectors like healthcare, additional requirements for model families, auditability, and human-in-the-loop collaboration emerge. This article explores how to maintain stable large model services under resource constraints and examines the engineering implementation of a medical vertical model family, covering architecture design, data governance, evaluation, compliance, and cost optimization.

    Large-scale models are evolving from single-point capability showcases to continuous engineering operations. As model parameter sizes, user request volumes, and vertical scenario complexities increase simultaneously, systems face challenges that extend beyond training. These encompass capital investment, compute supply, service stability, data governance, and compliance evaluation. Furthermore, highly regulated domains like healthcare demand model family architectures, auditability, and human-machine collaboration. This article discusses how to maintain stable large model services under resource constraints and how to engineer the deployment of medical vertical model families.

    I. Engineering Constraints Behind Capital-Intensive Investments

    Large model infrastructure exhibits distinct capital-intensive characteristics. Training clusters, inference clusters, high-speed networks, storage systems, and energy and O&M systems all require continuous investment. The industry’s discussion of massive funding and high valuations essentially reflects the shift in model R&D from algorithmic experimentation to asset-heavy engineering. However, capital does not directly equate to available compute. Capital investment must undergo procurement, deployment, network interconnection, scheduling optimization, and capacity operations to transform into stable model service capabilities.

    From an engineering perspective, training and inference exhibit different resource curves. The training phase pursues peak compute and long-term stable operation, while the inference phase faces traffic characteristics with pronounced peaks and valleys, long-tail requests, and high latency sensitivity. Relying solely on scaling up can easily lead to resource idling and cost overrun; over-compressing capacity, on the other hand, results in queuing, timeouts, and service degradation during peak periods. Therefore, a reasonable approach is to establish a capacity baseline: define service tiers based on model type, request length, concurrency, and latency targets; formulate elastic scaling strategies combined with historical traffic and growth forecasts; and validate system behavior under high watermarks through stress testing.

    Capital investment also brings governance requirements. The more expensive the resource, the more refined the metering needed: track invocation volumes and resource consumption by tenant, business line, and model version, and set budget thresholds and quotas to prevent low-priority tasks from crowding out critical services. For general cloud platforms, resource pooling and observability systems can be assembled using generic categories like container platforms, object storage, message queues, logging services, and monitoring alarms. However, the core remains the capacity model and scheduling strategy, rather than a single product capability.

    II. Service Stability and Usage Governance

    In large-scale model services, stability issues are rarely single-point failures; they are typically the cumulative result of resource contention, hot models, long-tail requests, cache invalidation, and release changes. Phenomena such as tightening usage for free tiers during demand peaks and occasional service fluctuations indicate that service providers must establish clear governance boundaries between user experience and system security.

    First, a tiered service strategy should be established. Free tiers, trial tiers, paid tiers, and critical business tiers should have different concurrency limits, token quotas, queuing priorities, and degradation strategies. Rate limiting can employ token bucket or leaky bucket models, controlling combinations by user, tenant, model, and API dimensions. Second, degradation links should be designed: when system load exceeds the high watermark, priority is given to short requests and high-priority businesses; for low-priority requests, return queuing prompts, cached results, or route to smaller models; for timeout requests, execute circuit breaking to prevent retry storms from amplifying failures.

    Observability is the foundation of stability governance. It is necessary to collect metrics such as request volume, concurrency, queuing duration, first-token latency, end-to-end latency, error rate, degradation rate, cache hit rate, and resource utilization, and to establish alert thresholds and post-mortem mechanisms. The release process should adopt gray releases, shadow traffic, and quick rollbacks to prevent model version or configuration changes from causing full-scale failures.

    The illustrative pseudocode is as follows:

    1. function admit(request):
    2. if request.userTier == "free":
    3. if not tokenBucket.allow(request.userId, freeQuota(request.model)):
    4. return fallback("quota_or_busy")
    5. if system.load > highWatermark:
    6. if request.priority < criticalThreshold:
    7. return fallback("cache_or_small_model")
    8. if request.estimatedTokens > longRequestLimit:
    9. enqueueWithLowerPriority(request)
    10. return routeToHealthyModel(request)

    The core expressed by this pseudocode is the combination of “admission control—priority—degradation—routing,” rather than relying on single-point scaling. In actual implementation, thresholds must be set based on business semantics and validated through stress testing and gray releases.

    III. Technical Architecture of the Medical Health Model Family

    Medical health scenarios are not suited for a one-size-fits-all general model. A more reasonable approach is to build a model family: use a general base model to provide language understanding and generation capabilities; inject professional corpus through continued pre-training in the medical domain; use task-adapted models to cover scenarios such as electronic medical record generation, medical knowledge QA, follow-up summaries, imaging report assistance, and risk alerts; and route, manage versions, and control permissions through a unified model gateway.

    Architecturally, a layered design of “Base Model Layer—Domain Model Layer—Task Model Layer—Application Orchestration Layer” can be adopted. The application orchestration layer combines Retrieval-Augmented Generation (RAG), knowledge bases, knowledge graphs, and tool calls to constrain model outputs within a traceable evidence scope. For medical QA and report assistance, the system should return citation sources, confidence prompts, and refusal boundaries, while retaining a doctor review step to prevent the model from directly replacing clinical decision-making.

    Data governance is critical for the medical model family. Training and evaluation data require desensitization, classification and grading, permission isolation, and audit trails; annotation guidelines should clarify terminology, entities, relationships, and expressions of uncertainty; data versions and model versions must be traceable. For multimodal data, alignment issues between text, imaging, and laboratory indicators must be addressed, and a data quality inspection process established.

    IV. Evaluation, Compliance, and Continuous Operations

    The evaluation of medical vertical models cannot rely solely on general benchmarks; it must cover real business scenarios: accuracy, recall, hallucination rate, rejection rate, citation consistency, latency, explainability, and safety. Beyond offline evaluation, small-traffic A/B testing, doctor sampling inspections, and red team testing are required. For high-risk outputs, mechanisms such as rule validation, sensitive word and risk entity interception, and secondary model review should be implemented.

    In terms of compliance, principles of minimal necessity, purpose limitation, authorized access, and auditability should be followed. Model services need to record inputs and outputs, callers, model versions, retrieved evidence, and manual review results to form a traceable link. During operations, model cards and data cards should be established to regularly assess drift, bias, and failure cases, and to route online issues back to the evaluation set and training data governance process.

    V. Cost Optimization and Landing Checklist

    Under resource-constrained conditions, cost optimization should take precedence over blind scaling. Common methods include request batching, result caching, model routing, quantization and distillation, cold/hot data tiering, elastic scaling, and low-priority queues. For long-text requests, chunked summarization and RAG can be employed; for high-frequency questions, cache or knowledge base hits can be prioritized; for non-critical scenarios, routing to smaller models is an option.

    The landing checklist recommendations include:

    1. Whether tiered service levels and quota strategies are defined;
    2. Whether capacity baselines, stress testing, and high-watermark contingency plans are completed;
    3. Whether rate limiting, queuing, circuit breaking, degradation, and gray release capabilities are in place;
    4. Whether request-level, model-level, and tenant-level observability metrics are established;
    5. Whether medical data has undergone desensitization, permission isolation, and auditing;
    6. Whether scenario-based evaluation sets, red team testing, and manual review processes are established;
    7. Whether model versions, data versions, and evidence chain traceability are available;
    8. Whether cost, latency, hallucination rate, and degradation rate are continuously tracked.

    Overall, the competitiveness of large-scale model services depends not only on parameter size but also on engineering governance capabilities under compute constraints. The value of the medical health model family lies not just in the model itself, but in the complete system comprising data governance, evaluation compliance, and human-machine collaboration. Only by balancing capacity, stability, cost, and compliance can vertical model applications transition from demonstrations to sustainable operations.