2026-11-12
Idle Compression in Agent Harnesses
2026-11-12 ~ 2026-11-12

TL;DR

  • The Problem: Coding agents easily accumulate 200K–300K tokens of tool outputs. Prompt caching keeps active turns cheap and fast, but provider caches expire after a short Time-To-Live (typically 5 minutes). Stepping away for coffee causes a cold-cache prefill on your next message—spiking latency and costing up to $10\times$ more.
  • The Solution: TTL-Aware Idle Compression starts a background countdown after each turn (e.g., at ~4.5 minutes). Right before the cache expires, the harness appends a summarization prompt to the existing conversation—reusing the still-warm KV cache (~95% cache hit)—and shrinks the bloated history down to a lean ~19K-token context.
  • Zero Disruption: It runs speculatively during human think-time. If you start typing while compression is mid-flight, the harness immediately aborts the background job and preserves your active flow with zero blocking latency.
  • The Trade-off: Compaction is lossy and speculative. Summarizing drops verbatim details (potentially forcing file re-reads), and compacting an abandoned terminal tab burns output tokens on a session that never resumes—making its ROI sensitive to cache pricing cliffs and session resume rates.

The blog is co-authored with Gemini Carbon.

2026-11-12
The Bitter Lesson of BF16 Master Weights: How Small-LR RL Silently Eats Your Updates
2026-11-12 ~ 2026-11-12

TL;DR

  • The Trap: Storing master weights in bfloat16 during small-learning-rate RL (lr = 5e-7) silently freezes most of the model. For a typical weight $|w| \approx 0.02$, the smallest step bf16 can resolve (half-ULP) is $6.10 \times 10^{-5}$—over $120\times$ larger than a 5e-7 Adam update. Every step rounds straight back to the original value.
  • Why It Goes Unnoticed: Training does not crash or flatline. Tiny-magnitude weights ($|w| \le 10^{-4}$) and near-zero biases have much smaller ULPs and do update—causing reward and easier benchmarks (GSM8K: 35.25% → 57.01%) to climb slowly while harder reasoning (MATH500: 35.01% → 35.01%) stays frozen at the exact untrained baseline.
  • The Fix: Restoring standard fp32 master weights (keeping bf16 forward/backward compute) beat 929 steps of bf16 training by Step 100, finishing +7.2 points higher on MATH500 (42.25%) and +21.3 points higher on GSM8K (78.32%), at the cost of ~7 GB/GPU extra memory and +20% step time.

The blog is co-authored with Gemini Carbon.

2026-10-19
Understanding TPM, RPM, TPS, and TTFT in LLM APIs
2026-10-19 ~ 2026-10-19

When working with Large Language Model (LLM) APIs, several metrics are commonly used to describe rate limits, throughput, and latency.

Understanding these metrics is essential for optimizing API performance, managing costs, and building scalable LLM applications, especially AI agents and large-scale inference systems.

1. Key Metrics at a Glance

MetricFull NameMeaning
TPMTokens Per MinuteMaximum tokens processed per minute
RPMRequests Per MinuteMaximum API requests per minute
TPSTokens Per SecondTypically, token generation speed or throughput
TTFTTime to First TokenLatency before the first output token arrives

These metrics describe different aspects of LLM API performance.

2026-10-15
ChatGPT Chat, Work, and Dot
2026-10-15 ~ 2026-10-23

The blog is generated by ChatGPT.

OpenAI’s ChatGPT has evolved beyond a conversational AI assistant. It now offers three distinct experiences: Chat, Work, and Dot, each designed for a different way of interacting with AI.

At a high level:

  • Chat: Think with AI.
  • Work: Delegate tasks to AI.
  • Dot: Pursue long-term goals with AI.

These experiences illustrate a broader evolution in AI systems: from answering questions, to executing tasks, to pursuing ongoing objectives.

1. Chat vs. Work vs. Dot — At a Glance

DimensionChatWorkDot
Primary roleAI assistantTask-execution agentPersistent agent
Main objectiveAnswer and assistComplete delegated tasksAdvance ongoing goals
Interaction styleConversationalTask-orientedGoal-oriented
ReasoningYesYesYes
Tool useSupportedSupportedSupported
Computer useNot its primary interfaceCloud/local computerDedicated cloud computer
MemoryChatGPT MemoryProject/task contextPersistent, evolving memory
Background executionThrough supported tasksYesYes
Scheduled executionSupportedSupportedSupported
Proactive behaviorLimited, task-dependentPrimarily instructed or scheduledCore design goal
Typical outcomeAnswers and insightsFinished deliverablesOngoing progress

These distinctions are conceptual rather than absolute. Chat can perform sophisticated research, Work can execute recurring tasks, and Dot can answer ordinary questions.

2026-05-07
Cache Hits in LLMs
2026-05-07 ~ 2026-10-15

The note is generated by Gemini.

Overview

In the context of Large Language Models (LLMs), a Cache Hit occurs when the inference engine identifies that specific data (tokens, KV pairs, or full responses) from a previous request is already stored in memory.


🚀 Key Types of Cache Hits

1. KV (Key-Value) Cache Hit

  • Level: Inference Engine (e.g., vLLM, TensorRT-LLM).
  • Mechanism: During the “Prefill” stage, the model stores the Key and Value tensors of the attention mechanism.
  • The Hit: Reuses stored tensors for identical prefixes.
  • Result: Drastically reduces Time to First Token (TTFT).

2. Semantic Cache Hit

  • Level: Application Layer.
  • Mechanism: Uses Vector Embeddings to compare queries.
  • The Hit: Returns a saved answer if the meaning is the same.
  • Result: Zero GPU cost and near-zero latency.

📊 Comparison Table

MetricCache HitCache Miss
ComputationLow (Retrieval)High (Full Forward Pass)
LatencyMillisecondsSeconds
CostNegligibleFull Token Usage

Tip

Maximizing your Cache Hit Ratio is the most effective way to scale LLM apps.