You need to agree to share your Hugging Face information to access this model

This repository is publicly accessible, but you have to accept the conditions to access its files and content.

Log in or Sign Up to review the conditions and access this model content.

gemma-7b-PDDL-CoT-binary

Gemma-7B trained to solve classical planning problems written in PDDL: SFT, then post-training on its own valid answers (outcome feedback). Given a domain and a problem, it writes a chain of thought that tracks the world state step by step, then a plan.

Part of a set of six models: Llama-3.1-8B and Gemma-7B, each as SFT, SFT + Binary feedback, and SFT + Detailed feedback. They share one dataset and one evaluation protocol.

Results

Test split of final_problems_plans_v2_cot_4levels: 1,901 problems, 10 domains, plain and obfuscated. One greedy answer per problem; a problem counts as solved when the VAL plan validator accepts the [PLAN] block.

All Easy (1–10 steps) Medium (11–20) Hard (21–30) Plain Obfuscated Negative-precondition domains
66.9% (1,272) 80.9% 63.6% 55.8% 70.6% 63.2% 45.8%
blocksworld ferry grippers logistics miconic openstacks pathways satellite spanner termes
59.9 100.0 96.5 40.1 84.0 76.5 38.0 74.6 76.5 23.0

Compared with the SFT model it starts from (1,262 solved): 144 problems newly solved, 134 newly failed, net +10 (paired sign test p = 0.59).

How to use

Prompt. Use the dataset's input column up to and including its [ASSISTANT] tag, followed by a newline. Encode it without special tokens and put the tokenizer's BOS token in front. There is no chat template and no system prompt.

Decoding. Greedy, with prompt and answer together within 16,384 tokens (at most 16,384 new tokens). The reported numbers compute the final logits in fp32 (vLLM's lm_head in fp32). This matters most for Gemma, whose large logits are coarsely quantised in bf16.

Output. A [CHAIN OF THOUGHT]: the initial state and goal, then for each step the action, its preconditions, effects and the state after. Then a [PLAN] block, one action per line. Validate that block with VAL.

Gemma activation. The config leaves hidden_activation unset. Transformers then uses the exact GELU the model was trained with (hidden_act: gelu); vLLM 0.10 would silently use the tanh approximation. With vLLM, pass hf_overrides={"hidden_activation": "gelu"} as below. The context is extended to 16,384 positions (NTK-aware RoPE base 20,109.5, already in the config).

import torch
from datasets import load_from_disk
from transformers import AutoModelForCausalLM, AutoTokenizer

repo = "cosmicishan/gemma-7b-PDDL-CoT-binary"
tok = AutoTokenizer.from_pretrained(repo)
model = AutoModelForCausalLM.from_pretrained(repo, torch_dtype=torch.bfloat16, device_map="auto")

row = load_from_disk("/path/to/final_problems_plans_v2_cot_4levels")["test"][0]   # the dataset is available from the authors on request
prompt = row["input"].partition("[ASSISTANT]")[0] + "[ASSISTANT]\n"
ids = [tok.bos_token_id] + tok.encode(prompt, add_special_tokens=False)
out = model.generate(torch.tensor([ids], device=model.device), 
                     max_new_tokens=min(16384, 16384 - len(ids)), do_sample=False)
answer = tok.decode(out[0, len(ids):], skip_special_tokens=True)
plan = answer.split("[PLAN]", 1)[-1].strip()

With vLLM:

from vllm import LLM, SamplingParams
llm = LLM(model="cosmicishan/gemma-7b-PDDL-CoT-binary", dtype="bfloat16", max_model_len=16384, hf_overrides={"hidden_activation": "gelu"})
params = SamplingParams(temperature=0.0, max_tokens=min(16384, 16384 - len(ids)))
outputs = llm.generate([{"prompt_token_ids": ids}], params)   # ids built as above

Training

Post-trained from cosmicishan/gemma-7b-PDDL-CoT-SFT, the SFT model, on 2,400 problems of the phase2 split. The model answered each problem once greedily and three times with sampling (temperature 0.8).

Binary feedback (outcome only).

  • The SFT model's answers to the phase-2 problems were marked valid or invalid by VAL.
  • The model was trained on its own shortest valid answers: rejection-sampling fine-tuning, 2,119 items from 1,515 problems with at least one valid answer.
  • Invalid answers give no training signal.

Settings.

  • Learning rate 2e-6, 16 items per update, 1 epoch.
  • fp32 output logits; frozen embeddings and output head.

Checkpoint selection. On 280 held-out phase2 problems; the test set was never used. Candidates: step 44: 172/280, step 88: 180/280, step 132: 184/280. This model is step 132.

Limitations

  • The model is trained for this dataset's 10 domains and answer format. It is not a general-purpose planner or chat model.
  • Termes is the weakest domain for every model and method.
  • Research use only. No safety evaluation was done.

License

Gemma is provided under and subject to the Gemma Terms of Use, including the Prohibited Use Policy.

Downloads last month
-
Safetensors
Model size
9B params
Tensor type
BF16
Β·
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for cosmicishan/gemma-7b-PDDL-CoT-binary

Base model

google/gemma-7b
Finetuned
(2)
this model

Collection including cosmicishan/gemma-7b-PDDL-CoT-binary