New Tool Radar

Local AI

How to Train a Small LoRA Fine-Tune in Text Generation WebUI’s Training Tab

Load a model in Text Generation WebUI, prepare a small Alpaca-format dataset, and run Start LoRA Training in the Training tab so the model learns your format or facts.

Schematic diagram with three steps: load a model and prepare an Alpaca-format dataset, open the Training tab and start LoRA training, then load the LoRA and test it.

Fine-tuning a model usually means scripts, libraries, and a training loop you write yourself. Text Generation WebUI (also called TextGen) builds the loop into its interface: its Training tab trains a LoRA — a small adapter that teaches a base model a format, a style, or a set of facts — from a dataset you supply, in the app. This is different from MLX LoRA fine-tuning, which is a command-line workflow on a Mac; here the whole job happens in the WebUI. A LoRA has to be matched to a single architecture (for example LLaMA-13B) and cannot be transferred to others, so train exactly on what you plan to use.

Make a plan and gather a dataset

First decide what the LoRA should learn: a dialogue format, or facts from your own documentation. Then gather the dataset. If you use a dataset similar to the Alpaca format, that is natively supported by the Formatted Dataset input in the WebUI, with premade formatter options. For Alpaca, the keys are instruction, input, and output, wherein input is sometimes blank. A small practice dataset in that format looks like this:

[
    {
        "instruction": "When does the lighthouse keeper check the lamp?",
        "input": "",
        "output": "Mara checks the lamp at noon."
    },
    {
        "instruction": "When does the supply boat arrive?",
        "input": "",
        "output": "The supply boat arrives on Tuesdays."
    }
]

If you can get the dataset into a simple text file, that works too: you can train using the Raw text file input option — just copy and paste a chat log or documentation page into a plain text file and train on it. The project’s own docs say 8-bit models are most stable for training, and 4-bit are supported but experimental.

Start the training

Load the WebUI and your model, and make sure you do not have any LoRAs already loaded (unless you want to train for multi-LoRA usage). Then open the Training tab at the top, Train LoRA sub-tab, fill in the name of the LoRA, select your dataset in the dataset options, select other parameters to your preference, and click Start LoRA Training. It can take a few hours for a large dataset, or just a few minutes if doing a small run. A setup guide adds the practical settings for a small run: load a Transformers model (not a quantized loader), pass --load-in-4bit to enable QLoRA mode, set LoRA Rank to 8–32, LoRA Alpha to twice the rank, Learning Rate to 1e-4 to 3e-4, Batch Size to 1–4 depending on VRAM, and Epochs to 3–5. The output saves to loras/<name>/.

While training runs, watch the loss value in the console window: it starts as a high number and gradually gets lower. The docs’ rule of thumb is that if loss goes below 1.0, the model is going to start forgetting its prior memories, and you should stop training. If loss starts at or suddenly jumps to exactly 0, something has gone wrong.

Check What you should see If you do not see it
Dataset Your Alpaca-format rows, with instruction, input, and output keys Use the Formatted Dataset input with the Alpaca formatter, or a raw text file
Training The loss value falls from a high number as training runs Loss at exactly 0 means something went wrong — stop and check the setup
Saved A folder under loras/<name>/ holding the adapter The run did not finish — check the console for the error
Learned The model answers the practice questions from the dataset If it is producing corrupted outputs, start over with a lower Learning Rate

Expected result. We checked Text Generation WebUI’s own Training LoRAs docs for the dataset formats, the Training tab steps, the rank and learning-rate guidance, and the loss rule, and a third-party setup guide for the QLoRA settings. We did not run Text Generation WebUI.

Limits

Training needs VRAM: under default settings, VRAM usage for training is very close to when generating text with 1000+ tokens of context — if you can generate text, you can train LoRAs. If you have low VRAM, reducing batch size or cutoff length helps; if it is too much, it will just error out, and you can lower settings and try again. Higher rank means more precise learning and more content learned, but also more VRAM while training. If your model is not learning detailed information, you might need more epochs or a higher rank; if it is enforcing a format you did not want, tweak the dataset or do not train as far. You cannot change the Rank of an already created LoRA, but you can resume a prior run with Copy parameters from. The practice dataset above is fictional. We did not run Text Generation WebUI, so no trained adapter here is a recorded result.

Sources

See all