How to use from the
Use from the
Transformers library
# Use a pipeline as a high-level helper
from transformers import pipeline

pipe = pipeline("text-generation", model="Tim-Xu/Llama-3.2-3B-OPCD-WebShop")
messages = [
    {"role": "user", "content": "Who are you?"},
]
pipe(messages)
# pip install -U transformers accelerate
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM

tokenizer = AutoTokenizer.from_pretrained("Tim-Xu/Llama-3.2-3B-OPCD-WebShop")
model = AutoModelForCausalLM.from_pretrained("Tim-Xu/Llama-3.2-3B-OPCD-WebShop", device_map="auto")
messages = [
    {"role": "user", "content": "Who are you?"},
]
inputs = tokenizer.apply_chat_template(
	messages,
	add_generation_prompt=True,
	tokenize=True,
	return_dict=True,
	return_tensors="pt",
).to(model.device)

outputs = model.generate(**inputs, max_new_tokens=256)
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:]))
Quick Links

Llama-3.2-3B-OPCD-WebShop

Llama-3.2-3B-Instruct trained with OPCD on WebShop: on-policy context distillation: the model samples its own response at each training state and the self-teacher scores the sampled tokens.

The training data come from the base model's own WebShop trajectories; no environment is run during training. At evaluation the model acts from the ordinary prompt alone.

Results

WebShop, 384 held-out episodes, in percent:

Policy Success Task score
Base policy 0.0 0.0
CD 2.3 3.4
OPCD (this model) 2.6 7.9
CDUP 18.8 37.3

Related models: Llama-3.2-3B-CD-WebShop, Llama-3.2-3B-CDUP-WebShop.

Training

Full fine-tuning of meta-llama/Llama-3.2-3B-Instruct on the base model's WebShop deployment states, sampling one response per visit at temperature 1.0.

Evaluation protocol

The Spark ReAct prompt, a five-step history window, a 30-step limit, temperature 0.4.

License

Built with Llama. Llama 3.2 is licensed under the Llama 3.2 Community License, Copyright ยฉ Meta Platforms, Inc. All Rights Reserved. See LICENSE.txt and USE_POLICY.md.

Downloads last month
31
Safetensors
Model size
4B params
Tensor type
BF16
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for Tim-Xu/Llama-3.2-3B-OPCD-WebShop

Finetuned
(2044)
this model

Collection including Tim-Xu/Llama-3.2-3B-OPCD-WebShop