Gisting compresses prompts by 75% to cut LLM costs while preserving behavior
morgymcg · x · 2026-08-22
The post introduces "Gisting," a technique that finds a set of tokens eliciting the same behavior as a full System Prompt. This method can reduce prompt size to 25%, significantly increasing throughput and lowering costs.
Shopify Engineering Implementation:
- Compression: Shopify compressed its GraphQL agent's system prompt from 6,000 to 1,500 gist tokens (4:1 ratio) without losing prediction quality.
- Performance Gains: At 350 RPM, median TTFT dropped from 438ms to 354ms, end-to-end latency from 6.8s to 4.2s, and QPS rose from 20.2 to 23.4.
- Mechanism: Special token embeddings are learned via knowledge distillation and swapped in at inference time to mimic the full prompt while model weights remain frozen.
- Resource Savings: The increased throughput allowed for a reduction in allocated GPUs for the agent's traffic.
Related event: Gisting Compresses Prompts to Cut LLM Costs by 75%(3 posts)→
More from Infra
- Running a 35B MoE LLM on 8GB VRAM: tuning llama.cpp to 1,232 tok/s prefill — Decent_Bug3349 · 2026-12-04
- Gemini team starts migrating off Cloudflare to Amazon CloudFront after CEO controversy — StefanoGogioso · 2026-12-04
- 'France is irrelevant' sparks tech brawl: nuclear recycling and silicon photonics say otherwise — JFPuget · 2026-12-04
- Infere launches OpenAI-compatible LLM gateway unifying five model providers — ptkvsk00 · 2026-12-04
- QVAC defaults to Qwen3.5 9B locally, with a one-line check for what your machine can run — alex_verem · 2026-12-04
- Qwen4 local inference megathread: share your t/s speeds, quant and VRAM configs — Fancy-Snow7 · 2026-12-04