Instructions to use Firworks/gemma-decide-e4b-v1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Laya
How to use Firworks/gemma-decide-e4b-v1 with Laya:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
Gemma Decide E4B v1
Gemma Decide E4B v1 is the single-24GB-GPU production workhorse of the Gemma Decide multimodal System 1 decision model family, adapted from google/gemma-4-E4B-it to answer multiple structured decision questions (noul, choice, score) over text, JSON, or image states in a single non-autoregressive forward pass with calibrated probabilities β compatible with the Jev and Laya decision schema.
- Code, server, & training/eval repo: github.com/firworksyt/gemma-decide
- Gemma Decide v1 Family:
Firworks/gemma-decide-e2b-v1(10.32 GBbf16, lightweight edge / co-located sidecar)Firworks/gemma-decide-e4b-v1(this model β16.14 GBbf16, single-24GB-GPU production workhorse)Firworks/gemma-decide-26b-a4b-v1(51.91 GBbf16, 4B active MoE β multimodal & knowledge-heavy flagship)
License notice: The
gemma-decidecodebase is licensed under Apache-2.0. Thesev1preview weights are released under CC-BY-NC-4.0 (research / non-commercial) because the v1 training mix includes public research/non-commercial and copyleft benchmark train splits (listed transparently below). The derived training dataset is not redistributed. A clean synthetic/permissive-only Apache-2.0v2release is planned.
Key Highlights
- Single-24GB-GPU sweet spot (
16.14 GBmergedbf16): Fits comfortably inbf16on a single RTX 4090 / RTX 3090 / L4 with room to spare β delivering 24β38 ms text and 45 ms multimodal latency even beforetorch.compile. - Ties 26B-A4B on multi-question agent states with the tightest calibration: Hits
69.1%on2,000unseentyped_decisionsquestions (+6.6 ptsover E2B) with0.100ECE,0.198Brier,8.3%option-order flip rate, and88.1%accuracy at>=0.90confidence. - Rock-solid order invariance & guardrails:
0.0%option-order flip rate onmnli(87.8%acc,@0.90: 97.2%@ 71% cov),96.3%onsst2(0.023ECE,@0.80: 98.9%@ 95% cov),83.3%on 77-waybanking77(@0.90: 97.1%@ 61% cov), and0.882Spearman /0.045ECE on 5-level ordinalsst5. - Strong step up in vision & zero-CoT knowledge:
54.8%on unseenmmstar(+6.5 ptsover E2B,45 mseager) and46.5%on unseen 10-waymmlu_pro(+9.5 ptsover E2B,@0.80: 87.2%/@0.90: 93.1%).
Gemma Decide v1 Family Comparison (n <= 400 / 4,400 Questions)
All models trained on the identical 20,997-bundle training split (LocalLLaMA/typed-decisions, Lin-Chen/MMStar, and TIGER-Lab/MMLU-Pro 100% unseen):
| Benchmark (Q's) | E2B v1 (10.3 GB) | E4B v1 (this model, 16.1 GB) | 26B-A4B v1 (51.9 GB, 4B active) |
|---|---|---|---|
| Held-out Val (1,000 bundles) | 0.495 / 85.6% |
0.432 / 87.4% |
0.332 / 90.1% |
typed_decisions (2,000 unseen) |
62.5% (Ο 0.810) |
69.1% *(ECE 0.100)* |
69.1% *(Ο 0.853)* |
sst2 (400, binary noul) |
94.0% (ECE 0.030) |
96.3% (ECE 0.023) |
97.0% *(ECE 0.019)* |
sst5 (400, 5-pt score) |
59.0% (Ο 0.863) |
62.5% *(ECE 0.045)* |
65.3% *(Ο 0.888)* |
mnli (400, 3-way NLI) |
86.0% (flip 2.5%) |
87.8% *(flip 0.0%)* |
91.0% *(ECE 0.028)* |
mmstar (400, unseen vision) |
48.3% (ECE 0.171) |
54.8% (ECE 0.153) |
66.3% *(ECE 0.118)* |
banking77 (400, 77-way) |
82.0% *(ECE 0.031)* |
83.3% (ECE 0.050) |
84.5% *(flip 3.3%)* |
mmlu_pro (400, 10-way 0-CoT) |
37.0% (ECE 0.109) |
46.5% (ECE 0.112) |
59.0% *(ECE 0.057)* |
Architecture
- Tree-Masked Causal Backbone (
google/gemma-4-E4B-it):state(text/JSON/images) occupies positions0 .. L_state - 1.- Every question branch
Q_istarts at logical positionL_stateand attends only tostate+ its own causal prefix (zero cross-question leakage, mathematically verified against sequential forward passes). - Preserves Gemma 4 E4B's KV-shared layers (
logits_to_keep = num_question_tokens), sliding/global attention, Per-Layer Embeddings (PLE), and native multimodal vision tower.
- 2-Layer Bidirectional
DecisionHead(110.77Mparams,hidden_size=2560,ffn_dim=3584,num_heads=8):- Each option line ends with Gemma 4's built-in
<mask>token. - A 2-layer Pre-Norm bidirectional transformer runs over each question branch so all options cross-attend (handling
"Other / None of the above"and minimizing option-order bias) before a 2-layer MLP outputs calibrated option logits.
- Each option line ends with Gemma 4's built-in
- Standalone Merged Checkpoint (
16.14 GB, zero PEFT):- Trained with LoRA (
r=32, alpha=64) on language, PLE, and vision encoder layers + unfrozenembed_visionprojector (88.34Mparams) + fullDecisionHead(110.77Mparams;199.11Mtotal trainable), then folded into base weights viamerge_and_unload()(verifiedmax_prob_diff = 0.00641text /0.00006multimodal).
- Trained with LoRA (
Detailed Benchmarks (n <= 400 / 4,400 Questions, Eager bf16 on RTX PRO 6000 Blackwell)
LocalLLaMA/typed-decisions, multimodal Lin-Chen/MMStar, and TIGER-Lab/MMLU-Pro are 100% unseen during training (zero leakage).
| Benchmark | Q's | Acc | ECE β | Brier β | Spearman / MAE | p50 ms (eager) | @0.80 Conf (Acc / Cov) | @0.90 Conf (Acc / Cov) | Flip Rate (60Q) |
|---|---|---|---|---|---|---|---|---|---|
typed_decisions (100% unseen) |
2,000 | 69.1% | 0.100 | 0.198 | 0.807 / 0.410 | 37.9 | 82.2% (56% cov) | 88.1% (35% cov) | 8.3% |
sst2 (binary noul) |
400 | 96.3% | 0.023 | 0.049 | β | 24.5 | 98.9% (95% cov) | 98.9% (91% cov) | β |
sst5 (5-pt ordinal score) |
400 | 62.5% | 0.045 | 0.501 | 0.882 / 0.470 | 24.4 | 75.0% (13% cov) | 50.0% (0.5% cov) | β |
mnli (3-way NLI choice) |
400 | 87.8% | 0.036 | 0.177 | β | 24.5 | 93.3% (82% cov) | 97.2% (71% cov) | 0.0% |
mmstar (100% unseen vision) |
400 | 54.8% | 0.153 | 0.591 | β | 45.0 | 74.2% (40% cov) | 84.1% (27% cov) | 10.0% |
banking77 (77-way dynamic choice) |
400 | 83.3% | 0.050 | 0.243 | β | 54.5 | 93.6% (74% cov) | 97.1% (61% cov) | 10.0% |
mmlu_pro (100% unseen 10-way, 0-CoT) |
400 | 46.5% | 0.112 | 0.653 | β | 24.8 | 87.2% (29% cov) | 93.1% (22% cov) | 55.0% |
typed_decisions per-primitive accuracy (2,000 unseen questions): choice = 68.3%, noul = 76.2%, score = 64.3% (MAE = 0.410 on 0β4 scale, Spearman = 0.807).
Training Data & Upstream Attributions
Trained on 21,997 bundles (45,319 calibrated questions; 20,997 train / 1,000 held-out validation & calibration; 5,997 multimodal bundles) for 2 epochs (2,625 steps, grad_accum=16, lora_lr=1e-4, head_lr=3e-4, 131.1 min) on 1Γ NVIDIA RTX PRO 6000 Blackwell (96 GB). Soft probability targets were distilled from Gemma 4 31B (google/gemma-4-31B-it, Apache-2.0) using 2-permutation order-debiased logprobs alongside train-split ground-truth anchors.
Upstream sources used (train splits only; strict zero-overlap with all eval sets):
- Synthetic software/agent JSON states generated by Gemma 4 31B across 24 domains Γ 4 tones (Apache-2.0 outputs)
- Conversational states adapted from
wildchat-1m(ODC-BY) andno_robots(CC-BY-NC-4.0), labeled by Gemma 4 31B - Multimodal vision states adapted from
A-OKVQA(research/NC),ChartQA(GPL-3.0),DocumentVQA(research/NC), andScienceQA-IMG(CC-BY-NC-SA-4.0), labeled by Gemma 4 31B - Text ground-truth train anchors:
PolyAI/banking77(CC-BY-4.0),SetFit/sst2&SetFit/sst5,nyu-mll/glue(mnli),google/boolq(CC-BY-SA-3.0),allenai/ai2_arc(CC-BY-SA-4.0),allenai/sciq(CC-BY-NC-3.0)
Usage
Install
uv pip install "gemma-decide[serve] @ git+https://github.com/firworksyt/gemma-decide.git"
# or clone the repo:
# git clone https://github.com/firworksyt/gemma-decide && cd gemma-decide && uv sync --extra serve
Python
import torch
from gemma_decide.model import GemmaDecideModel
from gemma_decide.schema import ChoiceQuestion, DecisionRequest, NoulQuestion, ScoreQuestion
model, processor = GemmaDecideModel.from_checkpoint(
"Firworks/gemma-decide-e4b-v1",
dtype=torch.bfloat16,
device_map="cuda:0",
)
model.compile_for_inference(dynamic=True)
req = DecisionRequest(
state={"ticket": "My debit card was declined twice at the grocery store."},
questions={
"urgent": NoulQuestion(instructions="Requires immediate customer support action."),
"intent": ChoiceQuestion(
instructions="Select the customer intent.",
criteria={
"declined_card_payment": "Card payment was declined",
"lost_or_stolen_card": "Card was lost or stolen",
"card_delivery": "Waiting for card delivery",
},
),
"frustration": ScoreQuestion(
instructions="Rate user frustration level.",
criteria=["Calm", "Mildly annoyed", "Frustrated", "Very angry"],
),
},
)
resp = model.decide(req, processor)
print(resp.model_dump_json(indent=2))
FastAPI Server (/v1/decisions & /v1/systemone)
uv run python scripts/serve.py \
--checkpoint Firworks/gemma-decide-e4b-v1 \
--compile --warmup --host 127.0.0.1 --port 8080
Limitations & Intended Use
- System 1, not System 2: Ideal for single-24GB-GPU production routing, multi-question agent state evaluation, RAG grounding/NLI guardrails, and ordinal rubric scoring β not multi-step math, code synthesis, or complex chain-of-thought reasoning. Pair with a confidence threshold (e.g.,
confidence >= 0.80) to escalate uncertain cases to a frontier LLM, or step up togemma-decide-26b-a4b-v1for heavy multimodal and domain-knowledge triage. - Vision resolution: Trained at a
280soft-token image budget. Fine dense OCR or tiny chart text may still require higher-resolution System-2 VLMs. - Non-commercial v1 weights: Use for research, evaluation, and non-commercial prototypes; await a clean Apache-2.0 v2 checkpoint for commercial production deployments.
- Downloads last month
- -