Validation finetune continuation

From wenmin-wu/ds-skills · View interactive version

Validation finetune continuation is an AI agent skill from the GitHub repository wenmin-wu/ds-skills. After training on the primary split, continues fine-tuning on the validation set to adapt the model to the target distribution before inference.

How to use this skill

Skill file

Validation Fine-tune Continuation

Overview

In cross-lingual or domain-shift competitions, training data comes from one distribution (e.g., English) and test data from another (e.g., multilingual). After standard training, continue fine-tuning on the validation set (which shares the test distribution) for a few extra epochs. This squeezes out extra performance by exposing the model to the target domain's patterns before submission.

Quick Start

# Phase 1: train on primary data
EPOCHS = 3
n_steps = len(x_train) // BATCH_SIZE
model.fit(train_dataset, steps_per_epoch=n_steps,
          validation_data=valid_dataset, epochs=EPOCHS)

# Phase 2: continue on validation data (target distribution)
n_steps = len(x_valid) // BATCH_SIZE
model.fit(valid_dataset.repeat(),
          steps_per_epoch=n_steps,
          epochs=EPOCHS)

Workflow

  1. Train model on the main training set for N epochs with validation monitoring
  2. After convergence, switch the training data to the validation set
  3. Use .repeat() if the validation set is small (avoids incomplete epochs)
  4. Train for additional epochs with a lower or unchanged learning rate
  5. Run inference on the test set using the continued model

Key Decisions

References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.