Part 2 · The Harness Around the Model

Recap (Part B) · Cost Optimization + PM Perspective

Five-layer cost system / KV Cache principles / image Tokens / full course capability checklist

THE QUESTION THIS PAGE ANSWERS

ANSWER FIRST

What is the key idea behind “Recap (Part B) · Cost Optimization + PM Perspective”?

Five-layer cost system / KV Cache principles / image Tokens / full course capability checklist

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.

Part 3 · Cost Optimization
💰
III. Five-Layer Cost Optimization System
Combined use can reduce Token costs by 70–90%
Model Routing Use lightweight models for simple tasks (classification, extraction); reserve flagship models for complex reasoning Save 60-80%
Syntax Layer YAML instead of JSON (save 15-30%), CSV instead of arrays (save 40%+), remove Markdown decoration Save 15-40%
Semantic Layer Dynamic Few-Shot vector matching (save 87%), LLMLingua-2 compression for long documents (save 60%), place key info at beginning/end Save 60-87%
Output Layer Negative constraints (precise elimination of filler), Diff editing (output only changes), Stop Sequence (timely cutoff) Save 20-50%
KV Cache Fixed System Prompt prefix → high cache hit rate; avoid dynamic timestamps (different every time = always MISS) Save 30-60%
❌ Dynamic Timestamp
Different prefix every time
System Prompt contains "current time: {time}", prefix changes every request → KV Cache always MISS
✅ Static Prefix
Prefix unchanged, cache stable
Put time in user message, not system; keep System Prompt fixed → continuous HIT
Part 4 · AI PM Integrated Perspective
🎯
IV. AI PM Integrated Perspective
From fundamentals to engineering — a complete perspective
🖼️
Image Token Cost
Resolution ≠ quality. 512px is sufficient for coarse classification; use 1K–2K for OCR; reserve 4K for high-precision detection. Task-matched resolution can reduce image costs by 60–90%.
🛡️
Prompt Security
4 attack types: privilege injection / role escape / Few-Shot poisoning / symbol injection. 4 defense layers: input filtering + permission tiering + output validation + audit logging.
📊
Multi-Turn Conversation Cost
Carrying the full history into every turn → exponential cost growth. Active context compression and a history management strategy are essential.
🔄
Streaming Output
Markdown and XML are streaming-friendly; JSON/YAML require waiting for the complete response before parsing. Format choice affects user experience and engineering complexity.
The Ultimate Conclusion of Both Chapters
The essence of an AI Harness is carefully designing every Message. From context management to cost optimization, everything comes down to designing the Message List sent to the model.
Capabilities You Have Mastered
Understand LLM Principles Identify & Mitigate Hallucinations Design Prompts Evaluate Output Formats Plan Agent Architecture Systematically Reduce Costs Defend Against Prompt Attacks
Chapter 2 Complete · Congratulations on Finishing the AI Harness Curriculum · From foundational understanding to engineering implementation, you now have the core perspective of an AI PM.

Why “Part 3 · Cost Optimization” can find relevant content

“Five-layer cost system / KV Cache principles / image Tokens / full course capability checklist” moves retrieval beyond storing material: the real question is how to find what is relevant. That decision shapes the input quality of RAG, recommendation, and image-search systems.

Similarity is not the answer

In the flow described by “Five-layer cost system / KV Cache principles / image Tokens / full course capability checklist”, embeddings place items in a comparable semantic space and a neighbor index narrows the search. The final answer still depends on whether the retrieved chunks cover the question, whether the distance metric fits, and whether the evidence is current.

Separate findable from relevant

Turn “Five-layer cost system / KV Cache principles / image Tokens / full course capability checklist” into a small test: prepare queries with known answers, record relevance, misses, and distractors, then decide whether chunking, the index, or reranking needs to change.

From “Part 3 · Cost Optimization” to “Part 4 · AI PM Integrated Perspective”

“Part 3 · Cost Optimization” grounds the problem in “💰 III. Five-Layer Cost Optimization System Combined use can reduce Token costs by 70–90% Model Routing Use lightweight models for simple tasks (classification, extraction); reserve flagship models for complex…”. “Part 4 · AI PM Integrated Perspective” then moves it toward “🎯 IV. AI PM Integrated Perspective From fundamentals to engineering — a complete perspective 🖼️ Image Token Cost Resolution ≠ quality. 512px is sufficient for coarse classification; use 1K–2K for OCR; reserve…”. 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

The same logic applies to retrieval: define what counts as relevant, check whether recall covers the question, and then inspect whether ranking, chunking, or freshness pushed useful evidence out.

  • “Part 3 · Cost Optimization”: 💰 III. Five-Layer Cost Optimization System Combined use can reduce Token costs by 70–90% Model Routing Use lightweight models for simple tasks (classification, extraction); reserve flagship models for complex…
  • “Part 4 · AI PM Integrated Perspective”: 🎯 IV. AI PM Integrated Perspective From fundamentals to engineering — a complete perspective 🖼️ Image Token Cost Resolution ≠ quality. 512px is sufficient for coarse classification; use 1K–2K for OCR; reserve…

The final “Finish by testing the claim” brings the discussion to “Five-layer cost system / KV Cache principles / image Tokens / full course capability checklist”. 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 Recap (Part B) · Cost Optimization + PM Perspective The Harness Around the Model
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