Posts

LangChain Tutorial: Chain Types

Image
201_chain_types Once you get more familiar with different types of chains, you will notice there is a configuration called chain types at instantiation. So what does that mean? What does it do? When should you consider using a particular chain type? Don't worry, you will find answers to all of those questions in this article. In short, this is the configuration that dictates which prompt technique is used to achieve the task. The difference in the results produced may be less clear, however, it could impact the performance of chain, and determine how effective the LLMs are being used. I will use summarization chain as example to explain further. For the patient, the difference are listed in the table below for your reference. Stuff Map Reduce Refine Rerank Generate text based on a single prompt. Uses a divide-and-conquer approach to break down a large task into smaller tasks. Uses a feedb