Successfully finetuned Llama 3.1 70B on your Substack blog posts to generate content in your writing style.
β
Finetuned Model: lydia-blog-llama70b-v1 (Llama 3.1 70B)
β
Training Data: 114 high-quality examples from your blog
β
Training Cost: $0.13
β
Final Loss: 0.2336 (excellent!)
β
Sample Quality: Generates text that sounds like you
python3 sample_correctly.pyThis will generate 500-token samples from your finetuned Llama 70B model.
Your finetuned checkpoint:
tinker://5e055c1d-a64d-5886-bb21-d59f26ce83b2:train:0/sampler_weights/ephemeral_175
blogposts_unified_instruction.jsonl- Training dataset (114 examples)sample_correctly.py- Working script to generate samplestinker_train_llama70b.py- Training script usedsubstack-feed.rss- Original blog RSS feedtraining_llama70b.log- Training results and sample outputsrequirements.txt- Python dependencies
parse_rss_to_plaintext.py- RSS β Plaintext convertercreate_all_formats.py- Format generatorcreate_unified_format.py- Unified format creatorclean_bad_examples.py- Removed incomplete examplesvalidate_unified.py- Data validator
- Llama 70B training: $0.13 (3 epochs, LoRA)
- Training time: ~10 minutes
- ~1,500 tokens: < $0.01
- Much cheaper than training!
Your finetuned Llama 70B achieved:
| Metric | Value |
|---|---|
| Final Loss | 0.2336 |
| Training Examples | 114 |
| Epochs | 3 |
| Method | LoRA (Low-Rank Adaptation) |
| Base Model | meta-llama/Llama-3.1-70B |
Prompt: "Write a blog post about AI safety:"
Output:
"Today I was fortunate enough to hear from a law student interested in avoiding catastrophic existential risk from superintelligence. In response to his questions, I wrote the following: Hey [..]! Thank you for coming to me with your questions :) I'm so glad there are more people thinking about this!..."
β
Matches your casual, personal tone
β
Uses your vocabulary and phrasing
β
Maintains your conversational style
After training on your blog posts, the model can:
-
Generate blog posts in your writing style
- Prompt: "Write a blog post about AI alignment:"
- Gets your tone, structure, and voice right
-
Answer questions about your work
- Prompt: "What are your thoughts on revealed preferences?"
- Draws from your actual blog content
-
Follow instructions on related topics
- Prompt: "Tell me about mutual information:"
- Uses your writing as a foundation
python3 sample_correctly.pytinker download lydia-blog-llama70b-v1cat training_llama70b.log- 114 examples (cleaned from 133 - removed bad summaries)
- ~91,000 tokens
- Average: 800 tokens/example
- 20 completion examples (full blog posts)
- 33 instruction examples (prompted writing)
- 61 Q&A examples (questions about your work)
{
"prompt": "Write a blog post about AI safety:",
"completion": "Today I was fortunate enough to hear from..."
}BASE_MODEL = "meta-llama/Llama-3.1-70B"
NUM_EPOCHS = 3
LEARNING_RATE = 5e-5
BATCH_SIZE = 4
METHOD = "LoRA" (Low-Rank Adaptation)- Llama 70B: Best balance of quality and cost
- LoRA: 11% cheaper than full finetuning, similar results
- 3 epochs: Prevents overfitting on small dataset
- Learning rate 5e-5: Standard for LoRA finetuning
- Temperature 0.7: Good balance (used in
sample_correctly.py) - Max tokens 500: Long enough for complete thoughts
- Stop sequence
\n\n\n: Prevents rambling
- β "Write a blog post about [topic]:"
- β "What are your thoughts on [concept]?"
- β "Explain [idea] in your words:"
- β Avoid overly generic prompts
curl https://lydianottingham.substack.com/feed > substack-feed.rsspython3 parse_rss_to_plaintext.py
python3 create_all_formats.py
python3 create_unified_format.py
python3 clean_bad_examples.py
python3 validate_unified.pypython3 tinker_train_llama70b.py| Scenario | Cost |
|---|---|
| Current model (done) | $0.13 |
| Retrain with more data | ~$0.15-0.25 |
| Daily inference (100 prompts) | ~$1-2 |
| Monthly inference (3000 prompts) | ~$30-60 |
- β Llama 70B captured your style better than smaller models
- β Cleaning bad examples improved quality significantly
- β Unified format (mixing completions, instructions, Q&A) created a versatile model
- β 3 epochs was the sweet spot (loss 0.23 vs 2.65 initially)
- β Initial sampling scripts didn't work (wrong API calls)
- β Created many extra training runs accidentally
- β
Final solution: Use
create_sampling_client(model_path=checkpoint)
- Tinker Docs: https://tinker-docs.thinkingmachines.ai/
- Tinker Console: https://tinker-console.thinkingmachines.ai
- Your Blog: https://lydianottingham.substack.com
You now have a production-ready, finetuned Llama 70B model that:
- Writes blog posts in your voice
- Answers questions about your work
- Follows instructions on related topics
- Cost only $0.13 to train
- Generates high-quality output
Ready to use! Run python3 sample_correctly.py to start generating.
Last updated: November 19, 2025