When working with large documents, one of the biggest challenges in using Large Language Models (LLMs) is the token limit ā models can only handle a certain amount of text at once.
LangChain solves this by offering three summarization strategies ā Stuff, Map-Reduce, and Refine ā each designed for different data sizes and relationships between documents.
š§© 1. Stuff Strategy ā "All in One Go"
How it works: LangChain simply "stuffs" all your documents into a single LLM prompt and asks the model to summarize them at once.
When to use:
- You have a few small documents.
- The total text easily fits within the model's token limit.
Example:
Docs
Doc A: Our store sold 200 units this week. Doc B: Customer satisfaction increased to 92%. Doc C: We plan to expand our delivery zones next month.
Stuff Prompt
Summarize all the following reports: [Doc A + Doc B + Doc C]
Result
Sales improved, customer satisfaction rose, and expansion is planned for next month.
ā Simple and fast ā ļø Not scalable ā breaks if total text is too long.
āļø 2. Map-Reduce Strategy ā "Summarize in Pieces, Then Combine"
How it works: This method breaks the text into chunks, summarizes each chunk separately (the Map phase), then combines those short summaries into one final summary (the Reduce phase).
When to use:
- You have many long or unrelated documents.
- You need to process data in parallel for speed or scale.
š§ Example: Company Meeting Transcripts
You have 3 meeting transcripts, each too long for a single LLM prompt. We'll summarize them using a Map-Reduce approach.
Docs
Doc A ā Marketing Meeting
Today we discussed the new brand campaign launch. The target audience will be Gen Z, and we'll focus on short-form videos for social media. We plan to collaborate with 10 influencers and track engagement rate weekly.
Doc B ā Engineering Sync
The backend migration to PostgreSQL is halfway done. There were minor performance issues with the new API endpoints, but the caching layer improved the average response time by 30%. Next sprint, the team will finalize database indexing and schema optimization.
Doc C ā Sales Update
Sales grew 15% this quarter due to the premium plan promotion. However, churn increased slightly among small customers. Next quarter, we'll experiment with flexible pricing and offer free onboarding support.
š§ Step 1: MAP phase ā each doc ā prompt ā LLM ā partial summary
For each doc, LangChain creates a MAP prompt:
Doc A prompt to LLM:
Summarize the following meeting notes in 1-2 sentences: "Today we discussed the new brand campaign launch. The target audience will be Gen Z, and we'll focus on short-form videos for social media. We plan to collaborate with 10 influencers and track engagement rate weekly."
LLM Output (Map Summary A):
Discussed Gen Z-focused brand campaign with influencer marketing and weekly tracking.
Doc B prompt to LLM:
Summarize the following meeting notes in 1-2 sentences: "The backend migration to PostgreSQL is halfway done. There were minor performance issues with the new API endpoints, but the caching layer improved the average response time by 30%. Next sprint, the team will finalize database indexing and schema optimization."
LLM Output (Map Summary B):
Backend migration halfway done; caching improved speed; next sprint focuses on database optimization.
Doc C prompt to LLM:
Summarize the following meeting notes in 1-2 sentences: "Sales grew 15% this quarter due to the premium plan promotion. However, churn increased slightly among small customers. Next quarter, we'll experiment with flexible pricing and offer free onboarding support."
LLM Output (Map Summary C):
Sales up 15% from premium promo, churn increased; next quarter focuses on flexible pricing and onboarding.
š§ Each document is processed independently, so the LLM never hits token limits.
š§© Step 2: REDUCE phase ā aggregate ā prompt ā LLM ā final summary
LangChain then combines the partial summaries and creates a REDUCE prompt:
Combine these summaries into a concise, high-level weekly company update: Summary A: Discussed Gen Z-focused brand campaign with influencer marketing and weekly tracking. Summary B: Backend migration halfway done; caching improved speed; next sprint focuses on database optimization. Summary C: Sales up 15% from premium promo, churn increased; next quarter focuses on flexible pricing and onboarding.
LLM Output (Final Summary):
The company made progress across departments: Marketing is preparing a Gen Z campaign with influencers, Engineering improved backend performance and plans optimization, and Sales saw growth but aims to reduce churn with new pricing strategies.
ā Works fast and scales well. ā ļø May lose some relationships between documents if they depend on each other.
š 3. Refine Strategy ā "Build Summary Step by Step"
How it works: This method processes documents in sequence. It starts with a summary of the first doc, then refines or updates that summary each time it reads a new document.
When to use:
- Documents are related or chronological (e.g., project updates, meeting minutes, chapters).
- You want a cohesive, context-aware summary.
š§ Example: SmartDesk Project
Refine is a sequential summarization method.
Instead of summarizing all documents independently (like Map-Reduce), it:
- Summarizes the first document,
- Then refines or updates that summary as it processes each subsequent document.
š Step 1 ā Start with Doc A (Product Planning)
Doc A
The SmartDesk project aims to create a height-adjustable desk with built-in wireless charging. The design team proposed a sleek aluminum frame and minimal control buttons. The target launch is Q2 next year.
š§ Initial Summary:
The SmartDesk project plans a height-adjustable desk featuring wireless charging, a minimalist aluminum design, and a Q2 launch next year.
ā This becomes our base summary.
š Step 2 ā Process Doc B (Engineering Report)
Doc B
Engineering validated the prototype but found that the wireless charger overheats after 30 minutes. They are testing heat dissipation materials to solve this. The aluminum frame is performing well in durability tests.
š Prompt to LLM:
"Here's the current summary:
- The SmartDesk project plans a height-adjustable desk featuring wireless charging, a minimalist aluminum design, and a Q2 launch next year.
Read the following new document and refine the summary with any new or updated information: [Doc B text]"
š§ Refined Summary:
The SmartDesk project aims to launch a height-adjustable aluminum desk with wireless charging in Q2 next year. Engineering validated the prototype but found overheating in the wireless charger. They are testing solutions to address this issue. The aluminum frame passed durability tests.
ā The new summary now adds technical updates and keeps all prior context.
š Step 3 ā Process Doc C (Marketing Plan)
Doc C
Marketing will highlight the desk's wireless charging and sustainability features. They are waiting for confirmation on the heat issue before producing video ads. The campaign will begin one month before the official launch.
š Prompt to LLM:
"Here's the current summary:
- The SmartDesk project aims to launch a height-adjustable aluminum desk with wireless charging in Q2 next year. Engineering validated the prototype but found overheating in the wireless charger. They are testing solutions to address this issue. The aluminum frame passed durability tests.
Read the following new document and refine the summary with any new or updated information: [Doc C text]"
š§ Final Refined Summary:
The SmartDesk project plans to launch a height-adjustable aluminum desk with wireless charging in Q2 next year. Engineering is addressing an overheating issue in the wireless charger. Marketing intends to emphasize the charging and sustainability features but will delay campaigns until the issue is resolved. The campaign is scheduled to start one month before launch.
ā Maintains full context between documents ā ļø Slower and more token-intensive than Map-Reduce
š§ Summary Table
| Strategy | How It Works | Best For | Strengths | Weaknesses | 
|---|---|---|---|---|
| Stuff | Put all docs in one prompt | Small total text | Simple, fast | Breaks if too long | 
| Map-Reduce | Summarize chunks separately, then merge | Many or unrelated docs | Scalable, parallel | May lose relationships | 
| Refine | Process docs sequentially, update summary | Related or ordered docs | Keeps full context | Slower, more tokens | 
š Quick Analogy
| Strategy | Analogy | 
|---|---|
| Stuff | Reading all notes at once, then writing a summary. | 
| Map-Reduce | Each teammate summarizes their section, then you summarize all their summaries. | 
| Refine | Reading notes one by one, improving your summary as you go. | 
š§© TL;DR
- Stuff ā Simple but limited by token size.
- Map-Reduce ā Great for many independent documents.
- Refine ā Best for related or sequential information where context matters.

