Reduce Reasoning Effort and/or Toggle Thinking to low?

#40
by mofhayat - opened

I'm trying reduce Nanbeige's reasoning efforts and reduce reasoning time for cases when it seems to get the right answer early in it's thought chain.

I am using the AutoModelForCausalLM lib with the pretrained base model (most recent version as of 3/10/26). I plan on fine tuning this model but I first wanted to set a base benchmark. I have noticed from some initial testing that I am getting correct answers early in the logic chain but then the model keeps thinking. Eventually it still gets the right answer but after much thought.

I imagine after some fine tuning it will reduce it's reasoning time for my usecase, but I wanted to first understand if there are some settings I can change to help achieve this.

I've tried looking for a reasoning_effort arg (similar to Grok) but do not see one. I also tried to remove the thinking logs from the response to see if that would help by adding/no_think ( similar to Qwen models source to the end of System messages and User messages with no luck. I've kept the temps between 0.2 and 0.7

I'm a bit new to playing around with LLMs at this level so apologies if this is a naive question.

As a reference; here are some settings I have configured

    tokenizer = AutoTokenizer.from_pretrained(
    'Nanbeige/Nanbeige4.1-3B',
    use_fast=False,
    trust_remote_code=True
    )
    
    model = AutoModelForCausalLM.from_pretrained(
    'Nanbeige/Nanbeige4.1-3B',
    torch_dtype='auto',
    trust_remote_code=True
    )
    # move model to MPS
    model = model.to("mps")

    messages = [
        {'role': 'system', 'content': SYSTEM_MESSAGE},
        {'role': 'user', 'content': user_content}
    ]
    prompt = tokenizer.apply_chat_template(
    messages,
    add_generation_prompt=True,
    tokenize=False
    )
    input_ids = tokenizer(prompt, add_special_tokens=False, return_tensors='pt').input_ids
    output_ids = model.generate(input_ids.to('mps'), max_new_tokens=1000, eos_token_id=166101, temperature=0.2, do_sample=True)
    
    resp = tokenizer.decode(output_ids[0], skip_special_tokens=True)

Sign up or log in to comment