LFM2.5-350M-Base degenerates on plain LM continuation (no chat template)

#1
by yuyijiong - opened

I'm testing LFM2.5-350M-Base as a standard causal LM with plain text continuation (no apply_chat_template, greedy decoding, add_special_tokens=False).

The model shows severe degeneration: repetitive tokens/phrases and failure on simple completions.

After other tests, I find LFM2.5-2.6B-Base doesn't show such degeneration, while 1.2B, 350M, 230M all show the same degeneration.

Minimal repro:

prefix = "The capital of France is"
inputs = tokenizer(prefix, return_tensors="pt", add_special_tokens=False).to(model.device)
out = model.generate(**inputs, max_new_tokens=16, do_sample=False)

Example: next-token top-1 is ' the'; generation becomes unrelated or repetitive (e.g. by by by..., = = =..., the the the...). On a small 17-case LM continuation suite: 0/17 matches.

Questions:

  1. Is plain LM continuation expected to work for this -Base checkpoint?
  2. Is this repetitive behavior known/expected?
  3. Should users always use chat templating, even for -Base?
Liquid AI org

I think you might just be missing the BOS token, can you try the following?

prompt = "The capital of France is"
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
output = model.generate(**inputs, max_new_tokens=16, do_sample=False)
print(tokenizer.decode(output[0], skip_special_tokens=True))

I think you might just be missing the BOS token, can you try the following?

prompt = "The capital of France is"
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
output = model.generate(**inputs, max_new_tokens=16, do_sample=False)
print(tokenizer.decode(output[0], skip_special_tokens=True))

Thank you. Adding BOS token solved this problem. It seems small size models are quite sensitive to BOS.

yuyijiong changed discussion status to closed

Sign up or log in to comment