Gisting: Compressing LLM Agent context to ↑ throughput and ↓ cost
Shopify compressed the ~6,000-token system prompt of its Sidekick GraphQL agent into ~1,500 learned gist tokens (4:1) without losing prediction quality. The gist embeddings are trained by knowledge distillation (KL divergence between full-prompt teacher logits and gist-prompt student logits) with model weights frozen, then written into the embedding matrix so serving needs no special path. Gisting complements prefix caching because decode still streams the whole KV cache per generated token. At 350 RPM, median TTFT fell 19%, end-to-end latency about 38%, and throughput rose 16%, allowing 14% fewer GPUs. Key recipe findings from an autoresearch loop: initialize gists from mean prompt-chunk embeddings, batch-level loss normalization, and precomputed teacher logits cutting training from 30 to 6 hours.
Related posts
- Sidekick's continual learning loop
Shopify Engineering hardMasterShopify's Sidekick GraphQL agent improves daily through a continual learning loop that turns production failures into model weight updates, beating frontier-model quality while cutting estimated serving costs from about $27M to $1M per year (96%). The loop starts with a rubric validated by inter-annotator agreement (Cohen's kappa) and an LLM judge calibrated with DSPy using GEPA and ACE, then backtested against past A/B tests and degradation tests. An autoresearch agent tunes prompts, tools and harness code against the judge. Hard negatives from production are then repaired by a panel of frontier critics via hinting and replay, and the repaired trajectories train a smaller model through chain-of-thought SFT followed by GRPO with the judge as reward. Gist-token compression shrinks the ~6,000-token system prompt to ~1,500 tokens, cutting end-to-end latency about 38% and GPU needs about 14%.
- How GPT-5.6 fuses frontier intelligence with frontier efficiency
OpenAI easyNovice
GPT-5.6's cost efficiency comes from optimizations across inference and the agentic harness, many of them landed by GPT-5.6 Sol running in Codex. On the inference side, Sol tuned load-balancing heuristics, rewrote production Triton/Gluon kernels (validated with the FpSan floating-point sanitizer) for a 20% cut in end-to-end serving cost, improved its own speculative-decoding draft model for over 15% better token-generation efficiency, and searched workload-specific batching, sharding and KV-cache configurations. The Rust agent harness reduces repeated work by deferring tool and MCP discovery, capping tool output at 10,000 tokens by default, and keeping model-visible history append-only with deterministic tool ordering so prompt-cache prefixes stay intact.
- Speeding up language models for travel applications
Amazon Science mediumAdeptCombining knowledge distillation with Medusa multi-token decoding let Booking.com replace large LLMs with a 1.1B-parameter TinyLlama student that matches a Llama-3.1 70B teacher while running 10 to 20 times as fast. The student is trained on human-labeled data plus teacher-generated labels, with Medusa heads attached and trained in the same stage. Distillation closed over 90% of the quality gap and gave roughly a 6x speedup. Medusa added another 2 to 3.6x, and the single-stage Medusa-2 variant was preferred for its simpler production pipeline. Across trip planning, smart filters and listing description generation, results included 15x faster p99 responses and descriptions at under one-third the cost of GPT-4.
- Making Knowledge Distillation Cheap Enough to Run at Scale
Hugging Face hardMasterTwo systems changes make LLM knowledge distillation far cheaper: caching the teacher's top-100 logits offline so the teacher never shares memory with the student, and a fused chunked KL loss that folds the output projection into the loss and recomputes chunks in the backward pass, so the full vocabulary × sequence logits grid is never materialized. On a single H200 at 8K context, offline top-100 distillation matches online training loss while cutting peak memory from 102.8 GB to 58.3 GB. In an isolated loss benchmark at 32K tokens, peak memory drops 15.6× (85.2 to 5.45 GiB), and distilling GPT-OSS 20B at 32K context shrank from four nodes to one with about 5× faster steps. The tradeoff is a repeated output projection that costs some speed at short contexts; the implementation is open-sourced.
- How we make AI coding more cost efficient without sacrificing task quality
GitHub Engineering mediumAdeptGitHub Copilot cut agent costs by optimizing for whole-task outcomes rather than per-tool-call token counts, after finding that aggressive shell-output compression (RTK) made agents reread or rerun commands and raised end-to-end cost. Four changes were validated with offline benchmarks and online A/B tests. They were selective output compression that preserves source-like output such as git diff and keeps a recovery path (5.5%), removing line-number prefixes from the view tool (3.1%), a meta-prompted task-tool prompt saving about 1,300 tokens per turn (2.9%), and batching background-task completion results to avoid retrieval turns (2.3%). The prompt rewrite initially serialized parallel agents, which shows that prompt behaviour needs regression tests and that savings must be measured in each workflow where a change ships.