Style Transfer in AI writing
Last week, I was looking at various ways in which I could “style transfer” my writing style to AI generated drafts.
The first draft usually generated by AI is so devoid of your style and personality, and to get to the stage where it even comes remotely close to that requires a lot of fine-tuning, and custom prompts. Due to the time consumed in style-transfer, I ended up writing on my own.
And yet, I still feel that there is a way in which this could be more efficient. I used Claude Projects to get this working prototype in place, and here’s how I did this:
I knew that the best evergreen content for training would be my published blog posts. Rough drafts or private notes would be too crude for the AI to make patterns out of it. So I used this as a good benchmark to emulate my style. I uploaded the markdown files into the Project knowledge section of the Claude Projects.
You can upload relevant documents, text, code, or other files to a project’s knowledge base, which Claude will use to better understand the context and background for your individual chats within that project. In addition, you can define project instructions for each project to further tailor Claude’s responses. For example, instructing Claude to use a more formal tone or answer questions from the perspective of a specific role or industry.
I attempted to make a sample blog with this instruction:
I want to write essays that follow the style and flair of my previous blog posts. I don't want it to look like any AI-generated gibberish, copypasta. I want it to sound, feel and smell as if it's written by me: Shreyas Prakash.
Write a blog on 'moats for open source large language models'
While thinking through the possible answer for this prompt, Claude was able to analyse my language, patterns etc, to then adjust various aspects of the essay to better match my voice:
I've written this essay incorporating several elements I noticed in your writing style:
1. Use of vivid analogies and metaphors (Robin Hood, master chef's signature dish)
2. Breaking down complex topics into clear, digestible sections
3. Incorporation of real-world examples and companies
4. A conversational yet insightful tone
5. Forward-looking analysis that goes beyond the obvious
6. Personal perspective and observations
In the first version it produced, I noticed a slightly better draft than the generic ones usually generated.
I still felt like the headers and descriptions where making it look AI-ish, so I gave an additional prompt for it to flow well:
This was a good start. But it’s just that — a start. The next part of using this material before publishing is to reflect on the sentences, and to add my own spin to it.
To summarise, these are the steps I followed —
- Upload your blog markdown exports to the Claude projects knowledge base.
- Give a description to the project on Claude as : ‘Write new blogs on my personal website based on “style transfer” from the way I have written previous blogs’
- Provide a prompt to guide this process further —
I want to write essays that follow the style and flair of my previous blog posts. I don't want it to look like any AI-generated gibberish, copypasta. I want it to sound, feel and smell as if it's written by me: Shreyas Prakash. Write a blog on 'TOPIC'
- Provide more guardrails such as — A strong opening hook, natural progression of ideas without explicit headers, characteristic use of concrete examples and metaphors, a more conversational tone throughout and with a signature email sign-off.