Peta1: Gemma 4 E4B Tree-of-Reasoning & Verifiable Outcome GRPO
Peta1 is an autonomous software engineering agent checkpoint based on google/gemma-4-E4B-it (4.3B active parameters), post-trained using a targeted three-stage curriculum:
- Tree-of-Reasoning (ToR) SFT: Supervised deliberation in Gemma 4's native latent thinking tokens (
<|channel|>thought) enforcing hypothesis formulation, environment simulation, and branch pruning.
- Capability Frontier Discovery: Screening of candidate tasks (G = 4, T = 0.7) to isolate the 18% informative frontier band (0 < p < 1.0), preventing policy gradient collapse from trivial (36%) and impossible (46%) tasks.
- Verifiable Outcome GRPO: Policy gradient optimization with verifiable rewards (R_target + R_format + R_tor - lambda * length) and Group Relative Advantage estimation driven entirely on Dual Tesla T4 GPUs.
Benchmark Results
1. Full Official SWE-bench Lite (n = 300)
Evaluated on the full official test split of princeton-nlp/SWE-bench_Lite:
| Checkpoint |
Solved / Total |
Resolution Rate |
95% Wilson CI |
| Base Gemma 4 E4B |
25 / 300 |
8.33% |
[5.71%, 12.01%] |
| Peta1 (Stage 3 ToR GRPO) |
101 / 300 |
33.67% |
[28.56%, 39.19%] |
| Absolute Gain (Delta) |
+76 tasks |
+25.33pp |
p = 5.23e-22 |
Paired Contingency Table (n = 300):
- Mutual Failure: 198
- Mutual Success: 24
- Solved ONLY by Peta1: 77 tasks
- Regressions (Solved ONLY by Base): 1 task
- Two-tailed exact McNemar test: chi^2 = 72.12, p = 5.23 × 10^-22.
2. The Navigation vs. Comprehension Dissociation
In a controlled 2-turn agentic evaluation across 20 repository tasks:
- Turn 1 (Autonomous Tool Navigation): Base Gemma 4 achieves 0.0% (0/20), while Peta1 achieves 25.0% (5/20) (+25.0pp gain).
- Turn 2 (Grounded Code Comprehension): When grounded file context is provided, both Base and Peta1 achieve 100.0% (20/20) resolution.
- This proves compact models possess strong latent code comprehension; post-training specifically cures exploration failure and tool navigation.
Quickstart
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "manojpanda/peta1"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype=torch.float16,
device_map="auto"
)
messages = [
{"role": "user", "content": "Locate the bug in flask/wrappers.py where JSON decoding does not respect request encoding."}
]
prompt = tokenizer.apply_chat_template(messages, add_generation_prompt=True, tokenize=False)
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
with torch.no_grad():
outputs = model.generate(**inputs, max_new_tokens=512, do_sample=False)
print(tokenizer.decode(outputs[0][inputs.input_ids.shape[1]:], skip_special_tokens=False))
Hardware & Training Details
- Hardware: 2x NVIDIA Tesla T4 (15 GiB VRAM each, Kaggle Free Tier)
- Precision: Full FP16 (zero quantization loss)
- Parameters: 4.3B active parameters
- License: Apache 2.0