4 ms·
LangChain is very cool. Templates and composability are the way forward. I'm guessing that most folks haven't created composable prompts, so a few experiences
by dandiep 4y ago
LangChain is very cool. Templates and composability are the way forward.
I'm guessing that most folks haven't created composable prompts, so a few experiences on why this stuff is necessary. I've been building a language learning app and it makes heavy use of GPT-3 [1], which has made clear a number of things for me:
1) Composability is fundamental to leveraging language models. You can't get language models to just generate things in one go. It's rather like a human. If you're writing a book, you start with an idea, then an outline, then a chapter outline, then writing paragraphs... Or in our case, generate a flashcard deck description, then vocab, then example sentences, etc.
2) Externalized prompt templates are also important. Engineers need to be able interface with experts who can create custom prompts. E.g. in our case, I need experts who speaks to build prompts specific to other languages for a language learning app [2].
3) Unit testing is critical. There is no linter for a prompt. I have made so many typos over the last year that broke things. OpenAI has released several new models over the last 2 years. Anthropic is coming out with a model. You need to have assurances your prompts work. I've actually had to start building a basic unit tester for our prompts because of this... [3] (please someone else do this so I don't have to)
4) external data is the next step forward for large language models. E.g. in my case, someone may want to learn about the history/culture of a country and we may want to reference existing articles on it since LLMs are known to hallucinate. We need to be able to interface with the web and databases easily. I'm not convinced that LangChain is the write layer of abstraction for this. I suspect/hope that the next version of GPT will have some significant advances in this regard.
1. https://squidgies.app https://squidgies.app
2. https://github.com/squidgyai/squidgy-prompts https://github.com/squidgyai/squidgy-prompts - open source composable prompts for Squidgies
3. https://github.com/squidgyai/squidgy-prompts/tree/main/tests https://github.com/squidgyai/squidgy-prompts/tree/main/tests - unit test in YAML
- tennisfan118 4y agoBuilding https://promptable.ai https://promptable.ai to solve testing!
- tintor 4y agoUnit testing: How would you automatically verify LLM output to a static prompt? Outputs can vary with each invocation.
- dandiep 4y agoTemperature = 0 solves a lot of it, but not all. A list of all options solves a portion of the remaining. Not sure what to do about the rest - maybe ask the LLM?
- beepbooptheory 4y agoSo much effort and processing power going into narrowing down and coercing a vastly general thing, makes me wonder at what point it stops being worth it to use the LLM.
- crosen99 4y agoIt’s a lot of work and it’s messy, but the multiplier on productivity is too large to ignore. At some point all this will get easier, but for now it’s do or die.
- beepbooptheory 4y agoAfter the dust settles, what is it really multiplying? Especially accounting for the energy/gpus it takes. At the very least, why not generate all the cards once, and edit as needed? I just feel like this entire concept verges on this: https://imgur.com/EiGL1Z0 https://imgur.com/EiGL1Z0