To fine-tune an LLM to speak in different time periods, you'll need to create a dataset that captures the linguistic characteristics of each era you want to model. The key is gathering authentic text from those periods and structuring your training data appropriately.
For data collection, you'll want to source texts that represent how people actually spoke and wrote during different eras. This includes literature, newspapers, letters, diaries, transcripts of speeches, and other contemporary documents. For example, for Victorian English you'd want texts from 1837-1901, while for 1920s American English you'd gather jazz age newspapers, novels, and correspondence. Public domain sources like Project Gutenberg, historical newspaper archives, and digital library collections are excellent starting points.
The fine-tuning approach depends on whether you want a single model that can switch between time periods or separate models for each era. For a multi-period model, you'd structure your training data with explicit markers or prompts that indicate the desired time period, something like "[1800s] <text in 1800s style>" or "Write in the style of the 1920s: ". This teaches the model to associate certain linguistic patterns with specific temporal contexts.
During the fine-tuning process itself, you'll want to use a pre-trained model as your base and then continue training on your historical dataset. The exact parameters will depend on your model architecture, but generally you'll use a lower learning rate than initial training, and you'll need to experiment with the number of epochs to avoid overfitting while still capturing period-specific language patterns.
Consider augmenting your dataset with style-specific features that characterize different eras: vocabulary choices, sentence structures, levels of formality, common phrases and idioms, spelling variations, and cultural references. You might also want to include negative examples where modern language is explicitly marked as not from a particular period, which can help the model learn boundaries.
For evaluation, you could create a test set with human experts rating how authentic the generated text sounds for each time period, or use automatic metrics that measure vocabulary overlap with genuine historical texts. You might also want to test edge cases, like asking the model to explain modern concepts in historical language styles.
Would you like me to elaborate on any particular aspect of this process, such as specific tools for dataset creation or parameter tuning strategies?