Skip to content

Generating rollout for Llama-3.2-3b-instruct is buggy, and generates responses in tool format #5307

@3rdAT

Description

@3rdAT

System Info

Problem:

Rollouts generated from Llama-3.2-3b-instruct is in tool format by default.

Example:

For a simple gsm8k question

Response 0: {"name": "twice as many as", "parameters": {"x": "10"}} 
Response 1: "{\"name\": \" Emma \" \"parameters\": {\"from_bank\": 2000, \"bought_furniture\": 400}}"
Response 2: {"name": " Emma's new amount after buying furniture", "parameters": {"initial_amount": "2000", "furniture_cost": "400"}}
Response 3: {"name": "age", "parameters": {"x": 35}} 
Response 4: {"name": "iscalculate", "parameters": {"x": "4", "a": "0", "b": "5"}}

To understand why it happens,

tok = AutoTokenizer.from_pretrained('meta-llama/Llama-3.2-3B-Instruct')

messages = [{'role': 'user', 'content': 'What is 2+2?'}]

# With tools=None (default - no tool calling)
out_none = tok.apply_chat_template(messages, add_generation_prompt=True, tokenize=False, tools=None)

# With tools=[] (empty list)
out_empty = tok.apply_chat_template(messages, add_generation_prompt=True, tokenize=False, tools=[])

print('=== tools=None ===')
print(repr(out_none))
print()
print('=== tools=[] ===')
print(repr(out_empty))
print()
print('=== Are they the same? ===')
print(out_none == out_empty)

Information

  • The official example scripts
  • My own modified scripts

Tasks

  • An officially supported task in the examples folder (such as GLUE/SQuAD, ...)
  • My own task or dataset (give details below)

Reproduction

Just run training on Llama-3.2 model.

Expected behavior

The rollouts should be actual response rather than a tool style output.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions