DEV Community

lukas kunhardt
lukas kunhardt

Posted on • Originally published at lukasvonkunhardt.com

The simplest way to improve LLM Answers

If you ask a language model a question, you'll get a prediction of the average of the internet's answer - whatever is said most often in reply to a question like yours.

You improve the output with one additional step: you force the model to first reason about which specific person would be best to answer this question, and then answer as them.

This works so well because experts in each field usually have a large public body of writing: books, lecture transcripts, blogs, etc. that went into the model's training data, so the model has a great understanding of how an expert thinks - and simulating "what does Paul Graham think about my startup idea" pulls far better answers than the crowd average.

I initially got the idea for this approach from this Karpathy tweet:

Andrej Karpathy's post on framing prompts around which expert would answer

Since then I have experimented with it and found that the best way to use this framing is to have the model really pick one specific person, or a panel of specific people to discuss this, and first explain why the chosen people are particularly well suited to answer this question. This seems to reinforce the character simulation.

I turned this into a reusable skill. Install it with one command, npx skills add lukaskunhardt/skills, or grab it on GitHub.

Top comments (0)