Adapting Open-Source LLMs: Technical Workflow and Compliance Disclosure

    This article explains why adapting open-source base models has become a common development path, outlines the main technical stages from base model selection to evaluation and artifact management, and summarizes license and compliance considerations. It also covers model provenance verification, model card templates, principles for external disclosure, and a practical checklist for project teams.

    1. Why Secondary Development Has Become Mainstream

    Open-source base models expose their weights and network architecture, allowing teams to perform domain adaptation on an already validated foundation without training from scratch. Pretraining from scratch requires large-scale compute, massive cleaned datasets, and long engineering cycles, which most organizations cannot sustain. Secondary development instead concentrates resources on three areas: the quality of domain data, how tasks are defined, and how rigorous the evaluation is.

    This division of labor changes the cost structure. The cost of training a base model is concentrated upfront and is usually a large one-time investment. Adaptation costs depend on data scale and the number of iterations, and can be expanded as needed. As a result, teams typically compare the following dimensions during model selection:

    • Parameter scale and inference cost: determines the GPU memory, throughput, and latency required for deployment.
    • Context length: determines the document length and multi-turn conversation depth the model can handle.
    • Language and domain coverage: determines the starting level of the base model in the target scenario.
    • License terms: determines whether commercial use is allowed, whether modified models can be released, and what attribution and redistribution obligations apply.

    Leaderboard scores are only one reference. The same benchmark can produce very different results under different evaluation settings, so selection should be based on the team’s own business test set.

    2. Technical Workflow: From Base Model to Usable Model

    Secondary development usually includes five stages, each with different goals and risks.

    1. Base model selection

    When selecting a base model, verify at least four items: whether the license permits commercial use, whether modified models may be released, whether the architecture is compatible with existing inference frameworks and hardware, and whether language and domain coverage match the target scenario. License issues are the most easily overlooked and should be confirmed by legal or compliance staff at project initiation, not just before launch.

    2. Continued pretraining (optional)

    When the domain corpus is large and differs significantly from the distribution of general corpora, continued pretraining can be performed on the domain corpus. The key at this stage is to control the learning rate and number of training steps to prevent the model from forgetting its original general capabilities, known as catastrophic forgetting. A common practice is to mix in a certain proportion of general corpus and check after training whether performance on general benchmarks has declined.

    3. Instruction tuning and alignment

    Instruction tuning trains the model to understand tasks and follow instructions. Training data usually consists of “instruction” and “response” pairs. Data quality has a much greater impact on results than data quantity. The following principles are recommended:

    • Instructions should cover the main task types in real business scenarios and include edge cases.
    • Response style should be consistent, and factual content should be verified manually or by rules.
    • Duplicate samples should be removed to avoid overfitting to high-frequency templates.
    • Examples of refusal or human handoff should be designed for high-risk topics.

    4. Evaluation

    Evaluation should be conducted at three levels, all of which are necessary:

    • General capability benchmarks: check whether the model retains basic language and reasoning capabilities.
    • Domain test set: written by business experts and covering common questions, edge cases, and failure cases.
    • Manual sampling: periodically sample online outputs, record error types, and feed them into the next training round.

    Evaluation records should be retained for every version iteration, including data version, training parameters, evaluation set version, and results, to support traceability.

    5. Artifact management

    When delivering a model, deliver the weights, model card, and license-related files together. The model card records the base model source, modifications, data overview, and known limitations. It is the foundation for later compliance review and external disclosure.

    The following pseudocode summarizes the workflow above:

    1. Input: open-source base model weights, full license text, domain corpus
    2. 1. Compliance review: confirm the license allows commercial use and redistribution; record attribution and notice requirements.
    3. 2. Data preparation: clean domain corpus, deduplicate, remove personal information and unauthorized content.
    4. 3. Continued pretraining (optional): train on domain corpus at a lower learning rate, mixing in general corpus.
    5. 4. Instruction tuning: construct instruction-response data and train task execution capability.
    6. 5. Evaluation: general benchmarks + domain test set + manual sampling; record versions and results.
    7. 6. Output: model weights + model card + license and notice files.

    3. License and Compliance Essentials

    Open-source licenses vary considerably, so teams should not rely only on the license name. Teams should read the full text and focus on the following items.

    • Redistribution obligations: whether the original copyright notice and license text must be retained, and whether modifications must be marked.
    • Attribution requirements: whether the base model source must be noted in documentation, product interfaces, or the model card.
    • Usage restrictions: some licenses impose additional conditions on use scenarios, user scale, sublicensing, or specific industries.
    • Definition of derivative works: whether a model with modified weights is considered a derivative work, and whether the terms specifically address this.
    • Training data authorization: whether the domain corpus comes from authorized channels, and whether it contains copyrighted content or personal information.
    • Industry regulation: healthcare, finance, government, and other scenarios require additional safety assessment and data compliance review.

    Compliance work should be completed at three points: project initiation, training, and release. Confirm the base model license at initiation, record data sources during training, and check attribution and notice files before release.

    4. Model Provenance Verification and Traceability Records

    Model source information should be fully archived internally and kept consistent with external materials. Teams can use configuration files to check whether declarations are complete. Model configuration files usually include fields such as architecture type, number of layers, hidden size, and vocabulary size, which can be compared with public information about the base model.

    The following pseudocode shows one verification approach:

    1. function check_model_provenance(config_file, internal_statement):
    2. read architecture_type, num_layers, hidden_size, vocab_size from config
    3. if architecture features do not match the base model in internal_statement:
    4. mark as "declaration incomplete" and request supplementary details
    5. if config contains upstream source related fields:
    6. check whether internal_statement names the corresponding source
    7. if not named, mark as "attribution required"
    8. return check results and action items

    The verification results should be added to the model card. The following template can serve as a starting point for teams:

    1. {
    2. "model_name": "<internal model name>",
    3. "version": "<version number>",
    4. "base_model": {
    5. "name": "<base model name and version>",
    6. "source": "<publisher and acquisition channel>",
    7. "license": "<license name and version>"
    8. },
    9. "modifications": [
    10. "Continued pretraining: <data scope and ratio>",
    11. "Instruction tuning: <sample count and task types>"
    12. ],
    13. "training_data_summary": "<data sources, authorization status, and cleaning methods>",
    14. "evaluation": {
    15. "general_benchmark": "<benchmark name and version>",
    16. "domain_testset": "<test set version and sample count>"
    17. },
    18. "attribution_notice": "<attribution text written according to license requirements>",
    19. "known_limitations": ["<known limitation one>", "<known limitation two>"]
    20. }

    Every item in the model card should have a traceable source. Fields for which evidence cannot be provided should be marked as pending confirmation and should not be left blank or filled with speculation.

    5. Principles for External Disclosure

    External communications are a key point of compliance and trust risk. Disclosure should follow these principles.

    1. Describe the base model source accurately. For example, “fine-tuned on an open-source base model for domain adaptation” is accurate. Vague statements such as “based on the best model in the community” can mislead readers, even if the sentence itself is not factually wrong.
    2. Distinguish self-trained models from secondary development. Training from scratch and fine-tuning open-source weights are different types of work, and communications should use the corresponding terminology rather than mixing them.
    3. State the conditions for performance data. Comparison results should specify the evaluation set, evaluation method, prompt settings, and version, and should state whether they have been reproduced by a third party. Comparison data that cannot be reproduced should not be published.
    4. Disclose at the same time as release. Base model source information should be disclosed when the product is released, avoiding trust issues caused by later additions.
    5. Keep communications consistent with technical documentation. Descriptions in technical whitepapers, model cards, and press releases should corroborate one another. If discrepancies appear, technical documentation should prevail and be corrected promptly.

    6. Implementation Checklist

    The following table can be used for day-to-day project management.

    Stage Check item Responsible role Artifact
    Project initiation Whether the base model license allows commercial use and release of modified models Legal and technical lead License review record
    Data Corpus source authorization, personal information cleaning, deduplication Data team Data inventory and processing log
    Training Training parameters, data version, random seed Algorithm team Training configuration and experiment record
    Evaluation General benchmarks, domain test set, manual sampling results Evaluation team Evaluation report
    Release Model card completeness, attribution text, notice files Project lead Model card and notice files
    External communications Consistency between promotional wording and technical documentation Joint marketing and technical review Review record

    Teams should update this checklist after each iteration and incorporate identified issues into the next round of process improvement. As long as records are retained at each stage, the results of secondary development can be reviewed, and the cost of compliance and disclosure will decrease accordingly.