All tutorials
    Fine-Tune
    Intermediate
    25 min

    Fine-Tune a Model You Trained

    Continue training a model you built on new data, watch validation live, see whether the tuned model beats the base, and generate a LoRA script for a Hugging Face model.

    What you will do

    Fine-tune a model in the browser and judge whether the result is better than what you started with. Then you will generate a LoRA script for a Hugging Face model, for when you want a bigger base model than a browser can train.

    Before you start

    • A model trained in the Model Builder or by a pipeline
    • A dataset with the same feature columns and target classes as the model was trained on

    Part 1: Tune your own model

    Step 1: Open Fine-Tune and choose a model

    Open Fine-Tune. The My trained models tab lists the models in the project. Every model a training run produces is kept automatically, so there is nothing to export first. Select yours.

    Step 2: Choose the data

    Pick the Dataset to tune on from your Data Hub and the Column to predict (some models do not record what they predict). A table too large to hold in memory is read when you choose it, up to 200,000 rows; for more, take a sample in PrepFlow or a pipeline first.

    Step 3: Settings

    Open the settings. Epochs (at most), Batch size and Learning rate are set gently by default, since fine-tuning wants a lower rate than training from scratch. Layers to train is 0 to train every layer, or N to train only the last N and freeze the rest. Stop after is how many epochs without validation improvement end the run (0 never stops early). Give the tuned model a name, and save a combination you like as a recipe to start from next time. DLWAY holds out validation rows for you: an even share of every class, or the table's own train/val column if it has one.

    Step 4: Run and watch

    Start the run. The live view shows every epoch. DLWAY stops when validation loss stops improving and keeps the best epoch rather than the last one. The model you started from is never changed; the result is a new model.

    Step 5: Did it help?

    When the run finishes, the tuned model is compared with the base model on the same validation rows: loss, accuracy and a confusion matrix over the classes. If the tuned model is no better, change the settings and run again. Runs are listed in the Fine-tunes rail with a state of running, finished, stopped or failed.

    Step 6: Use it

    From the same screen, open the tuned model in Deployment, or tune it again. To keep working on the design, choose Tune it as a graph: the Model Builder opens the model with its weights set as the starting point.

    Part 2: A Hugging Face model

    Step 7: Find a model

    Switch to the Hugging Face Hub tab and search for a model. Search works without signing in. Choose the task, such as text classification.

    Step 8: Generate the script

    Choose the Text column, the Label column and the LoRA rank (r), alpha and dropout, plus epochs, batch size and learning rate. DLWAY writes a LoRA fine-tuning script with its requirements and your dataset, as a script or a notebook for Colab. The script adapts the attention layers of the model's own architecture, pads each batch to its longest text and reports accuracy and macro-F1 every epoch. DLWAY does not run it, and no model comes back to the project; run it somewhere with a GPU and bring the results back yourself.

    Step 9: Look at it as a graph

    Choose Open as a graph. The Model Builder draws the same fine-tune as blocks: a pretrained model, an adapter and a task head. Editing a block changes the script.

    Pipelines

    The same engine runs the Fine-tune Model step of a pipeline, so the same model and data give the same result from either.

    Fine-Tuning and Visual Model Builder.

    Try it in DLWΛY

    Open the Studio and follow along in a real project. There is nothing to install.

    Open Studio