Downloads · 30 days
212
24% of all-time downloads
KS-AO-HUB/lora-dataset-size-vs-epoch-exposure
lora-dataset-size-vs-epoch-exposure is a text-to-image model from KS-AO-HUB. Use it when you need an image from a text prompt. It is set up for diffusers. The card lists the license as other.
Downloads · 30 days
212
24% of all-time downloads
All-time downloads
886
Public
Repo size
4.1 GB
Likes
1
Public
Click a slice to open those files.
.safetensors3.4 GB · 83%
From the Hugging Face model README

CLIP similarity, LPIPS distance, FID and diversity for all 15 runs. The main change runs top to bottom (dataset size, and therefore epochs), not left to right (batch size).
"Use a small, curated dataset" is one of the most common pieces of LoRA training advice. This project tests it under a fixed training budget.
I trained 15 LoRAs in a full 5×3 grid (dataset size × batch size), with every run seeing exactly 10,000 training samples. The question is a practical one: with a fixed amount of training, is it better to show the model a few images many times or many images a few times?
Practical takeaway: If you compare LoRAs trained on different dataset sizes for the same number of steps, expect the smaller dataset to score higher on CLIP. That alone doesn't make it the better model. Look at the outputs.

Right panel: intra-set diversity (LPIPS) rises with epochs (r = +0.57), more weakly than CLIP similarity (r = +0.83). Section 4.2 discusses why this diversity measure is hard to interpret.
Low-Rank Adaptation (LoRA; Hu et al., 2022) is the standard way to fine-tune large diffusion models for specific characters, styles and concepts. Most training guidance is still anecdotal: forum posts recommend dataset sizes or batch sizes without controlled comparisons.
This study trains 15 LoRAs across 5 dataset sizes (25, 50, 100, 200, 400 images) and 3 batch sizes (1, 2, 4), with total training samples (steps × batch size) held at 10,000.
A common practice is to train for a set number of steps regardless of dataset size. That is a fixed budget, and under a fixed budget a smaller dataset is automatically repeated more: shrinking the dataset 16× (400 → 25) increases repetitions per image 16× (25 → 400 epochs). Comparisons between "small" and "large" datasets made this way are really comparisons between two ways of spending the same budget. This study makes that trade-off explicit and measures it.
The same idea appears as the "fixed sample protocol" in Lee & Lee (2026), who study batch size in LLM LoRA fine-tuning. Hong & Choo (2025) name this trade-off between batch size, epochs and repeats under a fixed budget as an open question in their own LoRA study.
All code, prompts, metrics and aggregated results are public (Section 7).
The dataset was built by manual curation (filtering, cropping, tagging) and is not redistributed because of copyright. The reference set is also not redistributed.
All 15 LoRAs were trained on Illustrious SDXL using CivitAI's Dreambooth/LoRA Trainer (Kohya fork).
Constants across all runs:
| Parameter | Value |
|---|---|
| Checkpoint | Illustrious SDXL |
| Resolution | 2047 × 2047 (as reported by trainer; bucketing enabled) |
| Bucket Enabled | Yes |
| Shuffle Tags | Yes |
| Keep Tokens | 3 |
| Clip Skip | 2 |
| Flip Augmentation | Yes |
| Unet LR | 0.00012 |
| Text Encoder LR | 0.00005 |
| LR Scheduler | cosine_with_restarts (3 cycles) |
| Min SNR Gamma | 5 |
| Network Dim / Alpha | 32 / 16 |
| Optimizer | Adafactor |
Note on resolution: CivitAI's trainer allowed 2047 × 2047 rather than the expected 2048 × 2048. The exact bucketing behavior under this setting is unclear; all runs used the same configuration.
Note on learning rate: The learning rate was the same for every batch size. Lee & Lee (2026) show that tuning the learning rate separately for each batch size matters in LLM LoRA fine-tuning, so the batch-size result here applies to a fixed learning rate.
Experimental grid:
| Data Size | Batch Size | Steps | Epochs | Run ID |
|---|---|---|---|---|
| 400 | 4 | 2,500 | 25 | 1 |
| 400 | 2 | 5,000 | 25 | 2 |
| 400 | 1 | 10,000 | 25 | 3 |
| 200 | 4 | 2,500 | 50 | 4 |
| 200 | 2 | 5,000 | 50 | 5 |
| 200 | 1 | 10,000 | 50 | 6 |
| 100 | 4 | 2,500 | 100 | 7 |
| 100 | 2 | 5,000 | 100 | 8 |
| 100 | 1 | 10,000 | 100 | 9 |
| 50 | 4 | 2,500 | 200 | 10 |
| 50 | 2 | 5,000 | 200 | 11 |
| 50 | 1 | 10,000 | 200 | 12 |
| 25 | 4 | 2,500 | 400 | 13 |
| 25 | 2 | 5,000 | 400 | 14 |
| 25 | 1 | 10,000 | 400 | 15 |
What varies independently, and what doesn't. Because total samples are fixed, epochs = 10,000 ÷ dataset size. Each dataset size has exactly one epoch count, so in this design dataset size and epochs are the same variable described two ways. Batch size, by contrast, varies independently of epochs: within each dataset size, epochs are constant while batch size (and therefore step count) changes 4×.
clip_identity in the code): for each generated image, cosine similarity to its most similar reference image (OpenCLIP ViT-H/14 image embeddings; Radford et al., 2021), averaged over the 40 images. This measures whole-image similarity (character, outfit, pose, composition and style together), not character identity alone.lpips_identity): perceptual distance from each generation to the nearest reference (VGG-based; Zhang et al., 2018). Lower is more similar.Caveats on metrics:
- FID is not meaningful at this sample size. It estimates a 2,048-dimensional covariance from 20 reference images and 40 generations, far below what Clean-FID needs. FID values are reported for completeness, but no conclusions in this README rely on them.
- The overfitting proxy saturated at 1.0 for every run, so it gives no signal. A continuous similarity-to-training-set score would be more useful.
| run_id | data_size | batch_size | epochs | clip_identity | lpips_identity | diversity_lpips | fid |
|---|---|---|---|---|---|---|---|
| 1 | 400 | 4 | 25 | 0.8470 | 0.5267 | 0.5460 | 191.66 |
| 2 | 400 | 2 | 25 | 0.8430 | 0.5231 | 0.5290 | 207.70 |
| 3 | 400 | 1 | 25 | 0.8530 | 0.5237 | 0.5480 | 198.26 |
| 4 | 200 | 4 | 50 | 0.8650 | 0.5086 | 0.4970 | 193.53 |
| 5 | 200 | 2 | 50 | 0.8580 | 0.5082 | 0.5200 | 200.96 |
| 6 | 200 | 1 | 50 | 0.8550 | 0.5087 | 0.5240 | 191.87 |
| 7 | 100 | 4 | 100 | 0.8590 | 0.5157 | 0.5320 | 199.43 |
| 8 | 100 | 2 | 100 | 0.8530 | 0.5187 | 0.5360 | 210.29 |
| 9 | 100 | 1 | 100 | 0.8590 | 0.5188 | 0.5230 | 207.96 |
| 10 | 50 | 4 | 200 | 0.8580 | 0.5367 | 0.5640 | 189.12 |
| 11 | 50 | 2 | 200 | 0.8600 | 0.5176 | 0.5380 | 192.47 |
| 12 | 50 | 1 | 200 | 0.8680 | 0.5272 | 0.5600 | 189.48 |
| 13 | 25 | 4 | 400 | 0.8760 | 0.5291 | 0.5660 | 194.55 |
| 14 | 25 | 2 | 400 | 0.8860 | 0.5047 | 0.5400 | 189.06 |
| 15 | 25 | 1 | 400 | 0.8720 | 0.5214 | 0.5800 | 201.60 |
Means by dataset size (averaged over batch sizes):
| Data Size | Epochs | CLIP sim. ↑ | LPIPS dist. ↓ | Diversity | FID ↓ |
|---|---|---|---|---|---|
| 400 | 25 | 0.848 | 0.525 | 0.541 | 199.2 |
| 200 | 50 | 0.859 | 0.509 | 0.514 | 195.5 |
| 100 | 100 | 0.857 | 0.518 | 0.530 | 205.9 |
| 50 | 200 | 0.862 | 0.527 | 0.554 | 190.4 |
| 25 | 400 | 0.878 | 0.518 | 0.562 | 195.1 |
Means by batch size (averaged over dataset sizes):
| Batch Size | CLIP sim. ↑ | LPIPS dist. ↓ | Diversity | FID ↓ |
|---|---|---|---|---|
| 1 | 0.861 | 0.520 | 0.547 | 197.8 |
| 2 | 0.860 | 0.515 | 0.533 | 200.1 |
| 4 | 0.861 | 0.523 | 0.541 | 193.7 |
Correlations across the 15 runs:
| Metric | vs. log(epochs) | vs. log(batch size) |
|---|---|---|
| CLIP similarity | +0.83 | 0.00 |
| LPIPS distance | +0.11 | +0.16 |
| Diversity (LPIPS) | +0.57 | −0.12 |
| FID | −0.27 | −0.24 |
Since log(epochs) = log(10,000) − log(dataset size), every correlation with log(dataset size) is the same number with the sign flipped. The ±0.83 is one result, not two.
CLIP similarity rises as datasets shrink (and epochs rise). This is the clearest effect in the study:
Batch size adds nothing. Log-linear regressions of CLIP similarity:
| Model | Predictors | R² | Adjusted R² |
|---|---|---|---|
| Epochs only | log(epochs) | 0.689 | 0.665 |
| Full grid | log(data), log(batch), interaction | 0.689 | 0.605 |
The full model, with three predictors, explains no more variance than epochs alone. Adjusted R² is lower only because it penalizes the extra predictors. Since "epochs only" carries exactly the same information as "dataset size only," this comparison shows that batch size doesn't help. It does not distinguish epochs from dataset size. For LPIPS and FID, neither model explains anything (adjusted R² ≤ 0), so no comparison is meaningful there.
LPIPS distance shows no trend. While CLIP similarity rises strongly, perceptual distance to the references barely changes (R² = 0.011). Smaller-dataset runs get closer to the references in CLIP's embedding space without getting closer perceptually. One plausible reading is that CLIP is picking up broad features (hair, outfit, palette) more than fine detail, but this study doesn't test that directly.
Diversity rises somewhat with epochs (r = +0.57), but is hard to interpret. LPIPS between generations can rise because outputs vary in healthy ways (pose, framing), or because artifacts and noise make images differ from each other. This study can't tell which, and the 200-image runs had the lowest diversity, which doesn't fit a simple trend. With the overfitting proxy saturated, this study has no working measure of memorization.
Run 14 (25 images, batch size 2, 400 epochs):
| Metric | Run 14 Value | Rank (of 15) | Direction |
|---|---|---|---|
| CLIP similarity | 0.886 | 1st | ↑ higher = more similar |
| LPIPS distance | 0.5047 | 1st | ↓ lower = more similar |
| FID vs refs | 189.06 | 1st (tied with Run 10 at 189.12) | not reliable here |
| Diversity LPIPS | 0.540 | 7th | — |
On the similarity metrics, Run 14 looks like the best model in the study. Two caveats: its margins are small (its LPIPS distance is 0.004 below Run 5's), and with one run per configuration, its lead over the other 25-image runs (0.886 vs. 0.876 and 0.872) is only one to two run-to-run standard deviations and could be partly chance.
See the figure at the top of this page. The dominant gradient runs top to bottom (dataset size / epochs) rather than left to right (batch size).

Figure 3: Effect of dataset size, averaged over batch size. Error bars show ±1 SD across batch sizes.

Figure 4: Effect of batch size, averaged over dataset size. Slopes are flat or nearly flat.

Figure 5: The same data as Figure 3, plotted against epochs. Because epochs = 10,000 ÷ dataset size, this is Figure 3 mirrored.
Run 14 leads the similarity metrics, but a side-by-side comparison with Run 3 (400 images, 25 epochs; the best CLIP score among the 400-image runs) shows Run 14 producing visibly worse outputs.
Run #14: Data Size = 25, Batch = 2, Steps = 5,000
Run #3: Data Size = 400, Batch = 1, Steps = 10,000

Figure 6: Outputs from Run 14 (highest CLIP and LPIPS similarity) and Run 3 (lower scores). Run 14 shows edge ringing and oversharpening, anatomical inconsistencies, repeated features, and loss of fine detail. Run 3 shows more consistent proportions and more natural variation.
How strong is this evidence? It is one pair of runs, judged by me, without blinding. The two runs differ in dataset size, batch size and step count at once. So this is an illustrative case, not a measured effect. It does show that a model can lead on CLIP and LPIPS similarity and still look worse, which is enough to say these metrics are not sufficient on their own. A blinded preference test across all 15 runs would show how often this happens (Section 9).
At a fixed budget, the 25-image runs see each image 400 times; the 400-image runs see each image 25 times. Two explanations fit the CLIP results equally well:
This design can't separate them, because every small-dataset run is also a high-repetition run. No single design can, because total training = dataset size × epochs, so any experiment ties two of the three together:
| Design | Held fixed | Tied together |
|---|---|---|
| This study | total training | dataset size ↔ epochs |
| Same dataset, train longer | dataset size | epochs ↔ total training |
| Same epochs, more images | epochs | dataset size ↔ total training |
Each design answers a different question. This one answers the practitioner's question: given a fixed budget, how should it be split? At this budget, the metrics favor fewer images, and the visual inspection suggests the metrics may be overstating that. Combining results from more than one design (Section 9) is how the "why" could be narrowed down.
Batch size had no measurable effect on CLIP similarity (r = 0.00; no added variance explained), and only small correlations with the other metrics. This is the cleanest result in the study, because batch size varies while per-image exposure is held constant.
This is consistent with Lee & Lee (2026), who find LLM LoRA accuracy roughly flat across small batch sizes, degrading only above a critical batch size. Two cautions apply. Their experiments use LLMs, tuned learning rates, and datasets of 25K–200K examples, and they find the critical batch size shrinks as the dataset shrinks. So whether batch sizes 1–4 fall in the flat region for 25–400 images is an extrapolation, not something their results establish. This study also did not test large batches.
Hong & Choo (2025) tested batch sizes 1, 2, 4 and 8 for SD 1.5 LoRAs on architectural massing images and recommend 4. Their CLIP scores differed only slightly across batch sizes (0.208–0.212, computed on one hand-selected image per prompt), and the choice rested largely on visual judgment, so it does not conflict with the null result here. They list as a limitation that they "did not analyze in detail the changes in model performance according to combinations of hyperparameter settings for Batch Size, Epoch, and Repeats," and suggest varying batch size and repeats with the training budget fixed. That is close to the design used here (they propose fixing training steps; this study fixes total samples).
Practically, batch size mainly sets VRAM use. At a fixed learning rate, batch size 1 gave the same results as batch size 4.
The run that led on CLIP and LPIPS similarity looked worse than a run it outscored. CLIP similarity responded strongly to the dataset-size/repetition trade-off while perceptual distance barely moved.
If practitioners choose settings by CLIP score, they will tend to pick small, heavily repeated datasets. That is a version of Goodhart's law: a measure that becomes the target stops tracking what it was meant to measure. This study shows one instance; measuring how often it happens needs structured human evaluation.
Whether a repeated example is worth as much as a fresh one has been studied more directly elsewhere:
These are pretraining studies (or, for Gu et al., training from scratch), not LoRA fine-tuning. I'm not aware of a controlled study of this trade-off for LoRA fine-tuning of SDXL-class models.
GitHub repo: lora-epoch-confound-study
Contains:
results.csv)Training and reference images are not redistributed because of copyright.
This study uses the Kohya sd-scripts training framework via CivitAI's Dreambooth/LoRA Trainer wrapper, and the Illustrious SDXL checkpoint.
These are my working hypotheses. They fit the results above but are not established by them. If you test one, I'd like to hear how it goes.
1. Small datasets score higher because they overtrain, not because they learn better. Extra repetitions push the model to reproduce surface features (hair, outfit, colors) that CLIP rewards, while fine detail gets worse. Test: Train one LoRA on a fixed dataset and evaluate checkpoints saved every few epochs. If CLIP similarity rises while images degrade, with the dataset unchanged, repetition alone is doing it. (With a cosine schedule, a mid-run checkpoint isn't identical to a shorter run, so treat this as a first look.)
2. The main advantage of a large dataset is that it can be trained longer before overfitting. A larger dataset may not teach the concept better per se; it may just take more steps before any single image has been repeated too often. Test: Train a small and a large dataset to the same epoch count, then keep going. Compare when each starts to degrade.
3. Repetitions per image (epochs) is the setting that matters most. If hypotheses 1 and 2 hold, the useful rule is "don't exceed roughly N repetitions per image," not "use X images." Test: Train different dataset sizes to the same epoch count. If they look about equally good, epochs is the main lever.
4. CLIP similarity can't be trusted to pick the best LoRA. In the one comparison here, the best-scoring model looked worse. Test: Run a blinded forced-choice comparison across all 15 runs (random pairs, labels hidden, order shuffled) and check how often human preferences agree with the CLIP ranking.
5. Rising CLIP with flat LPIPS signals overtraining. If true, this asymmetry could be a cheap diagnostic. Test: Check whether runs or checkpoints with this pattern are the ones people rate worse in hypothesis 4's test.
Other useful extensions: seed replicates for a few configurations; larger batch sizes with tuned learning rates; a continuous memorization measure (similarity to the nearest training image); and other domains and base models (style LoRAs, realistic subjects, SD 1.5, SD 3, Flux).
Issues and PRs are welcome on the GitHub repo.