Tutorials

Full Fine-Tuning can be performed using SageMaker AI Serverless Model Customization.

SageMaker AI Serverless adds full fine-tuning, avoiding GPU setup and improving code LLM quality over low-rank methods on 110,000 examples.

Full Fine-Tuning can be performed using SageMaker AI Serverless Model Customization.

Key Takeaways

  • Amazon SageMaker AI Serverless Model Customization now supports full fine-tuning of large language models, removing the need for GPU provisioning, cluster setup, or distributed-training configuration.
  • Full fine-tuning updates all model parameters, overcoming the limitations of low-rank adaptation methods like LoRA and enabling deeper learning of complex domain-specific knowledge.
  • In a benchmark using 110,000 code examples on Qwen3-4B, full fine-tuning reached 90.0% LLM-as-Judge semantic correctness and outperformed LoRA across multiple evaluation metrics.
  • The serverless workflow simplifies customization by automatically handling compute, checkpoints, and training metrics, while also supporting built-in evaluation methods such as LLM-as-Judge, PRIMECODE, and MMLU.

Meta description: Amazon SageMaker AI Serverless Model Customization adds full fine-tuning, tested on a 110,000-example code dataset with quality gains over low-rank methods.

Full Fine-Tuning can be performed using SageMaker AI Serverless Model Customization.

Tags: Amazon SageMaker AI, full fine-tuning, LLM, code generation, serverless

Featured image: A friendly abstract illustration of a neural network being refined on a serverless cloud, with small code symbols and a quality gauge; no text, logos, or people.

Amazon SageMaker AI Serverless Model Customization now supports full fine-tuning for large language models, giving businesses, data scientists, and machine learning engineers a way to adapt a pretrained model to their own data without GPU provisioning, cluster setup, or distributed-training configuration. Fine-tuning continues training a pretrained LLM on company data so the model follows a specific domain, task, or style instead of relying only on general-purpose knowledge. For businesses, the value is twofold: better accuracy on specialized work and lower cost when a smaller specialized model matches or exceeds a frontier model at a fraction of the per-token inference price. Those savings compound across millions of requests, making fine-tuning an essential process for businesses looking to get more value from LLMs at lower costs.

Why full fine-tuning matters

Parameter-efficient fine-tuning methods such as low-rank adaptation emerged as a practical way to adapt LLMs to downstream tasks by updating only a small subset of model parameters and reducing GPU capacity requirements. Low-rank adaptation freezes pretrained weights and injects small pairs of replacement low-rank matrices into layers. That approach balances efficiency and expressiveness for simple adaptations, but the low-rank structure limits representation power and can compromise performance on complex tasks. The trade-off hampers the ability to capture complex patterns needed for diverse tasks. As tasks become more complex and datasets grow beyond tens of thousands of examples, the method can hit an accuracy plateau where raising rank and trainable parameters no longer closes the gap with standard fine-tuning. The gap is not only fewer parameters; it reflects rank deficiency, because low-rank updates cannot capture the full complexity of the weight changes needed for deep task adaptation.

Full fine-tuning addresses that limitation by updating model parameters simultaneously, so LLMs can fully absorb complex domain-specific knowledge. It modifies the model’s weight matrix uniformly, using the full representational capacity of the weight matrices rather than restricting updates to a small subspace. It also avoids the abrupt, localized distortions characteristic of low-rank methods. The result is stronger model convergence, better activation alignment across layers, and a model that preserves both the target task distribution and the richness of pre-trained knowledge.

Benchmark results on 110,000 code examples

The benchmark used supervised fine-tuning on the Qwen3-4B base model offered within Amazon SageMaker AI Studio. All experiments ran on Amazon SageMaker AI Serverless Model Customization and compared low-rank adaptation with full fine-tuning. Both methods received the same prompts, targets, and evaluation code.

The training set was Magicoder-Evol-Instruct-110K, a curated corpus of 110,000 coding instruction-response pairs spanning algorithm design, debugging, data structures, and systems programming. The data was split 90/5/5: 99,000 records for training, 5,500 for validation to monitor convergence and training loss during the customization job, and 5,500 held out for unbiased evaluation of the final model. The dataset was registered in SageMaker AI dataset assets.

At 100,000 or more training examples, full fine-tuning achieved 90.0 percent on LLM-as-Judge semantic correctness across code generation tasks. In the radar chart, the inner polygon for the base model stays low, the middle polygon for low-rank adaptation improves strongly and evenly, and the outer polygon for full fine-tuning extends further on every dimension, with particularly pronounced leads on BLEU and ROUGE-2. The pattern is presented as a broader advantage of full-rank optimization rather than a single-metric artifact.

How the serverless workflow supports evaluation

Serverless Model Customization lets data scientists and machine learning engineers focus on fine-tuning without managing infrastructure or GPU capacity planning. The user specifies the base model, dataset, and hyperparameters, and the service handles compute allocation and checkpoint management automatically in a serverless fashion. The code example used the SageMaker Python SDK, launching a full fine-tuning job with the `SFTTrainer` class and `TrainingType.FULL`; switching to low-rank adaptation required only changing that value to `TrainingType.LORA`, while the rest of the setup remained the same. Training performance metrics were tracked in the job and viewed in the linked MLflow app.

SageMaker AI Serverless Model Customization includes three built-in evaluation methods used in the benchmark: LLM-as-Judge, PRIMECODE, and MMLU. Each targets a different quality dimension: semantic correctness, code generation fidelity, and general knowledge retention. Together they provide a comprehensive picture of model customization quality.

LLM-as-Judge uses a frontier model, Amazon Nova Pro, as an automated evaluator that reads generated code alongside the original prompt and judges whether the solution is logically correct. The workflow can compare the customized model with the base model.

PRIMECODE measures how closely generated code matches reference solutions using deterministic text-similarity metrics: BLEU for n-gram precision, ROUGE-1/2/L for recall-oriented overlap, and F1 for precision-recall balance. Because these scores are reproducible, they are useful for controlled ablation studies. The benchmark used PRIMECODE as the primary measure of surface-level code quality, since it quantifies whether the model learned coding patterns, formatting conventions, and implementation style from the training data. A high BLEU score indicates code that looks structurally similar to expert-written solutions.

MMLU, or Massive Multitask Language Understanding, tests the model across 57 academic subjects, from abstract algebra and anatomy to Nutrition and Philosophy. It was used as a forgetting-detection guardrail to see whether domain-specific fine-tuning erodes broad general knowledge. Fine-tuning on code can overwrite general capabilities stored in model weights, so tracking MMLU accuracy before and after customization helps quantify that trade-off and reveals whether hyperparameter choices accelerate or mitigate it.

Rapid experimentation and hyperparameter notes

The serverless setup made rapid experimentation possible without re-provisioning infrastructure. The team changed training types between low-rank adaptation and full fine-tuning, swept hyperparameters, and tested across multiple base models. Over a short window, it ran tens of model customization jobs across Qwen3-4B, DeepSeek-R1-1.5B, Nemotron-30B, and Gemma-4-26B. The experiments systematically ablated learning rate, batch size, warmup ratio, epoch count, and dataset scale. Each job, from submission to evaluation results, completed in a few hours, and the resulting customized models were automatically registered in SageMaker Model Registry as versioned Model Packages for review or deployment.

The experiments configured hyperparameters including a learning rate of 2e-5, a global batch size of 8, two epochs, and a learning-rate warmup steps ratio of 0.1. SageMaker AI Serverless Model Customization supports many hyperparameters, and the service documentation page lists what can be set before launching a full fine-tuning job. Effective values vary by task, but the observed patterns are meant to provide starting points. For full fine-tuning, the learning rate controls how aggressively every weight is updated. Unlike low-rank adaptation, where only small adapter matrices change, too high a full fine-tuning learning rate can permanently overwrite pretrained knowledge. The available risk map references a learning rate of 2e-5, but the full dataset-size range is not specified.

What readers should watch next

For teams building domain-specific LLM applications, the main practical takeaway is that full fine-tuning can be tried without building a GPU training pipeline, and the same serverless environment can compare it against low-rank adaptation using identical prompts, targets, and evaluation code. The next questions are how consistently the benchmark advantage holds across different domains, how the cost and time of full fine-tuning scale beyond code generation, and how hyperparameter choices should be adjusted for smaller or lower-quality datasets.

Comments (0)

  1. No comments yet. Be the first to share what worked for you.

Leave a comment

Comments are reviewed before they appear. Your email address is not published.