Part 3 · From Working Demo to Useful Product

Local Compression vs LLM Compression

Zero-cost fast-but-rough vs paid slow-but-precise — when to use which

THE QUESTION THIS PAGE ANSWERS

ANSWER FIRST

What is the key idea behind “Local Compression vs LLM Compression”?

Zero-cost fast-but-rough vs paid slow-but-precise — when to use which

DECISION RULE

Make the claim earn its place. Use this page as a decision aid, not a definition to memorize. Connect the idea to one real task, one observable result, and one failure that would change your mind.

TRY NEXT

Write one question you could answer with evidence after trying this idea.

WATCH FOR

A conclusion that sounds complete but leaves the key assumption untested.

Comparison of the Two Approaches
Dimension Local Compression LLM Compression
MechanismRegex matching, character truncation, template replacementHave another LLM read and write a summary
CostZero (pure local compute)Costs money (one API call)
Latency<1ms1–5 seconds
QualityCrude; may drop key informationPrecise; preserves core semantics
Best forTool output, JSON results, repetitive contentMulti-turn conversation summaries, complex context distillation
Case Study: Two Ways to Compress the Same Conversation
本地压缩
Original conversation (10 turns · 4,200 tokens):
User: Find me high-speed trains from Beijing to Shanghai
AI: Sure, searching for you… (200-word detailed reply)
[Tool] 12306 results: G1 07:00–11:28 ¥553, G3 08:00–12:35 ¥553, G7 09:00–13:28 ¥553… (15 results total, 800 words)
AI: Found 15 trains, recommending G1… (300-word analysis)
User: G1 looks good, check if there's a business class seat
[Tool] Seat query result: {JSON data, 500 words}
AI: G1 business class: 3 seats available, ¥1,748… (200 words)
User: OK, business class it is. Also search hotels
[Tool] Hotel search results… (600 words)
AI: Recommending Pudong Shangri-La… (400 words)
User: Book that hotel and make me a travel checklist
Compressed result
Click the button above to see
LLM 压缩
Original conversation (10 turns · 4,200 tokens):
(Same original conversation as on the left)
Compressed result
Click the button above to see
The Right Order: Free Methods First, Then Paid
Recommended Context Compression Pipeline
1
Local Truncation
Drop tool output
Truncate long JSON
2
Template Replacement
Replace repetitive
structures with placeholders
3
Check if Enough
Still over the window?
Proceed to next step
4
LLM Summarization
Pay AI to
refine the context
Compress as much as possible with free methods first; only pay for AI help when you've exhausted local options — that order cannot be reversed. Local compression and LLM compression are sequential stages in a pipeline, not an either-or choice.

How “Comparison of the Two Approaches” changes an answer

“Zero-cost fast-but-rough vs paid slow-but-precise — when to use which” shows that a model does not process the “word count” we see. It processes Token pieces. Tokenization affects input length, how much context fits, and how much computation a request consumes.

Length, information, and context are different

As “Zero-cost fast-but-rough vs paid slow-but-precise — when to use which” grows, separate three questions: how many Tokens the text becomes, which pieces can change the current decision, and whether older material has fallen outside the context window. Removing repetition is often more useful than simply making the window larger.

Keep what can change the decision

Use “Zero-cost fast-but-rough vs paid slow-but-precise — when to use which” as an A/B test: keep the same question while removing repeated background, compressing format, and trimming irrelevant history. Compare answer quality, latency, and Token count.

From “Comparison of the Two Approaches” to “Case Study: Two Ways to Compress the Same Conversation”

“Comparison of the Two Approaches” grounds the problem in “Dimension Local Compression LLM Compression Mechanism Regex matching, character truncation, template replacement Have another LLM read and write a summary Cost Zero (pure local compute) Costs money (one API cal…”. “Case Study: Two Ways to Compress the Same Conversation” then moves it toward “Run Comparison Demo 本地压缩 Original conversation (10 turns · 4,200 tokens): User: Find me high-speed trains from Beijing to Shanghai AI: Sure, searching for you… (200-word detailed reply) [Tool] 12306 results: G1…”. Together, they show that the lesson is not just a conclusion to remember, but a claim with conditions.

Carry the judgment into the next situation

For long text, keep what can change the conclusion before compressing format and history. A larger context is worth its cost only when the added information is useful.

  • “Comparison of the Two Approaches”: Dimension Local Compression LLM Compression Mechanism Regex matching, character truncation, template replacement Have another LLM read and write a summary Cost Zero (pure local compute) Costs money (one API cal…
  • “Case Study: Two Ways to Compress the Same Conversation”: Run Comparison Demo 本地压缩 Original conversation (10 turns · 4,200 tokens): User: Find me high-speed trains from Beijing to Shanghai AI: Sure, searching for you… (200-word detailed reply) [Tool] 12306 results: G1…
  • “The Right Order: Free Methods First, Then Paid”: Recommended Context Compression Pipeline 1 Local Truncation Drop tool output Truncate long JSON → 2 Template Replacement Replace repetitive structures with placeholders → 3 Check if Enough Still over the window…

The final “The Right Order: Free Methods First, Then Paid” brings the discussion to “Recommended Context Compression Pipeline 1 Local Truncation Drop tool output Truncate long JSON → 2 Template Replacement Replace repetitive structures with placeholders → 3 Check if Enough Still over the window…”. The useful thing to carry forward is knowing which judgments must be revisited when input, scale, or risk changes.

Mark as learned Your reading progress updates automatically
← PreviousNext →

Keep reading

The next useful article in the thread.

ARTICLE DISCUSSION

Leave one useful thought here.

Keep the idea that clicked, the question that stayed open, or a small note for the next learner.

Discussing Local Compression vs LLM Compression From Working Demo to Useful Product
3discussionsArticle discussion · synced with the Circle
View in the learning circle
AM
Asha MorganContent editor
INSIGHTField note

I turned one judgment from this article into a small experiment I could run today. Knowing what to observe next is more useful than simply remembering the conclusion.

ARTICLE DISCUSSION7 helpful
LH
Lin HarperIndie developer
INSIGHTInsight

After reading this, I first looked for the conditions behind the idea instead of copying the method into a project. That order made the later trade-offs much clearer.

ARTICLE DISCUSSION5 helpful
KM
Kiki MooreProduct operations
QUESTIONQuestion

When this judgment reaches real work, which constraint should be added first? I am curious which step matters most between reading and the first practical attempt.

ARTICLE DISCUSSION4 helpful