Cactus Post-Trains Gemma 4 to Know When It's Wrong — Cuts Cloud Queries by Up to 85%
Cactus, a startup founded by Henry and Roman, has post-trained Google's Gemma 4 E2B to attach a confidence score (0–1) to every response. When confidence is high, the on-device model answers; when low, the query is routed to Gemini 3.1 Flash-Lite in the cloud. By sending only 15–55% of queries to the cloud depending on the benchmark (ChartQA, MMLU-Pro, MMBench), the hybrid system matches cloud-only performance at a fraction of the cost.
Full text
Hey HN, Henry & Roman here from Cactus. A small, on-device model is fast and private, but sometimes wrong, but frontier models are getting expensive pretty fast. So, we post-trained Gemma 4 E2B post-trained to know when it's wrong. Every response comes with a confidence score between 0 and 1. Developers can accept the on-device when it's high, hand off to a bigger cloud model when it's low. By routing only 15-35% of queries to Gemini 3.1 Flash-Lite, Gemma-4-E2B matches Gemini 3.1 Flash-Lite on most benchmarks. - ChartQA: 15-20% - LibriSpeech: 25-30% - MMBench, GigaSpeech, MMAU: 30-35% - MMLU-Pro: 45-55% We were always frustrated by the routing signals hybrid apps rely on: asking the model to rate itself in text (unreliable, and you're parsing prose), or token entropy heuristics (barely better than a coin flip in our tests). So we did mechanistic studies on small models, Gemma 4 particularly, and found the hidden state for different layers carry meaningful self-awareness signal for various situations. SO we extended the model with a 68k params probe layer (LayerNorm, low-rank projection, attention pooling, small MLP head) reads one intermediate layer during decoding and predicts p(wrong); confidence = 1 - p(wrong), returned as structured data, never parsed out of the answer text. Across 12 hold-out benchmarks spanning text, vision and audio, the probe averages 0.814 AUROC vs 0.549 for token entropy. The result that convinced us this is real: the probe was trained on zero audio data, yet scores 0.79-0.88 AUROC on four audio benchmarks where entropy is near-random or worse (0.32-0.52). It's reading a modality-independent correctness signal from the hidden state, not memorizing patterns from its training data. We published all weights on HuggingFace and provide copy-pase codes to run it on Transformers, MLX, Llama.cpp or Cactus. With Ollama, vLLM, SGLang etc in the works. For llama.cpp we ship a patch series you compile in once (upstreaming is planned). The code is MIT licensed; Gemma model use remains subject to the Gemma terms. GitHub: https://github.com/cactus-compute/cactus-hybrid Weights: https://huggingface.co/collections/Cactus-Compute/cactus-hyb... Some caveats: - The probe scores single-sequence decoding only, up to the first 1024 generated tokens. - Handoff works best when routing per task in a multi-step process, not per step. - Hierarchical routing is still in the works: try on-device, then DeepSeek v4 Flash, before Fable/GPT5.5/Gemini/Muse/Grok. - The technique is boutique for each model, we will share each weights as they roll out. These issues are currently being tackled at Cactus and updated weights will be shipped directly into the HuggingFace collection and GitHub repository straight up. Please let us know your thoughts, it helps us find ways to improve the design progressively. Thanks a million!
Comments URL: https://news.ycombinator.com/item?id=49010782
Points: 21
# Comments: 4
💻 Technology
Google Launches Gemini 2.5 Flash, Flash-Lite and Flash Cyber AI Models
Gizmodo · 2d ago
💻 Technology
GPT-4.5, Claude, Gemini and Grok attempt to draw the Mona Lisa
Hacker News · 2d ago
💻 Technology
Google releases three new Gemini models, but 3.5 Pro still missing
CNET · 3d ago
💻 Technology
There is no single best AI model – each excels at different tasks
TechRadar · 14d ago
💻 Technology
Claude Opus 5 Beats Claude 4 on Most Benchmarks at Half the Price
Decrypt · 34min ago
Will hybrid on-device/cloud AI models replace fully cloud-based solutions?
Comments
No comments yet
Comments
No comments yet — be the first to weigh in 👇
No comments yet. Be the first!